#include <RootOutputTree.h>
Definition at line 24 of file RootOutputTree.h.
Definition at line 34 of file RootOutputTree.h.
53 if (treeMaxVirtualSize >= 0) {
54 tree_.load()->SetMaxVirtualSize(treeMaxVirtualSize);
56 auto auxBranch =
tree_.load()->Branch(
61 auto productProvenanceBranch = metaTree_.load()->Branch(
63 &pProductProvenanceVector,
std::string const & BranchTypeToProductTreeName(BranchType const bt)
std::string const & productProvenanceBranchName(BranchType const bt)
std::vector< TBranch * > readBranches_
std::string const & BranchTypeToMetaDataTreeName(BranchType const bt)
cet::exempt_ptr< TFile > filePtr_
pointer get() const noexcept
std::atomic< bool > fastCloningEnabled_
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const bt)
std::atomic< int > nEntries_
std::atomic< int > splitLevel_
std::atomic< TTree * > tree_
static TTree * makeTTree(TFile *, std::string const &name, int splitLevel)
std::atomic< int > basketSize_
std::atomic< TTree * > metaTree_
std::vector< TBranch * > metaBranches_
std::atomic< int64_t > saveMemoryObjectThreshold_
void art::RootOutputTree::addOutputBranch |
( |
BranchDescription const & |
bd, |
|
|
void const *& |
pProd |
|
) |
| |
Definition at line 192 of file RootOutputTree.cc.
195 TClassRef cls = TClass::GetClass(bd.wrappedName().c_str());
196 if (TBranch* br =
tree_.load()->GetBranch(bd.branchName().c_str())) {
198 if (pProd ==
nullptr) {
206 EDProduct* prod =
reinterpret_cast<EDProduct*
>(cls->New());
208 br->SetAddress(&pProd);
214 auto bsize = bd.basketSize();
218 auto splitlvl = bd.splitLevel();
222 if (pProd !=
nullptr) {
224 <<
"OutputItem product pointer is not nullptr!\n";
226 EDProduct* prod =
reinterpret_cast<EDProduct*
>(cls->New());
228 TBranch* branch =
tree_.load()->Branch(bd.branchName().c_str(),
229 bd.wrappedName().c_str(),
242 branch->SetCompressionSettings(bd.compression());
247 std::unique_ptr<EDProduct>
dummy(static_cast<EDProduct*>(cls->New()));
251 auto cnt = branch->Fill();
258 branch->FlushBaskets();
259 branch->DropBaskets(
"all");
std::vector< TBranch * > readBranches_
static int constexpr invalidCompression
std::vector< TBranch * > producedBranches_
std::atomic< int > nEntries_
static int constexpr invalidSplitLevel
std::atomic< int > splitLevel_
std::atomic< TTree * > tree_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
cet::LibraryManager dummy("noplugin")
std::atomic< int > basketSize_
static int constexpr invalidBasketSize
std::atomic< int64_t > saveMemoryObjectThreshold_
void art::RootOutputTree::beginInputFile |
( |
bool |
fastCloning | ) |
|
|
inline |
bool art::RootOutputTree::checkSplitLevelAndBasketSize |
( |
cet::exempt_ptr< TTree const > |
inputTree | ) |
const |
Definition at line 49 of file RootOutputTree.cc.
53 if (inputTree ==
nullptr) {
57 if (outputBranch ==
nullptr) {
60 TBranch* inputBranch =
61 const_cast<TTree*
>(inputTree.
get())->GetBranch(outputBranch->GetName());
62 if (inputBranch ==
nullptr) {
65 if ((inputBranch->GetSplitLevel() != outputBranch->GetSplitLevel()) ||
66 (inputBranch->GetBasketSize() != outputBranch->GetBasketSize())) {
68 <<
"Fast Cloning disabled because split level or basket size " MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< TBranch * > readBranches_
pointer get() const noexcept
bool art::RootOutputTree::fastCloneTree |
( |
cet::exempt_ptr< TTree const > |
intree | ) |
|
Definition at line 98 of file RootOutputTree.cc.
107 if (intree->GetEntries() != 0) {
108 TTreeCloner cloner(const_cast<TTree*>(intree.
get()),
111 TTreeCloner::kIgnoreMissingTopLevel |
112 TTreeCloner::kNoWarnings |
113 TTreeCloner::kNoFileCache);
114 if (cloner.IsValid()) {
115 tree_.load()->SetEntries(
tree_.load()->GetEntries() +
116 intree->GetEntries());
122 <<
"INFO: Unable to fast clone tree " << intree->GetName() <<
'\n' 123 <<
"INFO: ROOT reason is:\n" 124 <<
"INFO: " << cloner.GetWarning() <<
'\n' 125 <<
"INFO: Processing will continue, tree will be slow cloned.";
129 if (
val->GetEntries() !=
tree_.load()->GetEntries()) {
std::set< std::string > unclonedReadBranchNames_
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< TBranch * > readBranches_
pointer get() const noexcept
std::atomic< bool > fastCloningEnabled_
std::vector< TBranch * > unclonedReadBranches_
std::atomic< TTree * > tree_
void art::RootOutputTree::fillTree |
( |
| ) |
|
Definition at line 153 of file RootOutputTree.cc.
std::vector< TBranch * > readBranches_
std::atomic< bool > fastCloningEnabled_
static void fillTreeBranches(TTree *, vector< TBranch * > const &branches, bool saveMemory, int64_t threshold)
std::vector< TBranch * > producedBranches_
std::atomic< int > nEntries_
std::vector< TBranch * > unclonedReadBranches_
std::atomic< TTree * > tree_
std::atomic< TTree * > metaTree_
std::vector< TBranch * > metaBranches_
std::atomic< int64_t > saveMemoryObjectThreshold_
bool art::RootOutputTree::isValid |
( |
| ) |
const |
TTree * art::RootOutputTree::makeTTree |
( |
TFile * |
filePtr, |
|
|
std::string const & |
name, |
|
|
int |
splitLevel |
|
) |
| |
|
static |
Definition at line 30 of file RootOutputTree.cc.
32 TTree*
tree =
new TTree(
name.c_str(),
"", splitLevel);
35 <<
"Failed to create the tree: " <<
name <<
"\n";
37 if (tree->IsZombie()) {
39 <<
"Tree: " <<
name <<
" is a zombie.\n";
41 tree->SetDirectory(filePtr);
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
TTree* art::RootOutputTree::metaTree |
( |
| ) |
const |
|
inline |
Definition at line 179 of file RootOutputTree.cc.
181 TBranch* br =
tree_.load()->GetBranch(bd.branchName().c_str());
185 tree_.load()->ResetBranchAddress(br);
std::atomic< TTree * > tree_
void art::RootOutputTree::setEntries |
( |
| ) |
|
|
inline |
Definition at line 90 of file RootOutputTree.h.
97 if (
tree_.load()->GetNbranches() != 0) {
98 tree_.load()->SetEntries(-1);
100 if (
metaTree_.load()->GetNbranches() != 0) {
std::atomic< TTree * > tree_
std::atomic< TTree * > metaTree_
TTree* art::RootOutputTree::tree |
( |
| ) |
const |
|
inline |
bool art::RootOutputTree::uncloned |
( |
std::string const & |
branchName | ) |
const |
|
inline |
Definition at line 110 of file RootOutputTree.h.
std::set< std::string > unclonedReadBranchNames_
void art::RootOutputTree::writeTree |
( |
| ) |
const |
Definition at line 91 of file RootOutputTree.cc.
static void writeTTree(TTree *) noexcept(false)
std::atomic< TTree * > tree_
std::atomic< TTree * > metaTree_
void art::RootOutputTree::writeTTree |
( |
TTree * |
tree | ) |
|
|
staticnoexcept |
std::atomic<int> art::RootOutputTree::basketSize_ |
|
private |
std::atomic<bool> art::RootOutputTree::fastCloningEnabled_ |
|
private |
std::vector<TBranch*> art::RootOutputTree::metaBranches_ {} |
|
private |
std::atomic<TTree*> art::RootOutputTree::metaTree_ |
|
private |
std::atomic<int> art::RootOutputTree::nEntries_ |
|
private |
std::vector<TBranch*> art::RootOutputTree::producedBranches_ {} |
|
private |
std::vector<TBranch*> art::RootOutputTree::readBranches_ {} |
|
private |
std::atomic<int64_t> art::RootOutputTree::saveMemoryObjectThreshold_ |
|
private |
std::atomic<int> art::RootOutputTree::splitLevel_ |
|
private |
std::atomic<TTree*> art::RootOutputTree::tree_ |
|
private |
std::vector<TBranch*> art::RootOutputTree::unclonedReadBranches_ {} |
|
private |
std::set<std::string> art::RootOutputTree::unclonedReadBranchNames_ {} |
|
private |
The documentation for this class was generated from the following files: