Re: [ROOT] How to save meta information?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Sep 16 2002 - 15:16:52 MEST


Hi Ole,


On Mon, 16 Sep 2002, Ole Streicher wrote:

> Hi!
> 
> I am looking for a good way to store meta information in ROOT files.
> 
> My design up to now consists of one ROOT tree per file. Each tree is
> produced by an "Algorithm", which itself may produce more than one
> tree (and thus, its results may be stored in more than one file).
> 
> For logging reasons, I want to store the parameters and the static
> meta information of the algorithms, too. What I am thinking about is
> something like:
> 
> class Algorithm: public MyObject {
>   static const string VersionInfo;
>   int Par1;
>   TTree *ResultTree1; //!
>   TTree *ResultTree2; //!
>   //...
>   ClassDef(Algorithm, 1)
> };
> 
> where the definition of VersionInfo is done with the help of CVS tags
> in the C++ file.
> 
> But, there are now some problems with that:
> - rootcint doesn't like "const" (see my other mail)

support for const (as above) was added by Philippe last week. take the
current CVS version.

> - the streamer seems not to store "static" members
(why?)

Now it does

> - how can I ensure that the algorithm goes into all files that it has
>   created? Can I just use "ResultTree1->GetCurrentFile()->Add(this);"?
>   before calling "Write()" to all files?

do "ResultTree1->GetCurrentFile()->AutoSave();
This will automatically cjange to teh right directory and will restore
the current dir after the operation, then you can do:
myAlgorithm.Write() into the current file or in as many files as you
want.

> 
> Is there another recommended way to store these meta information?

as shown above. Use the Write function.
> 
> BTW, Why do "inline" functions never have a documentation within root?
> They always point me to the "inline functions" section of the man page
> where they link to the source code. For example, I couldn't see from
> that what the difference between the "Add()" and the "Append()" member
> functions of TDirectory is.

Yes, we know. A limitation of THtml.

Rene Brun

> 
> Ole
> 



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