Re: writing big file

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Feb 11 1999 - 15:33:03 MET


Sean Kelly wrote:
> 
> 
> Hi Rooters,
> 
> I want to write a large ROOT file consisting of a number of Event
> objects stored in a super branch of a TTree object.  If I make a single
> call to hfile->Write() outside the event loop I run out of memmory.  My
> question, how do I flush the output buffers every 1000 events or so ?
> 
> thanks
> 
> Sean Kelly

Hi Sean,
You should not run out of memory, except if:
  1- You have created the TTree before opening the Root file in write
mode.
  2- You have a large number of branches and you have specified
     a large block size.

You can flush the output buffers with a given frequency using;
  1- TTree::SetAutoSave(Int_t autosave). When autosave bytes have been
     written to the buffers by TTree::Fill, the buffers are
automatically
     flushed to disk. By default Root will autosave every 200 Mbytes.
     This function should be called only once after the TTree creation.

  2- TTree::AutoSave(). You can call yourself this function at regular
     intervals (every 1000 events).

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:29 MET