Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
B3aRunAction Class Reference

Run action class. More...

#include <B3aRunAction.hh>

Inheritance diagram for B3aRunAction:
Collaboration diagram for B3aRunAction:

Public Member Functions

 B3aRunAction ()
 
virtual ~B3aRunAction ()
 
virtual void BeginOfRunAction (const G4Run *)
 
virtual void EndOfRunAction (const G4Run *)
 
void CountEvent ()
 
void SumDose (G4double dose)
 
- Public Member Functions inherited from G4UserRunAction
 G4UserRunAction ()
 
virtual ~G4UserRunAction ()
 
virtual G4RunGenerateRun ()
 
virtual void SetMaster (G4bool val=true)
 
G4bool IsMaster () const
 

Additional Inherited Members

- Protected Attributes inherited from G4UserRunAction
G4bool isMaster
 

Detailed Description

Run action class.

Definition at line 40 of file B3aRunAction.hh.

Constructor & Destructor Documentation

B3aRunAction::B3aRunAction ( )

Definition at line 42 of file B3aRunAction.cc.

43  : G4UserRunAction(),
44  fGoodEvents(0),
45  fSumDose(0.)
46 {
47  //add new units for dose
48  //
49  const G4double milligray = 1.e-3*gray;
50  const G4double microgray = 1.e-6*gray;
51  const G4double nanogray = 1.e-9*gray;
52  const G4double picogray = 1.e-12*gray;
53 
54  new G4UnitDefinition("milligray", "milliGy" , "Dose", milligray);
55  new G4UnitDefinition("microgray", "microGy" , "Dose", microgray);
56  new G4UnitDefinition("nanogray" , "nanoGy" , "Dose", nanogray);
57  new G4UnitDefinition("picogray" , "picoGy" , "Dose", picogray);
58 
59  // Register accumulable to the accumulable manager
61  accumulableManager->RegisterAccumulable(fGoodEvents);
62  accumulableManager->RegisterAccumulable(fSumDose);
63 }
static G4AccumulableManager * Instance()
static constexpr double microgray
Definition: G4SIunits.hh:312
G4bool RegisterAccumulable(G4Accumulable< T > &accumulable)
static constexpr double gray
Definition: G4SIunits.hh:309
static constexpr double milligray
Definition: G4SIunits.hh:311
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

B3aRunAction::~B3aRunAction ( )
virtual

Definition at line 67 of file B3aRunAction.cc.

68 { }

Member Function Documentation

void B3aRunAction::BeginOfRunAction ( const G4Run run)
virtual

Reimplemented from G4UserRunAction.

Definition at line 72 of file B3aRunAction.cc.

73 {
74  G4cout << "### Run " << run->GetRunID() << " start." << G4endl;
75 
76  // reset accumulables to their initial values
78  accumulableManager->Reset();
79 
80  //inform the runManager to save random number seed
82 }
void SetRandomNumberStore(G4bool flag)
static G4AccumulableManager * Instance()
G4GLOB_DLL std::ostream G4cout
G4int GetRunID() const
Definition: G4Run.hh:76
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void B3aRunAction::CountEvent ( )
inline

Definition at line 49 of file B3aRunAction.hh.

49 { fGoodEvents += 1; };

Here is the caller graph for this function:

void B3aRunAction::EndOfRunAction ( const G4Run run)
virtual

Reimplemented from G4UserRunAction.

Definition at line 86 of file B3aRunAction.cc.

87 {
88  G4int nofEvents = run->GetNumberOfEvent();
89  if (nofEvents == 0) return;
90 
91  // Merge accumulables
93  accumulableManager->Merge();
94 
95  // Run conditions
96  // note: There is no primary generator action object for "master"
97  // run manager for multi-threaded mode.
98  const B3PrimaryGeneratorAction* generatorAction
99  = static_cast<const B3PrimaryGeneratorAction*>(
101  G4String partName;
102  if (generatorAction)
103  {
104  G4ParticleDefinition* particle
105  = generatorAction->GetParticleGun()->GetParticleDefinition();
106  partName = particle->GetParticleName();
107  }
108 
109  // Print results
110  //
111  if (IsMaster())
112  {
113  G4cout
114  << G4endl
115  << "--------------------End of Global Run-----------------------"
116  << G4endl
117  << " The run was " << nofEvents << " events ";
118  }
119  else
120  {
121  G4cout
122  << G4endl
123  << "--------------------End of Local Run------------------------"
124  << G4endl
125  << " The run was " << nofEvents << " "<< partName;
126  }
127  G4cout
128  << "; Nb of 'good' e+ annihilations: " << fGoodEvents.GetValue() << G4endl
129  << " Total dose in patient : " << G4BestUnit(fSumDose.GetValue(),"Dose")
130  << G4endl
131  << "------------------------------------------------------------" << G4endl
132  << G4endl;
133 }
const G4VUserPrimaryGeneratorAction * GetUserPrimaryGeneratorAction() const
const G4ParticleGun * GetParticleGun() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
static G4AccumulableManager * Instance()
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfEvent() const
Definition: G4Run.hh:79
G4bool IsMaster() const
T GetValue() const
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4ParticleDefinition * GetParticleDefinition() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void B3aRunAction::SumDose ( G4double  dose)
inline

Definition at line 50 of file B3aRunAction.hh.

50 { fSumDose += dose; };

Here is the caller graph for this function:


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