CMS 3D CMS Logo

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

◆ EntryNumber

Definition at line 42 of file RootTree.h.

Function Documentation

◆ getEntry() [1/2]

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

◆ getEntry() [2/2]

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

Definition at line 537 of file RootTree.cc.

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

537  {
538  Int_t n = 0;
539  try {
540  n = tree->GetEntry(entryNumber);
541  } catch (cms::Exception const& e) {
542  throw Exception(errors::FileReadError, "", e);
543  }
544  return n;
545  }
Definition: tree.py:1

◆ trainCache()

std::unique_ptr< TTreeCache > edm::roottree::trainCache ( TTree *  tree,
InputFile file,
unsigned int  cacheSize,
char const *  branchNames 
)

Definition at line 547 of file RootTree.cc.

References haddnano::branchNames, and geometryDiff::file.

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

550  {
551  tree->LoadTree(0);
552  tree->SetCacheSize(cacheSize);
553  std::unique_ptr<TTreeCache> treeCache(dynamic_cast<TTreeCache*>(file.GetCacheRead()));
554  if (nullptr != treeCache.get()) {
555  treeCache->StartLearningPhase();
556  treeCache->SetEntryRange(0, tree->GetEntries());
557  treeCache->AddBranch(branchNames, kTRUE);
558  treeCache->StopLearningPhase();
559  }
560  // We own the treeCache_.
561  // We make sure the treeCache_ is detached from the file,
562  // so that ROOT does not also delete it.
563  file.SetCacheRead(nullptr);
564  return treeCache;
565  }
Definition: tree.py:1
branchNames
Definition: haddnano.py:54

Variable Documentation

◆ defaultCacheSize

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

◆ defaultLearningEntries

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

Definition at line 40 of file RootTree.h.

◆ defaultNonEventCacheSize

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().

◆ defaultNonEventLearningEntries

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

Definition at line 41 of file RootTree.h.

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