84{
85 G4int nofEvents = run->GetNumberOfEvent();
86 if (nofEvents == 0) return;
87
88
90 accumulableManager->Merge();
91
92
93
94 G4double edep =
fEdep.GetValue();
95 G4double edep2 =
fEdep2.GetValue();
96
97 G4double rms = edep2 - edep*edep/nofEvents;
98 if (rms > 0.) rms = std::sqrt(rms); else rms = 0.;
99
100 const auto detConstruction = static_cast<const DetectorConstruction*>(
101 G4RunManager::GetRunManager()->GetUserDetectorConstruction());
102 G4double mass = detConstruction->GetScoringVolume()->GetMass();
103 G4double dose = edep/mass;
104 G4double rmsDose = rms/mass;
105
106
107
108
109 const auto generatorAction = static_cast<const PrimaryGeneratorAction*>(
110 G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
112 if (generatorAction)
113 {
114 const G4ParticleGun* particleGun = generatorAction->GetParticleGun();
115 runCondition += particleGun->GetParticleDefinition()->GetParticleName();
116 runCondition += " of ";
117 G4double particleEnergy = particleGun->GetParticleEnergy();
118 runCondition +=
G4BestUnit(particleEnergy,
"Energy");
119 }
120
121
122
123 if (IsMaster()) {
124 G4cout
125 << G4endl
126 << "--------------------End of Global Run-----------------------";
127 }
128 else {
129 G4cout
130 << G4endl
131 << "--------------------End of Local Run------------------------";
132 }
133
134 G4cout
135 << G4endl
136 << " The run consists of " << nofEvents << " "<< runCondition
137 << G4endl
138 << " Cumulated dose per run, in scoring volume : "
140 << G4endl
141 << "------------------------------------------------------------"
142 << G4endl
143 << G4endl;
144}