[ROOT] Re: writing trees ...

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sun Mar 04 2001 - 10:30:20 MET


Anton,
File.Close does not write the Tree header to the file. May be you
mean File.Write ?
There are two ways to AutoSave Trees in a file.
 - User calls TTree::Autosave
 - TTree::SetAutoSave(nbytes) has been called. In this case, teh Tree
   header/buffers are only saved (by calling TTree::AutoSave) when
   more than nbytes have been written to the file since the previous
   AutoSave.
When calling SetAutoSave or AutoSave, you get 2 different copies
of the Tree header on the file. You can keep one copy only.
At the end of your job, instead of calling File.Write(),
do tree.Write(0,TObject::kOverwrite)

Rene Brun


On Sat, 3 Mar 2001, Anton Fokin wrote:

> Hi Rene,
> 
> if I do
> 
> TFile File(..);
> 
> TTree *Tree = new TTree(..);
> 
> Tree->AutoSave();
> 
> File.Close();
> 
> it looks like root writes the tree twice: on AutoSave and on File.Close().
> Am I right?
> 
> If so, could you prvide a check so that only modified tree will be written
> on AutoSave() and File.Close() ?
> 
> Regards,
> Anton
> 
> http://www.smartquant.com
> 
> 
> 



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