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

typedef Long64_t edm::roottree::EntryNumber

Definition at line 38 of file RootTree.h.

Function Documentation

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

Definition at line 273 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().

273  {
274  Int_t n = 0;
275  try {
276  n = branch->GetEntry(entryNumber);
277  }
278  catch(cms::Exception const& e) {
279  throw Exception(errors::FileReadError, "", e);
280  }
281  return n;
282  }
Int_t edm::roottree::getEntry ( TTree *  tree,
EntryNumber  entryNumber 
)

Definition at line 285 of file RootTree.cc.

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

285  {
286  Int_t n = 0;
287  try {
288  n = tree->GetEntry(entryNumber);
289  }
290  catch(cms::Exception const& e) {
291  throw Exception (errors::FileReadError, "", e);
292  }
293  return n;
294  }
std::unique_ptr< TTreeCache > edm::roottree::trainCache ( TTree *  tree,
InputFile &  file,
unsigned int  cacheSize,
char const *  branchNames 
)

Definition at line 297 of file RootTree.cc.

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

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

297  {
298  tree->LoadTree(0);
299  tree->SetCacheSize(cacheSize);
300  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
301  if (0 != treeCache.get()) {
302  treeCache->StartLearningPhase();
303  treeCache->SetEntryRange(0, tree->GetEntries());
304  treeCache->AddBranch(branchNames, kTRUE);
305  treeCache->StopLearningPhase();
306  }
307  // We own the treeCache_.
308  // We make sure the treeCache_ is detached from the file,
309  // so that ROOT does not also delete it.
310  file.SetCacheRead(0);
311  return treeCache;
312  }

Variable Documentation

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

Definition at line 34 of file RootTree.h.

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

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

Definition at line 36 of file RootTree.h.

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

Definition at line 35 of file RootTree.h.

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

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

Definition at line 37 of file RootTree.h.