30 #include "DetectorConstruction.hh"
31 #include "HistoManager.hh"
32 #include "PrimaryGeneratorAction.hh"
43 fParticle(0), fEkin(0.),
44 fNbInelastic(0), fNbInelastic2(0),
45 fEdeposit(0.), fEdeposit2(0.),
46 fTrackLen(0.), fTrackLen2(0.),
47 fProjRange(0.), fProjRange2(0.),
48 fNbOfSteps(0), fNbOfSteps2(0),
49 fStepSize(0.), fStepSize2(0.)
111 const Run* localRun =
static_cast<const Run*
>(run);
138 std::ios::fmtflags mode =
G4cout.flags();
139 G4cout.setf(std::ios::fixed,std::ios::floatfield);
148 G4cout <<
"\n ======================== run summary =====================\n";
150 <<
"\n The run is " <<
numberOfEvent <<
" "<< partName <<
" of "
153 << material->
GetName() <<
" (density: "
157 G4cout.setf(mode,std::ios::floatfield);
165 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
169 <<
"\n Nb of ionisations = " << fNbInelastic
176 <<
" +- " <<
G4BestUnit((
fEkin)*rms/(fNbInelastic*fNbInelastic),
"Energy")
183 myFile = fopen (
"wvalue.txt",
"a");
184 fprintf (myFile,
"%e %e %e %e %e \n",
fEkin/
eV, fNbInelastic, rms,
185 fEkin/
eV/fNbInelastic, (
fEkin/
eV)*rms/(fNbInelastic*fNbInelastic) );
192 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
196 <<
"\n Total Energy deposited = " <<
G4BestUnit(fEdeposit,
"Energy")
204 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
208 <<
"\n Track length of primary track = " <<
G4BestUnit(fTrackLen,
"Length")
215 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
218 <<
"\n Projected range = " <<
G4BestUnit(fProjRange,
"Length")
227 rms = fNbSteps2 - fNbSteps*fNbSteps;
228 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
231 G4cout <<
"\n Nb of steps of primary track = " << fNbSteps <<
" +- " << rms
236 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
240 <<
"\n Step size = " <<
G4BestUnit(fStepSize,
"Length")
248 G4double binWidth = analysisManager->GetH1Width(ih);
250 analysisManager->ScaleH1(ih,fac);
253 G4cout.setf(mode,std::ios::floatfield);
void AddProjRange(G4double x)
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
DetectorConstruction * fDetector
static constexpr double MeV
G4double GetAbsorRadius()
void AddEdep(G4double val)
static constexpr double mm
const G4String & GetParticleName() const
void AddTrackLength(G4double t)
G4Material * GetAbsorMaterial(G4int i)
const G4String & GetName() const
void AddInelastic(G4int nb)
virtual void Merge(const G4Run *)
static constexpr double eV
G4CsvAnalysisManager G4AnalysisManager
G4ParticleDefinition * fParticle
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static const G4double fac
G4GLOB_DLL std::ostream G4cout
virtual void Merge(const G4Run *)
G4double fEdeposit[kMaxAbsor]
void AddStepSize(G4int nb, G4double st)
Simple detector construction with a box volume placed in a world.
G4double GetDensity() const