List of Entries Obeying a Certain Condition from TTree

Hi,

I am looking for a way to find a list of Tree entries/indices obeying a condition. The problem is I have multiple variables for each entry and I need to find out which entries pass a selection before using a different variable for a calculation. I have seen the TEntryListArray but I am not sure if this does what I want or how to use it.

Many thanks in advanced!

_ROOT Version: ROOT 6.14/06 Built for linuxx8664gcc

See this post. The first answer pretty much does exactly what you want - you can impose your own conditions on certain variables and do other things with other variables in the same event.

Hi. I am trying to find a way of not looping over every entry as I have nearly 800,000 entries each with 100ish variables. Is there another way? How does TEntryListArray work?

Do not use TEntryListArray which is an implementation detail of TEntryLIst (which you should use … maybe) See https://root.cern.ch/doc/master/classTEntryList.html

The simplest maybe to use TTree::Draw:

tree->Draw(">>entrylistname",setofcondition,"entrylist");

See https://root.cern.ch/doc/master/classTTree.html#a73450649dc6e54b5b94516c468523e45

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.