Re: [ROOT] Use of TFolder

From: cstrato@EUnet.at
Date: Wed Oct 24 2001 - 20:57:46 MEST


Dear Rene

Thank you for your reply. At the moment I am just testing different
approaches to see what  I could use.

Probably, I do not quite understand the concept of TFolder helping
to minimize the coupling between classes. Suppose, I have the
following classes:

ClassA
   TList fListClassA  //list of ClassA!
   TList fListClassB

ClassB
   TList fListClassA
   TList fListClassC

ClassC
   TList fListClassB

How can TFolder help me to minimize the coupling between these
classes?

Thank you in advance
Christian


Rene Brun wrote:

> Hi Christian,
>
> The primary role of TFolder is to facilitate the description of the
> transient data structures, minimizing strong coupling between classes.
> Your folder structure is correct. However, your structure mimics a Unix
> directory structure. It is not what a TFolder is designed for.
> Why don't you use directly the OS file system to do this?
>
> Anyhow, assuming your existing folder structure, you can automatically
> generate a Root Tree from this structure by doing for example:
>
>    TFile *vFile = new TFile("folders.root","recreate");
>    TTree T("T","/MyRoot");
>    T.Fill();
>    T.Print();
>    T.Write();
>
> instead of the last 3 statements of your function MyFolders.
> The T.Print() will show you the automatic generation of the Tree branches
> from the folder structure. There is no need to specify branch addresses.
>
> Currently, Root is not capable of rebuilding the folder structure automatically
> when reading back a Tree. This is on my todo list since a few months now.
>
> Rene Brun
>
>
> > ----------------------------------
> > C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
> > V.i.e.n.n.a,  A.u.s.t.r.i.a
> >



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:04 MET