I’m processing a set of fairly complicated trees and need to check the value of one branch before reading in the rest of the branches (in order to make sure maximum array sizes aren’t exceeded). The following code works fine if inTree is a TTree, but I’m not sure what to do if inTree is a TChain instead.
Long64_t nEntries = inTree->GetEntries();
for (Long64_t iEntry = 0; iEntry < nEntries; iEntry++){
// first make sure NumCombos isn't too big...
inTree->SetBranchStatus("*",0);
inTree->SetBranchStatus("NumCombos",1);
inTree->GetEntry(iEntry);
if (inNumCombos > MAXCOMBOS) continue;
inTree->SetBranchStatus("*",1);
// if inNumCombos is okay, process the full tree...
inTree->GetEntry(iEntry);
// other processing...
}
I see from the documentation that this won’t work for a TChain, but is there a good alternative solution for this? Thanks a lot for any guidance!