Problems reading a TTree of TMap(s)

James M White (jmw@c3serve.c3.lanl.gov)
Fri, 13 Jun 1997 22:58:01 -0600 (MDT)


Greetings,
I have a somewhat complicated question (problem) with a
TTree. I'm trying to store into a TTree a TMap that maps TObjStrings
to complex objects. These complex objects come in 4 flavors:
1) Objects that contain simple Int_t(s) and Float_t(s).
2) Objects that contain (among other things) TH1(s).
3) Objects that contain TMap(s) that map TObjStrings to the equivalent
of your TObjNum. (I use this as a histogram for TObjString(s))
4) Objects that contain (among other things) TMap(s) that map
TObjString(s) to Objects like (3) above. (These are used as 2D
TObjString histograms)
These 4 objects are all built of a common ABC and all of my access to
them are trough the virtual methods in the ABC.

I have been able to create and store these TMap of complex
objects successfully (I think), and I can successfully retrieve any one
of the TMaps using the GetEvent() method. The trouble comes when I
call the GetEvent() method the second time. The TMap returned by
the second call to GetEvent() has some problems:
The objects of type (1) above are always correct.

The objects of type (2) above are always correct but I get the
following warning: "Warning in <TH1::Build>:Replacing existing
histogram: RunOutFloatHistogram".

The objects of types (3) and (4) are slightly mangled. (some of the
TObjNum(s) contain values that are off by +- 1 and sometime the
TObjString(s) are not correct)

Again the problem never occurs on the first call to GetEvent() no
matter what event number I ask for and it always occurs on subsequent
calls to GetEvent().

I'm not sure where to look for my problem. Could it be because I'm
having some problems with destructors? When is TH1::Build() called
and should I make the equivalent of it for objects (3) and (4)? I've
looked at the code and I'm not sure exactly what it does. Any help
would be appreciated.
Jim White