16#ifndef _RMG_RUN_ACTION_HH_
17#define _RMG_RUN_ACTION_HH_
22namespace fs = std::filesystem;
24#include "G4AnalysisManager.hh"
25#include "G4UserRunAction.hh"
27#include "RMGHardware.hh"
28#include "RMGVOutputScheme.hh"
75 for (
auto& el : fOutputDataFields) el->ClearBeforeEvent();
82 struct OutputFilePaths {
87 [[nodiscard]] OutputFilePaths BuildOutputFile()
const;
88 [[nodiscard]] fs::path GetWorkerTmpPath(fs::path path, std::string extension)
const;
89 void PostprocessOutputFile(
int number_of_primaries)
const;
91 RMGRun* fRMGRun =
nullptr;
92 bool fIsPersistencyEnabled =
false;
93 bool fIsAnaManInitialized =
false;
94 RMGMasterGenerator* fRMGMasterGenerator =
nullptr;
95 OutputFilePaths fCurrentOutputFile;
97 int fCurrentPrintModulo = -1;
99 std::vector<std::shared_ptr<RMGVOutputScheme>> fOutputDataFields;
Definition RMGMasterGenerator.hh:28
void SetupAnalysisManager()
Configure the Geant4 analysis manager and register all output ntuples.
Definition RMGRunAction.cc:57
RMGRunAction(bool persistency=false)
Construct a run action with no primary generator hook-up.
Definition RMGRunAction.cc:51
void BeginOfRunAction(const G4Run *) override
Open the output file, notify schemes, and record the run start time.
Definition RMGRunAction.cc:95
void ClearOutputDataFields()
Invoke RMGVOutputScheme::ClearBeforeEvent on every registered scheme.
Definition RMGRunAction.hh:74
const auto & GetAllOutputDataFields()
Output schemes registered on this thread.
Definition RMGRunAction.hh:72
void EndOfRunAction(const G4Run *) override
Close the output file and move the temporary worker file to its final path.
Definition RMGRunAction.cc:212
int GetCurrentRunPrintModulo() const
Print-modulo value chosen for the run currently being processed.
Definition RMGRunAction.hh:69
G4Run * GenerateRun() override
Allocate and return an RMGRun instance for the current run.
Definition RMGRunAction.cc:46
Per-run object extending G4Run with bookkeeping needed by remage.
Definition RMGRun.hh:29