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 Long64_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 51 of file RootTree.h.

typedef Long64_t edm::roottree::EntryNumber

Definition at line 39 of file RootTree.h.

Function Documentation

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

Definition at line 446 of file RootTree.cc.

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

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

446  {
447  Int_t n = 0;
448  try {
449  n = branch->GetEntry(entryNumber);
450  }
451  catch(cms::Exception const& e) {
452  throw Exception(errors::FileReadError, "", e);
453  }
454  return n;
455  }
Int_t edm::roottree::getEntry ( TTree *  tree,
EntryNumber  entryNumber 
)

Definition at line 458 of file RootTree.cc.

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

458  {
459  Int_t n = 0;
460  try {
461  n = tree->GetEntry(entryNumber);
462  }
463  catch(cms::Exception const& e) {
464  throw Exception (errors::FileReadError, "", e);
465  }
466  return n;
467  }
std::unique_ptr< TTreeCache > edm::roottree::trainCache ( TTree *  tree,
InputFile &  file,
unsigned int  cacheSize,
char const *  branchNames 
)

Definition at line 470 of file RootTree.cc.

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

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

470  {
471  tree->LoadTree(0);
472  tree->SetCacheSize(cacheSize);
473  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
474  if (0 != treeCache.get()) {
475  treeCache->StartLearningPhase();
476  treeCache->SetEntryRange(0, tree->GetEntries());
477  treeCache->AddBranch(branchNames, kTRUE);
478  treeCache->StopLearningPhase();
479  }
480  // We own the treeCache_.
481  // We make sure the treeCache_ is detached from the file,
482  // so that ROOT does not also delete it.
483  file.SetCacheRead(0);
484  return treeCache;
485  }

Variable Documentation

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

Definition at line 35 of file RootTree.h.

Referenced by edm::RootInputFileSequence::fillDescription().

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

Definition at line 37 of file RootTree.h.

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

Definition at line 36 of file RootTree.h.

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

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

Definition at line 38 of file RootTree.h.