Can anyone advise me how to properly use TTree::BuildIndex and TTree::GetEntryWithIndex / TChain::GetEntryWithIndex in an instance where my code will accept a TChain or a TTree? My code (too simple to even bother giving a snippet: it really just calls BuildIndex before a loop, and then GetEntryWithIndex inside a loop) works fine when run on a TTree and a TChain containing only one TTree. But I get the following error when run on a TChain containing two or more trees:
Warning in TChainIndex::GetSubTreeIndex: The index value is less than the smallest index values in subtrees
Error in TChainIndex::GetEntryNumberWithIndex: no index found
I apologize if this has already been covered elsewhere in the forum, but I did not find any pertinent entry (nor any newer than 2009) by searching TChain and index.
Thanks!