Exploit ordered data in TTree

Hi,
I have a huge TTree in a root file. I need to read it both sequentially and not.

When I read it not-sequentially, I would like to exploit the fact that data in my TTree are time ordered (where time is stored in a certain branch).

So for example when looking for entries in a certain time interval, I would like to tell ROOT not to loop anymore in the TTree when it find the first event after the stop time of the desired interval.

How can I do this?

For the moment, to speed up the process, I am using TTree::BuildIndex, since the structure of my TTree allow me to do this. But I would like to know if there is a more general method.

Thank you!

[quote]So for example when looking for entries in a certain time interval, I would like to tell ROOT not to loop anymore in the TTree when it find the first event after the stop time of the desired interval.[/quote]Which technique are you using for looping?

Philippe.