34 #include "RunAction.hh"
35 #include "PhysicsList.hh"
37 #include "PrimaryGeneratorAction.hh"
38 #include "HistoManager.hh"
54 :
G4UserRunAction(),fDetector(det),fPhysics(phys),fKinematic(kin),fRun(0),
82 G4Random::showEngineStatus();
87 if ( analysisManager->IsActive() ) {
88 analysisManager->OpenFile();
95 if (analysisManager->GetH1Activation(ih)) {
96 stepMax = analysisManager->GetH1Width(ih);
107 if (width == 0.) width = 1.;
111 for (
G4int i=1; i<= nbOfAbsor; i++) {
116 if (analysisManager->GetH1Activation(ih))
117 stepMax =
std::min(stepMax, width*newCsdaRange);
122 G4double newXfrontNorm = xfrontNorm + thickness/csdaRange;
134 std::ios::fmtflags mode =
G4cout.flags();
135 G4cout.setf(std::ios::fixed,std::ios::floatfield);
151 G4cout <<
"\n ======================== run summary =====================\n";
154 <<
"\n The run consists of " << nbofEvents <<
" "<< partName <<
" of "
156 <<
" through " << nbOfAbsor <<
" absorbers: \n";
157 for (
G4int i=1; i<= nbOfAbsor; i++) {
162 << material->
GetName() <<
" (density: "
165 G4cout <<
"\n ==========================================================\n";
177 G4double binWidth = analysisManager->GetH1Width(ih);
179 analysisManager->ScaleH1(ih,fac);
182 binWidth = analysisManager->GetH1Width(ih);
183 fac = (1./(nbofEvents*binWidth))*(
g/(
MeV*
cm2));
184 analysisManager->ScaleH1(ih,fac);
188 G4cout.setf(mode,std::ios::floatfield);
193 if ( analysisManager->IsActive() ) {
194 analysisManager->Write();
195 analysisManager->CloseFile();
199 G4Random::showEngineStatus();
G4double GetCsdaRange(G4int i)
G4StepLimiter * GetStepMaxProcess()
void BeginOfRunAction(const G4Run *)
static const G4double fac
const G4String & GetName() const
void SetCsdaRange(G4int i, G4double value)
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual G4Run * GenerateRun()
DetectorConstruction * fDetector
const G4String & GetParticleName() const
HistoManager * fHistoManager
G4Material * GetAbsorMaterial(G4int i)
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
PrimaryGeneratorAction * fKinematic
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfEvent() const
void SetXfrontNorm(G4int i, G4double value)
void EndOfRunAction(const G4Run *)
ExG4HbookAnalysisManager G4AnalysisManager
G4double GetAbsorThickness(G4int i)
G4double GetXfrontNorm(G4int i)
G4ParticleGun * GetParticleGun()
G4double energy(const ThreeVector &p, const G4double m)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4ParticleDefinition * GetParticleDefinition() const
Detector construction class to demonstrate various ways of placement.
G4double GetPDGCharge() const
G4double GetParticleEnergy() const