TEntryListArray: a list of entries and subentries in a TTree or TChain
TEntryListArray is an extension of TEntryList, used to hold selected entries and subentries (sublists) for when the user has a TTree with containers (vectors, arrays, ...).
End_Html
Usage with TTree::Draw to select entries and subentries
Its main purpose is to improve the performance of a code that needs to apply complex cuts on TTree::Draw multiple times. After the first call above to TTree::Draw, a TEntryListArray is created and filled with the entries and the indices of the arrays that satisfied the selection cut (x > 0). In the subsequent calls to TTree::Draw, only these entries / subentries are used to fill histograms.
About the class
The class derives from TEntryList and can be used basically in the same way. This same class is used to keep entries and subentries, so there are two types of TEntryListArray's:
The ones that only hold subentries
fEntry is set to the entry# for which the subentries correspond
fSubLists must be 0
The ones that hold entries and eventually lists with subentries in fSubLists.
fEntry = -1 for those
If there are no sublists for a given entry, all the subentries will be used in the selection
Additions with respect to TEntryList
Data members:
fSubLists: a container to hold the sublists
fEntry: the entry number if the list is used to hold subentries
fLastSubListQueried and fSubListIter: a pointer to the last sublist queried and an iterator to resume the loop from the last sublist queried (to speed up selection and insertion in TTree::Draw)
Public methods:
Contains, Enter and Remove with subentry as argument
GetSubListForEntry: to return the sublist corresponding to the given entry
Protected methods:
AddEntriesAndSubLists: called by Add when adding two TEntryList arrays with sublists
ConvertToTEntryListArray: convert TEntryList to TEntryListArray
RemoveSubList: to remove the given sublist
RemoveSubListForEntry: to remove the sublist corresponding to the given entry
SetEntry: to get / set a sublist for the given entry