Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

need to enter the output event file before creating and writing #93

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Framework/EventFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,17 @@ void EventFile::writeRunTree() {
fileName_ + "'.");
}

/**
* ROOT requires us to be in the correct directory when we create
* the output TTree for us to have it written into the correct
* location.
*
* In order to allow downstream processors to getHistoDirectory()
* and enter that directory for this histograms we need to enter
* the output event file again here so that our run tree ends up
* in the correct location.
*/
file_->cd();
runTree = new TTree("LDMX_Run", "LDMX run header");

// create the branch on this tree
Expand Down
Loading