37 _outTree->SetTitle(TString(_outTree->GetTitle()) +
"RngState ");
38 _outTree->Branch(
"rngState", &_rngState);
41 !(G4Threading::IsMultithreadedApplication())) {
42 std::string rngName = G4Random::getTheEngine()->name();
43 _outRootFile->WriteObjectAny(&rngName, TClass::GetClass(
"std::string"),
"rngName");
49 _outRootFile =
nullptr;
GGSRngStateAction()
Constructor.
TFile * GetFileForThisRun(const std::filesystem::path &baseName, const G4Run *run)
Opens a file for a given run and returns a pointer to it.
Stores the name of the random engine and its status at the beginning of each event.
void CloseFileForThisRun(const std::filesystem::path &baseName, const G4Run *run)
Closes the ROOT output file.
void BeginOfEventAction(const G4Event *)
Records the status of the random engine at the beginning of the event.
Class with additional functionalities for run managers.
void EndOfRunAction(const G4Run *)
Closes the output file for the current run.
const std::string & GetRandomStateAtBeginOfEvent()
Getter method for random engine state at the beginning of the current event.
TTree * GetDefaultTree(TFile *file)
Gets the default tree for this file.
static GGSRootFileService & GetInstance()
Get reference to GGSRootFileService unique instance.
void BeginOfRunAction(const G4Run *run)
Opens the output file for the current run and prepares the output tree.
#define RegisterUA(uaClassName)
Macro for registration of user actions classes.