CMS 3D CMS Logo

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

Classes

struct  BranchInfo
 
class  BranchMap
 

Typedefs

using EntryNumber = IndexIntoFile::EntryNumber_t
 

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

Definition at line 42 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 525 of file RootTree.cc.

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

525  {
526  Int_t n = 0;
527  try {
528  n = tree->GetEntry(entryNumber);
529  } catch (cms::Exception const& e) {
530  throw Exception(errors::FileReadError, "", e);
531  }
532  return n;
533  }
std::unique_ptr< TTreeCache > edm::roottree::trainCache ( TTree *  tree,
InputFile file,
unsigned int  cacheSize,
char const *  branchNames 
)

Definition at line 535 of file RootTree.cc.

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

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

538  {
539  tree->LoadTree(0);
540  tree->SetCacheSize(cacheSize);
541  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
542  if (nullptr != treeCache.get()) {
543  treeCache->StartLearningPhase();
544  treeCache->SetEntryRange(0, tree->GetEntries());
545  treeCache->AddBranch(branchNames, kTRUE);
546  treeCache->StopLearningPhase();
547  }
548  // We own the treeCache_.
549  // We make sure the treeCache_ is detached from the file,
550  // so that ROOT does not also delete it.
551  file.SetCacheRead(nullptr);
552  return treeCache;
553  }
tuple branchNames
Definition: haddnano.py:54

Variable Documentation

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

Definition at line 40 of file RootTree.h.

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

Definition at line 39 of file RootTree.h.

Referenced by edm::RootFile::makeProcessBlockRootTrees(), and edm::RootFile::RootFile().

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

Definition at line 41 of file RootTree.h.

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