Skip to content

Commit

Permalink
add configurable stream name for TreeAlgo
Browse files Browse the repository at this point in the history
  • Loading branch information
sfranchel authored and mamerl committed Apr 24, 2024
1 parent df8b715 commit 12eff9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Root/TreeAlgo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ EL::StatusCode TreeAlgo :: setupJob (EL::Job& job)
job.useXAOD();
xAOD::Init("TreeAlgo").ignore();

EL::OutputStream outForTree("tree");
job.outputAdd (outForTree);
EL::OutputStream outForTree(m_treeStreamName);
if(!job.outputHas(m_treeStreamName)) job.outputAdd (outForTree);

return EL::StatusCode::SUCCESS;
}
Expand All @@ -41,7 +41,7 @@ EL::StatusCode TreeAlgo :: initialize ()
m_store = wk()->xaodStore();

// get the file we created already
TFile* treeFile = wk()->getOutputFile ("tree");
TFile* treeFile = wk()->getOutputFile (m_treeStreamName);
treeFile->mkdir(m_name.c_str());
treeFile->cd(m_name.c_str());

Expand Down Expand Up @@ -293,7 +293,7 @@ EL::StatusCode TreeAlgo :: execute ()
}
}

TFile* treeFile = wk()->getOutputFile ("tree");
TFile* treeFile = wk()->getOutputFile (m_treeStreamName);

// let's make the tdirectory and ttrees
for(const auto& systName: event_systNames){
Expand Down
1 change: 1 addition & 0 deletions xAODAnaHelpers/TreeAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class TreeAlgo : public xAH::Algorithm
public:
// choose whether the tree gets saved in the same directory as output histograms
bool m_outHistDir = false;
std::string m_treeStreamName = "tree";

// holds bools that control which branches are filled
std::string m_evtDetailStr = "";
Expand Down

0 comments on commit 12eff9b

Please sign in to comment.