Hi Christian,
The total size reported by TTree::Print is the size in bytes of all buffers
already written to the file. It does not include the current buffer in memory.
In the development version in CVS, I have added a new function
TBranch::GetTotalSize that reports the size of all buffers on disk + the size of
the current buffer.
The new version of TTree::Print reports this more accurate information.
Rene Brun
Christian.Doerr@mpi-hd.mpg.de wrote:
>
> Good morning everybody,
>
> today I have a simple question about writing events to a tree.
> I link some Root classes with geant4 to create a Tree with one brach to
> store my event class:
>
> // create tree with branches
> fTree = new TTree(localTreeName,"A Tree with Events");
>
> // create pointer to event object
> fEvent = new BBRootEvent();
> fTree->Branch(localBranchName,"BBRootEvent", &fEvent, 16000, 1);
>
> (... then create and fill some events and write to tree with
> fTree->Fill() )
>
> fTree->Write("",kOverwrite);
>
> After rereading the information from file in a root session, I call
>
> t->Print();
>
> and get the following output:
>
> ******************************************************************************
> *Tree :MC_Tree : A Tree with Events *
> *Entries : 184 : Total = 31330 bytes File Size = 17149 *
> * : : Tree compression factor = 12.81 *
> ******************************************************************************
> *Branch :MC_Branch *
> *Entries : 184 : BranchElement (see below) *
> *............................................................................*
> *Br 0 :TObject : *
> *Entries : 184 : Total Size= 0 bytes File Size = 0 *
> *Baskets : 0 : Basket Size= 16000 bytes Compression= 1.00 *
> *............................................................................*
> *Br 1 :fEventNo : *
> *Entries : 184 : Total Size= 0 bytes File Size = 0 *
> *Baskets : 0 : Basket Size= 16000 bytes Compression= 1.00 *
> *............................................................................*
> *Br 2 :fNameOfDecay[30] : *
> *Entries : 184 : Total Size= 0 bytes File Size = 0 *
> *Baskets : 0 : Basket Size= 16000 bytes Compression= 1.00 *
> *............................................................................*
> *Br 3 :fFirstHit[20] : *
> *Entries : 184 : Total Size= 0 bytes File Size = 0 *
> *Baskets : 0 : Basket Size= 16000 bytes Compression= 1.00 *
> *............................................................................*
>
> .... and so on.
>
> My question is: Why does it say
>
> Total Size= 0 bytes File Size = 0
>
> for every branch, though the tree is appearantly not empty. The data is
> correctly stored, I can read it and fill histograms with it and so on.
> I just wonder....
>
> Thanks a lot for any reply
>
> Cheers, Christian
>
> PS: I'm using Root version 3.01/06 and Geant4 4.0
> under SuSE Linux 7.3 with gcc version 2.95.3
>
> -----------------------------------------------------------
> Christian Doerr
> Max-Planck-Institut fuer Kernphysik, Heidelberg
> Bothe-Labor, room 232 phone: +49-6221-516-259
> email: C.Doerr@mpi-hd.mpg.de www.christiandoerr.de
> -----------------------------------------------------------
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:50 MET