CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::RootTree Class Reference

#include <RootTree.h>

Public Types

typedef roottree::BranchMap BranchMap
 
typedef roottree::EntryNumber EntryNumber
 

Public Member Functions

void addBranch (BranchDescription const &prod, std::string const &oldBranchName)
 
TBranch * branchEntryInfoBranch () const
 
BranchMap const & branches () const
 
std::vector< std::string > const & branchNames () const
 
BranchType branchType () const
 
TTreeCache * checkTriggerCache (TBranch *branch, EntryNumber entryNumber) const
 
TTreeCache * checkTriggerCacheImpl (TBranch *branch, EntryNumber entryNumber) const
 
void close ()
 
bool current () const
 
bool current (EntryNumber entry) const
 
void dropBranch (std::string const &oldBranchName)
 
EntryNumber const & entries () const
 
EntryNumber const & entryNumber () const
 
EntryNumber const & entryNumberForIndex (unsigned int index) const
 
template<typename T >
void fillAux (T *&pAux)
 
template<typename T >
void fillBranchEntry (TBranch *branch, T *&pbuf)
 
template<typename T >
void fillBranchEntry (TBranch *branch, EntryNumber entryNumber, T *&pbuf)
 
template<typename T >
void fillBranchEntryMeta (TBranch *branch, T *&pbuf)
 
template<typename T >
void fillBranchEntryMeta (TBranch *branch, EntryNumber entryNumber, T *&pbuf)
 
void getEntry (TBranch *branch, EntryNumber entry) const
 
void insertEntryForIndex (unsigned int index)
 
bool isValid () const
 
TTree const * metaTree () const
 
bool next ()
 
bool nextWithCache ()
 
void numberOfBranchesToAdd (size_t iSize)
 
RootTreeoperator= (RootTree const &)=delete
 
bool previous ()
 
DelayedReaderresetAndGetRootDelayedReader () const
 
void resetTraining ()
 
void rewind ()
 
DelayedReaderrootDelayedReader () const
 
 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)
 
 RootTree (RootTree const &)=delete
 
TTreeCache * selectCache (TBranch *branch, EntryNumber entryNumber) const
 
void setEntryNumber (EntryNumber theEntryNumber)
 
void setPresence (BranchDescription &prod, std::string const &oldBranchName)
 
void setSignals (signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
 
bool skipEntries (unsigned int &offset)
 
void trainCache (char const *branchNames)
 
TTree const * tree () const
 
TTree * tree ()
 
 ~RootTree ()
 

Private Member Functions

void setCacheSize (unsigned int cacheSize)
 
void setTreeMaxVirtualSize (int treeMaxVirtualSize)
 
void startTraining ()
 
void stopTraining ()
 

Private Attributes

TBranch * auxBranch_
 
TBranch * branchEntryInfoBranch_
 
BranchMap branches_
 
std::vector< std::string > branchNames_
 
BranchType branchType_
 
unsigned int cacheSize_
 
bool enablePrefetching_
 
bool enableTriggerCache_
 
EntryNumber entries_
 
EntryNumber entryNumber_
 
std::unique_ptr< std::vector< EntryNumber > > entryNumberForIndex_
 
std::shared_ptr< InputFilefilePtr_
 
TTree * infoTree_
 
unsigned int learningEntries_
 
TTree * metaTree_
 
bool performedSwitchOver_
 
std::shared_ptr< TTreeCache > rawTreeCache_
 
EntryNumber rawTriggerSwitchOverEntry_
 
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
 
std::unique_ptr< RootDelayedReaderrootDelayedReader_
 
TBranch * statusBranch_
 
EntryNumber switchOverEntry_
 
std::unordered_set< TBranch * > trainedSet_
 
bool trainNow_
 
TTree * tree_
 
unsigned long treeAutoFlush_
 
std::shared_ptr< TTreeCache > treeCache_
 
std::unordered_set< TBranch * > triggerSet_
 
std::shared_ptr< TTreeCache > triggerTreeCache_
 

Detailed Description

Definition at line 101 of file RootTree.h.

Member Typedef Documentation

Definition at line 103 of file RootTree.h.

Definition at line 104 of file RootTree.h.

Constructor & Destructor Documentation

edm::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 at line 28 of file RootTree.cc.

References branchEntryInfoBranch_, branchType_, edm::BranchTypeToInfoTreeName(), edm::BranchTypeToProductTreeName(), cacheSize_, enablePrefetching_, enableTriggerCache_, Exception, filePtr_, edm::InEvent, infoTree_, learningEntries_, metaTree_, performedSwitchOver_, rawTriggerSwitchOverEntry_, rootDelayedReader_, setCacheSize(), setTreeMaxVirtualSize(), switchOverEntry_, trainedSet_, trainNow_, tree_, treeAutoFlush_, and triggerSet_.

36  : filePtr_(filePtr),
37  tree_(dynamic_cast<TTree*>(
38  filePtr_.get() != nullptr ? filePtr_->Get(BranchTypeToProductTreeName(branchType).c_str()) : nullptr)),
39  metaTree_(dynamic_cast<TTree*>(
40  filePtr_.get() != nullptr ? filePtr_->Get(BranchTypeToMetaDataTreeName(branchType).c_str()) : nullptr)),
42  auxBranch_(tree_ ? getAuxiliaryBranch(tree_, branchType_) : nullptr),
43  treeCache_(),
44  rawTreeCache_(),
47  trainedSet_(),
48  triggerSet_(),
49  entries_(tree_ ? tree_->GetEntries() : 0),
50  entryNumber_(-1),
51  entryNumberForIndex_(new std::vector<EntryNumber>(nIndexes, IndexIntoFile::invalidEntry)),
52  branchNames_(),
53  branches_{},
54  trainNow_(false),
55  switchOverEntry_(-1),
57  performedSwitchOver_{false},
58  learningEntries_(learningEntries),
59  cacheSize_(cacheSize),
60  treeAutoFlush_(0),
61  enablePrefetching_(enablePrefetching),
63  rootDelayedReader_(new RootDelayedReader(*this, filePtr, inputType)),
64  branchEntryInfoBranch_(metaTree_ ? getProductProvenanceBranch(metaTree_, branchType_)
65  : (tree_ ? getProductProvenanceBranch(tree_, branchType_) : nullptr)),
66  infoTree_(dynamic_cast<TTree*>(filePtr_.get() != nullptr
67  ? filePtr->Get(BranchTypeToInfoTreeName(branchType).c_str())
68  : nullptr)) // backward compatibility
69  {
70  if (not tree_) {
71  throw cms::Exception("WrongFileFormat")
72  << "The ROOT file does not contain a TTree named " << BranchTypeToProductTreeName(branchType)
73  << "\n This is either not an edm ROOT file or is one that has been corrupted.";
74  }
75  // On merged files in older releases of ROOT, the autoFlush setting is always negative; we must guess.
76  // TODO: On newer merged files, we should be able to get this from the cluster iterator.
77  long treeAutoFlush = (tree_ ? tree_->GetAutoFlush() : 0);
78  if (treeAutoFlush < 0) {
79  // The "+1" is here to avoid divide-by-zero in degenerate cases.
80  Long64_t averageEventSizeBytes = tree_->GetZipBytes() / (tree_->GetEntries() + 1) + 1;
81  treeAutoFlush_ = cacheSize_ / averageEventSizeBytes + 1;
82  } else {
83  treeAutoFlush_ = treeAutoFlush;
84  }
87  }
88  setTreeMaxVirtualSize(maxVirtualSize);
89  setCacheSize(cacheSize);
90  if (tree_) {
91  Int_t branchCount = tree_->GetListOfBranches()->GetEntriesFast();
92  trainedSet_.reserve(branchCount);
93  triggerSet_.reserve(branchCount);
94  }
95  }
EntryNumber entryNumber_
Definition: RootTree.h:224
std::string const & BranchTypeToMetaDataTreeName(BranchType const &branchType)
Definition: BranchType.cc:108
unsigned int learningEntries_
Definition: RootTree.h:232
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
Definition: RootTree.h:220
std::vector< std::string > branchNames_
Definition: RootTree.h:226
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
TTree * tree_
Definition: RootTree.h:210
bool trainNow_
Definition: RootTree.h:228
EntryNumber rawTriggerSwitchOverEntry_
Definition: RootTree.h:230
BranchMap branches_
Definition: RootTree.h:227
TTree * metaTree_
Definition: RootTree.h:211
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:221
TBranch * branchEntryInfoBranch_
Definition: RootTree.h:241
EntryNumber entries_
Definition: RootTree.h:223
bool enablePrefetching_
Definition: RootTree.h:237
std::unique_ptr< RootDelayedReader > rootDelayedReader_
Definition: RootTree.h:239
void setTreeMaxVirtualSize(int treeMaxVirtualSize)
Definition: RootTree.cc:188
BranchType branchType() const
Definition: RootTree.h:194
unsigned long treeAutoFlush_
Definition: RootTree.h:234
std::string const & BranchTypeToProductTreeName(BranchType const &branchType)
Definition: BranchType.cc:104
TBranch * auxBranch_
Definition: RootTree.h:213
std::string const & BranchTypeToInfoTreeName(BranchType const &branchType)
Definition: BranchType.cc:112
bool enableTriggerCache_
Definition: RootTree.h:238
static constexpr EntryNumber_t invalidEntry
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:218
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
void setCacheSize(unsigned int cacheSize)
Definition: RootTree.cc:178
bool performedSwitchOver_
Definition: RootTree.h:231
std::unique_ptr< std::vector< EntryNumber > > entryNumberForIndex_
Definition: RootTree.h:225
unsigned int cacheSize_
Definition: RootTree.h:233
std::unordered_set< TBranch * > triggerSet_
Definition: RootTree.h:222
EntryNumber switchOverEntry_
Definition: RootTree.h:229
std::shared_ptr< TTreeCache > triggerTreeCache_
Definition: RootTree.h:219
BranchType branchType_
Definition: RootTree.h:212
TTree * infoTree_
Definition: RootTree.h:243
edm::RootTree::~RootTree ( )

Definition at line 97 of file RootTree.cc.

97 {}
edm::RootTree::RootTree ( RootTree const &  )
delete

Member Function Documentation

void edm::RootTree::addBranch ( BranchDescription const &  prod,
std::string const &  oldBranchName 
)

Definition at line 136 of file RootTree.cc.

References MicroEventContent_cff::branch, branches_, edm::BranchDescription::branchID(), edm::BranchDescription::branchName(), branchNames_, info(), edm::roottree::BranchMap::insert(), isValid(), metaTree_, edm::BranchDescription::present(), edm::roottree::BranchInfo::productBranch_, edm::roottree::BranchInfo::provenanceBranch_, and tree_.

136  {
137  assert(isValid());
138  //use the translated branch name
139  TBranch* branch = tree_->GetBranch(oldBranchName.c_str());
140  roottree::BranchInfo info = roottree::BranchInfo(prod);
141  info.productBranch_ = nullptr;
142  if (prod.present()) {
143  info.productBranch_ = branch;
144  //we want the new branch name for the JobReport
145  branchNames_.push_back(prod.branchName());
146  }
147  TTree* provTree = (metaTree_ != nullptr ? metaTree_ : tree_);
148  info.provenanceBranch_ = provTree->GetBranch(oldBranchName.c_str());
149  branches_.insert(prod.branchID(), info);
150  }
static const TGPicture * info(bool iBackgroundIsBlack)
std::vector< std::string > branchNames_
Definition: RootTree.h:226
TTree * tree_
Definition: RootTree.h:210
BranchMap branches_
Definition: RootTree.h:227
TTree * metaTree_
Definition: RootTree.h:211
void insert(edm::BranchID const &iKey, BranchInfo const &iInfo)
Definition: RootTree.h:73
bool isValid() const
Definition: RootTree.cc:109
TBranch* edm::RootTree::branchEntryInfoBranch ( ) const
inline

Definition at line 186 of file RootTree.h.

References haddnano::branchNames, and edm::roottree::trainCache().

Referenced by edm::FullProvenanceReader::readProvenance().

186 { return branchEntryInfoBranch_; }
TBranch * branchEntryInfoBranch_
Definition: RootTree.h:241
roottree::BranchMap const & edm::RootTree::branches ( ) const

Definition at line 176 of file RootTree.cc.

References branches_.

Referenced by edm::RootDelayedReader::branches(), checkTriggerCacheImpl(), and trainCache().

176 { return branches_; }
BranchMap branches_
Definition: RootTree.h:227
std::vector<std::string> const& edm::RootTree::branchNames ( ) const
inline

Definition at line 138 of file RootTree.h.

Referenced by edm::RootFile::reportOpened().

138 { return branchNames_; }
std::vector< std::string > branchNames_
Definition: RootTree.h:226
BranchType edm::RootTree::branchType ( ) const
inline

Definition at line 194 of file RootTree.h.

Referenced by edm::RootDelayedReader::getProduct_().

194 { return branchType_; }
BranchType branchType_
Definition: RootTree.h:212
TTreeCache * edm::RootTree::checkTriggerCache ( TBranch *  branch,
EntryNumber  entryNumber 
) const
inline

Definition at line 255 of file RootTree.cc.

References checkTriggerCacheImpl(), enableTriggerCache_, trainedSet_, and treeCache_.

Referenced by selectCache().

255  {
256  if (!treeCache_->IsAsyncReading() && enableTriggerCache_ && (trainedSet_.find(branch) == trainedSet_.end())) {
258  } else {
259  return nullptr;
260  }
261  }
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:221
TTreeCache * checkTriggerCacheImpl(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:265
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
bool enableTriggerCache_
Definition: RootTree.h:238
TTreeCache * edm::RootTree::checkTriggerCacheImpl ( TBranch *  branch,
EntryNumber  entryNumber 
) const

Definition at line 265 of file RootTree.cc.

References branches(), entryNumber_, filePtr_, mps_fire::i, performedSwitchOver_, rawTriggerSwitchOverEntry_, rawTriggerTreeCache_, trainedSet_, tree_, triggerSet_, and triggerTreeCache_.

Referenced by checkTriggerCache().

265  {
266  // This branch is not going to be in the cache.
267  // Assume this is a "trigger pattern".
268  // Always make sure the branch is added to the trigger set.
269  if (triggerSet_.find(branch) == triggerSet_.end()) {
270  triggerSet_.insert(branch);
271  if (triggerTreeCache_.get()) {
272  triggerTreeCache_->AddBranch(branch, kTRUE);
273  }
274  }
275 
276  if (rawTriggerSwitchOverEntry_ < 0) {
277  // The trigger has never fired before. Take everything not in the
278  // trainedSet and load it from disk
279 
280  // Calculate the end of the next cluster; triggers in the next cluster
281  // will use the triggerCache, not the rawTriggerCache.
282  //
283  // Guarantee that rawTriggerSwitchOverEntry_ is positive (non-zero) after completion
284  // of this if-block.
285  TTree::TClusterIterator clusterIter = tree_->GetClusterIterator(entryNumber);
287  rawTriggerSwitchOverEntry_ = clusterIter();
288  }
289 
290  // ROOT will automatically expand the cache to fit one cluster; hence, we use
291  // 5 MB as the cache size below
292  tree_->SetCacheSize(static_cast<Long64_t>(5 * 1024 * 1024));
293  rawTriggerTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
295  rawTriggerTreeCache_->SetEnablePrefetching(false);
296  TObjArray* branches = tree_->GetListOfBranches();
297  int branchCount = branches->GetEntriesFast();
298 
299  // Train the rawTriggerCache to have everything not in the regular cache.
300  rawTriggerTreeCache_->SetLearnEntries(0);
302  for (int i = 0; i < branchCount; i++) {
303  TBranch* tmp_branch = (TBranch*)branches->UncheckedAt(i);
304  if (trainedSet_.find(tmp_branch) != trainedSet_.end()) {
305  continue;
306  }
307  rawTriggerTreeCache_->AddBranch(tmp_branch, kTRUE);
308  }
309  performedSwitchOver_ = false;
310  rawTriggerTreeCache_->StopLearningPhase();
311  filePtr_->SetCacheRead(nullptr);
312 
313  return rawTriggerTreeCache_.get();
315  // The raw trigger has fired and it contents are valid.
316  return rawTriggerTreeCache_.get();
317  } else if (rawTriggerSwitchOverEntry_ > 0) {
318  // The raw trigger has fired, but we are out of the cache. Use the
319  // triggerCache instead.
320  if (!performedSwitchOver_) {
321  rawTriggerTreeCache_.reset();
322  performedSwitchOver_ = true;
323 
324  // Train the triggerCache
325  tree_->SetCacheSize(static_cast<Long64_t>(5 * 1024 * 1024));
326  triggerTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
327  triggerTreeCache_->SetEnablePrefetching(false);
328  triggerTreeCache_->SetLearnEntries(0);
329  triggerTreeCache_->SetEntryRange(entryNumber, tree_->GetEntries());
330  for (std::unordered_set<TBranch*>::const_iterator it = triggerSet_.begin(), itEnd = triggerSet_.end();
331  it != itEnd;
332  it++) {
333  triggerTreeCache_->AddBranch(*it, kTRUE);
334  }
335  triggerTreeCache_->StopLearningPhase();
336  filePtr_->SetCacheRead(nullptr);
337  }
338  return triggerTreeCache_.get();
339  }
340 
341  // By construction, this case should be impossible.
342  assert(false);
343  return nullptr;
344  }
EntryNumber entryNumber_
Definition: RootTree.h:224
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
Definition: RootTree.h:220
TTree * tree_
Definition: RootTree.h:210
EntryNumber rawTriggerSwitchOverEntry_
Definition: RootTree.h:230
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:221
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
bool performedSwitchOver_
Definition: RootTree.h:231
std::unordered_set< TBranch * > triggerSet_
Definition: RootTree.h:222
BranchMap const & branches() const
Definition: RootTree.cc:176
std::shared_ptr< TTreeCache > triggerTreeCache_
Definition: RootTree.h:219
void edm::RootTree::close ( void  )

Definition at line 439 of file RootTree.cc.

References auxBranch_, branchEntryInfoBranch_, filePtr_, infoTree_, metaTree_, rawTreeCache_, rawTriggerTreeCache_, tree_, treeCache_, and triggerTreeCache_.

Referenced by lumiQTWidget.ApplicationWindow::fileQuit(), esMonitoring.AsyncLineReaderMixin::handle_close(), esMonitoring.FDJsonServer::handle_close(), Vispa.Gui.BoxContentDialog.BoxContentDialog::keyPressEvent(), and Vispa.Gui.FindDialog.FindDialog::keyPressEvent().

439  {
440  // The TFile is about to be closed, and destructed.
441  // Just to play it safe, zero all pointers to quantities that are owned by the TFile.
443  tree_ = metaTree_ = infoTree_ = nullptr;
444  // We own the treeCache_.
445  // We make sure the treeCache_ is detached from the file,
446  // so that ROOT does not also delete it.
447  filePtr_->SetCacheRead(nullptr);
448  // We *must* delete the TTreeCache here because the TFilePrefetch object
449  // references the TFile. If TFile is closed, before the TTreeCache is
450  // deleted, the TFilePrefetch may continue to do TFile operations, causing
451  // deadlocks or exceptions.
452  treeCache_.reset();
453  rawTreeCache_.reset();
454  triggerTreeCache_.reset();
455  rawTriggerTreeCache_.reset();
456  // We give up our shared ownership of the TFile itself.
457  filePtr_.reset();
458  }
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
Definition: RootTree.h:220
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
TTree * tree_
Definition: RootTree.h:210
TTree * metaTree_
Definition: RootTree.h:211
TBranch * branchEntryInfoBranch_
Definition: RootTree.h:241
TBranch * auxBranch_
Definition: RootTree.h:213
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:218
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
std::shared_ptr< TTreeCache > triggerTreeCache_
Definition: RootTree.h:219
TTree * infoTree_
Definition: RootTree.h:243
bool edm::RootTree::current ( ) const
inline

Definition at line 128 of file RootTree.h.

Referenced by edm::RootFile::fillEventAuxiliary(), edm::RootFile::readCurrentEvent(), edm::RootFile::readLuminosityBlockAuxiliary_(), and edm::RootFile::readRunAuxiliary_().

128 { return entryNumber_ < entries_ && entryNumber_ >= 0; }
bool edm::RootTree::current ( EntryNumber  entry) const
inline

Definition at line 129 of file RootTree.h.

129 { return entry < entries_ && entry >= 0; }
void edm::RootTree::dropBranch ( std::string const &  oldBranchName)

Definition at line 152 of file RootTree.cc.

References beamvalidation::br, MicroEventContent_cff::branch, entries(), mps_fire::i, and tree_.

152  {
153  //use the translated branch name
154  TBranch* branch = tree_->GetBranch(oldBranchName.c_str());
155  if (branch != nullptr) {
156  TObjArray* leaves = tree_->GetListOfLeaves();
157  int entries = leaves->GetEntries();
158  for (int i = 0; i < entries; ++i) {
159  TLeaf* leaf = (TLeaf*)(*leaves)[i];
160  if (leaf == nullptr)
161  continue;
162  TBranch* br = leaf->GetBranch();
163  if (br == nullptr)
164  continue;
165  if (br->GetMother() == branch) {
166  leaves->Remove(leaf);
167  }
168  }
169  leaves->Compress();
170  tree_->GetListOfBranches()->Remove(branch);
171  tree_->GetListOfBranches()->Compress();
172  delete branch;
173  }
174  }
TTree * tree_
Definition: RootTree.h:210
EntryNumber const & entries() const
Definition: RootTree.h:135
EntryNumber const& edm::RootTree::entries ( ) const
inline
EntryNumber const& edm::RootTree::entryNumber ( ) const
inline
RootTree::EntryNumber const & edm::RootTree::entryNumberForIndex ( unsigned int  index) const

Definition at line 99 of file RootTree.cc.

References entryNumberForIndex_, and findQualityFiles::size.

Referenced by edm::RootDelayedReader::getProduct_(), and edm::FullProvenanceReader::readProvenance().

99  {
100  assert(index < entryNumberForIndex_->size());
101  return (*entryNumberForIndex_)[index];
102  }
size
Write out results.
std::unique_ptr< std::vector< EntryNumber > > entryNumberForIndex_
Definition: RootTree.h:225
template<typename T >
void edm::RootTree::fillAux ( T *&  pAux)
inline

Definition at line 142 of file RootTree.h.

References edm::roottree::getEntry().

Referenced by edm::RootFile::fillLumiAuxiliary(), edm::RootFile::fillRunAuxiliary(), and edm::RootFile::fillThisEventAuxiliary().

142  {
143  auxBranch_->SetAddress(&pAux);
145  }
EntryNumber entryNumber_
Definition: RootTree.h:224
TBranch * auxBranch_
Definition: RootTree.h:213
void getEntry(TBranch *branch, EntryNumber entry) const
Definition: RootTree.cc:364
template<typename T >
void edm::RootTree::fillBranchEntry ( TBranch *  branch,
T *&  pbuf 
)
inline

Definition at line 158 of file RootTree.h.

References edm::roottree::getEntry().

Referenced by edm::RootFile::fillEventHistory().

158  {
159  branch->SetAddress(&pbuf);
161  }
EntryNumber entryNumber_
Definition: RootTree.h:224
void getEntry(TBranch *branch, EntryNumber entry) const
Definition: RootTree.cc:364
template<typename T >
void edm::RootTree::fillBranchEntry ( TBranch *  branch,
EntryNumber  entryNumber,
T *&  pbuf 
)
inline

Definition at line 175 of file RootTree.h.

References edm::roottree::getEntry().

175  {
176  branch->SetAddress(&pbuf);
178  }
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
void getEntry(TBranch *branch, EntryNumber entry) const
Definition: RootTree.cc:364
template<typename T >
void edm::RootTree::fillBranchEntryMeta ( TBranch *  branch,
T *&  pbuf 
)
inline

Definition at line 147 of file RootTree.h.

References MicroEventContent_cff::branch, and edm::roottree::getEntry().

Referenced by edm::FullProvenanceReader::readProvenance().

147  {
148  if (metaTree_ != nullptr) {
149  // Metadata was in separate tree. Not cached.
150  branch->SetAddress(&pbuf);
152  } else {
153  fillBranchEntry<T>(branch, pbuf);
154  }
155  }
EntryNumber entryNumber_
Definition: RootTree.h:224
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:495
TTree * metaTree_
Definition: RootTree.h:211
template<typename T >
void edm::RootTree::fillBranchEntryMeta ( TBranch *  branch,
EntryNumber  entryNumber,
T *&  pbuf 
)
inline

Definition at line 164 of file RootTree.h.

References MicroEventContent_cff::branch, and edm::roottree::getEntry().

164  {
165  if (metaTree_ != nullptr) {
166  // Metadata was in separate tree. Not cached.
167  branch->SetAddress(&pbuf);
169  } else {
170  fillBranchEntry<T>(branch, entryNumber, pbuf);
171  }
172  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:495
TTree * metaTree_
Definition: RootTree.h:211
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
void edm::RootTree::getEntry ( TBranch *  branch,
EntryNumber  entry 
) const

Definition at line 364 of file RootTree.cc.

References cms::Exception::addContext(), utilities::cache(), MillePedeFileConverter_cfg::e, filePtr_, edm::errors::FileReadError, selectCache(), AlCaHLTBitMon_QueryRunRegistry::string, and protons_cff::t.

Referenced by edm::RootDelayedReader::getProduct_().

364  {
365  try {
366  TTreeCache* cache = selectCache(branch, entryNumber);
367  filePtr_->SetCacheRead(cache);
368  branch->GetEntry(entryNumber);
369  filePtr_->SetCacheRead(nullptr);
370  } catch (cms::Exception const& e) {
371  // We make sure the treeCache_ is detached from the file,
372  // so that ROOT does not also delete it.
373  filePtr_->SetCacheRead(nullptr);
375  t.addContext(std::string("Reading branch ") + branch->GetName());
376  throw t;
377  }
378  }
TTreeCache * selectCache(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:346
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
def cache(function)
Definition: utilities.py:3
void edm::RootTree::insertEntryForIndex ( unsigned int  index)

Definition at line 104 of file RootTree.cc.

References entryNumber(), and findQualityFiles::size.

Referenced by edm::RootFile::readCurrentEvent(), edm::RootFile::readLuminosityBlock_(), and edm::RootFile::readRun_().

104  {
105  assert(index < entryNumberForIndex_->size());
106  (*entryNumberForIndex_)[index] = entryNumber();
107  }
size
Write out results.
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
bool edm::RootTree::isValid ( void  ) const

Definition at line 109 of file RootTree.cc.

References auxBranch_, branchEntryInfoBranch_, entries_, infoTree_, metaTree_, and tree_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), addBranch(), edm::RootFile::fillIndexIntoFile(), edm::RootFile::readLuminosityBlock_(), edm::RootFile::readLuminosityBlockAuxiliary_(), edm::RootFile::readRun_(), edm::RootFile::readRunAuxiliary_(), core.AutoHandle.AutoHandle::ReallyLoad(), setPresence(), and edm::RootFile::validateFile().

109  {
110  if (metaTree_ == nullptr || metaTree_->GetNbranches() == 0) {
111  return tree_ != nullptr && auxBranch_ != nullptr;
112  }
113  if (tree_ != nullptr && auxBranch_ != nullptr && metaTree_ != nullptr) { // backward compatibility
114  if (branchEntryInfoBranch_ != nullptr || infoTree_ != nullptr)
115  return true; // backward compatibility
116  return (entries_ == metaTree_->GetEntries() &&
117  tree_->GetNbranches() <= metaTree_->GetNbranches() + 1); // backward compatibility
118  } // backward compatibility
119  return false;
120  }
TTree * tree_
Definition: RootTree.h:210
TTree * metaTree_
Definition: RootTree.h:211
TBranch * branchEntryInfoBranch_
Definition: RootTree.h:241
EntryNumber entries_
Definition: RootTree.h:223
TBranch * auxBranch_
Definition: RootTree.h:213
TTree * infoTree_
Definition: RootTree.h:243
TTree const* edm::RootTree::metaTree ( ) const
inline

Definition at line 182 of file RootTree.h.

Referenced by edm::RootFile::createFileBlock().

182 { return metaTree_; }
TTree * metaTree_
Definition: RootTree.h:211
bool edm::RootTree::next ( void  )
inline

Definition at line 125 of file RootTree.h.

Referenced by edm::RootFile::fillIndexIntoFile(), and edm::RootFile::initializeDuplicateChecker().

125 { return ++entryNumber_ < entries_; }
EntryNumber entryNumber_
Definition: RootTree.h:224
EntryNumber entries_
Definition: RootTree.h:223
bool edm::RootTree::nextWithCache ( )

Definition at line 193 of file RootTree.cc.

References entries_, entryNumber_, and setEntryNumber().

193  {
194  bool returnValue = ++entryNumber_ < entries_;
195  if (returnValue) {
197  }
198  return returnValue;
199  }
EntryNumber entryNumber_
Definition: RootTree.h:224
EntryNumber entries_
Definition: RootTree.h:223
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
void edm::RootTree::numberOfBranchesToAdd ( size_t  iSize)
inline
RootTree& edm::RootTree::operator= ( RootTree const &  )
delete
bool edm::RootTree::previous ( )
inline

Definition at line 127 of file RootTree.h.

127 { return --entryNumber_ >= 0; }
EntryNumber entryNumber_
Definition: RootTree.h:224
DelayedReader * edm::RootTree::resetAndGetRootDelayedReader ( ) const

Definition at line 122 of file RootTree.cc.

References rootDelayedReader_.

Referenced by edm::RootFile::readCurrentEvent(), edm::RootFile::readLuminosityBlock_(), and edm::RootFile::readRun_().

122  {
123  rootDelayedReader_->reset();
124  return rootDelayedReader_.get();
125  }
std::unique_ptr< RootDelayedReader > rootDelayedReader_
Definition: RootTree.h:239
void edm::RootTree::resetTraining ( )
inline

Definition at line 192 of file RootTree.h.

Referenced by edm::RootFile::RootFile().

192 { trainNow_ = true; }
bool trainNow_
Definition: RootTree.h:228
void edm::RootTree::rewind ( )
inline

Definition at line 130 of file RootTree.h.

References PFRecoTauDiscriminationByIsolation_cfi::offset.

130 { entryNumber_ = 0; }
EntryNumber entryNumber_
Definition: RootTree.h:224
DelayedReader * edm::RootTree::rootDelayedReader ( ) const

Definition at line 127 of file RootTree.cc.

References rootDelayedReader_.

Referenced by edm::FullProvenanceReader::readProvenanceAsync().

127 { return rootDelayedReader_.get(); }
std::unique_ptr< RootDelayedReader > rootDelayedReader_
Definition: RootTree.h:239
TTreeCache * edm::RootTree::selectCache ( TBranch *  branch,
EntryNumber  entryNumber 
) const
inline

Definition at line 346 of file RootTree.cc.

References checkTriggerCache(), rawTreeCache_, trainedSet_, and treeCache_.

Referenced by getEntry().

346  {
347  TTreeCache* triggerCache = nullptr;
348  if (!treeCache_) {
349  return nullptr;
350  } else if (treeCache_->IsLearning() && rawTreeCache_) {
351  treeCache_->AddBranch(branch, kTRUE);
352  trainedSet_.insert(branch);
353  return rawTreeCache_.get();
354  } else if ((triggerCache = checkTriggerCache(branch, entryNumber))) {
355  // A NULL return value from checkTriggerCache indicates the trigger cache case
356  // does not apply, and we should continue below.
357  return triggerCache;
358  } else {
359  // The "normal" TTreeCache case.
360  return treeCache_.get();
361  }
362  }
TTreeCache * checkTriggerCache(TBranch *branch, EntryNumber entryNumber) const
Definition: RootTree.cc:255
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:221
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:218
void edm::RootTree::setCacheSize ( unsigned int  cacheSize)
private

Definition at line 178 of file RootTree.cc.

References cacheSize_, enablePrefetching_, filePtr_, rawTreeCache_, tree_, and treeCache_.

Referenced by RootTree().

178  {
179  cacheSize_ = cacheSize;
180  tree_->SetCacheSize(static_cast<Long64_t>(cacheSize));
181  treeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
182  if (treeCache_)
183  treeCache_->SetEnablePrefetching(enablePrefetching_);
184  filePtr_->SetCacheRead(nullptr);
185  rawTreeCache_.reset();
186  }
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
TTree * tree_
Definition: RootTree.h:210
bool enablePrefetching_
Definition: RootTree.h:237
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:218
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
unsigned int cacheSize_
Definition: RootTree.h:233
void edm::RootTree::setEntryNumber ( EntryNumber  theEntryNumber)

Definition at line 201 of file RootTree.cc.

References entries_, entryNumber_, filePtr_, performedSwitchOver_, rawTreeCache_, rawTriggerSwitchOverEntry_, rawTriggerTreeCache_, startTraining(), stopTraining(), switchOverEntry_, trainedSet_, trainNow_, tree_, treeAutoFlush_, treeCache_, triggerSet_, and triggerTreeCache_.

Referenced by edm::RootFile::fillEventAuxiliary(), edm::RootFile::fillIndexIntoFile(), edm::RootFile::initializeDuplicateChecker(), nextWithCache(), edm::RootFile::readLuminosityBlock_(), edm::RootFile::readLuminosityBlockAuxiliary_(), edm::RootFile::readRunAuxiliary_(), edm::RootFile::setAtEventEntry(), edm::RootFile::setEntryAtEvent(), edm::RootFile::setEntryAtLumi(), and edm::RootFile::setEntryAtRun().

201  {
202  filePtr_->SetCacheRead(treeCache_.get());
203 
204  // Detect a backward skip. If the skip is sufficiently large, we roll the dice and reset the treeCache.
205  // This will cause some amount of over-reading: we pre-fetch all the events in some prior cluster.
206  // However, because reading one event in the cluster is supposed to be equivalent to reading all events in the cluster,
207  // we're not incurring additional over-reading - we're just doing it more efficiently.
208  // NOTE: Constructor guarantees treeAutoFlush_ is positive, even if TTree->GetAutoFlush() is negative.
209  if (theEntryNumber < entryNumber_ and theEntryNumber >= 0) {
210  //We started reading the file near the end, now we need to correct for the learning length
211  if (switchOverEntry_ > tree_->GetEntries()) {
212  switchOverEntry_ = switchOverEntry_ - tree_->GetEntries();
213  if (rawTreeCache_) {
214  rawTreeCache_->SetEntryRange(theEntryNumber, switchOverEntry_);
215  rawTreeCache_->FillBuffer();
216  }
217  }
219  //We are using the triggerTreeCache_ not the rawTriggerTreeCache_.
220  //The triggerTreeCache was originally told to start from an entry further in the file.
221  triggerTreeCache_->SetEntryRange(theEntryNumber, tree_->GetEntries());
222  } else if (rawTriggerTreeCache_) {
223  //move the switch point to the end of the cluster holding theEntryNumber
225  TTree::TClusterIterator clusterIter = tree_->GetClusterIterator(theEntryNumber);
226  while ((rawTriggerSwitchOverEntry_ < theEntryNumber) || (rawTriggerSwitchOverEntry_ <= 0)) {
227  rawTriggerSwitchOverEntry_ = clusterIter();
228  }
229  rawTriggerTreeCache_->SetEntryRange(theEntryNumber, rawTriggerSwitchOverEntry_);
230  }
231  }
232  if ((theEntryNumber < static_cast<EntryNumber>(entryNumber_ - treeAutoFlush_)) && (treeCache_) &&
233  (!treeCache_->IsLearning()) && (entries_ > 0) && (switchOverEntry_ >= 0)) {
234  treeCache_->SetEntryRange(theEntryNumber, entries_);
235  treeCache_->FillBuffer();
236  }
237 
238  entryNumber_ = theEntryNumber;
239  tree_->LoadTree(entryNumber_);
240  filePtr_->SetCacheRead(nullptr);
241  if (treeCache_ && trainNow_ && entryNumber_ >= 0) {
242  startTraining();
243  trainNow_ = false;
244  trainedSet_.clear();
245  triggerSet_.clear();
247  }
248  if (treeCache_ && treeCache_->IsLearning() && switchOverEntry_ >= 0 && entryNumber_ >= switchOverEntry_) {
249  stopTraining();
250  }
251  }
EntryNumber entryNumber_
Definition: RootTree.h:224
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
Definition: RootTree.h:220
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
TTree * tree_
Definition: RootTree.h:210
bool trainNow_
Definition: RootTree.h:228
EntryNumber rawTriggerSwitchOverEntry_
Definition: RootTree.h:230
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:221
void stopTraining()
Definition: RootTree.cc:432
EntryNumber entries_
Definition: RootTree.h:223
unsigned long treeAutoFlush_
Definition: RootTree.h:234
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:218
void startTraining()
Definition: RootTree.cc:395
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
bool performedSwitchOver_
Definition: RootTree.h:231
std::unordered_set< TBranch * > triggerSet_
Definition: RootTree.h:222
EntryNumber switchOverEntry_
Definition: RootTree.h:229
std::shared_ptr< TTreeCache > triggerTreeCache_
Definition: RootTree.h:219
void edm::RootTree::setPresence ( BranchDescription prod,
std::string const &  oldBranchName 
)

Definition at line 129 of file RootTree.cc.

References isValid(), edm::BranchDescription::setDropped(), and tree_.

129  {
130  assert(isValid());
131  if (tree_->GetBranch(oldBranchName.c_str()) == nullptr) {
132  prod.setDropped(true);
133  }
134  }
TTree * tree_
Definition: RootTree.h:210
bool isValid() const
Definition: RootTree.cc:109
void edm::RootTree::setSignals ( signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *  preEventReadSource,
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *  postEventReadSource 
)

Definition at line 488 of file RootTree.cc.

References rootDelayedReader_.

Referenced by edm::RootFile::setSignals().

490  {
491  rootDelayedReader_->setSignals(preEventReadSource, postEventReadSource);
492  }
std::unique_ptr< RootDelayedReader > rootDelayedReader_
Definition: RootTree.h:239
void edm::RootTree::setTreeMaxVirtualSize ( int  treeMaxVirtualSize)
private

Definition at line 188 of file RootTree.cc.

References tree_.

Referenced by RootTree().

188  {
189  if (treeMaxVirtualSize >= 0)
190  tree_->SetMaxVirtualSize(static_cast<Long64_t>(treeMaxVirtualSize));
191  }
TTree * tree_
Definition: RootTree.h:210
bool edm::RootTree::skipEntries ( unsigned int &  offset)

Definition at line 380 of file RootTree.cc.

References entries_, entryNumber_, and PFRecoTauDiscriminationByIsolation_cfi::offset.

380  {
381  entryNumber_ += offset;
382  bool retval = (entryNumber_ < entries_);
383  if (retval) {
384  offset = 0;
385  } else {
386  // Not enough entries in the file to skip.
387  // The +1 is needed because entryNumber_ is -1 at the initialization of the tree, not 0.
388  long long overshoot = entryNumber_ + 1 - entries_;
390  offset = overshoot;
391  }
392  return retval;
393  }
EntryNumber entryNumber_
Definition: RootTree.h:224
EntryNumber entries_
Definition: RootTree.h:223
void edm::RootTree::startTraining ( )
private

Definition at line 395 of file RootTree.cc.

References edm::poolNames::branchListIndexesBranchName(), branchType_, edm::BranchTypeToAuxiliaryBranchName(), cacheSize_, entryNumber_, filePtr_, edm::InEvent, learningEntries_, rawTreeCache_, switchOverEntry_, trainedSet_, tree_, treeCache_, and triggerSet_.

Referenced by setEntryNumber().

395  {
396  if (cacheSize_ == 0) {
397  return;
398  }
399  assert(treeCache_);
400  assert(branchType_ == InEvent);
401  assert(!rawTreeCache_);
402  treeCache_->SetLearnEntries(learningEntries_);
403  tree_->SetCacheSize(static_cast<Long64_t>(cacheSize_));
404  rawTreeCache_.reset(dynamic_cast<TTreeCache*>(filePtr_->GetCacheRead()));
405  rawTreeCache_->SetEnablePrefetching(false);
406  filePtr_->SetCacheRead(nullptr);
407  rawTreeCache_->SetLearnEntries(0);
409  auto rawStart = entryNumber_;
410  auto rawEnd = switchOverEntry_;
411  auto treeStart = switchOverEntry_;
412  if (switchOverEntry_ >= tree_->GetEntries()) {
413  treeStart = switchOverEntry_ - tree_->GetEntries();
414  rawEnd = tree_->GetEntries();
415  }
416  rawTreeCache_->StartLearningPhase();
417  rawTreeCache_->SetEntryRange(rawStart, rawEnd);
418  rawTreeCache_->AddBranch("*", kTRUE);
419  rawTreeCache_->StopLearningPhase();
420  treeCache_->StartLearningPhase();
421  treeCache_->SetEntryRange(treeStart, tree_->GetEntries());
422  // Make sure that 'branchListIndexes' branch exist in input file
423  if (filePtr_->Get(poolNames::branchListIndexesBranchName().c_str()) != nullptr) {
424  treeCache_->AddBranch(poolNames::branchListIndexesBranchName().c_str(), kTRUE);
425  }
426  treeCache_->AddBranch(BranchTypeToAuxiliaryBranchName(branchType_).c_str(), kTRUE);
427  trainedSet_.clear();
428  triggerSet_.clear();
429  assert(treeCache_->GetTree() == tree_);
430  }
EntryNumber entryNumber_
Definition: RootTree.h:224
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:116
unsigned int learningEntries_
Definition: RootTree.h:232
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
TTree * tree_
Definition: RootTree.h:210
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:221
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:218
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
unsigned int cacheSize_
Definition: RootTree.h:233
std::unordered_set< TBranch * > triggerSet_
Definition: RootTree.h:222
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:253
EntryNumber switchOverEntry_
Definition: RootTree.h:229
BranchType branchType_
Definition: RootTree.h:212
void edm::RootTree::stopTraining ( )
private

Definition at line 432 of file RootTree.cc.

References filePtr_, rawTreeCache_, and treeCache_.

Referenced by setEntryNumber().

432  {
433  filePtr_->SetCacheRead(treeCache_.get());
434  treeCache_->StopLearningPhase();
435  filePtr_->SetCacheRead(nullptr);
436  rawTreeCache_.reset();
437  }
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
std::shared_ptr< TTreeCache > rawTreeCache_
Definition: RootTree.h:218
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
void edm::RootTree::trainCache ( char const *  branchNames)

Definition at line 460 of file RootTree.cc.

References branches(), cacheSize_, filePtr_, mps_fire::i, trainedSet_, tree_, and treeCache_.

Referenced by edm::RootFile::RootFile().

460  {
461  if (cacheSize_ == 0) {
462  return;
463  }
464  tree_->LoadTree(0);
465  assert(treeCache_);
466  filePtr_->SetCacheRead(treeCache_.get());
467  treeCache_->StartLearningPhase();
468  treeCache_->SetEntryRange(0, tree_->GetEntries());
469  treeCache_->AddBranch(branchNames, kTRUE);
470  treeCache_->StopLearningPhase();
471  assert(treeCache_->GetTree() == tree_);
472  // We own the treeCache_.
473  // We make sure the treeCache_ is detached from the file,
474  // so that ROOT does not also delete it.
475  filePtr_->SetCacheRead(nullptr);
476 
477  // Must also manually add things to the trained set.
478  TObjArray* branches = tree_->GetListOfBranches();
479  int branchCount = branches->GetEntriesFast();
480  for (int i = 0; i < branchCount; i++) {
481  TBranch* branch = (TBranch*)branches->UncheckedAt(i);
482  if ((branchNames[0] == '*') || (strcmp(branchNames, branch->GetName()) == 0)) {
483  trainedSet_.insert(branch);
484  }
485  }
486  }
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:138
std::shared_ptr< TTreeCache > treeCache_
Definition: RootTree.h:217
TTree * tree_
Definition: RootTree.h:210
std::unordered_set< TBranch * > trainedSet_
Definition: RootTree.h:221
std::shared_ptr< InputFile > filePtr_
Definition: RootTree.h:206
unsigned int cacheSize_
Definition: RootTree.h:233
BranchMap const & branches() const
Definition: RootTree.cc:176
TTree const* edm::RootTree::tree ( ) const
inline
TTree* edm::RootTree::tree ( )
inline

Member Data Documentation

TBranch* edm::RootTree::auxBranch_
private

Definition at line 213 of file RootTree.h.

Referenced by close(), and isValid().

TBranch* edm::RootTree::branchEntryInfoBranch_
private

Definition at line 241 of file RootTree.h.

Referenced by close(), isValid(), and RootTree().

BranchMap edm::RootTree::branches_
private

Definition at line 227 of file RootTree.h.

Referenced by addBranch(), and branches().

std::vector<std::string> edm::RootTree::branchNames_
private

Definition at line 226 of file RootTree.h.

Referenced by addBranch().

BranchType edm::RootTree::branchType_
private

Definition at line 212 of file RootTree.h.

Referenced by RootTree(), and startTraining().

unsigned int edm::RootTree::cacheSize_
private

Definition at line 233 of file RootTree.h.

Referenced by RootTree(), setCacheSize(), startTraining(), and trainCache().

bool edm::RootTree::enablePrefetching_
private

Definition at line 237 of file RootTree.h.

Referenced by RootTree(), and setCacheSize().

bool edm::RootTree::enableTriggerCache_
private

Definition at line 238 of file RootTree.h.

Referenced by checkTriggerCache(), and RootTree().

EntryNumber edm::RootTree::entries_
private

Definition at line 223 of file RootTree.h.

Referenced by isValid(), nextWithCache(), setEntryNumber(), and skipEntries().

EntryNumber edm::RootTree::entryNumber_
private
std::unique_ptr<std::vector<EntryNumber> > edm::RootTree::entryNumberForIndex_
private

Definition at line 225 of file RootTree.h.

Referenced by entryNumberForIndex().

std::shared_ptr<InputFile> edm::RootTree::filePtr_
private
TTree* edm::RootTree::infoTree_
private

Definition at line 243 of file RootTree.h.

Referenced by close(), isValid(), and RootTree().

unsigned int edm::RootTree::learningEntries_
private

Definition at line 232 of file RootTree.h.

Referenced by RootTree(), and startTraining().

TTree* edm::RootTree::metaTree_
private

Definition at line 211 of file RootTree.h.

Referenced by addBranch(), close(), isValid(), and RootTree().

bool edm::RootTree::performedSwitchOver_
mutableprivate

Definition at line 231 of file RootTree.h.

Referenced by checkTriggerCacheImpl(), RootTree(), and setEntryNumber().

std::shared_ptr<TTreeCache> edm::RootTree::rawTreeCache_
private
EntryNumber edm::RootTree::rawTriggerSwitchOverEntry_
mutableprivate

Definition at line 230 of file RootTree.h.

Referenced by checkTriggerCacheImpl(), RootTree(), and setEntryNumber().

std::shared_ptr<TTreeCache> edm::RootTree::rawTriggerTreeCache_
mutableprivate

Definition at line 220 of file RootTree.h.

Referenced by checkTriggerCacheImpl(), close(), and setEntryNumber().

std::unique_ptr<RootDelayedReader> edm::RootTree::rootDelayedReader_
private

Definition at line 239 of file RootTree.h.

Referenced by resetAndGetRootDelayedReader(), rootDelayedReader(), RootTree(), and setSignals().

TBranch* edm::RootTree::statusBranch_
private

Definition at line 244 of file RootTree.h.

EntryNumber edm::RootTree::switchOverEntry_
private

Definition at line 229 of file RootTree.h.

Referenced by RootTree(), setEntryNumber(), and startTraining().

std::unordered_set<TBranch*> edm::RootTree::trainedSet_
mutableprivate
bool edm::RootTree::trainNow_
private

Definition at line 228 of file RootTree.h.

Referenced by RootTree(), and setEntryNumber().

TTree* edm::RootTree::tree_
private
unsigned long edm::RootTree::treeAutoFlush_
private

Definition at line 234 of file RootTree.h.

Referenced by RootTree(), and setEntryNumber().

std::shared_ptr<TTreeCache> edm::RootTree::treeCache_
private
std::unordered_set<TBranch*> edm::RootTree::triggerSet_
mutableprivate

Definition at line 222 of file RootTree.h.

Referenced by checkTriggerCacheImpl(), RootTree(), setEntryNumber(), and startTraining().

std::shared_ptr<TTreeCache> edm::RootTree::triggerTreeCache_
mutableprivate

Definition at line 219 of file RootTree.h.

Referenced by checkTriggerCacheImpl(), close(), and setEntryNumber().