35 #include "DetectorConstruction.hh" 37 #include "HistoManager.hh" 38 #include "PrimaryGeneratorAction.hh" 49 fParticle(0), fEkin(0.),
50 fNbInelastic(0), fNbInelastic2(0),
51 fEdeposit(0.), fEdeposit2(0.),
52 fTrackLen(0.), fTrackLen2(0.),
53 fProjRange(0.), fProjRange2(0.),
54 fNbOfSteps(0), fNbOfSteps2(0),
55 fStepSize(0.), fStepSize2(0.)
117 const Run* localRun =
static_cast<const Run*
>(run);
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 " 159 << material->
GetName() <<
" (density: " 163 G4cout.setf(mode,std::ios::floatfield);
171 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
175 <<
"\n Nb of ionisations = " << fNbInelastic
182 <<
" +- " <<
G4BestUnit((
fEkin)*rms/(fNbInelastic*fNbInelastic),
"Energy")
189 myFile = fopen (
"wvalue.txt",
"a");
190 fprintf (myFile,
"%e %e %e %e %e \n",
fEkin/
eV, fNbInelastic, rms,
fEkin/
eV/fNbInelastic,
191 (
fEkin/
eV)*rms/(fNbInelastic*fNbInelastic) );
198 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
202 <<
"\n Total Energy deposited = " <<
G4BestUnit(fEdeposit,
"Energy")
210 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
214 <<
"\n Track length of primary track = " <<
G4BestUnit(fTrackLen,
"Length")
221 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
224 <<
"\n Projected range = " <<
G4BestUnit(fProjRange,
"Length")
233 rms = fNbSteps2 - fNbSteps*fNbSteps;
234 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
237 G4cout <<
"\n Nb of steps of primary track = " << fNbSteps <<
" +- " << rms
242 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
246 <<
"\n Step size = " <<
G4BestUnit(fStepSize,
"Length")
254 G4double binWidth = analysisManager->GetH1Width(ih);
256 analysisManager->ScaleH1(ih,fac);
259 G4cout.setf(mode,std::ios::floatfield);
virtual void Merge(const G4Run *)
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void AddInelastic(G4int nb)
G4Material * GetAbsorMaterial(G4int i)
void AddEdep(G4double val)
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double GetAbsorRadius()
ExG4HbookAnalysisManager G4AnalysisManager
DetectorConstruction * fDetector
static const G4double fac
Detector construction class to define materials and geometry.
G4ParticleDefinition * fParticle
void AddTrackLength(G4double t)
void AddStepSize(G4int nb, G4double st)
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
const G4String & GetName() const
virtual void Merge(const G4Run *)
void AddProjRange(G4double x)