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

Run action class. More...

#include <B3bRunAction.hh>

Inheritance diagram for B3bRunAction:
Collaboration diagram for B3bRunAction:

Public Member Functions

 B3bRunAction ()
 
virtual ~B3bRunAction ()
 
virtual G4RunGenerateRun ()
 
virtual void BeginOfRunAction (const G4Run *)
 
virtual void EndOfRunAction (const G4Run *)
 
- Public Member Functions inherited from G4UserRunAction
 G4UserRunAction ()
 
virtual ~G4UserRunAction ()
 
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 41 of file B3bRunAction.hh.

Constructor & Destructor Documentation

B3bRunAction::B3bRunAction ( )

Definition at line 42 of file B3bRunAction.cc.

43  : G4UserRunAction()
44 {
45  //add new units for dose
46  //
47  const G4double milligray = 1.e-3*gray;
48  const G4double microgray = 1.e-6*gray;
49  const G4double nanogray = 1.e-9*gray;
50  const G4double picogray = 1.e-12*gray;
51 
52  new G4UnitDefinition("milligray", "milliGy" , "Dose", milligray);
53  new G4UnitDefinition("microgray", "microGy" , "Dose", microgray);
54  new G4UnitDefinition("nanogray" , "nanoGy" , "Dose", nanogray);
55  new G4UnitDefinition("picogray" , "picoGy" , "Dose", picogray);
56 }
static constexpr double microgray
Definition: G4SIunits.hh:312
static constexpr double gray
Definition: G4SIunits.hh:309
static constexpr double milligray
Definition: G4SIunits.hh:311
double G4double
Definition: G4Types.hh:76
B3bRunAction::~B3bRunAction ( )
virtual

Definition at line 60 of file B3bRunAction.cc.

61 { }

Member Function Documentation

void B3bRunAction::BeginOfRunAction ( const G4Run run)
virtual

Reimplemented from G4UserRunAction.

Definition at line 70 of file B3bRunAction.cc.

71 {
72  G4cout << "### Run " << run->GetRunID() << " start." << G4endl;
73 
74  //inform the runManager to save random number seed
76 }
void SetRandomNumberStore(G4bool flag)
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 B3bRunAction::EndOfRunAction ( const G4Run run)
virtual

Reimplemented from G4UserRunAction.

Definition at line 80 of file B3bRunAction.cc.

81 {
82  G4int nofEvents = run->GetNumberOfEvent();
83  if (nofEvents == 0) return;
84 
85  // Run conditions
86  // note: There is no primary generator action object for "master"
87  // run manager for multi-threaded mode.
88  const B3PrimaryGeneratorAction* generatorAction
89  = static_cast<const B3PrimaryGeneratorAction*>(
91  G4String partName;
92  if (generatorAction)
93  {
94  G4ParticleDefinition* particle
95  = generatorAction->GetParticleGun()->GetParticleDefinition();
96  partName = particle->GetParticleName();
97  }
98 
99  //results
100  //
101  const B3bRun* b3Run = static_cast<const B3bRun*>(run);
102  G4int nbGoodEvents = b3Run->GetNbGoodEvents();
103  G4double sumDose = b3Run->GetSumDose();
104 
105  //print
106  //
107  if (IsMaster())
108  {
109  G4cout
110  << G4endl
111  << "--------------------End of Global Run-----------------------"
112  << G4endl
113  << " The run was " << nofEvents << " events ";
114  }
115  else
116  {
117  G4cout
118  << G4endl
119  << "--------------------End of Local Run------------------------"
120  << G4endl
121  << " The run was " << nofEvents << " "<< partName;
122  }
123  G4cout
124  << "; Nb of 'good' e+ annihilations: " << nbGoodEvents << G4endl
125  << " Total dose in patient : " << G4BestUnit(sumDose,"Dose") << G4endl
126  << "------------------------------------------------------------" << G4endl
127  << G4endl;
128 }
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
G4double GetSumDose() const
Definition: B3bRun.hh:53
Definition: B3bRun.hh:42
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfEvent() const
Definition: G4Run.hh:79
G4bool IsMaster() const
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4int GetNbGoodEvents() const
Definition: B3bRun.hh:52
G4ParticleDefinition * GetParticleDefinition() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4Run * B3bRunAction::GenerateRun ( void  )
virtual

Reimplemented from G4UserRunAction.

Definition at line 65 of file B3bRunAction.cc.

66 { return new B3bRun; }
Definition: B3bRun.hh:42

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