I am trying to read a TTree from a TFile using ROOT 3.10.01. I do this using tree->MakeSelector(). After adding “fChain->GetEntry(entry);” to the “Process()” method (why is it not there by default?!? Previous versions of ROOT at least had this cricial piece of code in a comment), I see that only some of my variables are being filled from the tree, the rest of them a garbage. This seems to be caused by incorrect value pointers:
Here is the tree “structure” generated by MakeSelector():
class T_align : public TSelector {
public :
TTree *fChain; //!pointer to the analyzed TTree or TChain
//Declaration of leaves types
Int_t EVID_nrun;
Int_t EVID_nevt;
Int_t ALIGN_nplanes;
Int_t ALIGN_iplane[45]; //[nplanes]
Float_t ALIGN_posu[45]; //[nplanes]
Float_t ALIGN_posv[45]; //[nplanes]
Float_t ALIGN_resuv[45]; //[nplanes]
Float_t ALIGN_resz[45]; //[nplanes]
Float_t ALIGN_fitp;
Float_t ALIGN_fitc;
Float_t ALIGN_fitcl;
//List of branches
TBranch *b_EVID; //!
TBranch *b_ALIGN; //!
Here are the value addresses printed by printf("%s %p %p",“nplanes”,b_ALIGN->FindLeaf(“nplanes”)->GetValuePointer(),&ALIGN_nplanes):
pointers nplanes: 0x8b0f720 0x8b0f720, diff 0
pointers iplane: 0x8b0f724 0x8b0f724, diff 0
pointers posu: 0x8b0f724 0x8b0f7d8, diff -180
pointers posv: 0x8b0f724 0x8b0f88c, diff -360
pointers resuv: 0x8b0f724 0x8b0f940, diff -540
pointers resz: 0x8b0f724 0x8b0f9f4, diff -720
pointers fitp: 0x8b0f724 0x8b0faa8, diff -900
pointers fitc: 0x8b0f728 0x8b0faac, diff -900
pointers fitcl: 0x8b0f72c 0x8b0fab0, diff -900
Observe how the value pointers for “iplane[nplanes]”, etc fail to increment. What is going on here?
K.O.