Logo ROOT   6.16/01
Reference Guide
TTreeReader.cxx
Go to the documentation of this file.
1// @(#)root/treeplayer:$Id$
2// Author: Axel Naumann, 2011-09-21
3
4/*************************************************************************
5 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers and al. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TTreeReader.h"
13
14#include "TChain.h"
15#include "TDirectory.h"
16#include "TEntryList.h"
17#include "TTreeCache.h"
18#include "TTreeReaderValue.h"
19#include "TFriendProxy.h"
20
21
22// clang-format off
23/**
24 \class TTreeReader
25 \ingroup treeplayer
26 \brief A simple, robust and fast interface to read values from ROOT colmnar datasets such as TTree, TChain or TNtuple
27
28 TTreeReader is associated to TTreeReaderValue and TTreeReaderArray which are handles to concretely
29 access the information in the dataset.
30
31 Example code can be found in
32 - tutorials/tree/hsimpleReader.C
33 - tutorials/trees/h1analysisTreeReader.C
34 - <a href="http://root.cern.ch/gitweb?p=roottest.git;a=tree;f=root/tree/reader;hb=HEAD">This example</a>
35
36 You can generate a skeleton of `TTreeReaderValue<T>` and `TTreeReaderArray<T>` declarations
37 for all of a tree's branches using `TTree::MakeSelector()`.
38
39 Roottest contains an
40 <a href="http://root.cern.ch/gitweb?p=roottest.git;a=tree;f=root/tree/reader;hb=HEAD">example</a>
41 showing the full power.
42
43A simpler analysis example can be found below: it histograms a function of the px and py branches.
44
45~~~{.cpp}
46// A simple TTreeReader use: read data from hsimple.root (written by hsimple.C)
47
48#include "TFile.h
49#include "TH1F.h
50#include "TTreeReader.h
51#include "TTreeReaderValue.h
52
53void hsimpleReader() {
54 // Create a histogram for the values we read.
55 TH1F("h1", "ntuple", 100, -4, 4);
56
57 // Open the file containing the tree.
58 TFile *myFile = TFile::Open("$ROOTSYS/tutorials/hsimple.root");
59
60 // Create a TTreeReader for the tree, for instance by passing the
61 // TTree's name and the TDirectory / TFile it is in.
62 TTreeReader myReader("ntuple", myFile);
63
64 // The branch "px" contains floats; access them as myPx.
65 TTreeReaderValue<Float_t> myPx(myReader, "px");
66 // The branch "py" contains floats, too; access those as myPy.
67 TTreeReaderValue<Float_t> myPy(myReader, "py");
68
69 // Loop over all entries of the TTree or TChain.
70 while (myReader.Next()) {
71 // Just access the data as if myPx and myPy were iterators (note the '*'
72 // in front of them):
73 myHist->Fill(*myPx + *myPy);
74 }
75
76 myHist->Draw();
77}
78~~~
79
80A more complete example including error handling and a few combinations of
81TTreeReaderValue and TTreeReaderArray would look like this:
82
83~~~{.cpp}
84#include <TFile.h>
85#include <TH1.h>
86#include <TTreeReader.h>
87#include <TTreeReaderValue.h>
88#include <TTreeReaderArray.h>
89
90#include "TriggerInfo.h"
91#include "Muon.h"
92#include "Tau.h"
93
94#include <vector>
95#include <iostream>
96
97bool CheckValue(ROOT::Internal::TTreeReaderValueBase& value) {
98 if (value->GetSetupStatus() < 0) {
99 std::cerr << "Error " << value->GetSetupStatus()
100 << "setting up reader for " << value->GetBranchName() << '\n';
101 return false;
102 }
103 return true;
104}
105
106
107// Analyze the tree "MyTree" in the file passed into the function.
108// Returns false in case of errors.
109bool analyze(TFile* file) {
110 // Create a TTreeReader named "MyTree" from the given TDirectory.
111 // The TTreeReader gives access to the TTree to the TTreeReaderValue and
112 // TTreeReaderArray objects. It knows the current entry number and knows
113 // how to iterate through the TTree.
114 TTreeReader reader("MyTree", file);
115
116 // Read a single float value in each tree entries:
117 TTreeReaderValue<float> weight(reader, "event.weight");
118
119 // Read a TriggerInfo object from the tree entries:
120 TTreeReaderValue<TriggerInfo> triggerInfo(reader, "triggerInfo");
121
122 //Read a vector of Muon objects from the tree entries:
123 TTreeReaderValue<std::vector<Muon>> muons(reader, "muons");
124
125 //Read the pT for all jets in the tree entry:
126 TTreeReaderArray<double> jetPt(reader, "jets.pT");
127
128 // Read the taus in the tree entry:
129 TTreeReaderArray<Tau> taus(reader, "taus");
130
131
132 // Now iterate through the TTree entries and fill a histogram.
133
134 TH1F("hist", "TTreeReader example histogram", 10, 0., 100.);
135
136 while (reader.Next()) {
137 if (!CheckValue(weight)) return false;
138 if (!CheckValue(triggerInfo)) return false;
139 if (!CheckValue(muons)) return false;
140 if (!CheckValue(jetPt)) return false;
141 if (!CheckValue(taus)) return false;
142
143 // Access the TriggerInfo object as if it's a pointer.
144 if (!triggerInfo->hasMuonL1())
145 continue;
146
147 // Ditto for the vector<Muon>.
148 if (!muons->size())
149 continue;
150
151 // Access the jetPt as an array, whether the TTree stores this as
152 // a std::vector, std::list, TClonesArray or Jet* C-style array, with
153 // fixed or variable array size.
154 if (jetPt.GetSize() < 2 || jetPt[0] < 100)
155 continue;
156
157 // Access the array of taus.
158 if (!taus.IsEmpty()) {
159 // Access a float value - need to dereference as TTreeReaderValue
160 // behaves like an iterator
161 float currentWeight = *weight;
162 for (const Tau& tau: taus) {
163 hist->Fill(tau.eta(), currentWeight);
164 }
165 }
166 } // TTree entry / event loop
167}
168~~~
169*/
170// clang-format on
171
173
174using namespace ROOT::Internal;
175
176// Provide some storage for the poor little symbol.
177constexpr const char * const TTreeReader::fgEntryStatusText[TTreeReader::kEntryBeyondEnd + 1];
178
179////////////////////////////////////////////////////////////////////////////////
180/// Default constructor. Call SetTree to connect to a TTree.
181
182TTreeReader::TTreeReader() : fNotify(this) {}
183
184////////////////////////////////////////////////////////////////////////////////
185/// Access data from tree.
186
187TTreeReader::TTreeReader(TTree* tree, TEntryList* entryList /*= nullptr*/):
188 fTree(tree),
189 fEntryList(entryList),
190 fNotify(this)
191{
192 if (!fTree) {
193 Error("TTreeReader", "TTree is NULL!");
194 } else {
195 Initialize();
196 }
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// Access data from the tree called keyname in the directory (e.g. TFile)
201/// dir, or the current directory if dir is NULL. If keyname cannot be
202/// found, or if it is not a TTree, IsInvalid() will return true.
203
204TTreeReader::TTreeReader(const char* keyname, TDirectory* dir, TEntryList* entryList /*= nullptr*/):
205 fEntryList(entryList),
206 fNotify(this)
207{
208 if (!dir) dir = gDirectory;
209 dir->GetObject(keyname, fTree);
210 Initialize();
211}
212
213////////////////////////////////////////////////////////////////////////////////
214/// Tell all value readers that the tree reader does not exist anymore.
215
217{
218 for (std::deque<ROOT::Internal::TTreeReaderValueBase*>::const_iterator
219 i = fValues.begin(), e = fValues.end(); i != e; ++i) {
220 (*i)->MarkTreeReaderUnavailable();
221 }
222 if (fTree && fNotify.IsLinked())
223 fNotify.RemoveLink(*fTree);
224
225 // Need to clear the map of proxies before deleting the director otherwise
226 // they will have a dangling pointer.
227 fProxies.clear();
228
229 for (auto feproxy: fFriendProxies) {
230 delete feproxy;
231 }
232 fFriendProxies.clear();
233
234 delete fDirector;
235}
236
237////////////////////////////////////////////////////////////////////////////////
238/// Initialization of the director.
239
241{
242 fEntry = -1;
243 if (!fTree) {
246 return;
247 }
248
250 if (fTree->InheritsFrom(TChain::Class())) {
252 }
253
255
256 if (!fNotify.IsLinked()) {
257 fNotify.PrependLink(*fTree);
258
259 if (fTree->GetTree()) {
260 // The current TTree is already available.
262 Notify();
264 }
265 }
266}
267
268////////////////////////////////////////////////////////////////////////////////
269/// Callback from TChain and TTree's LoadTree.
270
272{
273
276 // This can happen if someone switched trees behind us.
277 // Likely cause: a TChain::LoadTree() e.g. from TTree::Process().
278 // This means that "local" should be set!
279 // There are two entities switching trees which is bad.
280 Warning("SetEntryBase()",
281 "The current tree in the TChain %s has changed (e.g. by TTree::Process) "
282 "even though TTreeReader::SetEntry() was called, which switched the tree "
283 "again. Did you mean to call TTreeReader::SetLocalEntry()?",
284 fTree->GetName());
285 }
287 } else {
289 }
290
292 Warning("SetEntryBase()",
293 "The TTree / TChain has an associated TEntryList. "
294 "TTreeReader ignores TEntryLists unless you construct the TTreeReader passing a TEntryList.");
296 }
297
298 fDirector->Notify();
299
300 if (fProxiesSet) {
301 for (auto value: fValues) {
302 value->NotifyNewTree(fTree->GetTree());
303 }
304 }
305
306 return kTRUE;
307}
308
309////////////////////////////////////////////////////////////////////////////////
310/// Tell readers we now have a tree.
311/// fValues gets insertions during this loop (when parameterized arrays are read),
312/// invalidating iterators. Use old-school counting instead.
313
315
316 for (size_t i = 0; i < fValues.size(); ++i) {
318 reader->CreateProxy();
319 if (!reader->GetProxy()){
320 return kFALSE;
321 }
322
323 }
324 // If at least one proxy was there and no error occurred, we assume the proxies to be set.
325 fProxiesSet = !fValues.empty();
326
327 // Now we need to properly set the TTreeCache. We do this in steps:
328 // 1. We set the entry range according to the entry range of the TTreeReader
329 // 2. We add to the cache the branches identifying them by the name the user provided
330 // upon creation of the TTreeReader{Value, Array}s
331 // 3. We stop the learning phase.
332 // Operations 1, 2 and 3 need to happen in this order. See: https://sft.its.cern.ch/jira/browse/ROOT-9773?focusedCommentId=87837
333 if (fProxiesSet) {
334 const auto curFile = fTree->GetCurrentFile();
335 if (curFile && fTree->GetTree()->GetReadCache(curFile, true)) {
336 if (!(-1LL == fEndEntry && 0ULL == fBeginEntry)) {
337 // We need to avoid to pass -1 as end entry to the SetCacheEntryRange method
338 const auto lastEntry = (-1LL == fEndEntry) ? fTree->GetEntriesFast() : fEndEntry;
339 fTree->SetCacheEntryRange(fBeginEntry, lastEntry);
340 }
341 for (auto value: fValues) {
342 fTree->AddBranchToCache(value->GetProxy()->GetBranchName(), true);
343 }
344 fTree->StopCacheLearningPhase();
345 }
346 }
347
348 return kTRUE;
349}
350
351////////////////////////////////////////////////////////////////////////////////
352/// Set the range of entries to be loaded by `Next()`; end will not be loaded.
353///
354/// If end <= begin, `end` is ignored (set to `-1`) and only `begin` is used.
355/// Example:
356///
357/// ~~~ {.cpp}
358/// reader.SetEntriesRange(3, 5);
359/// while (reader.Next()) {
360/// // Will load entries 3 and 4.
361/// }
362/// ~~~
363///
364/// \param beginEntry The first entry to be loaded by `Next()`.
365/// \param endEntry The entry where `Next()` will return kFALSE, not loading it.
366
368{
369 if (beginEntry < 0)
370 return kEntryNotFound;
371 // Complain if the entries number is larger than the tree's / chain's / entry
372 // list's number of entries, unless it's a TChain and "max entries" is
373 // uninitialized (i.e. TTree::kMaxEntries).
374 if (beginEntry >= GetEntries(false) && !(IsChain() && GetEntries(false) == TTree::kMaxEntries)) {
375 Error("SetEntriesRange()", "first entry out of range 0..%lld", GetEntries(false));
376 return kEntryNotFound;
377 }
378
379 if (endEntry > beginEntry)
380 fEndEntry = endEntry;
381 else
382 fEndEntry = -1;
383 if (beginEntry - 1 < 0)
384 Restart();
385 else {
386 EEntryStatus es = SetEntry(beginEntry - 1);
387 if (es != kEntryValid) {
388 Error("SetEntriesRange()", "Error setting first entry %lld: %s",
389 beginEntry, fgEntryStatusText[(int)es]);
390 return es;
391 }
392 }
393
394 fBeginEntry = beginEntry;
395
396 return kEntryValid;
397}
398
401 fProxiesSet = false; // we might get more value readers, meaning new proxies.
402 fEntry = -1;
403 if (const auto curFile = fTree->GetCurrentFile()) {
404 if (auto tc = fTree->GetTree()->GetReadCache(curFile, true)) {
405 tc->DropBranch("*", true);
406 tc->ResetCache();
407 }
408 }
409}
410
411////////////////////////////////////////////////////////////////////////////////
412/// Returns the number of entries of the TEntryList if one is provided, else
413/// of the TTree / TChain, independent of a range set by SetEntriesRange().
414///
415/// \param force If `IsChain()` and `force`, determines whether all TFiles of
416/// this TChain should be opened to determine the exact number of entries
417/// of the TChain. If `!IsChain()`, `force` is ignored.
418
420 if (fEntryList)
421 return fEntryList->GetN();
422 if (!fTree)
423 return -1;
424 if (force)
425 return fTree->GetEntries();
426 return fTree->GetEntriesFast();
427}
428
429
430
431////////////////////////////////////////////////////////////////////////////////
432/// Load an entry into the tree, return the status of the read.
433/// For chains, entry is the global (i.e. not tree-local) entry number, unless
434/// `local` is `true`, in which case `entry` specifies the entry number within
435/// the current tree. This is needed for instance for TSelector::Process().
436
438{
439 if (IsInvalid()) {
441 fEntry = -1;
442 return fEntryStatus;
443 }
444
445 fEntry = entry;
446
447 Long64_t entryAfterList = entry;
448 if (fEntryList) {
449 if (entry >= fEntryList->GetN()) {
450 // Passed the end of the chain, Restart() was not called:
451 // don't try to load entries anymore. Can happen in these cases:
452 // while (tr.Next()) {something()};
453 // while (tr.Next()) {somethingelse()}; // should not be calling somethingelse().
455 return fEntryStatus;
456 }
457 if (entry >= 0) entryAfterList = fEntryList->GetEntry(entry);
458 if (local && IsChain()) {
459 // Must translate the entry list's entry to the current TTree's entry number.
460 local = kFALSE;
461 }
462 }
463
464 TTree* treeToCallLoadOn = local ? fTree->GetTree() : fTree;
465
467 const Long64_t loadResult = treeToCallLoadOn->LoadTree(entryAfterList);
469
470 if (loadResult < 0) {
471 // ROOT-9628 We cover here the case when:
472 // - We deal with a TChain
473 // - The last file is opened
474 // - The TTree is not correctly loaded
475 // The system is robust against issues with TTrees associated to the chain
476 // when they are not at the end of it.
477 if (loadResult == -3 && TestBit(kBitIsChain) && !fTree->GetTree()) {
478 fDirector->Notify();
479 if (fProxiesSet) {
480 for (auto value: fValues) {
481 value->NotifyNewTree(fTree->GetTree());
482 }
483 }
484 Warning("SetEntryBase()",
485 "There was an issue opening the last file associated to the TChain "
486 "being processed.");
488 return fEntryStatus;
489 }
490
491 if (loadResult == -2) {
492 fDirector->Notify();
493 if (fProxiesSet) {
494 for (auto value: fValues) {
495 value->NotifyNewTree(fTree->GetTree());
496 }
497 }
499 return fEntryStatus;
500 }
501
502 if (loadResult == -1) {
503 // The chain is empty
505 return fEntryStatus;
506 }
507
508 if (loadResult == -4) {
509 // The TChainElement corresponding to the entry is missing or
510 // the TTree is missing from the file.
511 fDirector->Notify();
512 if (fProxiesSet) {
513 for (auto value: fValues) {
514 value->NotifyNewTree(fTree->GetTree());
515 }
516 }
518 return fEntryStatus;
519 }
520
521 Warning("SetEntryBase()",
522 "Unexpected error '%lld' in %s::LoadTree", loadResult,
523 treeToCallLoadOn->IsA()->GetName());
524
526 return fEntryStatus;
527 }
528
529 if (!fProxiesSet) {
530 if (!SetProxies()) {
532 return fEntryStatus;
533 }
534 }
535
536 if (fEndEntry >= 0 && entry >= fEndEntry) {
538 return fEntryStatus;
539 }
540 fDirector->SetReadEntry(loadResult);
542 return fEntryStatus;
543}
544
545////////////////////////////////////////////////////////////////////////////////
546/// Set (or update) the which tree to read from. `tree` can be
547/// a TTree or a TChain.
548
549void TTreeReader::SetTree(TTree* tree, TEntryList* entryList /*= nullptr*/)
550{
551 fTree = tree;
552 fEntryList = entryList;
553 fEntry = -1;
554
555 if (fTree) {
557 SetBit(kBitIsChain, fTree->InheritsFrom(TChain::Class()));
558 } else {
560 }
561
562 if (!fDirector) {
563 Initialize();
564 }
565 else {
568 }
569}
570
571////////////////////////////////////////////////////////////////////////////////
572/// Set (or update) the which tree to read from, passing the name of a tree in a
573/// directory.
574///
575/// \param keyname - name of the tree in `dir`
576/// \param dir - the `TDirectory` to load `keyname` from (or gDirectory if `nullptr`)
577/// \param entryList - the `TEntryList` to attach to the `TTreeReader`.
578
579void TTreeReader::SetTree(const char* keyname, TDirectory* dir, TEntryList* entryList /*= nullptr*/)
580{
581 TTree* tree = nullptr;
582 if (!dir)
583 dir = gDirectory;
584 dir->GetObject(keyname, tree);
585 SetTree(tree, entryList);
586}
587
588////////////////////////////////////////////////////////////////////////////////
589/// Add a value reader for this tree.
590
592{
593 if (fProxiesSet) {
594 Error("RegisterValueReader",
595 "Error registering reader for %s: TTreeReaderValue/Array objects must be created before the call to Next() / SetEntry() / SetLocalEntry(), or after TTreeReader::Restart()!",
596 reader->GetBranchName());
597 return false;
598 }
599 fValues.push_back(reader);
600 return true;
601}
602
603////////////////////////////////////////////////////////////////////////////////
604/// Remove a value reader for this tree.
605
607{
608 std::deque<ROOT::Internal::TTreeReaderValueBase*>::iterator iReader
609 = std::find(fValues.begin(), fValues.end(), reader);
610 if (iReader == fValues.end()) {
611 Error("DeregisterValueReader", "Cannot find reader of type %s for branch %s", reader->GetDerivedTypeName(), reader->fBranchName.Data());
612 return;
613 }
614 fValues.erase(iReader);
615}
void Class()
Definition: Class.C:29
#define e(i)
Definition: RSha256.hxx:103
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
#define gDirectory
Definition: TDirectory.h:213
void SetReadEntry(Long64_t entry)
Move to a new entry to read entry is the 'local' entry number; i.e.
Base class of TTreeReaderValue.
Describe directory structure in memory.
Definition: TDirectory.h:34
void GetObject(const char *namecycle, T *&ptr)
Definition: TDirectory.h:139
A List of entry numbers in a TTree or TChain.
Definition: TEntryList.h:26
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().
Definition: TEntryList.cxx:653
virtual Long64_t GetN() const
Definition: TEntryList.h:75
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:866
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
A simple, robust and fast interface to read values from ROOT colmnar datasets such as TTree,...
Definition: TTreeReader.h:44
TTreeReader()
Default constructor. Call SetTree to connect to a TTree.
Bool_t fProxiesSet
True if the proxies have been set, false otherwise.
Definition: TTreeReader.h:303
ELoadTreeStatus fLoadTreeStatus
Indicator on how LoadTree was called 'last' time.
Definition: TTreeReader.h:289
EEntryStatus fEntryStatus
status of most recent read request
Definition: TTreeReader.h:288
void SetTree(TTree *tree, TEntryList *entryList=nullptr)
Set (or update) the which tree to read from.
TNotifyLink< TTreeReader > fNotify
Definition: TTreeReader.h:290
Bool_t SetProxies()
Tell readers we now have a tree.
Bool_t IsChain() const
Definition: TTreeReader.h:169
@ kEntryNotFound
the tree entry number does not exist
Definition: TTreeReader.h:129
@ kEntryUnknownError
LoadTree return less than -4, likely a 'newer' error code.
Definition: TTreeReader.h:134
@ kEntryDictionaryError
problem reading dictionary info from tree
Definition: TTreeReader.h:132
@ kEntryBeyondEnd
last entry loop has reached its end
Definition: TTreeReader.h:133
@ kEntryChainFileError
problem in opening a chain's file
Definition: TTreeReader.h:131
@ kEntryNoTree
the tree does not exist
Definition: TTreeReader.h:128
@ kEntryValid
data read okay
Definition: TTreeReader.h:126
std::deque< ROOT::Internal::TTreeReaderValueBase * > fValues
readers that use our director
Definition: TTreeReader.h:293
Bool_t Notify()
Callback from TChain and TTree's LoadTree.
TTree * fTree
tree that's read
Definition: TTreeReader.h:286
ROOT::Internal::TBranchProxyDirector * fDirector
proxying director, owned
Definition: TTreeReader.h:291
~TTreeReader()
Tell all value readers that the tree reader does not exist anymore.
EEntryStatus SetEntriesRange(Long64_t beginEntry, Long64_t endEntry)
Set the begin and end entry numbers.
std::deque< ROOT::Internal::TFriendProxy * > fFriendProxies
proxying for friend TTrees, owned
Definition: TTreeReader.h:292
Bool_t fSetEntryBaseCallingLoadTree
True if during the LoadTree execution triggered by SetEntryBase.
Definition: TTreeReader.h:304
@ kInternalLoadTree
Notify/LoadTree was last called from SetEntryBase.
Definition: TTreeReader.h:140
@ kNoTree
default state, no TTree is connected (formerly 'Zombie' state)
Definition: TTreeReader.h:138
@ kExternalLoadTree
User code called LoadTree directly.
Definition: TTreeReader.h:141
@ kLoadTreeNone
Notify has not been called yet.
Definition: TTreeReader.h:139
static constexpr const char *const fgEntryStatusText[kEntryBeyondEnd+1]
Definition: TTreeReader.h:144
void Initialize()
Initialization of the director.
void Restart()
Restart a Next() loop from entry 0 (of TEntryList index 0 of fEntryList is set).
EEntryStatus SetEntryBase(Long64_t entry, Bool_t local)
Load an entry into the tree, return the status of the read.
TEntryList * fEntryList
entry list to be used
Definition: TTreeReader.h:287
Long64_t fEntry
Current (non-local) entry of fTree or of fEntryList if set.
Definition: TTreeReader.h:296
Bool_t RegisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
Add a value reader for this tree.
Long64_t fBeginEntry
This allows us to propagate the range to the TTreeCache.
Definition: TTreeReader.h:302
void DeregisterValueReader(ROOT::Internal::TTreeReaderValueBase *reader)
Remove a value reader for this tree.
@ kBitHaveWarnedAboutEntryListAttachedToTTree
the tree had a TEntryList and we have warned about that
Definition: TTreeReader.h:282
@ kBitIsChain
our tree is a chain
Definition: TTreeReader.h:281
NamedProxies_t fProxies
attached ROOT::TNamedBranchProxies; owned
Definition: TTreeReader.h:294
Long64_t GetEntries(Bool_t force) const
Returns the number of entries of the TEntryList if one is provided, else of the TTree / TChain,...
Bool_t IsInvalid() const
Definition: TTreeReader.h:171
Long64_t fEndEntry
The end of the entry loop.
Definition: TTreeReader.h:301
EEntryStatus SetEntry(Long64_t entry)
Set the next entry (or index of the TEntryList if that is set).
Definition: TTreeReader.h:191
static constexpr Long64_t kMaxEntries
Definition: TTree.h:215
Definition: tree.py:1