myTree->Draw("i_id1:i_id2","i_id1!=-1 && i_id2!=-1 && i_id1==0","goff"); Int_t nmatching=myTree->GetSelectedRows(); You can also do a TTree *newmyTree=myTree->CopyTree("cut"); Int_t nmatching=newmyTree->GetEntries(); Cheers, Kevin >Hi, > > Is there any way to scan a ROOT tree and count the entries that satisfy some user cuts? > > The command below scans the tree and prints the results 25 entries each time, but what I want >is to avoid the printing and just go through all the entries without stopping every 25. > > myTree->Scan("i_id1:i_id2","i_id1!=-1 && i_id2!=-1 && i_id1==0"); > > Is there any variation of this? > > Thanks! > >Stelios.
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET