CMS 3D CMS Logo

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 #include "TLeaf.h"
11 
12 #include <cassert>
13 #include <iostream>
14 
15 namespace edm {
16  namespace {
17  TBranch* getAuxiliaryBranch(TTree* tree, BranchType const& branchType) {
18  TBranch* branch = tree->GetBranch(BranchTypeToAuxiliaryBranchName(branchType).c_str());
19  if (branch == nullptr) {
20  branch = tree->GetBranch(BranchTypeToAuxBranchName(branchType).c_str());
21  }
22  return branch;
23  }
24  TBranch* getProductProvenanceBranch(TTree* tree, BranchType const& branchType) {
25  TBranch* branch = tree->GetBranch(BranchTypeToBranchEntryInfoBranchName(branchType).c_str());
26  return branch;
27  }
28  } // namespace
29  RootTree::RootTree(std::shared_ptr<InputFile> filePtr,
30  BranchType const& branchType,
31  unsigned int nIndexes,
32  unsigned int maxVirtualSize,
33  unsigned int cacheSize,
34  unsigned int learningEntries,
35  bool enablePrefetching,
36  InputType inputType)
37  : filePtr_(filePtr),
38  tree_(dynamic_cast<TTree*>(
39  filePtr_.get() != nullptr ? filePtr_->Get(BranchTypeToProductTreeName(branchType).c_str()) : nullptr)),
40  metaTree_(dynamic_cast<TTree*>(
41  filePtr_.get() != nullptr ? filePtr_->Get(BranchTypeToMetaDataTreeName(branchType).c_str()) : nullptr)),
42  branchType_(branchType),
43  auxBranch_(tree_ ? getAuxiliaryBranch(tree_, branchType_) : nullptr),
44  treeCache_(),
45  rawTreeCache_(),
46  triggerTreeCache_(),
47  rawTriggerTreeCache_(),
48  trainedSet_(),
49  triggerSet_(),
50  entries_(tree_ ? tree_->GetEntries() : 0),
51  entryNumber_(-1),
52  entryNumberForIndex_(new std::vector<EntryNumber>(nIndexes, IndexIntoFile::invalidEntry)),
53  branchNames_(),
54  branches_{},
55  trainNow_(false),
56  switchOverEntry_(-1),
57  rawTriggerSwitchOverEntry_(-1),
58  performedSwitchOver_{false},
59  learningEntries_(learningEntries),
60  cacheSize_(cacheSize),
61  treeAutoFlush_(0),
62  enablePrefetching_(enablePrefetching),
63  enableTriggerCache_(branchType_ == InEvent),
64  rootDelayedReader_(new RootDelayedReader(*this, filePtr, inputType)),
65  branchEntryInfoBranch_(metaTree_ ? getProductProvenanceBranch(metaTree_, branchType_)
66  : (tree_ ? getProductProvenanceBranch(tree_, branchType_) : nullptr)),
67  infoTree_(dynamic_cast<TTree*>(filePtr_.get() != nullptr
68  ? filePtr->Get(BranchTypeToInfoTreeName(branchType).c_str())
69  : nullptr)) // backward compatibility
70  {
71  if (not tree_) {
72  throw cms::Exception("WrongFileFormat")
73  << "The ROOT file does not contain a TTree named " << BranchTypeToProductTreeName(branchType)
74  << "\n This is either not an edm ROOT file or is one that has been corrupted.";
75  }
76  // On merged files in older releases of ROOT, the autoFlush setting is always negative; we must guess.
77  // TODO: On newer merged files, we should be able to get this from the cluster iterator.
78  long treeAutoFlush = (tree_ ? tree_->GetAutoFlush() : 0);
79  if (treeAutoFlush < 0) {
80  // The "+1" is here to avoid divide-by-zero in degenerate cases.
81  Long64_t averageEventSizeBytes = tree_->GetZipBytes() / (tree_->GetEntries() + 1) + 1;
82  treeAutoFlush_ = cacheSize_ / averageEventSizeBytes + 1;
83  } else {
84  treeAutoFlush_ = treeAutoFlush;
85  }
86  if (treeAutoFlush_ < learningEntries_) {
87  learningEntries_ = treeAutoFlush_;
88  }
89  setTreeMaxVirtualSize(maxVirtualSize);
90  setCacheSize(cacheSize);
91  if (tree_) {
92  Int_t branchCount = tree_->GetListOfBranches()->GetEntriesFast();
93  trainedSet_.reserve(branchCount);
94  triggerSet_.reserve(branchCount);
95  }
96  }
97 
99 
101  assert(index < entryNumberForIndex_->size());
102  return (*entryNumberForIndex_)[index];
103  }
104 
106  assert(index < entryNumberForIndex_->size());
107  (*entryNumberForIndex_)[index] = entryNumber();
108  }
109 
110  bool RootTree::isValid() const {
111  if (metaTree_ == nullptr || metaTree_->GetNbranches() == 0) {
112  return tree_ != nullptr && auxBranch_ != nullptr;
113  }
114  if (tree_ != nullptr && auxBranch_ != nullptr && metaTree_ != nullptr) { // backward compatibility
115  if (branchEntryInfoBranch_ != nullptr || infoTree_ != nullptr)
116  return true; // backward compatibility
117  return (entries_ == metaTree_->GetEntries() &&
118  tree_->GetNbranches() <= metaTree_->GetNbranches() + 1); // backward compatibility
119  } // backward compatibility
120  return false;
121  }
122 
124  rootDelayedReader_->reset();
125  return rootDelayedReader_.get();
126  }
127 
129 
131  assert(isValid());
132  if (tree_->GetBranch(oldBranchName.c_str()) == nullptr) {
133  prod.setDropped(true);
134  }
135  }
136 
137  void RootTree::addBranch(BranchDescription const& prod, std::string const& oldBranchName) {
138  assert(isValid());
139  //use the translated branch name
140  TBranch* branch = tree_->GetBranch(oldBranchName.c_str());
142  info.productBranch_ = nullptr;
143  if (prod.present()) {
144  info.productBranch_ = branch;
145  //we want the new branch name for the JobReport
146  branchNames_.push_back(prod.branchName());
147  }
148  TTree* provTree = (metaTree_ != nullptr ? metaTree_ : tree_);
149  info.provenanceBranch_ = provTree->GetBranch(oldBranchName.c_str());
150  branches_.insert(prod.branchID(), info);
151  }
152 
153  void RootTree::dropBranch(std::string const& oldBranchName) {
154  //use the translated branch name
155  TBranch* branch = tree_->GetBranch(oldBranchName.c_str());
156  if (branch != nullptr) {
157  TObjArray* leaves = tree_->GetListOfLeaves();
158  int entries = leaves->GetEntries();
159  for (int i = 0; i < entries; ++i) {
160  TLeaf* leaf = (TLeaf*)(*leaves)[i];
161  if (leaf == nullptr)
162  continue;
163  TBranch* br = leaf->GetBranch();
164  if (br == nullptr)
165  continue;
166  if (br->GetMother() == branch) {
167  leaves->Remove(leaf);
168  }
169  }
170  leaves->Compress();
171  tree_->GetListOfBranches()->Remove(branch);
172  tree_->GetListOfBranches()->Compress();
173  delete branch;
174  }
175  }
176 
178 
179  void RootTree::setCacheSize(unsigned int cacheSize) {
180  cacheSize_ = cacheSize;
181  tree_->SetCacheSize(static_cast<Long64_t>(cacheSize));
182  treeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
183  if (treeCache_)
184  treeCache_->SetEnablePrefetching(enablePrefetching_);
185  filePtr_->SetCacheRead(nullptr);
186  rawTreeCache_.reset();
187  }
188 
189  void RootTree::setTreeMaxVirtualSize(int treeMaxVirtualSize) {
190  if (treeMaxVirtualSize >= 0)
191  tree_->SetMaxVirtualSize(static_cast<Long64_t>(treeMaxVirtualSize));
192  }
193 
195  bool returnValue = ++entryNumber_ < entries_;
196  if (returnValue) {
198  }
199  return returnValue;
200  }
201 
202  void RootTree::setEntryNumber(EntryNumber theEntryNumber) {
203  filePtr_->SetCacheRead(treeCache_.get());
204 
205  // Detect a backward skip. If the skip is sufficiently large, we roll the dice and reset the treeCache.
206  // This will cause some amount of over-reading: we pre-fetch all the events in some prior cluster.
207  // However, because reading one event in the cluster is supposed to be equivalent to reading all events in the cluster,
208  // we're not incurring additional over-reading - we're just doing it more efficiently.
209  // NOTE: Constructor guarantees treeAutoFlush_ is positive, even if TTree->GetAutoFlush() is negative.
210  if (theEntryNumber < entryNumber_ and theEntryNumber >= 0) {
211  //We started reading the file near the end, now we need to correct for the learning length
212  if (switchOverEntry_ > tree_->GetEntries()) {
213  switchOverEntry_ = switchOverEntry_ - tree_->GetEntries();
214  if (rawTreeCache_) {
215  rawTreeCache_->SetEntryRange(theEntryNumber, switchOverEntry_);
216  rawTreeCache_->FillBuffer();
217  }
218  }
220  //We are using the triggerTreeCache_ not the rawTriggerTreeCache_.
221  //The triggerTreeCache was originally told to start from an entry further in the file.
222  triggerTreeCache_->SetEntryRange(theEntryNumber, tree_->GetEntries());
223  } else if (rawTriggerTreeCache_) {
224  //move the switch point to the end of the cluster holding theEntryNumber
226  TTree::TClusterIterator clusterIter = tree_->GetClusterIterator(theEntryNumber);
227  while ((rawTriggerSwitchOverEntry_ < theEntryNumber) || (rawTriggerSwitchOverEntry_ <= 0)) {
228  rawTriggerSwitchOverEntry_ = clusterIter();
229  }
230  rawTriggerTreeCache_->SetEntryRange(theEntryNumber, rawTriggerSwitchOverEntry_);
231  }
232  }
233  if ((theEntryNumber < static_cast<EntryNumber>(entryNumber_ - treeAutoFlush_)) && (treeCache_) &&
234  (!treeCache_->IsLearning()) && (entries_ > 0) && (switchOverEntry_ >= 0)) {
235  treeCache_->SetEntryRange(theEntryNumber, entries_);
236  treeCache_->FillBuffer();
237  }
238 
239  entryNumber_ = theEntryNumber;
240  tree_->LoadTree(entryNumber_);
241  filePtr_->SetCacheRead(nullptr);
242  if (treeCache_ && trainNow_ && entryNumber_ >= 0) {
243  startTraining();
244  trainNow_ = false;
245  trainedSet_.clear();
246  triggerSet_.clear();
248  }
249  if (treeCache_ && treeCache_->IsLearning() && switchOverEntry_ >= 0 && entryNumber_ >= switchOverEntry_) {
250  stopTraining();
251  }
252  }
253 
254  // The actual implementation is done below; it's split in this strange
255  // manner in order to keep a by-definition-rare code path out of the instruction cache.
256  inline TTreeCache* RootTree::checkTriggerCache(TBranch* branch, EntryNumber entryNumber) const {
257  if (!treeCache_->IsAsyncReading() && enableTriggerCache_ && (trainedSet_.find(branch) == trainedSet_.end())) {
259  } else {
260  return nullptr;
261  }
262  }
263 
264  // See comments in the header. If this function is called, we already know
265  // the trigger cache is active and it was a cache miss for the regular cache.
266  TTreeCache* RootTree::checkTriggerCacheImpl(TBranch* branch, EntryNumber entryNumber) const {
267  // This branch is not going to be in the cache.
268  // Assume this is a "trigger pattern".
269  // Always make sure the branch is added to the trigger set.
270  if (triggerSet_.find(branch) == triggerSet_.end()) {
271  triggerSet_.insert(branch);
272  if (triggerTreeCache_.get()) {
273  triggerTreeCache_->AddBranch(branch, kTRUE);
274  }
275  }
276 
277  if (rawTriggerSwitchOverEntry_ < 0) {
278  // The trigger has never fired before. Take everything not in the
279  // trainedSet and load it from disk
280 
281  // Calculate the end of the next cluster; triggers in the next cluster
282  // will use the triggerCache, not the rawTriggerCache.
283  //
284  // Guarantee that rawTriggerSwitchOverEntry_ is positive (non-zero) after completion
285  // of this if-block.
286  TTree::TClusterIterator clusterIter = tree_->GetClusterIterator(entryNumber);
288  rawTriggerSwitchOverEntry_ = clusterIter();
289  }
290 
291  // ROOT will automatically expand the cache to fit one cluster; hence, we use
292  // 5 MB as the cache size below
293  tree_->SetCacheSize(static_cast<Long64_t>(5 * 1024 * 1024));
294  rawTriggerTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
296  rawTriggerTreeCache_->SetEnablePrefetching(false);
297  TObjArray* branches = tree_->GetListOfBranches();
298  int branchCount = branches->GetEntriesFast();
299 
300  // Train the rawTriggerCache to have everything not in the regular cache.
301  rawTriggerTreeCache_->SetLearnEntries(0);
303  for (int i = 0; i < branchCount; i++) {
304  TBranch* tmp_branch = (TBranch*)branches->UncheckedAt(i);
305  if (trainedSet_.find(tmp_branch) != trainedSet_.end()) {
306  continue;
307  }
308  rawTriggerTreeCache_->AddBranch(tmp_branch, kTRUE);
309  }
310  performedSwitchOver_ = false;
311  rawTriggerTreeCache_->StopLearningPhase();
312  filePtr_->SetCacheRead(nullptr);
313 
314  return rawTriggerTreeCache_.get();
316  // The raw trigger has fired and it contents are valid.
317  return rawTriggerTreeCache_.get();
318  } else if (rawTriggerSwitchOverEntry_ > 0) {
319  // The raw trigger has fired, but we are out of the cache. Use the
320  // triggerCache instead.
321  if (!performedSwitchOver_) {
322  rawTriggerTreeCache_.reset();
323  performedSwitchOver_ = true;
324 
325  // Train the triggerCache
326  tree_->SetCacheSize(static_cast<Long64_t>(5 * 1024 * 1024));
327  triggerTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
328  triggerTreeCache_->SetEnablePrefetching(false);
329  triggerTreeCache_->SetLearnEntries(0);
330  triggerTreeCache_->SetEntryRange(entryNumber, tree_->GetEntries());
331  for (std::unordered_set<TBranch*>::const_iterator it = triggerSet_.begin(), itEnd = triggerSet_.end();
332  it != itEnd;
333  it++) {
334  triggerTreeCache_->AddBranch(*it, kTRUE);
335  }
336  triggerTreeCache_->StopLearningPhase();
337  filePtr_->SetCacheRead(nullptr);
338  }
339  return triggerTreeCache_.get();
340  }
341 
342  // By construction, this case should be impossible.
343  assert(false);
344  return nullptr;
345  }
346 
347  inline TTreeCache* RootTree::selectCache(TBranch* branch, EntryNumber entryNumber) const {
348  TTreeCache* triggerCache = nullptr;
349  if (!treeCache_) {
350  return nullptr;
351  } else if (treeCache_->IsLearning() && rawTreeCache_) {
352  treeCache_->AddBranch(branch, kTRUE);
353  trainedSet_.insert(branch);
354  return rawTreeCache_.get();
355  } else if ((triggerCache = checkTriggerCache(branch, entryNumber))) {
356  // A NULL return value from checkTriggerCache indicates the trigger cache case
357  // does not apply, and we should continue below.
358  return triggerCache;
359  } else {
360  // The "normal" TTreeCache case.
361  return treeCache_.get();
362  }
363  }
364 
365  void RootTree::getEntry(TBranch* branch, EntryNumber entryNumber) const {
366  try {
367  TTreeCache* cache = selectCache(branch, entryNumber);
368  filePtr_->SetCacheRead(cache);
369  branch->GetEntry(entryNumber);
370  filePtr_->SetCacheRead(nullptr);
371  } catch (cms::Exception const& e) {
372  // We make sure the treeCache_ is detached from the file,
373  // so that ROOT does not also delete it.
374  filePtr_->SetCacheRead(nullptr);
376  t.addContext(std::string("Reading branch ") + branch->GetName());
377  throw t;
378  }
379  }
380 
381  bool RootTree::skipEntries(unsigned int& offset) {
382  entryNumber_ += offset;
383  bool retval = (entryNumber_ < entries_);
384  if (retval) {
385  offset = 0;
386  } else {
387  // Not enough entries in the file to skip.
388  // The +1 is needed because entryNumber_ is -1 at the initialization of the tree, not 0.
389  long long overshoot = entryNumber_ + 1 - entries_;
391  offset = overshoot;
392  }
393  return retval;
394  }
395 
397  if (cacheSize_ == 0) {
398  return;
399  }
403  treeCache_->SetLearnEntries(learningEntries_);
404  tree_->SetCacheSize(static_cast<Long64_t>(cacheSize_));
405  rawTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
406  rawTreeCache_->SetEnablePrefetching(false);
407  filePtr_->SetCacheRead(nullptr);
408  rawTreeCache_->SetLearnEntries(0);
410  auto rawStart = entryNumber_;
411  auto rawEnd = switchOverEntry_;
412  auto treeStart = switchOverEntry_;
413  if (switchOverEntry_ >= tree_->GetEntries()) {
414  treeStart = switchOverEntry_ - tree_->GetEntries();
415  rawEnd = tree_->GetEntries();
416  }
417  rawTreeCache_->StartLearningPhase();
418  rawTreeCache_->SetEntryRange(rawStart, rawEnd);
419  rawTreeCache_->AddBranch("*", kTRUE);
420  rawTreeCache_->StopLearningPhase();
421  treeCache_->StartLearningPhase();
422  treeCache_->SetEntryRange(treeStart, tree_->GetEntries());
423  // Make sure that 'branchListIndexes' branch exist in input file
424  if (filePtr_->Get(poolNames::branchListIndexesBranchName().c_str()) != nullptr) {
425  treeCache_->AddBranch(poolNames::branchListIndexesBranchName().c_str(), kTRUE);
426  }
427  treeCache_->AddBranch(BranchTypeToAuxiliaryBranchName(branchType_).c_str(), kTRUE);
428  trainedSet_.clear();
429  triggerSet_.clear();
430  assert(treeCache_->GetTree() == tree_);
431  }
432 
434  filePtr_->SetCacheRead(treeCache_.get());
435  treeCache_->StopLearningPhase();
436  filePtr_->SetCacheRead(nullptr);
437  rawTreeCache_.reset();
438  }
439 
441  // The TFile is about to be closed, and destructed.
442  // Just to play it safe, zero all pointers to quantities that are owned by the TFile.
444  tree_ = metaTree_ = infoTree_ = nullptr;
445  // We own the treeCache_.
446  // We make sure the treeCache_ is detached from the file,
447  // so that ROOT does not also delete it.
448  filePtr_->SetCacheRead(nullptr);
449  // We *must* delete the TTreeCache here because the TFilePrefetch object
450  // references the TFile. If TFile is closed, before the TTreeCache is
451  // deleted, the TFilePrefetch may continue to do TFile operations, causing
452  // deadlocks or exceptions.
453  treeCache_.reset();
454  rawTreeCache_.reset();
455  triggerTreeCache_.reset();
456  rawTriggerTreeCache_.reset();
457  // We give up our shared ownership of the TFile itself.
458  filePtr_.reset();
459  }
460 
461  void RootTree::trainCache(char const* branchNames) {
462  if (cacheSize_ == 0) {
463  return;
464  }
465  tree_->LoadTree(0);
467  filePtr_->SetCacheRead(treeCache_.get());
468  treeCache_->StartLearningPhase();
469  treeCache_->SetEntryRange(0, tree_->GetEntries());
470  treeCache_->AddBranch(branchNames, kTRUE);
471  treeCache_->StopLearningPhase();
472  assert(treeCache_->GetTree() == tree_);
473  // We own the treeCache_.
474  // We make sure the treeCache_ is detached from the file,
475  // so that ROOT does not also delete it.
476  filePtr_->SetCacheRead(nullptr);
477 
478  // Must also manually add things to the trained set.
479  TObjArray* branches = tree_->GetListOfBranches();
480  int branchCount = branches->GetEntriesFast();
481  for (int i = 0; i < branchCount; i++) {
482  TBranch* branch = (TBranch*)branches->UncheckedAt(i);
483  if ((branchNames[0] == '*') || (strcmp(branchNames, branch->GetName()) == 0)) {
484  trainedSet_.insert(branch);
485  }
486  }
487  }
488 
490  signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> const* preEventReadSource,
491  signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> const* postEventReadSource) {
492  rootDelayedReader_->setSignals(preEventReadSource, postEventReadSource);
493  }
494 
495  namespace roottree {
496  Int_t getEntry(TBranch* branch, EntryNumber entryNumber) {
497  Int_t n = 0;
498  try {
499  n = branch->GetEntry(entryNumber);
500  } catch (cms::Exception const& e) {
501  throw Exception(errors::FileReadError, "", e);
502  }
503  return n;
504  }
505 
506  Int_t getEntry(TTree* tree, EntryNumber entryNumber) {
507  Int_t n = 0;
508  try {
509  n = tree->GetEntry(entryNumber);
510  } catch (cms::Exception const& e) {
511  throw Exception(errors::FileReadError, "", e);
512  }
513  return n;
514  }
515 
516  std::unique_ptr<TTreeCache> trainCache(TTree* tree,
517  InputFile& file,
518  unsigned int cacheSize,
519  char const* branchNames) {
520  tree->LoadTree(0);
521  tree->SetCacheSize(cacheSize);
522  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
523  if (nullptr != treeCache.get()) {
524  treeCache->StartLearningPhase();
525  treeCache->SetEntryRange(0, tree->GetEntries());
526  treeCache->AddBranch(branchNames, kTRUE);
527  treeCache->StopLearningPhase();
528  }
529  // We own the treeCache_.
530  // We make sure the treeCache_ is detached from the file,
531  // so that ROOT does not also delete it.
532  file.SetCacheRead(nullptr);
533  return treeCache;
534  }
535  } // namespace roottree
536 } // namespace edm
edm::RootTree::triggerTreeCache_
std::shared_ptr< TTreeCache > triggerTreeCache_
Definition: RootTree.h:222
edm::RootTree::treeAutoFlush_
unsigned long treeAutoFlush_
Definition: RootTree.h:237
edm::RootTree::addBranch
void addBranch(BranchDescription const &prod, std::string const &oldBranchName)
Definition: RootTree.cc:137
edm::RootTree::trainCache
void trainCache(char const *branchNames)
Definition: RootTree.cc:461
mps_fire.i
i
Definition: mps_fire.py:428
edm::RootTree::setEntryNumber
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:202
edm::RootTree::rootDelayedReader
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:128
edm::RootTree::cacheSize_
unsigned int cacheSize_
Definition: RootTree.h:236
edm::RootTree::EntryNumber
roottree::EntryNumber EntryNumber
Definition: RootTree.h:106
edm::RootTree::startTraining
void startTraining()
Definition: RootTree.cc:396
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::roottree::trainCache
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
Definition: RootTree.cc:516
edm::RootTree::tree_
TTree * tree_
Definition: RootTree.h:212
edm::RootTree::branches
BranchMap const & branches() const
Definition: RootTree.cc:177
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:180
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::RootTree::auxBranch_
TBranch * auxBranch_
Definition: RootTree.h:215
tree
Definition: tree.py:1
RootDelayedReader.h
edm::RootTree::trainedSet_
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:224
edm::RootTree::rawTriggerTreeCache_
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
Definition: RootTree.h:223
edm::RootTree::rawTreeCache_
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:220
edm::RootTree::~RootTree
~RootTree()
Definition: RootTree.cc:98
edm::RootTree::checkTriggerCacheImpl
TTreeCache * checkTriggerCacheImpl(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:266
edm::IndexIntoFile
Definition: IndexIntoFile.h:225
RootTree.h
cms::cuda::assert
assert(be >=bs)
edm::RootTree::entries_
EntryNumber entries_
Definition: RootTree.h:226
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
edm::BranchTypeToProductTreeName
std::string const & BranchTypeToProductTreeName(BranchType const &branchType)
Definition: BranchType.cc:93
edm::RootTree::setCacheSize
void setCacheSize(unsigned int cacheSize)
Definition: RootTree.cc:179
edm::InputFile
Definition: InputFile.h:21
edm::poolNames::branchListIndexesBranchName
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:202
edm::RootTree::branches_
BranchMap branches_
Definition: RootTree.h:230
edm::InputType
InputType
Definition: InputType.h:5
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::BranchTypeToAuxiliaryBranchName
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:109
edm::Exception
Definition: EDMException.h:77
edm::BranchTypeToBranchEntryInfoBranchName
std::string const & BranchTypeToBranchEntryInfoBranchName(BranchType const &branchType)
Definition: BranchType.cc:127
EDMException.h
edm::RootTree::RootTree
RootTree(std::shared_ptr< InputFile > filePtr, BranchType const &branchType, unsigned int nIndexes, unsigned int maxVirtualSize, unsigned int cacheSize, unsigned int learningEntries, bool enablePrefetching, InputType inputType)
Definition: RootTree.cc:29
edm::RootTree::branchEntryInfoBranch_
TBranch * branchEntryInfoBranch_
Definition: RootTree.h:244
edm::RootTree::entryNumberForIndex_
std::unique_ptr< std::vector< EntryNumber > > entryNumberForIndex_
Definition: RootTree.h:228
edm::roottree::EntryNumber
IndexIntoFile::EntryNumber_t EntryNumber
Definition: RootTree.h:51
edm::BranchTypeToInfoTreeName
std::string const & BranchTypeToInfoTreeName(BranchType const &branchType)
Definition: BranchType.cc:104
edm::RootTree::skipEntries
bool skipEntries(unsigned int &offset)
Definition: RootTree.cc:381
edm::RootTree::enablePrefetching_
bool enablePrefetching_
Definition: RootTree.h:240
edm::StreamContext
Definition: StreamContext.h:31
edm::RootTree::switchOverEntry_
EntryNumber switchOverEntry_
Definition: RootTree.h:232
edm::RootTree::selectCache
TTreeCache * selectCache(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:347
edm::RootTree::filePtr_
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:208
edm::RootTree::entryNumberForIndex
EntryNumber const & entryNumberForIndex(unsigned int index) const
Definition: RootTree.cc:100
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::RootTree::branchNames_
std::vector< std::string > branchNames_
Definition: RootTree.h:229
edm::InEvent
Definition: BranchType.h:11
edm::RootTree::triggerSet_
std::unordered_set< TBranch * > triggerSet_
Definition: RootTree.h:225
edm::RootTree::infoTree_
TTree * infoTree_
Definition: RootTree.h:246
edm::RootTree::resetAndGetRootDelayedReader
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:123
utilities.cache
def cache(function)
Definition: utilities.py:3
edm::BranchTypeToAuxBranchName
std::string const & BranchTypeToAuxBranchName(BranchType const &branchType)
Definition: BranchType.cc:115
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::RootTree::getEntry
void getEntry(TBranch *branch, EntryNumber entry) const
Definition: RootTree.cc:365
BranchDescription.h
edm::RootTree::branchType_
BranchType branchType_
Definition: RootTree.h:214
edm::RootTree::enableTriggerCache_
bool enableTriggerCache_
Definition: RootTree.h:241
edm::RootTree::entryNumber_
EntryNumber entryNumber_
Definition: RootTree.h:227
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:671
edm::RootTree::dropBranch
void dropBranch(std::string const &oldBranchName)
Definition: RootTree.cc:153
edm::BranchTypeToMetaDataTreeName
std::string const & BranchTypeToMetaDataTreeName(BranchType const &branchType)
Definition: BranchType.cc:98
beamvalidation.br
br
Definition: beamvalidation.py:398
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::roottree::BranchInfo
Definition: RootTree.h:52
edm::RootTree::checkTriggerCache
TTreeCache * checkTriggerCache(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:256
InputFile.h
edm::RootTree::trainNow_
bool trainNow_
Definition: RootTree.h:231
edm::RootTree::branchNames
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:140
edm::RootTree::insertEntryForIndex
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:105
edm::roottree::BranchMap
Definition: RootTree.h:67
edm::RootTree::isValid
bool isValid() const
Definition: RootTree.cc:110
edm::RootTree::learningEntries_
unsigned int learningEntries_
Definition: RootTree.h:235
edm::RootTree::stopTraining
void stopTraining()
Definition: RootTree.cc:433
std
Definition: JetResolutionObject.h:76
edm::RootTree::setTreeMaxVirtualSize
void setTreeMaxVirtualSize(int treeMaxVirtualSize)
Definition: RootTree.cc:189
edm::RootTree::entryNumber
EntryNumber const & entryNumber() const
Definition: RootTree.h:135
edm::RootTree::entries
EntryNumber const & entries() const
Definition: RootTree.h:137
Exception
Definition: hltDiff.cc:246
edm::RootTree::close
void close()
Definition: RootTree.cc:440
edm::RootTree::rawTriggerSwitchOverEntry_
EntryNumber rawTriggerSwitchOverEntry_
Definition: RootTree.h:233
edm::roottree::BranchMap::insert
void insert(edm::BranchID const &iKey, BranchInfo const &iInfo)
Definition: RootTree.h:75
edm::DelayedReader
Definition: DelayedReader.h:29
Exception.h
edm::RootTree::performedSwitchOver_
bool performedSwitchOver_
Definition: RootTree.h:234
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::BranchDescription
Definition: BranchDescription.h:32
cms::Exception
Definition: Exception.h:70
edm::roottree::getEntry
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:496
edm::RootTree::treeCache_
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:219
edm::RootTree::setSignals
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
Definition: RootTree.cc:489
edm::RootTree::metaTree_
TTree * metaTree_
Definition: RootTree.h:213
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::errors::FileReadError
Definition: EDMException.h:50
edm::signalslot::Signal
Definition: DelayedReader.h:26
edm::RootTree::nextWithCache
bool nextWithCache()
Definition: RootTree.cc:194
edm::RootTree::rootDelayedReader_
std::unique_ptr< RootDelayedReader > rootDelayedReader_
Definition: RootTree.h:242
edm::RootTree::setPresence
void setPresence(BranchDescription &prod, std::string const &oldBranchName)
Definition: RootTree.cc:130
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29