Re: [ROOT] Using a TMapFile to share a TTree

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Oct 09 2003 - 12:18:44 MEST


John,

A Tree in a TMapFile works, but this is not a solution for large trees.
You cannot make your Tree bigger than the shared memory segment.
It is better to use a normal tree overflowing on disk. The Tree_Writer
and the Tree_Reader being in separate processes/machines.
To make sure that the reader has a coherent/safe view of the writer process
see comments in TDirectory::SaveSelf

Rene Brun

> Frankland John wrote:
> 
> Hi Rene,
> 
> Well, that was a stupid mistake, proving that after a certain hour it is
> better to go to bed
> than to keep "working"! Thanks a lot. However, as regards my other questions,
> have you
> any advice ? Because in the various messages I read in the ROOTtalk digest, it
> seemed
> that a TTree could not exist in a TMapFile, or wouldn't work correctly, but I
> don't know if
> these messages were only pertinent to the older versions of ROOT ?
> 
> Best regards
> John
> 
> Also, is it possible to share the TTree in this way and still write it to disk
> ?
> Because when I tried to open the TMapFile after stopping the scripts I was
> informed
> (quite logically) that said file is not a TFile... Is it just a buffer of
> sorts ?
> 
> What I actually want to be able to do is to store incoming data acquisition
> events in a TTree
> whilst an independent process triggered by a certain type of event would then
> look back through
> all the previously stored events for some correlation. Is this the best (only)
> way to do it ?
> 
> Rene Brun wrote:
> 
> > Hi John,
> >
> > You have an error in treecons.C.
> > When a Tree has N entries, the last entry number is N-1.
> > Your program will work if you change treecons.C as shown below.
> >
> > Rene Brun
> >
> >
> >
> 
> --
> 
>                      John D. Franklandtel: +33
>                      Beam Coordinator (0)231454628
>                      GANIL            fax: +33
>                      B.P. 55027       (0)231454665
>                      14076 CAEN Cedex
>                      05



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET