34 #include "RunAction.hh"
35 #include "DetectorConstruction.hh"
36 #include "PhysicsList.hh"
38 #include "PrimaryGeneratorAction.hh"
39 #include "HistoManager.hh"
55 fDetector(det),fPhysics(phys),fKinematic(kin),fHistoManager(0)
76 CLHEP::HepRandom::showEngineStatus();
108 if ( analysisManager->IsActive() ) {
109 analysisManager->OpenFile();
116 if (analysisManager->GetH1Activation(ih))
117 stepMax = analysisManager->GetH1Width(ih);
119 if (analysisManager->GetH1Activation(ih)) {
124 G4cout <<
"\n---> stepMax from histos 1 and 8 = "
132 std::ios::fmtflags mode =
G4cout.flags();
133 G4cout.setf(std::ios::fixed,std::ios::floatfield);
136 if (NbofEvents == 0)
return;
137 G4double fNbofEvents = double(NbofEvents);
149 G4cout <<
"\n ======================== run summary ======================\n";
153 G4cout <<
"\n The run consists of " << NbofEvents <<
" "<< partName <<
" of "
156 << material->
GetName() <<
" (density: "
159 G4cout <<
"\n ============================================================\n";
165 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
169 <<
"\n Total Energy deposited = " <<
G4BestUnit(fEdeposit,
"Energy")
177 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
181 <<
"\n Track length of primary track = " <<
G4BestUnit(fTrackLen,
"Length")
192 <<
" (from full dE/dx)" <<
G4endl;
198 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
201 <<
"\n Projected range = " <<
G4BestUnit(fProjRange,
"Length")
208 rms = fNbSteps2 - fNbSteps*
fNbSteps;
209 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
212 G4cout <<
"\n Nb of steps of primary track = " << fNbSteps <<
" +- " << rms;
216 if (rms>0.) rms = std::sqrt(rms);
else rms = 0.;
220 <<
"\t Step size= " <<
G4BestUnit(fStepSize,
"Length")
228 G4double binWidth = analysisManager->GetH1Width(ih);
230 analysisManager->ScaleH1(ih,fac);
235 binWidth = analysisManager->GetH1Width(ih);
236 fac = 1./(NbofEvents*binWidth*
energy);
237 analysisManager->ScaleH1(ih,fac);
240 G4cout.setf(mode,std::ios::floatfield);
244 if ( analysisManager->IsActive() ) {
245 analysisManager->Write();
246 analysisManager->CloseFile();
250 CLHEP::HepRandom::showEngineStatus();
G4StepLimiter * GetStepMaxProcess()
void BeginOfRunAction(const G4Run *)
static const G4double fac
const G4String & GetName() const
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
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 EndOfRunAction(const G4Run *)
G4double GetAbsorRadius()
ExG4HbookAnalysisManager G4AnalysisManager
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