Dear Rooters,
Using the Show() method in TTree I obtain a “bus error”.
ROOT 5.22/00a (tags/v5-22-00a@27441, May 08 2009, 13:15:54 on macosx 10.4.11)
gcc version 4.0.1 (Apple Computer, Inc. build 5363)
I have a class (SamplePoint) inheriting from TObject containing only one Short_t so that a TClonesArray of type Short_t can be contained in another class (Signal).
(I had problems reading std vectors from a Tree and also memory leaks
with Int_t fNSamples; // # of sampled points
Short_t *thisSample; //[fNSamples]
contained within another class, so I went down the TClonesArray of Short_ts path)
If in a macro I do a simple
{
TFile *f = TFile::Open(“TestEvent.root”);
TTree testT = (TTree) f->Get(“testTree1”);
for(Int_t i = 0; i < 3; i++) {
testT->Show(i);
}
}
I get the obvious warnings :
Warning in TClass::TClass: no dictionary for class Signal is available
Warning in TClass::TClass: no dictionary for class SamplePoint is available
But, the N Short_t of the TClonesArray values are displayed.
However, when I try and read in the dictionary via gSystem->Load("./libTNT2Event.so");, or,
gROOT->ProcessLine(".L TNT2Event.cxx++"); then I get a bus error.
Included is a tar of the reduced problem.
sequence :
make TestEvent
./TestEvent
root -l CheckTree.C
within CheckTree.C are the readDict and showBusError flags to switch behaviour.
Probably related is the fact that when I try and read the size of the TClonesArray using
Signal *signal = new Signal();
…
TClonesArray *samplePoints = new TClonesArray();
samplePoints = signal->GetSamples();
Int_t nSamples = samplePoints->GetLast() + 1;
nSamples is always 0.
Many thanks,
Karl Hauschild
test5.tar.gz (78.5 KB)