35 #include "PrimaryGeneratorAction.hh"
36 #include "DetectorConstruction.hh"
45 :fDetector(det), fPrimary(prim)
66 const Run* localRun =
static_cast<const Run*
>(run);
80 #ifndef G4MULTITHREADED
85 if (nEvents == 0) {
return; }
98 G4cout <<
"\n The run consists of " << nEvents <<
" "<< particle <<
" of "
101 << matName <<
" (density: "
110 if (rms>0.) { rms = std::sqrt(rms); }
120 G4double ekin[100], dedxproton[100], dedxmp[100];
124 for(i = 0; i < 100; ++i) {
134 for(i=0; i<100; ++i) {
135 G4cout <<
" E(MeV)= " << ekin[i] <<
" dedxp(MeV/mm)= " << dedxproton[i]
136 <<
" dedxmp(MeV/mm)= " << dedxmp[i]
150 for(i=0; i<100; ++i) {
155 std::log10(calc.
GetRange(ekin[i],
"proton",matName)/
mm));
157 std::log10(calc.
GetRange(ekin[i],
"monopole",matName)/
mm));
PrimaryGeneratorAction * fPrimary
DetectorConstruction * fDetector
static constexpr double MeV
static constexpr double keV
static constexpr double mm
G4AnalysisManager * fAnalysisManager
const G4String & GetParticleName() const
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *mat, G4double cut=DBL_MAX)
G4ParticleGun * GetParticleGun()
G4Material * GetAbsorMaterial(G4int i)
G4int GetNumberOfEvent() const
const G4String & GetName() const
void FillHisto(G4int id, G4double x, G4double weight=1.0)
virtual void Merge(const G4Run *)
The primary generator action class with particle gun.
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double GetParticleEnergy() const
static const G4double fac
G4GLOB_DLL std::ostream G4cout
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
virtual void Merge(const G4Run *)
G4ParticleDefinition * GetParticleDefinition() const
Simple detector construction with a box volume placed in a world.
G4double GetDensity() const