34 #include "RunAction.hh"
36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
76 if (NbOfEvents == 0)
return;
88 G4cout <<
"\n The run consists of " << NbOfEvents <<
" "<< Particle <<
" of "
91 << material->
GetName() <<
" (density: "
97 G4cout <<
"\n Process calls frequency --->";
98 std::map<G4String,G4int>::iterator it;
99 for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
101 G4int count = it->second;
103 G4cout <<
"\t" << procName <<
" = " << count;
104 if (procName ==
"Transportation") survive = count;
107 if (totalCount == 0)
return;
109 G4double ratio = double(survive)/totalCount;
111 G4cout <<
"\n Nb of incident particles unaltered after "
113 << material->
GetName() <<
" : " << survive
114 <<
" over " << totalCount <<
" incident particles."
115 <<
" Ratio = " << 100*ratio <<
" %" <<
G4endl;
117 if (ratio == 0.)
return;
121 G4double CrossSection = - std::log(ratio)/tickness;
124 G4cout <<
" ---> CrossSection per volume:\t" << CrossSection*
cm <<
" cm^-1 "
125 <<
"\tCrossSection per mass: " <<
G4BestUnit(massicCS,
"Surface/Mass")
130 G4cout <<
"\n Verification from G4EmCalculator: \n";
133 for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
143 if (procName !=
"Transportation")
144 G4cout <<
"\t" << procName <<
"= "
151 G4double Ratio = std::exp(-sumc*density*tickness);
152 G4cout <<
"\tExpected ratio of transmitted particles= "
153 << 100*Ratio <<
" %" <<
G4endl;
159 fProcCounter.clear();
void BeginOfRunAction(const G4Run *)
const G4String & GetName() const
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetRandomNumberStore(G4bool flag)
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
const G4String & GetParticleName() const
double precision function energy(A, Z)
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfEvent() const
G4Material * GetMaterial()
void EndOfRunAction(const G4Run *)
static void showEngineStatus()
static G4RunManager * GetRunManager()
G4ParticleGun * GetParticleGun()
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
G4ParticleDefinition * GetParticleDefinition() const
G4double GetParticleEnergy() const