34 #include "RunAction.hh"
36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
38 #include "HistoManager.hh"
53 fDetector(det), fPrimary(prim), fHistoManager(0)
73 CLHEP::HepRandom::showEngineStatus();
83 if ( analysisManager->IsActive() ) {
84 analysisManager->OpenFile();
135 if (NbOfEvents == 0)
return;
148 G4cout <<
"\n The run consists of " << NbOfEvents <<
" "<< Particle <<
" of "
151 << material->
GetName() <<
" (density: "
155 G4cout <<
"\n Process calls frequency --->";
156 std::map<const G4VProcess*,G4int>::iterator it;
159 G4int count = it->second;
160 G4cout <<
"\t" << procName <<
"= " << count;
161 if (procName ==
"Transportation") survive = count;
165 G4cout <<
"\n\n Nb of incident particles surviving after "
176 G4double rms = std::sqrt(std::fabs(MeanTrack2 - MeanFreePath*MeanFreePath));
178 if(MeanFreePath > 0.0) { CrossSection = 1./MeanFreePath; }
181 if(massicMFP > 0.0) { massicCS = 1./massicMFP; }
185 <<
"\tmassic: " <<
G4BestUnit(massicMFP,
"Mass/Surface")
186 <<
"\n CrossSection:\t" << CrossSection*
cm <<
" cm^-1 "
187 <<
"\t\tmassic: " <<
G4BestUnit(massicCS,
"Surface/Mass")
194 G4double crossSection = CrossSection/nbAtoms;
195 G4cout <<
" crossSection per atom:\t"
200 G4cout <<
"\n Verification : "
201 <<
"crossSections from G4HadronicProcessStore:";
217 G4cout <<
"\n" << std::setw(20) << procName <<
"= "
218 <<
G4BestUnit(massSigma,
"Surface/Mass") <<
"\t"
222 G4cout <<
"\n" << std::setw(20) <<
"total" <<
"= "
233 G4cout <<
"\n" << std::setw(20) << procName <<
"= "
236 G4cout <<
"\n" << std::setw(20) <<
"total" <<
"= "
244 std::map<G4String,G4int>::iterator ic;
247 G4int count = ic->second;
250 G4cout <<
" " << std::setw(50) << name <<
": " << std::setw(7) << count
251 <<
" Q = " << std::setw(wid) <<
G4BestUnit(Q,
"Energy")
258 G4cout <<
"\n" << std::setw(58) <<
"Number of gamma: N = "
263 <<
"\n --> NOTE: XXXX because neutronHP is unable to return target nucleus"
268 G4cout <<
"\n List of generated particles: \n" <<
G4endl;
270 std::map<G4String,G4int>::iterator ip;
273 G4int count = ip->second;
277 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
278 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
288 G4cout <<
"\n Momentum balance: Pmean = "
289 << std::setw(wid) <<
G4BestUnit(Pbmean,
"Energy")
311 if ( analysisManager->IsActive() ) {
312 analysisManager->Write();
313 analysisManager->CloseFile();
317 CLHEP::HepRandom::showEngineStatus();
void BeginOfRunAction(const G4Run *)
static G4HadronicProcessStore * Instance()
const G4String & GetName() const
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetRandomNumberStore(G4bool flag)
const G4Element * GetElement(G4int iel) const
DetectorConstruction * fDetector
const G4String & GetParticleName() const
HistoManager * fHistoManager
G4GLOB_DLL std::ostream G4cout
std::map< G4String, G4double > fNuclChannelQ
void CountNuclearChannel(G4String, G4double)
G4int GetNumberOfEvent() const
G4Material * GetMaterial()
void EndOfRunAction(const G4Run *)
ExG4HbookAnalysisManager G4AnalysisManager
const G4String & GetProcessName() const
std::map< G4String, G4int > fProcCounter
G4double GetTotNbOfAtomsPerVolume() const
static G4RunManager * GetRunManager()
std::map< G4String, G4double > fEmean
G4ParticleGun * GetParticleGun()
G4double energy(const ThreeVector &p, const G4double m)
void ParticleCount(G4String, G4double)
G4double GetCrossSectionPerVolume(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Material *material)
G4ParticleDefinition * GetParticleDefinition() const
Detector construction class to demonstrate various ways of placement.
size_t GetNumberOfElements() const
std::map< G4String, G4int > fParticleCount
G4double GetCrossSectionPerAtom(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Element *element, const G4Material *material=0)
G4double GetParticleEnergy() const
PrimaryGeneratorAction * fPrimary
std::map< G4String, G4int > fNuclChannelCount