From C.Loizides: Handle manual branch loading if requested by the user (via SetAutoBranchLoading(kFALSE))
This turns off the usage of TTree::GetEntry, and uses TBranch::GetEntry. It relies on the fact that the user loads
the needed branches in his tasks on demand (via LoadBranch(brname))
This feature is disabled by default, and therefore the current use of the manager targeted at train mode persists.
The purpose is to speed up the analysis in case only a few branches are needed, and if cuts can be made based on quickly loadable information. For example, on my laptop with auto branch loading enabled takes about 8ms/event while with auto branch loading disabled (just loading the header and run info) only 0.8 ms (ie order of magnitude faster). For a more realistic case, with an actual track based analysis attached, a speed up of 2-3 was achieved.
/* should have meaningful check here, use dummy just to illustrate example*/
if (some_condition_on_event_header_or_ESDRun_object) {
return;
}
// We can load the interesting branches:
am->LoadBranch("Tracks");
// Track loop to fill a pT spectrum
printf("There are %d tracks in this event\n", fESD->GetNumberOfTracks());
... track loop