9 #include "G4RunManager.hh"
11 #include "G4ParameterManager.hh"
12 #include "G4LogicalVolumeStore.hh"
13 #include "G4LogicalVolume.hh"
14 #include "G4UnitsTable.hh"
15 #include "G4SystemOfUnits.hh"
29 const G4double milligray = 1.e-3*gray;
30 const G4double microgray = 1.e-6*gray;
31 const G4double nanogray = 1.e-9*gray;
32 const G4double picogray = 1.e-12*gray;
36 new G4UnitDefinition(
"milligray",
"milliGy" ,
"Dose", milligray);
37 new G4UnitDefinition(
"microgray",
"microGy" ,
"Dose", microgray);
38 new G4UnitDefinition(
"nanogray" ,
"nanoGy" ,
"Dose", nanogray);
39 new G4UnitDefinition(
"picogray" ,
"picoGy" ,
"Dose", picogray);
42 G4ParameterManager* parameterManager = G4ParameterManager::Instance();
43 parameterManager->RegisterParameter(fEdep);
44 parameterManager->RegisterParameter(fEdep2);
63 G4RunManager::GetRunManager()->SetRandomNumberStore(
false);
66 G4ParameterManager* parameterManager = G4ParameterManager::Instance();
68 parameterManager->Reset();
86 G4int nofEvents = run->GetNumberOfEvent();
87 if (nofEvents == 0)
return;
90 G4ParameterManager* parameterManager = G4ParameterManager::Instance();
91 parameterManager->Merge();
97 G4double edep = fEdep.GetValue();
98 G4double edep2 = fEdep2.GetValue();
100 G4double rms = edep2 - edep*edep/nofEvents;
101 if (rms > 0.) rms = std::sqrt(rms);
else rms = 0.;
108 (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
113 G4double dose = edep/mass;
114 G4double rmsDose = rms/mass;
126 (G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
130 G4String runCondition;
136 const G4ParticleGun* particleGun = generatorAction->
GetParticleGun();
138 runCondition += particleGun->GetParticleDefinition()->GetParticleName();
140 runCondition +=
" of ";
142 G4double particleEnergy = particleGun->GetParticleEnergy();
144 runCondition += G4BestUnit(particleEnergy,
"Energy");
159 <<
"--------------------End of Global Run-----------------------";
164 <<
"--------------------End of Local Run------------------------";
169 <<
" The run consists of " << nofEvents <<
" "<< runCondition
171 <<
" Cumulated dose per run, in scoring volume : "
172 << G4BestUnit(dose,
"Dose") <<
" rms = " << G4BestUnit(rmsDose,
"Dose")
174 <<
"------------------------------------------------------------"
virtual void EndOfRunAction(const G4Run *)
Definition of the B1DetectorConstruction class.
Detector construction class to define materials and geometry.
Definition of the B1PrimaryGeneratorAction class.
void AddEdep(G4double edep)
for a user event action object to update fEdep and fEdep2. fEdep represents the energy deposit of a...
G4LogicalVolume * GetScoringVolume() const
virtual void BeginOfRunAction(const G4Run *)
const G4ParticleGun * GetParticleGun() const
virtual ~B1RunAction()
do nothing..