I am tearing my hair out because I can’t get this small script to work. If I comment the GetEntries line the code runs as expected–I get 130 prints of “in”. But using any method of ccbar (TChain) I only get one print of “in” and that’s it. It is as if it’s not moving through the iterator. I’ve tried:
- One root file (this works), any 2 files do not (although I have ~560 files)
- recasting some of these variables
void compareAllSigAndBack(){
TChain *ccbar = new TChain("ntp11");
ccbar->Add("/home/jmorris/storage/rootfiles/gammagamma/ccbar/Run1/rootfiles/SP-1005-AllEventsSkim-Run1-R18d_*.root");
TIter iter((TObjArray*) ccbar->GetListOfBranches());
while(iter.Next()) {
cout << "in" <<endl>GetEntries();
// cout << nbackground << endl;
}
}
Thank you!
TSC