There is no easy way (that I know of) of doing this with a formula.
You need to either either MakeSelector or MakeProxy or to pass a script to Draw. Something like:void onlyfirst() {
Int_t len = ... here grab the length of your array ...;
for(int i=0;i < len; ++i) {
if (array[i]>1) {
htemp->Fill(array[i);
return;
}
}
and usetree->Draw("onlyfirst.C","","nohist");
Cheers,
Philippe
Here you need to add a TH1* member to the class and have it valid before the call of the function.
Load it compiled, so the execution is not too long (using .“L theclass.C++”).
I find it to work well.
The remaining problems : only 1D graph, and no automatique computing of the histo range as in TTree::Draw(), and “same” option won’t work.