Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
art::RootOutputTree Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/art/v2_13_00/source/art/Framework/IO/Root/RootOutputTree.h"

Public Member Functions

template<typename Aux >
 RootOutputTree (cet::exempt_ptr< TFile > filePtr, BranchType const branchType, Aux const *&pAux, ProductProvenances *&pProductProvenanceVector, int const bufSize, int const splitLevel, int64_t const treeMaxVirtualSize, int64_t const saveMemoryObjectThreshold)
 
 RootOutputTree (RootOutputTree const &)=delete
 
RootOutputTreeoperator= (RootOutputTree const &)=delete
 
bool isValid () const
 
void setOutputBranchAddress (BranchDescription const &pd, void const *&pProd)
 
void resetOutputBranchAddress (BranchDescription const &)
 
void addOutputBranch (BranchDescription const &, void const *&pProd)
 
bool checkSplitLevelAndBasketSize (cet::exempt_ptr< TTree const >) const
 
bool fastCloneTree (cet::exempt_ptr< TTree const >)
 
void fillTree ()
 
void writeTree () const
 
TTree * tree () const
 
TTree * metaTree () const
 
void setEntries ()
 
void beginInputFile (bool fastCloning)
 
bool uncloned (std::string const &branchName) const
 

Static Public Member Functions

static TTree * makeTTree (TFile *, std::string const &name, int splitLevel)
 
static void writeTTree (TTree *) noexcept(false)
 

Private Member Functions

void fillTree_metaTreePart ()
 
void fillTree_producedBranchesPart ()
 
void fillTree_unclonedReadBranchesPart ()
 
void fillTree_readBranchesPart ()
 

Private Attributes

cet::exempt_ptr< TFile > filePtr_
 
TTree *const tree_
 
TTree *const metaTree_
 
TBranch * auxBranch_ {nullptr}
 
TBranch * productProvenanceBranch_ {nullptr}
 
std::vector< TBranch * > producedBranches_ {}
 
std::vector< TBranch * > metaBranches_ {}
 
std::vector< TBranch * > readBranches_ {}
 
std::vector< TBranch * > unclonedReadBranches_ {}
 
std::set< std::stringunclonedReadBranchNames_ {}
 
bool fastCloningEnabled_ {false}
 
int basketSize_
 
int splitLevel_
 
int64_t saveMemoryObjectThreshold_
 
int nEntries_ {0}
 

Detailed Description

Definition at line 24 of file RootOutputTree.h.

Constructor & Destructor Documentation

template<typename Aux >
art::RootOutputTree::RootOutputTree ( cet::exempt_ptr< TFile >  filePtr,
BranchType const  branchType,
Aux const *&  pAux,
ProductProvenances *&  pProductProvenanceVector,
int const  bufSize,
int const  splitLevel,
int64_t const  treeMaxVirtualSize,
int64_t const  saveMemoryObjectThreshold 
)
inline

Definition at line 35 of file RootOutputTree.h.

References addOutputBranch(), auxBranch_, basketSize_, art::BranchTypeToAuxiliaryBranchName(), art::BranchTypeToMetaDataTreeName(), art::BranchTypeToProductTreeName(), checkSplitLevelAndBasketSize(), fastCloneTree(), fillTree(), isValid(), makeTTree(), metaBranches_, metaTree_, operator=(), productProvenanceBranch_, art::productProvenanceBranchName(), readBranches_, resetOutputBranchAddress(), saveMemoryObjectThreshold_, setOutputBranchAddress(), splitLevel_, tree_, and writeTree().

43  : filePtr_{filePtr}
44  , tree_{makeTTree(filePtr.get(),
45  BranchTypeToProductTreeName(branchType),
46  splitLevel)}
47  , metaTree_{makeTTree(filePtr.get(),
48  BranchTypeToMetaDataTreeName(branchType),
49  0)}
50  , basketSize_{bufSize}
51  , splitLevel_{splitLevel}
52  , saveMemoryObjectThreshold_{saveMemoryObjectThreshold}
53  {
54  if (treeMaxVirtualSize >= 0) {
55  tree_->SetMaxVirtualSize(treeMaxVirtualSize);
56  }
57  auxBranch_ = tree_->Branch(
58  BranchTypeToAuxiliaryBranchName(branchType).c_str(), &pAux, bufSize, 0);
59  delete pAux;
60  pAux = nullptr;
61  readBranches_.push_back(auxBranch_);
63  metaTree_->Branch(productProvenanceBranchName(branchType).c_str(),
64  &pProductProvenanceVector,
65  bufSize,
66  0);
68  }
std::string const & productProvenanceBranchName(BranchType)
std::vector< TBranch * > readBranches_
cet::exempt_ptr< TFile > filePtr_
TTree *const metaTree_
pointer get() const noexcept
Definition: exempt_ptr.h:146
std::string const & BranchTypeToProductTreeName(BranchType)
std::string const & BranchTypeToAuxiliaryBranchName(BranchType)
TBranch * productProvenanceBranch_
std::string const & BranchTypeToMetaDataTreeName(BranchType)
static TTree * makeTTree(TFile *, std::string const &name, int splitLevel)
int64_t saveMemoryObjectThreshold_
std::vector< TBranch * > metaBranches_
art::RootOutputTree::RootOutputTree ( RootOutputTree const &  )
delete

Member Function Documentation

void art::RootOutputTree::addOutputBranch ( BranchDescription const &  ,
void const *&  pProd 
)

Referenced by RootOutputTree().

void art::RootOutputTree::beginInputFile ( bool  fastCloning)
inline

Definition at line 117 of file RootOutputTree.h.

References fastCloningEnabled_.

118  {
119  fastCloningEnabled_ = fastCloning;
120  }
bool art::RootOutputTree::checkSplitLevelAndBasketSize ( cet::exempt_ptr< TTree const >  ) const

Referenced by RootOutputTree().

bool art::RootOutputTree::fastCloneTree ( cet::exempt_ptr< TTree const >  )

Referenced by RootOutputTree().

void art::RootOutputTree::fillTree ( )

Referenced by RootOutputTree().

void art::RootOutputTree::fillTree_metaTreePart ( )
private

Referenced by uncloned().

void art::RootOutputTree::fillTree_producedBranchesPart ( )
private

Referenced by uncloned().

void art::RootOutputTree::fillTree_readBranchesPart ( )
private

Referenced by uncloned().

void art::RootOutputTree::fillTree_unclonedReadBranchesPart ( )
private

Referenced by uncloned().

bool art::RootOutputTree::isValid ( ) const

Referenced by RootOutputTree().

static TTree* art::RootOutputTree::makeTTree ( TFile *  ,
std::string const &  name,
int  splitLevel 
)
static

Referenced by RootOutputTree().

TTree* art::RootOutputTree::metaTree ( ) const
inline

Definition at line 95 of file RootOutputTree.h.

References metaTree_.

96  {
97  return metaTree_;
98  }
TTree *const metaTree_
RootOutputTree& art::RootOutputTree::operator= ( RootOutputTree const &  )
delete

Referenced by RootOutputTree().

void art::RootOutputTree::resetOutputBranchAddress ( BranchDescription const &  )

Referenced by RootOutputTree().

void art::RootOutputTree::setEntries ( )
inline

Definition at line 101 of file RootOutputTree.h.

References metaTree_, and tree_.

102  {
103  // The member trees are filled by filling their
104  // branches individually, which ends up not setting
105  // the tree entry count. Tell the trees to set their
106  // entry count based on their branches (all branches
107  // must have the same number of entries).
108  if (tree_->GetNbranches() != 0) {
109  tree_->SetEntries(-1);
110  }
111  if (metaTree_->GetNbranches() != 0) {
112  metaTree_->SetEntries(-1);
113  }
114  }
TTree *const metaTree_
void art::RootOutputTree::setOutputBranchAddress ( BranchDescription const &  pd,
void const *&  pProd 
)

Referenced by RootOutputTree().

TTree* art::RootOutputTree::tree ( ) const
inline

Definition at line 89 of file RootOutputTree.h.

References tree_.

90  {
91  return tree_;
92  }
bool art::RootOutputTree::uncloned ( std::string const &  branchName) const
inline
void art::RootOutputTree::writeTree ( ) const

Referenced by RootOutputTree().

static void art::RootOutputTree::writeTTree ( TTree *  )
staticnoexcept

Member Data Documentation

TBranch* art::RootOutputTree::auxBranch_ {nullptr}
private

Definition at line 139 of file RootOutputTree.h.

Referenced by RootOutputTree().

int art::RootOutputTree::basketSize_
private

Definition at line 153 of file RootOutputTree.h.

Referenced by RootOutputTree().

bool art::RootOutputTree::fastCloningEnabled_ {false}
private

Definition at line 151 of file RootOutputTree.h.

Referenced by beginInputFile().

cet::exempt_ptr<TFile> art::RootOutputTree::filePtr_
private

Definition at line 136 of file RootOutputTree.h.

std::vector<TBranch*> art::RootOutputTree::metaBranches_ {}
private

Definition at line 143 of file RootOutputTree.h.

Referenced by RootOutputTree().

TTree* const art::RootOutputTree::metaTree_
private

Definition at line 138 of file RootOutputTree.h.

Referenced by metaTree(), RootOutputTree(), and setEntries().

int art::RootOutputTree::nEntries_ {0}
private

Definition at line 156 of file RootOutputTree.h.

std::vector<TBranch*> art::RootOutputTree::producedBranches_ {}
private

Definition at line 142 of file RootOutputTree.h.

TBranch* art::RootOutputTree::productProvenanceBranch_ {nullptr}
private

Definition at line 140 of file RootOutputTree.h.

Referenced by RootOutputTree().

std::vector<TBranch*> art::RootOutputTree::readBranches_ {}
private

Definition at line 144 of file RootOutputTree.h.

Referenced by RootOutputTree().

int64_t art::RootOutputTree::saveMemoryObjectThreshold_
private

Definition at line 155 of file RootOutputTree.h.

Referenced by RootOutputTree().

int art::RootOutputTree::splitLevel_
private

Definition at line 154 of file RootOutputTree.h.

Referenced by RootOutputTree().

TTree* const art::RootOutputTree::tree_
private

Definition at line 137 of file RootOutputTree.h.

Referenced by RootOutputTree(), setEntries(), and tree().

std::vector<TBranch*> art::RootOutputTree::unclonedReadBranches_ {}
private

Definition at line 145 of file RootOutputTree.h.

std::set<std::string> art::RootOutputTree::unclonedReadBranchNames_ {}
private

Definition at line 146 of file RootOutputTree.h.

Referenced by uncloned().


The documentation for this class was generated from the following file: