Geant4
10.02.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
B3bRunAction.cc
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
// $Id: B3bRunAction.cc 94031 2015-11-05 11:54:38Z ihrivnac $
27
//
30
31
#include "
B3bRunAction.hh
"
32
#include "
B3bRun.hh
"
33
#include "B3PrimaryGeneratorAction.hh"
34
35
#include "
G4Run.hh
"
36
#include "
G4RunManager.hh
"
37
#include "
G4UnitsTable.hh
"
38
#include "
G4SystemOfUnits.hh
"
39
40
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41
42
B3bRunAction::B3bRunAction
()
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
}
57
58
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59
60
B3bRunAction::~B3bRunAction
()
61
{ }
62
63
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64
65
G4Run
*
B3bRunAction::GenerateRun
()
66
{
return
new
B3bRun
; }
67
68
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69
70
void
B3bRunAction::BeginOfRunAction
(
const
G4Run
* run)
71
{
72
G4cout
<<
"### Run "
<< run->
GetRunID
() <<
" start."
<<
G4endl
;
73
74
//inform the runManager to save random number seed
75
G4RunManager::GetRunManager
()->
SetRandomNumberStore
(
false
);
76
}
77
78
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79
80
void
B3bRunAction::EndOfRunAction
(
const
G4Run
* run)
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
*
>
(
90
G4RunManager::GetRunManager
()->
GetUserPrimaryGeneratorAction
());
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
}
129
130
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4RunManager::GetUserPrimaryGeneratorAction
const G4VUserPrimaryGeneratorAction * GetUserPrimaryGeneratorAction() const
Definition:
G4RunManager.hh:362
G4RunManager.hh
B3bRunAction.hh
Definition of the B3bRunAction class.
G4UnitsTable.hh
G4UnitDefinition
Definition:
G4UnitsTable.hh:64
B3PrimaryGeneratorAction::GetParticleGun
const G4ParticleGun * GetParticleGun() const
Definition:
B3PrimaryGeneratorAction.hh:55
G4BestUnit
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
Definition:
G4SteppingVerbose.cc:53
G4RunManager::SetRandomNumberStore
void SetRandomNumberStore(G4bool flag)
Definition:
G4RunManager.hh:400
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:111
B3bRunAction::B3bRunAction
B3bRunAction()
Definition:
B3bRunAction.cc:42
B3bRunAction::~B3bRunAction
virtual ~B3bRunAction()
Definition:
B3bRunAction.cc:60
G4int
int G4int
Definition:
G4Types.hh:78
milligray
static const double milligray
Definition:
G4SIunits.hh:308
G4ParticleDefinition::GetParticleName
const G4String & GetParticleName() const
Definition:
G4ParticleDefinition.hh:159
B3bRun::GetSumDose
G4double GetSumDose() const
Definition:
B3bRun.hh:53
B3bRun
Run class.
Definition:
B3bRun.hh:42
microgray
static const double microgray
Definition:
G4SIunits.hh:309
B3PrimaryGeneratorAction
The primary generator action class with particle gum.
Definition:
B3PrimaryGeneratorAction.hh:47
G4cout
G4GLOB_DLL std::ostream G4cout
G4Run::GetNumberOfEvent
G4int GetNumberOfEvent() const
Definition:
G4Run.hh:79
G4UserRunAction::IsMaster
G4bool IsMaster() const
Definition:
G4UserRunAction.hh:69
G4Run::GetRunID
G4int GetRunID() const
Definition:
G4Run.hh:76
G4Run
Definition:
G4Run.hh:46
B3bRun.hh
Definition of the B3bRun class.
B3bRunAction::EndOfRunAction
virtual void EndOfRunAction(const G4Run *)
Definition:
B3bRunAction.cc:80
gray
static const double gray
Definition:
G4SIunits.hh:306
B3bRunAction::BeginOfRunAction
virtual void BeginOfRunAction(const G4Run *)
Definition:
B3bRunAction.cc:70
G4RunManager::GetRunManager
static G4RunManager * GetRunManager()
Definition:
G4RunManager.cc:79
B3bRun::GetNbGoodEvents
G4int GetNbGoodEvents() const
Definition:
B3bRun.hh:52
B3bRunAction::GenerateRun
virtual G4Run * GenerateRun()
Definition:
B3bRunAction.cc:65
G4Run.hh
G4ParticleGun::GetParticleDefinition
G4ParticleDefinition * GetParticleDefinition() const
Definition:
G4ParticleGun.hh:106
G4UserRunAction
Definition:
G4UserRunAction.hh:52
G4endl
#define G4endl
Definition:
G4ios.hh:61
G4double
double G4double
Definition:
G4Types.hh:76
G4SystemOfUnits.hh
G4String
Definition:
G4String.hh:45
geant4.10.02.p02
examples
basic
B3
B3b
src
B3bRunAction.cc
Generated on Fri Jul 1 2016 14:10:42 for Geant4 by
1.8.8