12 #ifndef ROOT_TTreeReader 13 #define ROOT_TTreeReader 25 #ifndef ROOT_THashTable 31 #ifndef ROOT_TTreeReaderUtils 44 class TBranchProxyDirector;
61 public std::iterator<std::input_iterator_tag, const Long64_t, Long64_t> {
67 bool IsValid()
const {
return fEntry >= 0; }
76 fEntry(entry), fReader(&reader) {}
81 if (!IsValid() && !lhs.
IsValid())
return true;
87 return !(*
this == lhs);
114 if (fReader->
SetEntry(fEntry) != kEntryValid) {
143 fEntryStatus(kEntryNoTree),
144 fMostRecentTreeNumber(-1),
155 void SetTree(
TTree* tree);
161 Bool_t Next() {
return SetEntry(GetCurrentEntry() + 1) == kEntryValid; }
209 std::deque<ROOT::Internal::TTreeReaderValueBase*>
fValues;
224 #endif // defined TTreeReader ROOT::Internal::TNamedBranchProxy * FindProxy(const char *branchname) const
Iterate through the entries of a TTree.
bool operator!=(const Iterator_t &lhs) const
Compare two iterators for inequality.
TCollection * GetProxies()
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
std::deque< ROOT::Internal::TTreeReaderValueBase * > fValues
readers that use our director
void SetTree(const char *, TDirectory *)
Long64_t fEntry
Entry number of the tree referenced by this iterator; -1 is invalid.
bool IsValid() const
Whether the iterator points to a valid entry.
THashTable fProxies
attached ROOT::TNamedBranchProxies; owned
THashTable implements a hash table to store TObject's.
#define ClassDef(name, id)
the tree entry number does not exist
Iterator_t begin()
Return an iterator to the 0th TTree entry.
TDirectory * fDirectory
directory (or current file for chains)
EEntryStatus fEntryStatus
status of most recent read request
const Long64_t & operator*()
Set the entry number in the reader and return it.
Iterator_t()
Default-initialize the iterator as "past the end".
Long64_t fLastEntry
The last entry to be processed.
ROOT::Internal::TBranchProxyDirector * fDirector
proxying director, owned
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void Initialize(Bool_t useTMVAStyle=kTRUE)
This class defines an abstract interface that must be implemented by all classes that contain diction...
TTime operator*(const TTime &t1, const TTime &t2)
Bool_t fProxiesSet
True if the proxies have been set, false otherwise.
Collection abstract base class.
Long64_t GetEntries(Bool_t force) const
EEntryStatus SetEntry(Long64_t entry)
no entry has been loaded yet
const Long64_t & operator*() const
problem in opening a chain's file
problem in accessing a chain element, e.g. file without the tree
void SetChain(const char *, TFileCollection *)
Iterator_t operator++(int)
Increment the iterator (postfix i++).
EEntryStatus SetLocalEntry(Long64_t entry)
Describe directory structure in memory.
TTree * fTree
tree that's read
problem reading dictionary info from tree
EEntryStatus GetEntryStatus() const
Iterator_t & operator++()
Increment the iterator (prefix ++i).
Mother of all ROOT objects.
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
bool operator==(const Iterator_t &lhs) const
Compare two iterators for equality.
A TTree object has a header with a name and a title.
TTreeReader * fReader
The reader we select the entries on.
Int_t fMostRecentTreeNumber
TTree::GetTreeNumber() of the most recent tree.
void SetLastEntry(Long64_t entry)
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
Iterator_t(TTreeReader &reader, Long64_t entry)
Initialize the iterator with the reader it steers and a tree entry number; -1 is invalid.