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

Commit

Permalink
need to enter the output event file before creating and writing
Browse files Browse the repository at this point in the history
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 the histograms we need to enter
the output event file again here so that our run tree ends up
in the correct location.
  • Loading branch information
tomeichlersmith committed Jan 30, 2024
1 parent 3fb33da commit 1eb1fba
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit 1eb1fba

Please sign in to comment.