Re: [ROOT] TTree::Branch()

From: Denis Bertini (d.bertini@gsi.de)
Date: Wed Feb 06 2002 - 14:43:18 MET


Hi Rene,
Let me be more explicit,  following is an example of what i would like
 to do:

>>>

{
  // main Event class
  // This Event class contains a pointer to an EventHeader class defined
  // with in the comment field the option //! (not streamed)
  //
    class HEvent: public TObject{
       private:
        HEventHeader *head; //!
        // ... other data members
      public:
        // ...
     }

   HEvent *event = new HEvent() ;


   //Event-Structure placed at top-level TTree
   TBranch *br= tree->Branch("Event",event->ClassName(),
   &event,4000,99);

   // get the Header from HEvent class
    HEventHeader* head= event->getHeader();


   // custom branching mechanism
   TBranch* br0 = tree->Branch("EventHeader",head->ClassName(),
                 &head, 4000,99);

   // i add the branch  myself
   br->GetListOfBranches()->Add(br0);

   // and so on ...
    HTrigger* triggerInfo =  head->getTriggerInfo();

   TBranch* br1 = tree->Branch("aTrack","HTrigger",&triggerInfo,4000,99);

  // i add the branch myself
    br0->GetListOfBranches()->Add(br1);

}

  Like this i should create "myself" something like:

                        * Event (top level branch)
                                  |
                                   ------- EventHeader*
                                                             |
                                                              ----- triggerInfo *


  I am not sure it is the right thing to do, but somehow i am not able
   to realize that within the new ROOT 3.02.7 .
   Any hints?
                                                                              thanks

Denis





Rene Brun wrote:

> Denis,
>
> I do not understand your question. You can always create a separate Tree
> with one single branch.
>
> Rene Brun
>
> Denis Bertini wrote:
> >
> > Hi,
> >  I would like to use a TTree::Branch() method that do not add automatically the
> >   created branch on the top level Tree. Is there any flag, option i could use from
> > TTree
> >   , TbranchElement class to do so?
> >                                                                        Thanks in
> > advance,
> >
> > Denis Bertini



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