Scope and TMapFile

Greg Veramendi (mendi@cdfsga.fnal.gov)
Wed, 14 Jul 1999 13:54:45 -0500 (CDT)


Hello All,
I'm trying to write a program that uses the TMapFile class. I
need to be able to add some objects to the TMapFile and not others. I
discovered that the Add command is unecessary when adding objects. For
example:

root [0] TMapFile *mfile;
root [1] mfile = TMapFile::Create("stuff.map","RECREATE", 30000,"test
map file");
root [2] mfile->ls()
Object Class Size
*** no objects stored in memory mapped file ***
root [3] TH2F * ghist;
root [4] mfile->ls()
Object Class Size
*** no objects stored in memory mapped file ***
root [5] ghist = new TH2F("Gaussian","This is a gaussian",100,-10,10,100,-10,10);
root [7] mfile->ls()
Object Class Size
Gaussian (null) 0

As you can see the Histogram was added without an explicit mfile->Add().

How do I create a Histogram outside the scope of a TMapFile object once
it has been created? And is there any way to know what scopes you are in?

thanks,
Greg Veramendi
LBL