Re: TTrees in TMapfiles

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Jun 24 1998 - 17:30:58 MEST


Norbert Danneberg wrote:
> 
> Hi Experts,
> 
> is it possible to store TTree objects in TMapFiles? I looked at the
> example hprod.C and tried to implement a similar program for TTrees.
> When I start the program mfile->Update  () results in a segmentation
> violation.
> 

Hi Norbert,
You should be able to use TTrees with shared memory (TMapFile).
However, your TTree cannot be associated to a file. It must be
completely in memory. To create a TTree in memory, you can do:
  solution 1
  ==========
    gROOT->cd();
    TTree *T = new TTree(......

  solution 2
  ==========
    TTree *T = new TTree(...
    T->SetDirectory(0);

When you will invoke mfile->Update, a copy of the existing TTree
with all its branches/leaves/buffers/etc will be serialized
into the shared memory area.

For further info, see the class TMapFile.
For additional help, see directly with Fons.Rademakers@cern.ch

Rene Brun



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