Getting event number associated to a value in TLeaf

Dear root experts,

I am reading a large TTree in which I have a TLeaf which has values in bijective correspondence with the event numbers.

Is there a way to get the entry correspondent to a fixed value of my TLeaf, without looping on all the entries?

Thanks for our help,


Hi Davide,

I’m afraid you’ll have to loop over the entries and break once you find it…

Cheers, Bertrand.

Hi Davide,

If this is a query you need to do often on the same file/tree and the leaf data can be summarized by an integer, you can use TTree::BuildIndex to speed up the additional searches.