Hi,
I have a root ntuple file containing muon, electron, jets, and genparticles. I have produced the .C and .h for analyzing it by loading one of the root files (located in
/castor/cern.ch/user/b/boeriu/LQBG) and then did
RootNtupleMaker->MakeClass(“lq”);
If I try to look at the information stored in the root ntuple now, it
prints ok for muons and electrons, but I get a memory related error
for the jets and genparticles for the same root file for which the .C
and .h were created (!?). I have tried changing the range of the
vectors for jets and genparticles, chaining multiple files before
creating the .C and .h ,nothing seems to cure the bad behaviour.
Basically what I have inside the .C file looks like this:
void lq::Loop(){
Long64_t nentries = fChain->GetEntriesFast();
[…]
Float_t muEta, muPhi,muEnergy,jetEta,jetPhi,jetEnergy;
RootNtupleMaker->SetBranchAddress(“muonEta”,&muEta);
RootNtupleMaker->SetBranchAddress(“muonPhi”,&muPhi);
RootNtupleMaker->SetBranchAddress(“muonEnergy”,&muEnergy);
RootNtupleMaker->SetBranchAddress(“caloJetIC5Eta”, &jetEta);
RootNtupleMaker->SetBranchAddress(“caloJetIC5Phi”,&jetPhi);
RootNtupleMaker->SetBranchAddress(“caloJetIC5Energy”,&jetEnergy);
for (int i=0; i < RootNtupleMaker->GetEntries(); i++){
RootNtupleMaker->GetEntry(i);
std::cout <<"entry “<<i<<” muonEta "<< muEta<< std::endl;
std::cout <<"entry “<<i<<” jetEta "<< jetEta<< std::endl;
}
}
In root executing:
.L lq.C;
lq t;
t.Loop();
I get the error:
*** glibc detected *** free(): invalid next size (fast): 0x09446018 ***
If I comment out the jets part (including the SetBranchAddress) and
just print muons and electrons everything works fine. Am I missing
some important piece in there? I can’t see a difference between the
branches from the .C and .h (except in size of course), so I cannot
tell why one branch is ok to look at, and the next not…
I have tried instead of Chain->GetEntriesFast() to use
Chain->GetEntries() (and even both options in the same .C file) but the
same error shows up. I have run out of things to try and need some
expert help on this! The ROOT version I used is this:
Version 5.14/00f 29 May 2007
Thanks in advance for your help!!
Best,
Oana