193 using namespace ROOT::Internal;
201 fEntryStatus(kEntryNotLoaded),
202 fMostRecentTreeNumber(-1),
208 Error(
"TTreeReader",
"TTree is NULL!");
222 fEntryStatus(kEntryNotLoaded),
223 fMostRecentTreeNumber(-1),
238 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
240 (*i)->MarkTreeReaderUnavailable();
298 return ((
TChain*)
fTree)->GetChainEntryNumber(currentTreeEntry);
300 return currentTreeEntry;
326 Int_t treeNumberBeforeLoadTree =
fTree->GetTreeNumber();
328 TTree* treeToCallLoadOn = local ?
fTree->GetTree() :
fTree;
329 Long64_t loadResult = treeToCallLoadOn->LoadTree(entry);
331 if (loadResult == -2) {
342 if (
fTree->GetTreeNumber() != treeNumberBeforeLoadTree) {
345 R__ASSERT(!local &&
"Logic error - !local but tree number changed?");
347 "The current tree in the TChain %s has changed (e.g. by TTree::Process) "
348 "even though TTreeReader::SetEntry() was called, which switched the tree "
349 "again. Did you mean to call TTreeReader::SetLocalEntry()?",
359 value->NotifyNewTree(
fTree->GetTree());
368 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
372 if (!(*i)->GetProxy()){
421 Error(
"RegisterValueReader",
422 "Error registering reader for %s: TTreeReaderValue/Array objects must be created before the call to Next() / SetEntry() / SetLocalEntry(), or after TTreeReader::Restart()!",
435 std::deque<ROOT::Internal::TTreeReaderValueBase*>::iterator iReader
437 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
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 GetCurrentEntry() const
Returns the index of the current entry being read.
TDirectory * fDirectory
directory (or current file for chains)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
EEntryStatus fEntryStatus
status of most recent read request
void Error(const char *location, const char *msgfmt,...)
Long64_t fLastEntry
The last entry to be processed.
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.
EEntryStatus SetEntry(Long64_t entry)
void Restart()
Restart a Next() loop from the first entry.
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.
EEntryStatus SetEntriesRange(Long64_t first, Long64_t last)
Set the range of entries to be processed.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.