35 #include "DetectorConstruction.hh"
37 #include "HistoManager.hh"
38 #include "PrimaryGeneratorAction.hh"
49 fParticle(0), fEkin(0.),
50 fEdeposit(0.), fEdeposit2(0.),
51 fTrackLen(0.), fTrackLen2(0.),
52 fProjRange(0.), fProjRange2(0.),
53 fNbOfSteps(0), fNbOfSteps2(0),
54 fStepSize(0.), fStepSize2(0.)
108 const Run* localRun =
static_cast<const Run*
>(run);
111 fParticle = localRun->fParticle;
112 fEkin = localRun->fEkin;
115 fEdeposit += localRun->fEdeposit;
116 fEdeposit2 += localRun->fEdeposit2;
117 fTrackLen += localRun->fTrackLen;
118 fTrackLen2 += localRun->fTrackLen2;
119 fProjRange += localRun->fProjRange;
120 fProjRange2 += localRun->fProjRange2;
121 fNbOfSteps += localRun->fNbOfSteps ;
122 fNbOfSteps2 += localRun->fNbOfSteps2;
123 fStepSize += localRun->fStepSize;
124 fStepSize2 += localRun->fStepSize2;
133 std::ios::fmtflags mode =
G4cout.flags();
134 G4cout.setf(std::ios::fixed,std::ios::floatfield);
143 G4cout <<
"\n ======================== run summary =====================\n";
145 <<
"\n The run is " <<
numberOfEvent <<
" "<< partName <<
" of "
146 <<
G4BestUnit(fEkin,
"Energy") <<
" through a sphere of radius "
148 << material->
GetName() <<
" (density: "
152 G4cout.setf(mode,std::ios::floatfield);
158 G4double rms = fEdeposit2 - fEdeposit*fEdeposit;
159 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
163 <<
"\n Total Energy deposited = " <<
G4BestUnit(fEdeposit,
"Energy")
172 <<
"\n S value = " << sValue/
gray <<
" Gy/Bq.s "
173 <<
" +- " << rmsSValue/
gray
180 rms = fTrackLen2 - fTrackLen*fTrackLen;
181 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
185 <<
"\n Track length of primary track = " <<
G4BestUnit(fTrackLen,
"Length")
191 rms = fProjRange2 - fProjRange*fProjRange;
192 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
195 <<
"\n Projected range = " <<
G4BestUnit(fProjRange,
"Length")
202 G4double fNbSteps = fNbOfSteps/dNofEvents,
203 fNbSteps2 = fNbOfSteps2/dNofEvents;
204 rms = fNbSteps2 - fNbSteps*fNbSteps;
205 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
208 G4cout <<
"\n Nb of steps of primary track = " << fNbSteps <<
" +- " << rms
212 rms = fStepSize2 - fStepSize*fStepSize;
213 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
217 <<
"\n Step size = " <<
G4BestUnit(fStepSize,
"Length")
225 G4double binWidth = analysisManager->GetH1Width(ih);
227 analysisManager->ScaleH1(ih,fac);
230 G4cout.setf(mode,std::ios::floatfield);
235 myFile = fopen (
"s.txt",
"a");
virtual void Merge(const G4Run *)
static constexpr double mm
const G4String & GetName() const
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetParticleName() const
G4Material * GetAbsorMaterial(G4int i)
void AddEdep(G4double val)
G4GLOB_DLL std::ostream G4cout
static constexpr double gray
G4double GetAbsorRadius()
static constexpr double eV
G4double GetAbsorMass() const
static constexpr double nm
G4double energy(const ThreeVector &p, const G4double m)
static const G4double fac
Detector construction class to define materials and geometry.
static constexpr double MeV
void AddTrackLength(G4double t)
void AddStepSize(G4int nb, G4double st)
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
virtual void Merge(const G4Run *)
G4CsvAnalysisManager G4AnalysisManager
void AddProjRange(G4double x)