177 fEntryList(entryList)
180 Error(
"TTreeReader",
"TTree is NULL!");
204 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
206 (*i)->MarkTreeReaderUnavailable();
255 Error(
"SetEntriesRange()",
"first entry out of range 0..%lld",
GetEntries(
false));
259 if (endEntry > beginEntry)
263 if (beginEntry - 1 < 0)
268 Error(
"SetEntriesRange()",
"Error setting first entry %lld: %s",
297 return fTree->GetEntries();
298 return fTree->GetEntriesFast();
319 "The TTree / TChain has an associated TEntryList. " 320 "TTreeReader ignores TEntryLists unless you construct the TTreeReader passing a TEntryList.");
353 Int_t treeNumberBeforeLoadTree =
fTree->GetTreeNumber();
355 TTree* treeToCallLoadOn = local ?
fTree->GetTree() :
fTree;
356 Long64_t loadResult = treeToCallLoadOn->LoadTree(entryAfterList);
358 if (loadResult == -2) {
369 if (
fTree->GetTreeNumber() != treeNumberBeforeLoadTree) {
372 R__ASSERT(!local &&
"Logic error - !local but tree number changed?");
374 "The current tree in the TChain %s has changed (e.g. by TTree::Process) " 375 "even though TTreeReader::SetEntry() was called, which switched the tree " 376 "again. Did you mean to call TTreeReader::SetLocalEntry()?",
386 value->NotifyNewTree(
fTree->GetTree());
397 for (
size_t i = 0; i <
fValues.size(); ++i) {
457 TTree*
tree =
nullptr;
470 Error(
"RegisterValueReader",
471 "Error registering reader for %s: TTreeReaderValue/Array objects must be created before the call to Next() / SetEntry() / SetLocalEntry(), or after TTreeReader::Restart()!",
484 std::deque<ROOT::Internal::TTreeReaderValueBase*>::iterator iReader
486 if (iReader ==
fValues.end()) {
TTree * SetTree(TTree *newtree)
virtual Long64_t GetN() 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)
std::deque< ROOT::Internal::TTreeReaderValueBase * > fValues
readers that use our director
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Long64_t fEndEntry
The end of the entry loop.
void SetReadEntry(Long64_t entry)
EEntryStatus SetEntryBase(Long64_t entry, Bool_t local)
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Bool_t RegisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
Detail::TBranchProxy * GetProxy() const
the tree entry number does not exist
const char * GetBranchName() const
EEntryStatus fEntryStatus
status of most recent read request
TEntryList * fEntryList
entry list to be used
EEntryStatus SetEntriesRange(Long64_t beginEntry, Long64_t endEntry)
Sets the entry that Next() will stop iteration on.
ROOT::Internal::TBranchProxyDirector * fDirector
proxying director, owned
Bool_t fProxiesSet
True if the proxies have been set, false otherwise.
Long64_t GetEntries(Bool_t force) const
virtual void CreateProxy()
Create the proxy object for our branch.
~TTreeReader()
Tell all value readers that the tree reader does not exist anymore.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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).
Long64_t GetReadEntry() const
Describe directory structure in memory.
TTree * fTree
tree that's read
void Initialize()
Initialization of the director.
the tree had a TEntryList and we have warned about that
void DeregisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
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
Long64_t fEntry
Current (non-local) entry of fTree or of fEntryList if set.
static constexpr const char *const fgEntryStatusText[kEntryBeyondEnd+1]
virtual const char * GetDerivedTypeName() const =0
void SetTree(TTree *tree, TEntryList *entryList=nullptr)
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
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
last entry loop has reached its end