CMS 3D CMS Logo

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

Classes

struct  BranchInfo
 

Typedefs

typedef std::map< BranchKey const, BranchInfoBranchMap
 
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 int const defaultCacheSize = 20U * 1024 * 1024
 
unsigned int const defaultLearningEntries = 20U
 
unsigned int const defaultNonEventCacheSize = 1U * 1024 * 1024
 
unsigned int const defaultNonEventLearningEntries = 1U
 

Typedef Documentation

typedef std::map<BranchKey const, BranchInfo> edm::roottree::BranchMap

Definition at line 63 of file RootTree.h.

Definition at line 49 of file RootTree.h.

Function Documentation

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

Definition at line 483 of file RootTree.cc.

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

483  {
484  Int_t n = 0;
485  try {
486  n = tree->GetEntry(entryNumber);
487  }
488  catch(cms::Exception const& e) {
489  throw Exception (errors::FileReadError, "", e);
490  }
491  return n;
492  }
Definition: tree.py:1
std::unique_ptr< TTreeCache > edm::roottree::trainCache ( TTree *  tree,
InputFile file,
unsigned int  cacheSize,
char const *  branchNames 
)

Definition at line 495 of file RootTree.cc.

References edm::InputFile::GetCacheRead(), and edm::InputFile::SetCacheRead().

Referenced by edm::RootTree::branchEntryInfoBranch(), and edm::RootFile::RootFile().

495  {
496  tree->LoadTree(0);
497  tree->SetCacheSize(cacheSize);
498  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
499  if (nullptr != treeCache.get()) {
500  treeCache->StartLearningPhase();
501  treeCache->SetEntryRange(0, tree->GetEntries());
502  treeCache->AddBranch(branchNames, kTRUE);
503  treeCache->StopLearningPhase();
504  }
505  // We own the treeCache_.
506  // We make sure the treeCache_ is detached from the file,
507  // so that ROOT does not also delete it.
508  file.SetCacheRead(0);
509  return treeCache;
510  }
Definition: tree.py:1

Variable Documentation

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

Definition at line 47 of file RootTree.h.

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

Definition at line 46 of file RootTree.h.

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

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

Definition at line 48 of file RootTree.h.