35 #include "RunAction.hh"
36 #include "HistoManager.hh"
47 fSumEAbs(0.), fSum2EAbs(0.),
48 fSumEGap(0.), fSum2EGap(0.),
49 fSumLAbs(0.), fSum2LAbs(0.),
50 fSumLGap(0.), fSum2LGap(0.)
66 fSumEAbs = fSum2EAbs =fSumEGap = fSum2EGap = 0.;
67 fSumLAbs = fSum2LAbs =fSumLGap = fSum2LGap = 0.;
71 fHistoManager->Book();
81 fSumEAbs += EAbs; fSum2EAbs += EAbs*EAbs;
82 fSumEGap += EGap; fSum2EGap += EGap*EGap;
84 fSumLAbs += LAbs; fSum2LAbs += LAbs*LAbs;
85 fSumLGap += LGap; fSum2LGap += LGap*LGap;
93 if (NbOfEvents == 0)
return;
97 fSumEAbs /= NbOfEvents; fSum2EAbs /= NbOfEvents;
98 G4double rmsEAbs = fSum2EAbs - fSumEAbs*fSumEAbs;
99 if (rmsEAbs >0.) rmsEAbs = std::sqrt(rmsEAbs);
else rmsEAbs = 0.;
101 fSumEGap /= NbOfEvents; fSum2EGap /= NbOfEvents;
102 G4double rmsEGap = fSum2EGap - fSumEGap*fSumEGap;
103 if (rmsEGap >0.) rmsEGap = std::sqrt(rmsEGap);
else rmsEGap = 0.;
105 fSumLAbs /= NbOfEvents; fSum2LAbs /= NbOfEvents;
106 G4double rmsLAbs = fSum2LAbs - fSumLAbs*fSumLAbs;
107 if (rmsLAbs >0.) rmsLAbs = std::sqrt(rmsLAbs);
else rmsLAbs = 0.;
109 fSumLGap /= NbOfEvents; fSum2LGap /= NbOfEvents;
110 G4double rmsLGap = fSum2LGap - fSumLGap*fSumLGap;
111 if (rmsLGap >0.) rmsLGap = std::sqrt(rmsLGap);
else rmsLGap = 0.;
116 <<
"\n--------------------End of Run------------------------------\n"
117 <<
"\n mean Energy in Absorber : " <<
G4BestUnit(fSumEAbs,
"Energy")
119 <<
"\n mean Energy in Gap : " <<
G4BestUnit(fSumEGap,
"Energy")
124 <<
"\n mean trackLength in Absorber : " <<
G4BestUnit(fSumLAbs,
"Length")
126 <<
"\n mean trackLength in Gap : " <<
G4BestUnit(fSumLGap,
"Length")
128 <<
"\n------------------------------------------------------------\n"
134 fHistoManager->
Save();
void BeginOfRunAction(const G4Run *)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfEvent() const
void EndOfRunAction(const G4Run *)
void FillPerEvent(G4double, G4double, G4double, G4double)