12 #ifndef ROOT_TTreeReader
13 #define ROOT_TTreeReader
38 class TBranchProxyDirector;
55 public std::iterator<std::input_iterator_tag, const Long64_t, Long64_t> {
81 return !(*
this == lhs);
145 SetTree(keyname,
nullptr, entryList);
240 std::deque<ROOT::Internal::TTreeReaderValueBase*>
fValues;
257 #endif // defined TTreeReader
const Long64_t & operator*() const
Iterate through the entries of a TTree.
#define R__DEPRECATED(MAJOR, MINOR, REASON)
TCollection * GetProxies()
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
bool IsValid() const
Whether the iterator points to a valid entry.
Iterator_t end() const
Return an iterator beyond the last TTree entry.
TTreeReader(const char *keyname, TEntryList *entryList=nullptr)
std::deque< ROOT::Internal::TTreeReaderValueBase * > fValues
readers that use our director
ROOT::Internal::TNamedBranchProxy * FindProxy(const char *branchname) const
void SetTree(const char *keyname, TEntryList *entryList=nullptr)
bool operator==(const Iterator_t &lhs) const
Compare two iterators for equality.
Long64_t fEntry
Entry number of the tree referenced by this iterator; -1 is invalid.
Long64_t fEndEntry
The end of the entry loop.
THashTable fProxies
attached ROOT::TNamedBranchProxies; owned
Bool_t RegisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
Add a value reader for this tree.
EEntryStatus SetEntryBase(Long64_t entry, Bool_t local)
Load an entry into the tree, return the status of the read.
TEntryList * GetEntryList() const
THashTable implements a hash table to store TObject's.
#define ClassDef(name, id)
void SetLastEntry(Long64_t endEntry) R__DEPRECATED(6
the tree entry number does not exist
Long64_t GetCurrentEntry() const
Returns the index of the current entry being read.
Iterator_t begin()
Return an iterator to the 0th TTree entry.
Long64_t GetEntries(Bool_t force) const
Returns the number of entries of the TEntryList if one is provided, else of the TTree / TChain...
EEntryStatus fEntryStatus
status of most recent read request
the tree had a TEntryList and we have warned about that
const Long64_t & operator*()
Set the entry number in the reader and return it.
TEntryList * fEntryList
entry list to be used
Iterator_t()
Default-initialize the iterator as "past the end".
ROOT::Internal::TBranchProxyDirector * fDirector
proxying director, owned
This class defines an abstract interface that must be implemented by all classes that contain diction...
Bool_t fProxiesSet
True if the proxies have been set, false otherwise.
Collection abstract base class.
Bool_t TestBit(UInt_t f) const
~TTreeReader()
Tell all value readers that the tree reader does not exist anymore.
EEntryStatus SetEntry(Long64_t entry)
Set the next entry (or index of the TEntryList if that is set).
no entry has been loaded yet
problem in opening a chain's file
problem in accessing a chain element, e.g. file without the tree
void Restart()
Restart a Next() loop from entry 0 (of TEntryList index 0 of fEntryList is set).
Iterator_t operator++(int)
Increment the iterator (postfix i++).
EEntryStatus SetLocalEntry(Long64_t entry)
Set the next local tree entry.
please use SetEntriesRange()!")
Describe directory structure in memory.
TTree * fTree
tree that's read
void Initialize()
Initialization of the director.
void DeregisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
Remove a value reader for this tree.
EEntryStatus GetEntryStatus() const
problem reading dictionary info from tree
Iterator_t & operator++()
Increment the iterator (prefix ++i).
Mother of all ROOT objects.
bool operator!=(const Iterator_t &lhs) const
Compare two iterators for inequality.
Bool_t Next()
Move to the next entry (or index of the TEntryList if that is set).
Long64_t fEntry
Current (non-local) entry of fTree or of fEntryList if set.
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
TObject * FindObject(const char *name) const
Find object using its name.
A TTree object has a header with a name and a title.
void SetTree(TTree *tree, TEntryList *entryList=nullptr)
Set (or update) the which tree to read from.
TTreeReader * fReader
The reader we select the entries on.
Int_t fMostRecentTreeNumber
TTree::GetTreeNumber() of the most recent tree.
A List of entry numbers in a TTree or TChain.
Iterator_t(TTreeReader &reader, Long64_t entry)
Initialize the iterator with the reader it steers and a tree entry number; -1 is invalid.
last entry loop has reached its end