34 #include "DetectorConstruction.hh"
35 #include "PrimaryGeneratorAction.hh"
36 #include "HistoManager.hh"
49 fParticle(0), fEkin(0.)
88 const Run* localRun =
static_cast<const Run*
>(run);
138 if (TotNbofEvents == 0)
return;
141 EnergyBalance /= TotNbofEvents;
145 if (rmsEdep>0.) rmsEdep = std::sqrt(rmsEdep/TotNbofEvents);
150 if (rmsTLCh>0.) rmsTLCh = std::sqrt(rmsTLCh/TotNbofEvents);
155 if (rmsTLNe>0.) rmsTLNe = std::sqrt(rmsTLNe/TotNbofEvents);
160 if (rmsStCh>0.) rmsStCh = std::sqrt(rmsStCh/TotNbofEvents);
165 if (rmsStNe>0.) rmsStNe = std::sqrt(rmsStNe/TotNbofEvents);
173 transmit[0] = 100.*
fTransmit[0]/TotNbofEvents;
174 transmit[1] = 100.*
fTransmit[1]/TotNbofEvents;
177 reflect[0] = 100.*
fReflect[0]/TotNbofEvents;
178 reflect[1] = 100.*
fReflect[1]/TotNbofEvents;
184 if (rmsMsc > 0.) { rmsMsc = std::sqrt(rmsMsc); }
190 fEnergyLeak[0] /= TotNbofEvents;
fEnergyLeak2[0] /= TotNbofEvents;
192 if (rmsEl0>0.) rmsEl0 = std::sqrt(rmsEl0/TotNbofEvents);
195 fEnergyLeak[1] /= TotNbofEvents;
fEnergyLeak2[1] /= TotNbofEvents;
197 if (rmsEl1>0.) rmsEl1 = std::sqrt(rmsEl1/TotNbofEvents);
209 G4double dEdxTable = 0., dEdxFull = 0.;
214 G4double stopTable = dEdxTable/density;
215 G4double stopFull = dEdxFull /density;
220 G4double stopPower = meandEdx/density;
222 G4cout <<
"\n ======================== run summary ======================\n";
226 G4cout <<
"\n The run was " << TotNbofEvents <<
" " << partName <<
" of "
229 << material->
GetName() <<
" (density: "
234 G4cout <<
"\n Total energy deposit in absorber per event = "
235 <<
G4BestUnit(fEnergyDeposit,
"Energy") <<
" +- "
239 G4cout <<
"\n -----> Mean dE/dx = " << meandEdx/(
MeV/
cm) <<
" MeV/cm"
240 <<
"\t(" << stopPower/(
MeV*
cm2/
g) <<
" MeV*cm2/g)"
244 G4cout <<
" restricted dEdx = " << dEdxTable/(
MeV/
cm) <<
" MeV/cm"
245 <<
"\t(" << stopTable/(
MeV*
cm2/
g) <<
" MeV*cm2/g)"
248 G4cout <<
" full dEdx = " << dEdxFull/(
MeV/
cm) <<
" MeV/cm"
249 <<
"\t(" << stopFull/(
MeV*
cm2/
g) <<
" MeV*cm2/g)"
252 G4cout <<
"\n Leakage : primary = "
253 <<
G4BestUnit(fEnergyLeak[0],
"Energy") <<
" +- "
256 <<
G4BestUnit(fEnergyLeak[1],
"Energy") <<
" +- "
260 G4cout <<
" Energy balance : edep + eleak = "
264 G4cout <<
"\n Total track length (charged) in absorber per event = "
265 <<
G4BestUnit(fTrakLenCharged,
"Length") <<
" +- "
268 G4cout <<
" Total track length (neutral) in absorber per event = "
269 <<
G4BestUnit(fTrakLenNeutral,
"Length") <<
" +- "
272 G4cout <<
"\n Number of steps (charged) in absorber per event = "
273 << fNbStepsCharged <<
" +- " << rmsStCh <<
G4endl;
275 G4cout <<
" Number of steps (neutral) in absorber per event = "
276 << fNbStepsNeutral <<
" +- " << rmsStNe <<
G4endl;
278 G4cout <<
"\n Number of secondaries per event : Gammas = " << Gamma
279 <<
"; electrons = " << Elect
280 <<
"; positrons = " << Posit <<
G4endl;
282 G4cout <<
"\n Number of events with the primary particle transmitted = "
283 << transmit[1] <<
" %" <<
G4endl;
285 G4cout <<
" Number of events with at least 1 particle transmitted "
286 <<
"(same charge as primary) = " << transmit[0] <<
" %" <<
G4endl;
288 G4cout <<
"\n Number of events with the primary particle reflected = "
289 << reflect[1] <<
" %" <<
G4endl;
291 G4cout <<
" Number of events with at least 1 particle reflected "
292 <<
"(same charge as primary) = " << reflect[0] <<
" %" <<
G4endl;
296 G4cout <<
"\n MultipleScattering:"
297 <<
"\n rms proj angle of transmit primary particle = "
298 << rmsMsc/
mrad <<
" mrad (central part only)" <<
G4endl;
300 G4cout <<
" computed theta0 (Highland formula) = "
303 G4cout <<
" central part defined as +- "
305 <<
" Tail ratio = " << tailMsc <<
" %" <<
G4endl;
314 analysisManager->
ScaleH1(ih,fac);
318 fac = 1./(TotNbofEvents*binWidth);
319 analysisManager->
ScaleH1(ih,fac);
322 analysisManager->
ScaleH1(ih,1./TotNbofEvents);
345 G4double teta0 = 13.6*
MeV*z*std::sqrt(t)*(1.+0.038*std::log(t))/bpc;