177 fEntryList(entryList)
180 Error(
"TTreeReader",
"TTree is NULL!");
192 fEntryList(entryList)
204 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
206 (*i)->MarkTreeReaderUnavailable();
256 Error(
"SetEntriesRange()",
"first entry out of range 0..%lld",
GetEntries(
false));
260 if (endEntry > beginEntry)
264 if (beginEntry - 1 < 0)
269 Error(
"SetEntriesRange()",
"Error setting first entry %lld: %s",
298 return fTree->GetEntries();
299 return fTree->GetEntriesFast();
320 "The TTree / TChain has an associated TEntryList. " 321 "TTreeReader ignores TEntryLists unless you construct the TTreeReader passing a TEntryList.");
354 Int_t treeNumberBeforeLoadTree =
fTree->GetTreeNumber();
356 TTree* treeToCallLoadOn = local ?
fTree->GetTree() :
fTree;
357 Long64_t loadResult = treeToCallLoadOn->LoadTree(entryAfterList);
359 if (loadResult == -2) {
370 if (
fTree->GetTreeNumber() != treeNumberBeforeLoadTree) {
373 R__ASSERT(!local &&
"Logic error - !local but tree number changed?");
375 "The current tree in the TChain %s has changed (e.g. by TTree::Process) " 376 "even though TTreeReader::SetEntry() was called, which switched the tree " 377 "again. Did you mean to call TTreeReader::SetLocalEntry()?",
387 value->NotifyNewTree(
fTree->GetTree());
398 for (
size_t i = 0; i <
fValues.size(); ++i) {
458 TTree*
tree =
nullptr;
471 Error(
"RegisterValueReader",
472 "Error registering reader for %s: TTreeReaderValue/Array objects must be created before the call to Next() / SetEntry() / SetLocalEntry(), or after TTreeReader::Restart()!",
485 std::deque<ROOT::Internal::TTreeReaderValueBase*>::iterator iReader
487 if (iReader ==
fValues.end()) {
488 Error(
"DeregisterValueReader",
"Cannot find reader of type %s for branch %s",
reader->GetDerivedTypeName(),
reader->fBranchName.Data());
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)
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
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Long64_t fEndEntry
The end of the entry loop.
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
EEntryStatus fEntryStatus
status of most recent read request
EEntryStatus SetEntriesRange(Long64_t beginEntry, Long64_t endEntry)
Sets the entry that Next() will stop iteration on.
TEntryList * fEntryList
entry list to be used
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
Returns the number of entries of the TEntryList if one is provided, else of the TTree / TChain...
~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)
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
Long64_t fEntry
Current (non-local) entry of fTree or of fEntryList if set.
static constexpr const char *const fgEntryStatusText[kEntryBeyondEnd+1]
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
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
last entry loop has reached its end