Hi Phillipe. Thanks so much for your reply.
Attached is a root file. It appears that this problem is only with the member variables that are in my most base class.
My explanation above was too simplistic. Let me show you my real class structure and then you can look at my root file.
class EdwEventBase {
fRunNumber
fEdwGlobalEventTime
fRunStartTime
etc…
}
class EdwDataEventBase {
fGSEventNumber
fDetectorStatusWord
fBlindnessWord
}
class EdwHLAEvent : public EdwEventBase {
… (empty so far)
}
class EdwHLADataEvent : public EdwHLAEvent, public EdwDataEventBase {
fDataCleaningBits
}
So, then I run
fillEvents(){
TFile f(“new.root”);
TTree t = new TTree(“EdwT”,“EdwEventTree”);
EdwHLADataEvent mEv = new EdwHLADataEvent();
t->Branch(“EdwHLADataEventBranch”,“EdwHLADataEvent”,&mEv,32000,99);
for(Int_t i = 0; i < 100000; i++){
mEv->SetRunNumber(i);
mEv->SetDataCleaning(4);
mEv->SetEventTime(10.023432i);
mEv->SetDataCleaning(0x2);
mEv->SetGSEventNumber(3i+1994);
t->Fill();
}
t->Write();
f.Close();
delete mEv;
}
(Sorry - I don’t know how to properly format my text here so that its more readable for you).
When I use the TBrowser (or when I use my library of classes), I can successfully read the EdwEventBase.fRunNumber member variable and I see a histogram of numbers from 0 to 100000. But, when I am in the TreeViewer and I double click EdwEventBase.fRunNumber, I see 10000 entries of the value of 0. The same is true for EdwEventBase.fEdwGlobalEventTime.
However, I get the proper behavior for the EdwDataEventBase.fGSEventNumber and EdwHLADataEvent.fDataCleaningBits (I see the data from the Browser and the TreeViewer). These, as you’ll notice, are derived classes and thus higher up in the Branch structure.
Thanks again for your help.
Adam Cox
new.root (940 KB)