In my analysis code I would like to inspect a few events, quickly. So when doing so I disable all the branches in the input root file and then enable the event number branch. I then loop over all the entries in the chain looking for events that match my requested event number. When it is found I re-enable all the branches and then do another GetEntry on the chain. Once that is done I print out the info for the event. All the variables are accessed though TChain::SetBranchAddress and I am using root version 4.04/02b. The problem is that I just get all zeros for the variables. But when I look at events in the first file in the TChain it works ok. Is there something special that I need to do here to get this to work right? Thanks. The code snippet is listed below.
if(onlyInspectEvent) {
if(evtnum == inspecteventnumber) {
chain->SetBranchStatus("*", 1);
chain->GetEntry(i);
printEventInfo();
chain->SetBranchStatus("*", 0);
chain->SetBranchStatus("evtnum", 1);
}
continue;
}
Justace