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 fPenetration(0.), fPenetration2(0.),
54 fNbOfSteps(0), fNbOfSteps2(0),
55 fStepSize(0.), fStepSize2(0.)
100 fPenetration2 += x*
x;
108 fNbOfSteps2 += nb*nb;
117 const Run* localRun =
static_cast<const Run*
>(run);
120 fParticle = localRun->fParticle;
121 fEkin = localRun->fEkin;
124 fEdeposit += localRun->fEdeposit;
125 fEdeposit2 += localRun->fEdeposit2;
126 fTrackLen += localRun->fTrackLen;
127 fTrackLen2 += localRun->fTrackLen2;
128 fProjRange += localRun->fProjRange;
129 fProjRange2 += localRun->fProjRange2;
130 fPenetration += localRun->fPenetration;
131 fPenetration2 += localRun->fPenetration2;
132 fNbOfSteps += localRun->fNbOfSteps ;
133 fNbOfSteps2 += localRun->fNbOfSteps2;
134 fStepSize += localRun->fStepSize;
135 fStepSize2 += localRun->fStepSize2;
144 std::ios::fmtflags mode =
G4cout.flags();
145 G4cout.setf(std::ios::fixed,std::ios::floatfield);
154 G4cout <<
"\n ======================= run summary ====================\n";
156 <<
"\n The run is " <<
numberOfEvent <<
" "<< partName <<
" of "
157 <<
G4BestUnit(fEkin,
"Energy") <<
" through a sphere of radius "
159 << material->
GetName() <<
" (density: "
163 G4cout.setf(mode,std::ios::floatfield);
171 G4double rmsTrack = fTrackLen2 - fTrackLen*fTrackLen;
173 if (rmsTrack>0.) rmsTrack = std::sqrt(rmsTrack);
else rmsTrack = 0.;
177 <<
"\n Track length of primary track = " <<
G4BestUnit(fTrackLen,
"Length")
184 G4double rmsProj = fProjRange2 - fProjRange*fProjRange;
185 if (rmsProj>0.) rmsProj = std::sqrt(rmsProj);
else rmsProj = 0.;
188 <<
"\n Projected range = "
195 G4double rmsPene = fPenetration2 - fPenetration*fPenetration;
196 if (rmsPene>0.) rmsPene = std::sqrt(rmsPene);
else rmsPene = 0.;
199 <<
"\n Penetration = "
208 myFile = fopen (
"range.txt",
"a");
209 fprintf (myFile,
"%e %e %e %e %e %e %e\n",
221 G4cout.setf(mode,std::ios::floatfield);
virtual void Merge(const G4Run *)
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
G4double GetAbsorRadius()
static constexpr double eV
static constexpr double nm
G4double energy(const ThreeVector &p, const G4double m)
void AddPenetration(G4double x)
Detector construction class to define materials and geometry.
void AddTrackLength(G4double t)
void AddStepSize(G4int nb, G4double st)
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
virtual void Merge(const G4Run *)
void AddProjRange(G4double x)