How to filter events in TTree based on time?

Hey people,

I have a function that analyses the events in a TTree object. Now I want to use that function to analyse a subset of these events, based on a specific time interval. This seems like a common task; what would be the best way to do this? I tried creating a substree and copying only the appropriate events, but I got stuck at an error that remains unresolved (see topic at [url][Bug] TTree -> Fill() returns error only when put under if()

Thank you for any input!

Scipio