167 using namespace ROOT::Internal;
174 fEntryList(entryList)
177 Error(
"TTreeReader",
"TTree is NULL!");
189 fEntryList(entryList)
201 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
203 (*i)->MarkTreeReaderUnavailable();
255 if (endEntry > beginEntry)
259 if (beginEntry - 1 < 0)
287 return fTree->GetEntries();
288 return fTree->GetEntriesFast();
309 "The TTree / TChain has an associated TEntryList. "
310 "TTreeReader ignores TEntryLists unless you construct the TTreeReader passing a TEntryList.");
343 Int_t treeNumberBeforeLoadTree =
fTree->GetTreeNumber();
345 TTree* treeToCallLoadOn = local ?
fTree->GetTree() :
fTree;
346 Long64_t loadResult = treeToCallLoadOn->LoadTree(entryAfterList);
348 if (loadResult == -2) {
359 if (
fTree->GetTreeNumber() != treeNumberBeforeLoadTree) {
362 R__ASSERT(!local &&
"Logic error - !local but tree number changed?");
364 "The current tree in the TChain %s has changed (e.g. by TTree::Process) "
365 "even though TTreeReader::SetEntry() was called, which switched the tree "
366 "again. Did you mean to call TTreeReader::SetLocalEntry()?",
376 value->NotifyNewTree(
fTree->GetTree());
385 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
389 if (!(*i)->GetProxy()){
445 TTree*
tree =
nullptr;
458 Error(
"RegisterValueReader",
459 "Error registering reader for %s: TTreeReaderValue/Array objects must be created before the call to Next() / SetEntry() / SetLocalEntry(), or after TTreeReader::Restart()!",
472 std::deque<ROOT::Internal::TTreeReaderValueBase*>::iterator iReader
474 if (iReader ==
fValues.end()) {
TTree * SetTree(TTree *newtree)
Long64_t GetReadEntry() const
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
void GetObject(const char *namecycle, T *&ptr)
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
std::deque< ROOT::Internal::TTreeReaderValueBase * > fValues
readers that use our director
Long64_t fEndEntry
The end of the entry loop.
const char * GetBranchName() const
void SetReadEntry(Long64_t entry)
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
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.
the tree entry number does not exist
Long64_t GetEntries(Bool_t force) const
Returns the number of entries of the TEntryList if one is provided, else of the TTree / TChain...
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
EEntryStatus fEntryStatus
status of most recent read request
the tree had a TEntryList and we have warned about that
void Error(const char *location, const char *msgfmt,...)
TEntryList * fEntryList
entry list to be used
ROOT::Internal::TBranchProxyDirector * fDirector
proxying director, owned
void Initialize(Bool_t useTMVAStyle=kTRUE)
Bool_t fProxiesSet
True if the proxies have been set, false otherwise.
Bool_t TestBit(UInt_t f) const
~TTreeReader()
Tell all value readers that the tree reader does not exist anymore.
virtual Long64_t GetEntry(Int_t index)
Return the number of the entry #index of this TEntryList in the TTree or TChain See also Next()...
EEntryStatus SetEntry(Long64_t entry)
Set the next entry (or index of the TEntryList if that is set).
void Restart()
Restart a Next() loop from entry 0 (of TEntryList index 0 of fEntryList is set).
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.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
problem reading dictionary info from tree
virtual Long64_t GetN() const
Long64_t fEntry
Current (non-local) entry of fTree or of fEntryList if set.
virtual const char * GetDerivedTypeName() const =0
void SetTree(TTree *tree, TEntryList *entryList=nullptr)
Set (or update) the which tree to read from.
Int_t fMostRecentTreeNumber
TTree::GetTreeNumber() of the most recent tree.
A List of entry numbers in a TTree or TChain.
static constexpr Long64_t kMaxEntries
last entry loop has reached its end
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.