CMS 3D CMS Logo

Classes | Typedefs | Functions | Variables
edm::roottree Namespace Reference

Classes

struct  BranchInfo
 
class  BranchMap
 

Typedefs

typedef IndexIntoFile::EntryNumber_t EntryNumber
 

Functions

Int_t getEntry (TBranch *branch, EntryNumber entryNumber)
 
Int_t getEntry (TTree *tree, EntryNumber entryNumber)
 
std::unique_ptr< TTreeCache > trainCache (TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
 

Variables

unsigned const int defaultCacheSize = 20U * 1024 * 1024
 
unsigned const int defaultLearningEntries = 20U
 
unsigned const int defaultNonEventCacheSize = 1U * 1024 * 1024
 
unsigned const int defaultNonEventLearningEntries = 1U
 

Typedef Documentation

◆ EntryNumber

Definition at line 51 of file RootTree.h.

Function Documentation

◆ getEntry() [1/2]

Int_t edm::roottree::getEntry ( TBranch *  branch,
EntryNumber  entryNumber 
)

◆ getEntry() [2/2]

Int_t edm::roottree::getEntry ( TTree *  tree,
EntryNumber  entryNumber 
)

Definition at line 506 of file RootTree.cc.

506  {
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  }

References MillePedeFileConverter_cfg::e, Exception, edm::errors::FileReadError, and dqmiodumpmetadata::n.

◆ trainCache()

std::unique_ptr< TTreeCache > edm::roottree::trainCache ( TTree *  tree,
InputFile file,
unsigned int  cacheSize,
char const *  branchNames 
)

Definition at line 516 of file RootTree.cc.

519  {
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  }

References FrontierConditions_GlobalTag_cff::file.

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

Variable Documentation

◆ defaultCacheSize

unsigned const int edm::roottree::defaultCacheSize = 20U * 1024 * 1024

◆ defaultLearningEntries

unsigned const int edm::roottree::defaultLearningEntries = 20U

Definition at line 49 of file RootTree.h.

◆ defaultNonEventCacheSize

unsigned const int edm::roottree::defaultNonEventCacheSize = 1U * 1024 * 1024

Definition at line 48 of file RootTree.h.

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

◆ defaultNonEventLearningEntries

unsigned const int edm::roottree::defaultNonEventLearningEntries = 1U

Definition at line 50 of file RootTree.h.

dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:152
tree
Definition: tree.py:1
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
Exception
Definition: hltDiff.cc:246
cms::Exception
Definition: Exception.h:70
edm::errors::FileReadError
Definition: EDMException.h:50
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37