32 #include "RunAction.hh"
59 sumEAbs = sum2EAbs =sumEGap = sum2EGap = 0.;
60 sumLAbs = sum2LAbs =sumLGap = sum2LGap = 0.;
70 sumEAbs += EAbs; sum2EAbs += EAbs*EAbs;
71 sumEGap += EGap; sum2EGap += EGap*EGap;
73 sumLAbs += LAbs; sum2LAbs += LAbs*LAbs;
74 sumLGap += LGap; sum2LGap += LGap*LGap;
82 if (NbOfEvents == 0)
return;
86 sumEAbs /= NbOfEvents; sum2EAbs /= NbOfEvents;
87 G4double rmsEAbs = sum2EAbs - sumEAbs*sumEAbs;
88 if (rmsEAbs >0.) rmsEAbs = std::sqrt(rmsEAbs);
else rmsEAbs = 0.;
90 sumEGap /= NbOfEvents; sum2EGap /= NbOfEvents;
91 G4double rmsEGap = sum2EGap - sumEGap*sumEGap;
92 if (rmsEGap >0.) rmsEGap = std::sqrt(rmsEGap);
else rmsEGap = 0.;
94 sumLAbs /= NbOfEvents; sum2LAbs /= NbOfEvents;
95 G4double rmsLAbs = sum2LAbs - sumLAbs*sumLAbs;
96 if (rmsLAbs >0.) rmsLAbs = std::sqrt(rmsLAbs);
else rmsLAbs = 0.;
98 sumLGap /= NbOfEvents; sum2LGap /= NbOfEvents;
99 G4double rmsLGap = sum2LGap - sumLGap*sumLGap;
100 if (rmsLGap >0.) rmsLGap = std::sqrt(rmsLGap);
else rmsLGap = 0.;
105 <<
"\n--------------------End of Run------------------------------\n"
106 <<
"\n mean Energy in Absorber : " <<
G4BestUnit(sumEAbs,
"Energy")
108 <<
"\n mean Energy in Gap : " <<
G4BestUnit(sumEGap,
"Energy")
113 <<
"\n mean trackLength in Absorber : " <<
G4BestUnit(sumLAbs,
"Length")
115 <<
"\n mean trackLength in Gap : " <<
G4BestUnit(sumLGap,
"Length")
117 <<
"\n------------------------------------------------------------\n"