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.),
100 fNbOfSteps2 += nb*nb;
123 const Run* localRun =
static_cast<const Run*
>(run);
126 fParticle = localRun->fParticle;
127 fEkin = localRun->fEkin;
130 fEdeposit += localRun->fEdeposit;
131 fEdeposit2 += localRun->fEdeposit2;
132 fTrackLen += localRun->fTrackLen;
133 fTrackLen2 += localRun->fTrackLen2;
134 fProjRange += localRun->fProjRange;
135 fProjRange2 += localRun->fProjRange2;
136 fNbOfSteps += localRun->fNbOfSteps ;
137 fNbOfSteps2 += localRun->fNbOfSteps2;
138 fStepSize += localRun->fStepSize;
139 fStepSize2 += localRun->fStepSize2;
141 fCsdaRange = localRun->fCsdaRange;
150 std::ios::fmtflags mode =
G4cout.flags();
151 G4cout.setf(std::ios::fixed,std::ios::floatfield);
160 G4cout <<
"\n ======================== run summary =====================\n";
162 <<
"\n The run is " <<
numberOfEvent <<
" "<< partName <<
" of "
165 << material->
GetName() <<
" (density: "
169 G4cout.setf(mode,std::ios::floatfield);
175 G4double rms = fEdeposit2 - fEdeposit*fEdeposit;
176 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
180 <<
"\n Total Energy deposited = " <<
G4BestUnit(fEdeposit,
"Energy")
187 rms = fTrackLen2 - fTrackLen*fTrackLen;
188 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
192 <<
"\n Track length of primary track = " <<
G4BestUnit(fTrackLen,
"Length")
198 <<
"\n Range from EmCalculator = " <<
G4BestUnit(fCsdaRange,
"Length")
199 <<
" (from full dE/dx)" <<
G4endl;
205 rms = fProjRange2 - fProjRange*fProjRange;
206 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
209 <<
"\n Projected range = " <<
G4BestUnit(fProjRange,
"Length")
216 G4double fNbSteps = fNbOfSteps/dNofEvents,
217 fNbSteps2 = fNbOfSteps2/dNofEvents;
218 rms = fNbSteps2 - fNbSteps*fNbSteps;
219 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
222 G4cout <<
"\n Nb of steps of primary track = " << fNbSteps <<
" +- " << rms;
225 rms = fStepSize2 - fStepSize*fStepSize;
226 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
230 <<
"\t Step size= " <<
G4BestUnit(fStepSize,
"Length")
238 G4double binWidth = analysisManager->GetH1Width(ih)
239 *analysisManager->GetH1Unit(ih);
241 analysisManager->ScaleH1(ih,fac);
246 binWidth = analysisManager->GetH1Width(ih);
248 analysisManager->ScaleH1(ih,fac);
251 G4cout.setf(mode,std::ios::floatfield);
virtual void Merge(const G4Run *)
static constexpr double mm
const G4String & GetName() const
void SetCsdaRange(G4int i, G4double value)
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
const XML_Char int const XML_Char * value
G4double GetAbsorRadius()
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)