I found that in the past, a BuildIndex() call was always necessary on TChain to use GetEntryWithIndex(). However, in one post, I see a mention that if member TTrees already have indices stored in the file, this should be enough. Mine do, and the TChain that I built does not have an index - GetTreeIndex() returns a null pointer. Is this the expected behaviour for ROOT 6.30.06?
Thanks for reaching out to the forum! And thanks for adding the reference to the previous post. It would also of course be beneficial to have a code reproducer of your situation.
Keep in mind that there might be a slight misunderstanding, if I understand your description properly. It is true that a TTreeIndex can be stored to file together with its TTree, but this does not mean that a TChain will get this automatically. A TChain is simply a virtual concatenation of TTrees, so it does not automatically know whether you want to build an index for it, even if its TTrees might have their indices stored on disk. So if you’re working with a TChain, please make sure to call BuildIndex on it before befriending it to another TChain/TTree.