Loading...
Searching...
No Matches
Public Member Functions | List of all members
scavenger::RunAction Class Reference

#include <Doxymodules_medical.h>

Inheritance diagram for scavenger::RunAction:
G4UserRunAction

Public Member Functions

 RunAction ()
 
 ~RunAction () override=default
 
G4RunGenerateRun () override
 
void BeginOfRunAction (const G4Run *) override
 
void EndOfRunAction (const G4Run *) override
 

Detailed Description

Definition at line 352 of file Doxymodules_medical.h.

Constructor & Destructor Documentation

◆ RunAction()

scavenger::RunAction::RunAction ( )

Definition at line 41 of file RunAction.cc.

◆ ~RunAction()

scavenger::RunAction::~RunAction ( )
overridedefault

Member Function Documentation

◆ GenerateRun()

G4Run * scavenger::RunAction::GenerateRun ( )
override

Definition at line 46 of file RunAction.cc.

46 {
47 Run *run = new Run();
48 return run;
49}

◆ BeginOfRunAction()

void scavenger::RunAction::BeginOfRunAction ( const G4Run run)
override

Definition at line 53 of file RunAction.cc.

53 {
54 G4cout << "### Run " << run->GetRunID() << " starts." << G4endl;
55
56 // informs the runManager to save random number seed
57 G4RunManager::GetRunManager()->SetRandomNumberStore(false);
58}

◆ EndOfRunAction()

void scavenger::RunAction::EndOfRunAction ( const G4Run run)
override

Definition at line 62 of file RunAction.cc.

62 {
63 G4int nofEvents = run->GetNumberOfEvent();
64 if (nofEvents == 0) {
65 return;
66 }
67 const Run *scavengerRun = dynamic_cast<const Run *>(run);
68 G4double sumDose = scavengerRun->GetSumDose();
69 if (IsMaster()) {
70 G4cout
71 << G4endl
72 << "--------------------End of Global Run-----------------------"
73 << G4endl
74 << " The run has " << nofEvents << " events "
75 << G4endl;
76 auto masterScorer = dynamic_cast<ScoreSpecies *>(scavengerRun->GetPrimitiveScorer());
77 G4cout << "Number of events recorded by the species scorer = "
78 << masterScorer->GetNumberOfRecordedEvents()
79 << G4endl;
80 masterScorer->OutputAndClear();
81 } else {
82 G4cout
83 << G4endl
84 << "--------------------End of Local Run------------------------"
85 << G4endl
86 << " The run has " << nofEvents << " events"
87 << G4endl;
88 }
89 G4cout
90 << " Total energy deposited in the world volume : " << sumDose / eV << " eV"
91 << G4endl
92 << " ------------------------------------------------------------"
93 << G4endl
94 << G4endl;
95}

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

Applications | User Support | Publications | Collaboration