Re: [ROOT] storing branches in trees ...

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jan 21 2002 - 15:15:51 MET


Hi Volker,

So, what you want is what TFolder is already doing.
If you have a folder with the structure that you describe, by doing
  TTree T("T","/Main")
you will automatically create a tree with the corresponding branch hierarchy.
Unfortunately, there is no way (yet) to rebuild the folder structure
when connecting the Tree again in read mode. However, all the information
about the hierarchy is already saved in the Tree.

There is a difficulty when connecting the tree in read mode. You may want
to connect multiple files with the same folder structure. What do you do then?
 - delete the previous folder content and replace it with the new one ?
 - have a /Main1, /Main2, etc ?

I would appreciate comments on this issue before attempting an implementation.

Rene Brun


Volker Hejny wrote:
> 
> Hi Rene,
> 
> On Mon, Jan 21, 2002 at 11:21:20AM +0000, Rene Brun wrote:
> > Suppose a TList *list containing objects A,B,C and D.
> > Calling tree.Branch("event",list)
> > This will create 4 top branches.
> 
> That's exactly my point. I'd like to have a pseudo-branch 'event' at top
> level and four subbranches A,B,C,D. Just to keep the tree structure and
> to have an overview of the contents while browsing.
> 
> > In turn, if classes A,B,C or D have subobjects
> > or pointers to TClonesArray, this will be split using the usual split rules.
> > When reading the Tree, you still have to set the branch addresses for A,B,C,D.
> > I could implement a special SetBranchAddress taking a list as input.
> 
> If the starting collection was a folder and the objects were organized in
> subfolders, I'd like to have this structure back in an automatic way.
> If I have a TFolder structure like
> 
> Main
> |---Raw
> |   |---Det1
> |   |---Det2
> |   |---Det3
> |
> |---Calibrated
>     |---Det1
>     |---Det2
>     |---Det3
> 
> If I want to have that structure back later on, I have to save the
> information by myself.
> 
> > It will take more time if you have many variables of this type. I would be
> > curious to know the difference in time in your particular case.
> > You can always have a RUN object and do RUN.Write() at the time when
> > you do tree.Write().
> 
> In principle, yes. But this would mean to introduce an additional object.
> For example, one information to be stored could be the position in
> the folder hierachy mentioned above ...
> 
> Best regards,
> Volker
> 
> --
> Dr. Volker Hejny                Tel: 02461/616853                      **
> Institut f. Kernphysik          Fax: 02461/613930                     **
> ---------------------------------------------------------------- **  ** ---
> Forschungszentrum Juelich GmbH, D-52425 Juelich                    **



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