CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RootTree.cc
Go to the documentation of this file.
1 #include "RootTree.h"
2 #include "RootDelayedReader.h"
6 #include "InputFile.h"
7 #include "TTree.h"
8 #include "TTreeIndex.h"
9 #include "TTreeCache.h"
10 
11 #include <iostream>
12 
13 namespace edm {
14  namespace {
15  TBranch* getAuxiliaryBranch(TTree* tree, BranchType const& branchType) {
16  TBranch* branch = tree->GetBranch(BranchTypeToAuxiliaryBranchName(branchType).c_str());
17  if (branch == 0) {
18  branch = tree->GetBranch(BranchTypeToAuxBranchName(branchType).c_str());
19  }
20  return branch;
21  }
22  TBranch* getProductProvenanceBranch(TTree* tree, BranchType const& branchType) {
23  TBranch* branch = tree->GetBranch(BranchTypeToBranchEntryInfoBranchName(branchType).c_str());
24  return branch;
25  }
26  }
27  RootTree::RootTree(boost::shared_ptr<InputFile> filePtr,
28  BranchType const& branchType,
29  unsigned int maxVirtualSize,
30  unsigned int cacheSize,
31  unsigned int learningEntries,
32  bool enablePrefetching) :
33  filePtr_(filePtr),
34  tree_(dynamic_cast<TTree*>(filePtr_.get() != 0 ? filePtr_->Get(BranchTypeToProductTreeName(branchType).c_str()) : 0)),
35  metaTree_(dynamic_cast<TTree*>(filePtr_.get() != 0 ? filePtr_->Get(BranchTypeToMetaDataTreeName(branchType).c_str()) : 0)),
36  branchType_(branchType),
37  auxBranch_(tree_ ? getAuxiliaryBranch(tree_, branchType_) : 0),
38  treeCache_(),
39  rawTreeCache_(),
40  triggerTreeCache_(),
41  rawTriggerTreeCache_(),
42  trainedSet_(),
43  triggerSet_(),
44  entries_(tree_ ? tree_->GetEntries() : 0),
45  entryNumber_(-1),
46  branchNames_(),
47  branches_(new BranchMap),
48  trainNow_(false),
49  switchOverEntry_(-1),
50  rawTriggerSwitchOverEntry_(-1),
51  learningEntries_(learningEntries),
52  cacheSize_(cacheSize),
53  treeAutoFlush_(0),
54  enablePrefetching_(enablePrefetching),
55  enableTriggerCache_(branchType_ == InEvent),
56  rootDelayedReader_(new RootDelayedReader(*this, filePtr)),
57  branchEntryInfoBranch_(metaTree_ ? getProductProvenanceBranch(metaTree_, branchType_) : (tree_ ? getProductProvenanceBranch(tree_, branchType_) : 0)),
58  infoTree_(dynamic_cast<TTree*>(filePtr_.get() != 0 ? filePtr->Get(BranchTypeToInfoTreeName(branchType).c_str()) : 0)) // backward compatibility
59  {
60  assert(tree_);
61  // On merged files in older releases of ROOT, the autoFlush setting is always negative; we must guess.
62  // TODO: On newer merged files, we should be able to get this from the cluster iterator.
63  long treeAutoFlush = (tree_ ? tree_->GetAutoFlush() : 0);
64  if (treeAutoFlush < 0) {
65  // The "+1" is here to avoid divide-by-zero in degenerate cases.
66  Long64_t averageEventSizeBytes = tree_->GetZipBytes() / (tree_->GetEntries()+1) + 1;
67  treeAutoFlush_ = cacheSize_/averageEventSizeBytes+1;
68  } else {
69  treeAutoFlush_ = treeAutoFlush;
70  }
73  }
74  setTreeMaxVirtualSize(maxVirtualSize);
75  setCacheSize(cacheSize);
76  if (tree_) {
77  Int_t branchCount = tree_->GetListOfBranches()->GetEntriesFast();
78  trainedSet_.reserve(branchCount);
79  triggerSet_.reserve(branchCount);
80  }
81  }
82 
84  }
85 
86  bool
88  if (metaTree_ == 0 || metaTree_->GetNbranches() == 0) {
89  return tree_ != 0 && auxBranch_ != 0;
90  }
91  if (tree_ != 0 && auxBranch_ != 0 && metaTree_ != 0) { // backward compatibility
92  if (branchEntryInfoBranch_ != 0 || infoTree_ != 0) return true; // backward compatibility
93  return (entries_ == metaTree_->GetEntries() && tree_->GetNbranches() <= metaTree_->GetNbranches() + 1); // backward compatibility
94  } // backward compatibility
95  return false;
96  }
97 
100  rootDelayedReader_->reset();
101  return rootDelayedReader_.get();
102  }
103 
104  void
105  RootTree::setPresence(BranchDescription const& prod, std::string const& oldBranchName) {
106  assert(isValid());
107  prod.init();
108  if(tree_->GetBranch(oldBranchName.c_str()) == 0){
109  prod.setDropped();
110  }
111  }
112 
113  void
115  BranchDescription const& prod,
116  std::string const& oldBranchName) {
117  assert(isValid());
118  prod.init();
119  //use the translated branch name
120  TBranch* branch = tree_->GetBranch(oldBranchName.c_str());
122  info.productBranch_ = 0;
123  if (prod.present()) {
124  info.productBranch_ = branch;
125  //we want the new branch name for the JobReport
126  branchNames_.push_back(prod.branchName());
127  }
128  TTree* provTree = (metaTree_ != 0 ? metaTree_ : tree_);
129  info.provenanceBranch_ = provTree->GetBranch(oldBranchName.c_str());
130  branches_->insert(std::make_pair(key, info));
131  }
132 
133  void
134  RootTree::dropBranch(std::string const& oldBranchName) {
135  //use the translated branch name
136  TBranch* branch = tree_->GetBranch(oldBranchName.c_str());
137  if (branch != 0) {
138  TObjArray* leaves = tree_->GetListOfLeaves();
139  int entries = leaves->GetEntries();
140  for (int i = 0; i < entries; ++i) {
141  TLeaf* leaf = (TLeaf*)(*leaves)[i];
142  if (leaf == 0) continue;
143  TBranch* br = leaf->GetBranch();
144  if (br == 0) continue;
145  if (br->GetMother() == branch) {
146  leaves->Remove(leaf);
147  }
148  }
149  leaves->Compress();
150  tree_->GetListOfBranches()->Remove(branch);
151  tree_->GetListOfBranches()->Compress();
152  delete branch;
153  }
154  }
155 
156  roottree::BranchMap const&
157  RootTree::branches() const {return *branches_;}
158 
159  void
160  RootTree::setCacheSize(unsigned int cacheSize) {
161  cacheSize_ = cacheSize;
162  tree_->SetCacheSize(static_cast<Long64_t>(cacheSize));
163  treeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
164  if(treeCache_) treeCache_->SetEnablePrefetching(enablePrefetching_);
165  filePtr_->SetCacheRead(0);
166  rawTreeCache_.reset();
167  }
168 
169  void
170  RootTree::setTreeMaxVirtualSize(int treeMaxVirtualSize) {
171  if (treeMaxVirtualSize >= 0) tree_->SetMaxVirtualSize(static_cast<Long64_t>(treeMaxVirtualSize));
172  }
173 
174  void
176  filePtr_->SetCacheRead(treeCache_.get());
177 
178  // Detect a backward skip. If the skip is sufficiently large, we roll the dice and reset the treeCache.
179  // This will cause some amount of over-reading: we pre-fetch all the events in some prior cluster.
180  // However, because reading one event in the cluster is supposed to be equivalent to reading all events in the cluster,
181  // we're not incurring additional over-reading - we're just doing it more efficiently.
182  // NOTE: Constructor guarantees treeAutoFlush_ is positive, even if TTree->GetAutoFlush() is negative.
183  if ((theEntryNumber < static_cast<EntryNumber>(entryNumber_-treeAutoFlush_)) &&
184  (treeCache_) && (!treeCache_->IsLearning()) && (entries_ > 0) && (switchOverEntry_ >= 0)) {
185  treeCache_->SetEntryRange(theEntryNumber, entries_);
186  treeCache_->FillBuffer();
187  }
188 
189  entryNumber_ = theEntryNumber;
190  tree_->LoadTree(entryNumber_);
191  filePtr_->SetCacheRead(0);
192  if(treeCache_ && trainNow_ && entryNumber_ >= 0) {
193  startTraining();
194  trainNow_ = false;
195  trainedSet_.clear();
196  triggerSet_.clear();
198  }
199  if (treeCache_ && treeCache_->IsLearning() && switchOverEntry_ >= 0 && entryNumber_ >= switchOverEntry_) {
200  stopTraining();
201  }
202  }
203 
204  // The actual implementation is done below; it's split in this strange
205  // manner in order to keep a by-definition-rare code path out of the instruction cache.
206  inline TTreeCache*
207  RootTree::checkTriggerCache(TBranch* branch, EntryNumber entryNumber) const {
208  if (!treeCache_->IsAsyncReading() && enableTriggerCache_ && (trainedSet_.find(branch) == trainedSet_.end())) {
209  return checkTriggerCacheImpl(branch, entryNumber);
210  } else {
211  return NULL;
212  }
213  }
214 
215  // See comments in the header. If this function is called, we already know
216  // the trigger cache is active and it was a cache miss for the regular cache.
217  TTreeCache*
218  RootTree::checkTriggerCacheImpl(TBranch* branch, EntryNumber entryNumber) const {
219  // This branch is not going to be in the cache.
220  // Assume this is a "trigger pattern".
221  // Always make sure the branch is added to the trigger set.
222  if (triggerSet_.find(branch) == triggerSet_.end()) {
223  triggerSet_.insert(branch);
224  if (triggerTreeCache_.get()) { triggerTreeCache_->AddBranch(branch, kTRUE); }
225  }
226 
227  if (rawTriggerSwitchOverEntry_ < 0) {
228  // The trigger has never fired before. Take everything not in the
229  // trainedSet and load it from disk
230 
231  // Calculate the end of the next cluster; triggers in the next cluster
232  // will use the triggerCache, not the rawTriggerCache.
233  TTree::TClusterIterator clusterIter = tree_->GetClusterIterator(entryNumber);
234  while (rawTriggerSwitchOverEntry_ < entryNumber) {
235  rawTriggerSwitchOverEntry_ = clusterIter();
236  }
237 
238  // ROOT will automatically expand the cache to fit one cluster; hence, we use
239  // 5 MB as the cache size below
240  tree_->SetCacheSize(static_cast<Long64_t>(5*1024*1024));
241  rawTriggerTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
242  if(rawTriggerTreeCache_) rawTriggerTreeCache_->SetEnablePrefetching(false);
243  TObjArray *branches = tree_->GetListOfBranches();
244  int branchCount = branches->GetEntriesFast();
245 
246  // Train the rawTriggerCache to have everything not in the regular cache.
247  rawTriggerTreeCache_->SetLearnEntries(0);
248  rawTriggerTreeCache_->SetEntryRange(entryNumber, rawTriggerSwitchOverEntry_);
249  for (int i=0;i<branchCount;i++) {
250  TBranch *tmp_branch = (TBranch*)branches->UncheckedAt(i);
251  if (trainedSet_.find(tmp_branch) != trainedSet_.end()) {
252  continue;
253  }
254  rawTriggerTreeCache_->AddBranch(tmp_branch, kTRUE);
255  }
256  performedSwitchOver_ = false;
257  rawTriggerTreeCache_->StopLearningPhase();
258  filePtr_->SetCacheRead(0);
259 
260  return rawTriggerTreeCache_.get();
262  // The raw trigger has fired and it contents are valid.
263  return rawTriggerTreeCache_.get();
264  } else if (rawTriggerSwitchOverEntry_ > 0) {
265  // The raw trigger has fired, but we are out of the cache. Use the
266  // triggerCache instead.
267  if (!performedSwitchOver_) {
268  rawTriggerTreeCache_.reset();
269  performedSwitchOver_ = true;
270 
271  // Train the triggerCache
272  tree_->SetCacheSize(static_cast<Long64_t>(5*1024*1024));
273  triggerTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
274  triggerTreeCache_->SetEnablePrefetching(false);
275  triggerTreeCache_->SetLearnEntries(0);
276  triggerTreeCache_->SetEntryRange(entryNumber, tree_->GetEntries());
277  for(std::unordered_set<TBranch*>::const_iterator it = triggerSet_.begin(), itEnd = triggerSet_.end();
278  it != itEnd;
279  it++)
280  {
281  triggerTreeCache_->AddBranch(*it, kTRUE);
282  }
283  triggerTreeCache_->StopLearningPhase();
284  filePtr_->SetCacheRead(0);
285  }
286  return triggerTreeCache_.get();
288  // The raw trigger has fired and it contents are valid.
289  return rawTriggerTreeCache_.get();
290  } else if (rawTriggerSwitchOverEntry_ > 0) {
291  // The raw trigger has fired, but we are out of the cache. Use the
292  // triggerCache instead.
293  if (!performedSwitchOver_) {
294  rawTriggerTreeCache_.reset();
295  performedSwitchOver_ = true;
296 
297  // Train the triggerCache
298  tree_->SetCacheSize(static_cast<Long64_t>(5*1024*1024));
299  triggerTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
300  triggerTreeCache_->SetEnablePrefetching(false);
301  triggerTreeCache_->SetLearnEntries(0);
302  triggerTreeCache_->SetEntryRange(entryNumber, tree_->GetEntries());
303  for(std::unordered_set<TBranch*>::const_iterator it = triggerSet_.begin(), itEnd = triggerSet_.end();
304  it != itEnd;
305  it++)
306  {
307  triggerTreeCache_->AddBranch(*it, kTRUE);
308  }
309  triggerTreeCache_->StopLearningPhase();
310  filePtr_->SetCacheRead(0);
311  }
312  return triggerTreeCache_.get();
313  }
314 
315  // By construction, this case should be impossible.
316  assert (false);
317  return NULL;
318  }
319 
320  inline TTreeCache*
321  RootTree::selectCache(TBranch* branch, EntryNumber entryNumber) const {
322  TTreeCache *triggerCache = NULL;
323  if (!treeCache_) {
324  return NULL;
325  } else if (treeCache_->IsLearning() && rawTreeCache_) {
326  treeCache_->AddBranch(branch, kTRUE);
327  trainedSet_.insert(branch);
328  return rawTreeCache_.get();
329  } else if ((triggerCache = checkTriggerCache(branch, entryNumber))) {
330  // A NULL return value from checkTriggerCache indicates the trigger cache case
331  // does not apply, and we should continue below.
332  return triggerCache;
333  } else {
334  // The "normal" TTreeCache case.
335  return treeCache_.get();
336  }
337  }
338 
339  void
340  RootTree::getEntry(TBranch* branch, EntryNumber entryNumber) const {
341  try {
342  TTreeCache * cache = selectCache(branch, entryNumber);
343  filePtr_->SetCacheRead(cache);
344  branch->GetEntry(entryNumber);
345  filePtr_->SetCacheRead(0);
346  } catch(cms::Exception const& e) {
347  // We make sure the treeCache_ is detached from the file,
348  // so that ROOT does not also delete it.
349  filePtr_->SetCacheRead(0);
351  t.addContext(std::string("Reading branch ")+branch->GetName());
352  throw t;
353  }
354  }
355 
356  void
358  if (cacheSize_ == 0) {
359  return;
360  }
361  assert(treeCache_);
362  assert(branchType_ == InEvent);
363  assert(!rawTreeCache_);
364  treeCache_->SetLearnEntries(learningEntries_);
365  tree_->SetCacheSize(static_cast<Long64_t>(cacheSize_));
366  rawTreeCache_.reset(dynamic_cast<TTreeCache *>(filePtr_->GetCacheRead()));
367  rawTreeCache_->SetEnablePrefetching(false);
368  filePtr_->SetCacheRead(0);
369  rawTreeCache_->SetLearnEntries(0);
371  rawTreeCache_->StartLearningPhase();
373  rawTreeCache_->AddBranch("*", kTRUE);
374  rawTreeCache_->StopLearningPhase();
375  treeCache_->StartLearningPhase();
376  treeCache_->SetEntryRange(switchOverEntry_, tree_->GetEntries());
377  treeCache_->AddBranch(poolNames::branchListIndexesBranchName().c_str(), kTRUE);
378  treeCache_->AddBranch(BranchTypeToAuxiliaryBranchName(branchType_).c_str(), kTRUE);
379  trainedSet_.clear();
380  triggerSet_.clear();
381  assert(treeCache_->GetTree() == tree_);
382  }
383 
384  void
386  filePtr_->SetCacheRead(treeCache_.get());
387  treeCache_->StopLearningPhase();
388  filePtr_->SetCacheRead(0);
389  rawTreeCache_.reset();
390  }
391 
392  void
394  // The TFile is about to be closed, and destructed.
395  // Just to play it safe, zero all pointers to quantities that are owned by the TFile.
397  tree_ = metaTree_ = infoTree_ = 0;
398  // We own the treeCache_.
399  // We make sure the treeCache_ is detached from the file,
400  // so that ROOT does not also delete it.
401  filePtr_->SetCacheRead(0);
402  // We *must* delete the TTreeCache here because the TFilePrefetch object
403  // references the TFile. If TFile is closed, before the TTreeCache is
404  // deleted, the TFilePrefetch may continue to do TFile operations, causing
405  // deadlocks or exceptions.
406  treeCache_.reset();
407  rawTreeCache_.reset();
408  triggerTreeCache_.reset();
409  rawTriggerTreeCache_.reset();
410  // We give up our shared ownership of the TFile itself.
411  filePtr_.reset();
412  }
413 
414  void
415  RootTree::trainCache(char const* branchNames) {
416  if (cacheSize_ == 0) {
417  return;
418  }
419  tree_->LoadTree(0);
420  assert(treeCache_);
421  filePtr_->SetCacheRead(treeCache_.get());
422  treeCache_->StartLearningPhase();
423  treeCache_->SetEntryRange(0, tree_->GetEntries());
424  treeCache_->AddBranch(branchNames, kTRUE);
425  treeCache_->StopLearningPhase();
426  assert(treeCache_->GetTree() == tree_);
427  // We own the treeCache_.
428  // We make sure the treeCache_ is detached from the file,
429  // so that ROOT does not also delete it.
430  filePtr_->SetCacheRead(0);
431 
432  // Must also manually add things to the trained set.
433  TObjArray *branches = tree_->GetListOfBranches();
434  int branchCount = branches->GetEntriesFast();
435  for (int i=0;i<branchCount;i++) {
436  TBranch *branch = (TBranch*)branches->UncheckedAt(i);
437  if ((branchNames[0] == '*') || (strcmp(branchNames, branch->GetName()) == 0)) {
438  trainedSet_.insert(branch);
439  }
440  }
441 
442  }
443 
444  namespace roottree {
445  Int_t
446  getEntry(TBranch* branch, EntryNumber entryNumber) {
447  Int_t n = 0;
448  try {
449  n = branch->GetEntry(entryNumber);
450  }
451  catch(cms::Exception const& e) {
452  throw Exception(errors::FileReadError, "", e);
453  }
454  return n;
455  }
456 
457  Int_t
458  getEntry(TTree* tree, EntryNumber entryNumber) {
459  Int_t n = 0;
460  try {
461  n = tree->GetEntry(entryNumber);
462  }
463  catch(cms::Exception const& e) {
464  throw Exception (errors::FileReadError, "", e);
465  }
466  return n;
467  }
468 
469  std::unique_ptr<TTreeCache>
470  trainCache(TTree* tree, InputFile& file, unsigned int cacheSize, char const* branchNames) {
471  tree->LoadTree(0);
472  tree->SetCacheSize(cacheSize);
473  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
474  if (0 != treeCache.get()) {
475  treeCache->StartLearningPhase();
476  treeCache->SetEntryRange(0, tree->GetEntries());
477  treeCache->AddBranch(branchNames, kTRUE);
478  treeCache->StopLearningPhase();
479  }
480  // We own the treeCache_.
481  // We make sure the treeCache_ is detached from the file,
482  // so that ROOT does not also delete it.
483  file.SetCacheRead(0);
484  return treeCache;
485  }
486  }
487 }
EntryNumber entryNumber_
Definition: RootTree.h:152
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:446
boost::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:145
int i
Definition: DBlmapReader.cc:9
std::string const & BranchTypeToMetaDataTreeName(BranchType const &branchType)
Definition: BranchType.cc:106
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:114
unsigned int learningEntries_
Definition: RootTree.h:159
TTreeCache * checkTriggerCache(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:207
void addBranch(BranchKey const &key, BranchDescription const &prod, std::string const &oldBranchName)
Definition: RootTree.cc:114
void dropBranch(std::string const &oldBranchName)
Definition: RootTree.cc:134
std::vector< std::string > branchNames_
Definition: RootTree.h:153
void setPresence(BranchDescription const &prod, std::string const &oldBranchName)
Definition: RootTree.cc:105
std::string & branchName() const
TTree * tree_
Definition: RootTree.h:138
bool trainNow_
Definition: RootTree.h:155
EntryNumber rawTriggerSwitchOverEntry_
Definition: RootTree.h:157
TFileCacheRead * GetCacheRead() const
Definition: InputFile.h:45
roottree::BranchMap BranchMap
Definition: RootTree.h:59
EntryNumber const & entries() const
Definition: RootTree.h:87
TTree * metaTree_
Definition: RootTree.h:139
RootTree(boost::shared_ptr< InputFile > filePtr, BranchType const &branchType, unsigned int maxVirtualSize, unsigned int cacheSize, unsigned int learningEntries, bool enablePrefetching)
Definition: RootTree.cc:27
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:149
#define NULL
Definition: scimark2.h:8
void stopTraining()
Definition: RootTree.cc:385
TBranch * branchEntryInfoBranch_
Definition: RootTree.h:168
EntryNumber entries_
Definition: RootTree.h:151
boost::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:146
bool enablePrefetching_
Definition: RootTree.h:164
void trainCache(char const *branchNames)
Definition: RootTree.cc:415
void setTreeMaxVirtualSize(int treeMaxVirtualSize)
Definition: RootTree.cc:170
std::map< BranchKey const, BranchInfo > BranchMap
Definition: RootTree.h:51
BranchType
Definition: BranchType.h:11
boost::shared_ptr< TTreeCache > triggerTreeCache_
Definition: RootTree.h:147
boost::shared_ptr< TTreeCache > rawTriggerTreeCache_
Definition: RootTree.h:148
tuple leaf
Definition: Node.py:62
TTreeCache * selectCache(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:321
unsigned long treeAutoFlush_
Definition: RootTree.h:161
std::string const & BranchTypeToBranchEntryInfoBranchName(BranchType const &branchType)
Definition: BranchType.cc:126
std::string const & BranchTypeToProductTreeName(BranchType const &branchType)
Definition: BranchType.cc:102
TTreeCache * checkTriggerCacheImpl(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:218
TBranch * auxBranch_
Definition: RootTree.h:141
std::string const & BranchTypeToInfoTreeName(BranchType const &branchType)
Definition: BranchType.cc:110
TBranch * provenanceBranch_
Definition: RootTree.h:48
bool enableTriggerCache_
Definition: RootTree.h:165
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:99
void close()
Definition: RootTree.cc:393
void getEntry(TBranch *branch, EntryNumber entry) const
Definition: RootTree.cc:340
void startTraining()
Definition: RootTree.cc:357
boost::shared_ptr< BranchMap > branches_
Definition: RootTree.h:154
void addContext(std::string const &context)
Definition: Exception.cc:227
bool isValid() const
Definition: RootTree.cc:87
TBranch * productBranch_
Definition: RootTree.h:47
void setCacheSize(unsigned int cacheSize)
Definition: RootTree.cc:160
bool performedSwitchOver_
Definition: RootTree.h:158
list key
Definition: combine.py:13
unsigned int cacheSize_
Definition: RootTree.h:160
Long64_t EntryNumber
Definition: RootTree.h:39
std::unordered_set< TBranch * > triggerSet_
Definition: RootTree.h:150
std::string const & BranchTypeToAuxBranchName(BranchType const &branchType)
Definition: BranchType.cc:118
BranchMap const & branches() const
Definition: RootTree.cc:157
std::unique_ptr< DelayedReader > rootDelayedReader_
Definition: RootTree.h:166
boost::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:134
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
Definition: RootTree.cc:470
void SetCacheRead(TFileCacheRead *tfcr)
Definition: InputFile.h:46
EntryNumber switchOverEntry_
Definition: RootTree.h:156
T get(const Candidate &c)
Definition: component.h:56
BranchType branchType_
Definition: RootTree.h:140
TTree * infoTree_
Definition: RootTree.h:170
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
roottree::EntryNumber EntryNumber
Definition: RootTree.h:60