Dear all,

I am wondering if there’s an easy way of truncating the event sample in my tree.
Let’s say I have a TTree with variables x and y, and I only want to plot the (x,y) histogram for the events which have an x between 0% and 99% of the total integral, effectively cutting out the 1% hightest values of x.

I found several elaborate ways of doing this, storing truncation values. But I would like to know if there’s an easy way, maybe using some TTree functionality that I am unaware of.



To do this, you need to make 2 pass through the data and hence the following should work:tree->Draw("x","","goff"); double threshold = calculated_threshold(htemp); tree->Draw("x:y",TString::Format("x < %f",threshold));