Re: [ROOT] TObjArray and TTree automatic splitting

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Mar 05 2002 - 12:46:28 MET


Hi Denis,

 A TObjArray cannot be split by definition because its items may be
any TObject*.
If all the objects in the TObjArray are of the same class, then replace
your TObjArray by a TClonesArray and you will get an automatic split.

Note that the version 3.03 contains a new TBranch constructor:
Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99)
that creates one sub-branch for each element in the collection.

Rene Brun

On Tue, 5 Mar 2002, Denis Bertini wrote:

> 
> Hi rooters,
> 
>  I have a class Event that contains a "TObjArray *" pointer as datamenber.
>   so like
> 
>      class Event : public TObject{
>      // ...
>       TObjArray *myArray;  //
>        //...
>      };
> 
>     I put this Class Event in a top-level branch of TTree so:
> 
>      Event *event =  new Event();
>      TBranch *br= tree->Branch("Event.","MyEvent",
>                         &event1,4000,99);
> 
>     so with splitlevel = 99 (max)
> 
>      I see that the TObjArray is not splitted, is there any reasons for that?
>      I know that in the new ROOT version there is a special "Branch" method
>      for TObjArray 's and that you have to create this splitting by hand, but
> everything
>       is created a new "top-level" branches which is not suitable in my case.
>        Any hints?
>                                           Denis
> 
> 
> 
> 
> 



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