[ROOT] Re: 2 copy of TClass in one TTree

From: Elena Vataga (vataga@fnal.gov)
Date: Tue Feb 05 2002 - 10:48:04 MET


Hello, Rene!

Thank you for your reply. I tried to put "." as you suggested.
The size of blocks (size of TClonesArray) I am getting in this way is
correct, but track information (all data members of TTrack class) are 0.
I tried to increased splitting level, it does not help.
Without dot all blocks are filled but with the same information..
Any suggestions?

		Thank you,
			Elena

On Mon, 4 Feb 2002, Rene Brun wrote:

> Hi Elena,
>
> Use a '.' at the end of the branch name.
>
>  _isltup->Branch("CDF_TRACKs.", "TTrkBlock", &Trks, bufsize,split);
>  _isltup->Branch("Ele_TRACKs.", "TTrkBlock", &EleTrks, bufsize,split);
>
> Note that to copy a subset of a Tree to a new Tree (subset of branches or
> events), you do not need to write a class. You can use directly TTree::CopyTree.
>
> Rene Brun
>
> Elena Vataga wrote:
> >
> >         Hello, rooters!
> >
> > Would be most thankful to you for advice!
> >
> > I was trying to do the following: save in TTree 2 branches:
> >         1. all tracks found in event    (~50-60 tracks/event)
> >         2. tracks with associated hit in EM calorimeter (~1-3 trks/event)
> >
> > To do it, wrote a class TTracks derived from TObject and
> > made 2 branches:
> >
> >   TTrkBlock* Trks;              // TClonesArray of TTracks
> >   TTrkBlock* EleTrks;
> >   TTree* _isltup;
> > ....
> >   Trks    = new TTrkBlock;
> >   EleTrks = new TTrkBlock;
> > ...
> >  _isltup->Branch("CDF_TRACKs", "TTrkBlock", &Trks, bufsize,split);
> >  _isltup->Branch("Ele_TRACKs", "TTrkBlock", &EleTrks, bufsize,split);
> >
> > The problem I have:
> >                  each of branches by itself (when I book ONLY
> > "CDF_TRACKs" or ONLY "Ele_TRACKs") is filled correctly.
> > When I am trying to book both branches - they are identical
> > because TTrack class is the same, so variables names are the same..
> > Is there a way to use the same class to write in 2 different branches
> > with different selection criteria?
> >
> >         Thank you in advance,
> >                                 Elena
>



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:40 MET