35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
50 fParticle(0), fEkin(0.),
51 fNbOfTraks0(0), fNbOfTraks1(0),
52 fNbOfSteps0(0), fNbOfSteps1(0),
54 fTrueRange(0.), fTrueRange2(0.),
55 fProjRange(0.), fProjRange2(0.),
56 fTransvDev(0.), fTransvDev2(0.)
75 std::map<G4String,G4int>::iterator it =
fProcCounter.find(procName);
88 const Run* localRun =
static_cast<const Run*
>(run);
109 std::map<G4String,G4int>::const_iterator it;
114 G4int localCount = it->second;
139 G4cout <<
"\n ======================== run summary ======================\n";
143 << material->
GetName() <<
" (density: "
149 G4cout <<
"\n total energy deposit: "
154 G4cout <<
"\n nb tracks/event"
155 <<
" neutral: " << std::setw(wid) <<
fNbOfTraks0/dNbOfEvents
156 <<
" charged: " << std::setw(wid) <<
fNbOfTraks1/dNbOfEvents
157 <<
"\n nb steps/event"
158 <<
" neutral: " << std::setw(wid) <<
fNbOfSteps0/dNbOfEvents
159 <<
" charged: " << std::setw(wid) <<
fNbOfSteps1/dNbOfEvents
166 std::map<G4String,G4int>::iterator it;
169 G4int count = it->second;
170 G4String space =
" ";
if (++index%3 == 0) space =
"\n";
171 G4cout <<
" " << std::setw(20) << procName <<
"="<< std::setw(7) << count
180 if (trueRms>0.) trueRms = std::sqrt(trueRms);
else trueRms = 0.;
184 if (projRms>0.) projRms = std::sqrt(projRms);
else projRms = 0.;
188 if (trvsRms>0.) trvsRms = std::sqrt(trvsRms);
else trvsRms = 0.;
197 G4cout <<
"\n---------------------------------------------------------\n";
198 G4cout <<
" Primary particle : " ;
200 <<
" rms = " <<
G4BestUnit(trueRms,
"Length");
203 <<
" rms = " <<
G4BestUnit(projRms,
"Length");
207 G4cout <<
"\n transverse dispersion at end = "
210 G4cout <<
"\n mass true Range from simulation = "
211 <<
G4BestUnit(fTrueRange*density,
"Mass/Surface")
212 <<
"\n from PhysicsTable (csda range) = "
213 <<
G4BestUnit(rangeTable*density,
"Mass/Surface");
214 G4cout <<
"\n---------------------------------------------------------\n";
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
DetectorConstruction * fDetector
const G4String & GetParticleName() const
G4double GetPDGCharge() const
const G4String & GetName() const
virtual void Merge(const G4Run *)
std::map< G4String, G4int > fProcCounter
G4ParticleDefinition * fParticle
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void CountProcesses(G4String procName)
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4GLOB_DLL std::ostream G4cout
virtual void Merge(const G4Run *)
G4Material * GetMaterial()
Simple detector construction with a box volume placed in a world.
G4double GetDensity() const