170 fEntryStatus(kEntryNotLoaded),
171 fMostRecentTreeNumber(-1),
177 Error(
"TTreeReader",
"TTree is NULL!");
207 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
209 (*i)->MarkTreeReaderUnavailable();
225 if (
fTree->GetEntryList()) {
227 "TTreeReader support for TEntryList only available since ROOT 6.10!");
248 if (endEntry > beginEntry)
271 return ((
TChain*)
fTree)->GetChainEntryNumber(currentTreeEntry);
273 return currentTreeEntry;
299 Int_t treeNumberBeforeLoadTree =
fTree->GetTreeNumber();
301 TTree* treeToCallLoadOn = local ?
fTree->GetTree() :
fTree;
302 Long64_t loadResult = treeToCallLoadOn->LoadTree(entry);
304 if (loadResult == -2) {
315 if (
fTree->GetTreeNumber() != treeNumberBeforeLoadTree) {
318 R__ASSERT(!local &&
"Logic error - !local but tree number changed?");
320 "The current tree in the TChain %s has changed (e.g. by TTree::Process) " 321 "even though TTreeReader::SetEntry() was called, which switched the tree " 322 "again. Did you mean to call TTreeReader::SetLocalEntry()?",
332 value->NotifyNewTree(
fTree->GetTree());
341 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
345 if (!(*i)->GetProxy()){
394 Error(
"RegisterValueReader",
395 "Error registering reader for %s: TTreeReaderValue/Array objects must be created before the call to Next() / SetEntry() / SetLocalEntry(), or after TTreeReader::Restart()!",
408 std::deque<ROOT::Internal::TTreeReaderValueBase*>::iterator iReader
410 if (iReader ==
fValues.end()) {
TTree * SetTree(TTree *newtree)
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
Long64_t GetCurrentEntry() const
Returns the index of the current entry being read.
void GetObject(const char *namecycle, T *&ptr)
Bool_t TestBit(UInt_t f) const
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
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
const char * GetBranchName() const
TDirectory * fDirectory
directory (or current file for chains)
EEntryStatus fEntryStatus
status of most recent read request
EEntryStatus SetEntriesRange(Long64_t beginEntry, Long64_t endEntry)
Set the range of entries to be processed.
Long64_t fLastEntry
The last entry to be processed.
ROOT::Internal::TBranchProxyDirector * fDirector
proxying director, owned
Bool_t fProxiesSet
True if the proxies have been set, false otherwise.
~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.
EEntryStatus SetEntry(Long64_t entry)
no entry has been loaded yet
void Restart()
Restart a Next() loop from the first entry.
Long64_t GetReadEntry() const
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 const char * GetDerivedTypeName() const =0
A chain is a collection of files containg TTree objects.
void SetTree(TTree *tree)
Set (or update) the which tree to reader from.
Int_t fMostRecentTreeNumber
TTree::GetTreeNumber() of the most recent tree.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.