Grabbing entry number of selection from tree

Is there an easy way to grab the entry numbers from a tree after applying a cut? For example, if I have a tree with branches:

Int_t trignum
Int_t value

and I want to know the tree entry number corresponding to trignum = 20453. I could just loop over entries until I find this value, but my trees are very very large, and this would be too time consuming.


Jesse Wodin

see class TEventList or TEntryList



The simplest is to create a TEntryList during the application of the cut:root [1] ntuple->Draw(">>elist","px>3.0","entrylist") (Long64_t)48 root [2] elist->Print("all") ntuple /local2/pcanal/root_working/code/root.untouched/tutorials/hsimple.root 728 857 2485 ....


Does this solution also work for a TChain?

Ah, this seems to work with “eventlist” as opposed to “entrylist.”