Hi Mark,
OK, I understand now what you want to do.
You can remove the track from the list of tracks, but
BE VERY CAREFUL to loop on the list in the reverse order,
otherwise, your will skip tracks!!
If you do not want to delete the tracks from the list,
you can also mark the selected (or not-selected) tracks
with a statement like
track->SetBit(kKEEP);
and later on:
if (track->TestBit(kKEEP)) {...
where kKEEP is a bit mask that can be defined using the macro BIT.
SetBit will modify the TObject::fBits data member.
All classes deriving from TObject can use this facility.
Up to 24 bits are free to use.
For example to kKEEP can be defined as
const Int_t kKEEP = BIT(7); //want to set bit 7 in fBits
TestBit, SetBit are part of TObject and the macro BIT is defined
in TObject.h.
This method has the advantage that you can have several selection
mechanisms and quickly test (using the &, | bit operators)
a combination of tests.
Rene Brun
>
>
> =================================================================
> = =
> = Mark Boulay =
> = Department of Physics phone/voice mail: (613) 545-6861 =
> = Queen's University fax: (613) 545-6813 =
> = Kingston, Ontario email: mgb@sno.phy.queensu.ca =
> = Canada, K7L 3N6 =
> = =
> =================================================================
>
> On Tue, 13 Oct 1998, Rene Brun wrote:
>
> > Mark Boulay wrote:
> > >
> > > Dear Root team:
> > > I want to accomplish the following, and am not sure what
> > > the best (if any) method is for doing it. I have a TTree which
> > > contains a TClonesArray branch. When reading the tree, I would
> > > like to test each object in the TClonesArray, and only use it
> > > if it passes some test based on a flag I have set. I am currently
> > > writing the TTree with splitlevel = 1, which contains an event-level
> > > branch, which in turn contains the TClonesArray.
> > >
> >
> > Mark,
> > Please, be more specific with your question. What do you mean by
> > "testing each object"? What is the difference between testing
> > and using.
> > See examples of a TTree in $ROOTSYS/test/Event and associated
> > macros eventa and eventb.
> >
> > Rene Brun
> >