CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Typedefs | Functions | Variables
edm::roottree Namespace Reference

Classes

struct  BranchInfo
 

Typedefs

typedef std::map< BranchKey
const, BranchInfo
BranchMap
 
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 
)

Definition at line 490 of file RootTree.cc.

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

Referenced by edm::RootTree::fillBranchEntryMeta(), edm::RootFile::fillEventHistory(), edm::RootFile::readEntryDescriptionTree(), edm::RootFile::readParentageTree(), edm::OldProvenanceReader::readProvenance(), and edm::RootFile::RootFile().

490  {
491  Int_t n = 0;
492  try {
493  n = branch->GetEntry(entryNumber);
494  }
495  catch(cms::Exception const& e) {
496  throw Exception(errors::FileReadError, "", e);
497  }
498  return n;
499  }
Int_t edm::roottree::getEntry ( TTree *  tree,
EntryNumber  entryNumber 
)

Definition at line 502 of file RootTree.cc.

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

502  {
503  Int_t n = 0;
504  try {
505  n = tree->GetEntry(entryNumber);
506  }
507  catch(cms::Exception const& e) {
508  throw Exception (errors::FileReadError, "", e);
509  }
510  return n;
511  }
std::unique_ptr< TTreeCache > edm::roottree::trainCache ( TTree *  tree,
InputFile file,
unsigned int  cacheSize,
char const *  branchNames 
)

Definition at line 514 of file RootTree.cc.

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

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

514  {
515  tree->LoadTree(0);
516  tree->SetCacheSize(cacheSize);
517  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
518  if (nullptr != treeCache.get()) {
519  treeCache->StartLearningPhase();
520  treeCache->SetEntryRange(0, tree->GetEntries());
521  treeCache->AddBranch(branchNames, kTRUE);
522  treeCache->StopLearningPhase();
523  }
524  // We own the treeCache_.
525  // We make sure the treeCache_ is detached from the file,
526  // so that ROOT does not also delete it.
527  file.SetCacheRead(0);
528  return treeCache;
529  }

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.