GGS(GenericGEANT4Simulation)Software  2.99.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Macros
Public Member Functions
GGSRngStateAction Class Reference

Stores the name of the random engine and its status at the beginning of each event. More...

#include <GGSRngStateAction.h>

Inheritance diagram for GGSRngStateAction:
Inheritance graph
[legend]
Collaboration diagram for GGSRngStateAction:
Collaboration graph
[legend]

Public Member Functions

 GGSRngStateAction ()
 Constructor.
 
void BeginOfEventAction (const G4Event *)
 Records the status of the random engine at the beginning of the event.
 
void BeginOfRunAction (const G4Run *run)
 Opens the output file for the current run and prepares the output tree. More...
 
void EndOfRunAction (const G4Run *)
 Closes the output file for the current run.
 
- Public Member Functions inherited from GGSUserAction
 GGSUserAction ()
 Constructor. More...
 
virtual ~GGSUserAction ()
 Destructor.
 
G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *)
 Override of the ClassifyNewTrack method. More...
 

Detailed Description

Stores the name of the random engine and its status at the beginning of each event.

Definition at line 26 of file GGSRngStateAction.h.

Member Function Documentation

void GGSRngStateAction::BeginOfRunAction ( const G4Run *  run)

Opens the output file for the current run and prepares the output tree.

Parameters
runThe current run.

Definition at line 34 of file GGSRngStateAction.cpp.

34  {
35  _outRootFile = GGSRootFileService::GetInstance().GetFileForThisRun("", run);
36  _outTree = GGSRootFileService::GetInstance().GetDefaultTree(_outRootFile);
37  _outTree->SetTitle(TString(_outTree->GetTitle()) + "RngState ");
38  _outTree->Branch("rngState", &_rngState);
39 
40  if (GGSRootFileService::GetInstance().GetOutputMode() == GGSRootFileService::OutputMode::MULTIFILE ||
41  !(G4Threading::IsMultithreadedApplication())) {
42  std::string rngName = G4Random::getTheEngine()->name();
43  _outRootFile->WriteObjectAny(&rngName, TClass::GetClass("std::string"), "rngName");
44  }
45 }
TFile * GetFileForThisRun(const std::filesystem::path &baseName, const G4Run *run)
Opens a file for a given run and returns a pointer to it.
TTree * GetDefaultTree(TFile *file)
Gets the default tree for this file.
static GGSRootFileService & GetInstance()
Get reference to GGSRootFileService unique instance.

The documentation for this class was generated from the following files: