34 #include "RunAction.hh"
36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
38 #include "RunActionMessenger.hh"
40 #include "EmAcceptance.hh"
52 fDet(det),fKin(kin),fRunMessenger(0), fAnalysisManager(0),fRun(0),
53 fVerbose(0), fEdeptrue(1.), fRmstrue(1.), fLimittrue(
DBL_MAX)
56 fHistoName[0] =
"testem2";
68 void RunAction::BookHisto()
74 fAnalysisManager = G4AnalysisManager::Instance();
80 fAnalysisManager->OpenFile(fHistoName[0]);
82 fAnalysisManager->SetVerboseLevel(1);
83 G4String extension = fAnalysisManager->GetFileType();
84 fHistoName[1] = fHistoName[0] +
"." + extension;
94 fAnalysisManager->SetFirstHistoId(1);
95 fAnalysisManager->CreateH1(
"h1",
"total energy deposit(percent of Einc)",
98 fAnalysisManager->CreateH1(
"h2",
"total charged tracklength (radl)",
99 110,0.,110.*Ekin/
GeV);
101 fAnalysisManager->CreateH1(
"h3",
"total neutral tracklength (radl)",
102 110,0.,1100.*Ekin/
GeV);
104 fAnalysisManager->CreateH1(
"h4",
"longit energy profile (% of E inc)",
105 nLbin,0.,nLbin*dLradl);
107 fAnalysisManager->CreateP1(
"p4",
"longit energy profile (% of E inc)",
108 nLbin,0.,nLbin*dLradl, 0., 1000.);
110 fAnalysisManager->CreateH1(
"h5",
"rms on longit Edep (% of E inc)",
111 nLbin,0.,nLbin*dLradl);
113 G4double Zmin=0.5*dLradl, Zmax=Zmin+nLbin*dLradl;
114 fAnalysisManager->CreateH1(
"h6",
"cumul longit energy dep (% of E inc)",
117 fAnalysisManager->CreateH1(
"h7",
"rms on cumul longit Edep (% of E inc)",
120 fAnalysisManager->CreateH1(
"h8",
"radial energy profile (% of E inc)",
121 nRbin,0.,nRbin*dRradl);
123 fAnalysisManager->CreateP1(
"p8",
"radial energy profile (% of E inc)",
124 nRbin,0.,nRbin*dRradl, 0., 1000.);
126 fAnalysisManager->CreateH1(
"h9",
"rms on radial Edep (% of E inc)",
127 nRbin,0.,nRbin*dRradl);
129 G4double Rmin=0.5*dRradl, Rmax=Rmin+nRbin*dRradl;
130 fAnalysisManager->CreateH1(
"h10",
"cumul radial energy dep (% of E inc)",
133 fAnalysisManager->CreateH1(
"h11",
"rms on cumul radial Edep (% of E inc)",
136 G4cout <<
"\n----> Histogram file is opened in " << fHistoName[1] <<
G4endl;
150 fRun =
new Run(fDet, fKin);
160 if (
isMaster) G4Random::showEngineStatus();
176 if (
isMaster) G4Random::showEngineStatus();
179 fAnalysisManager->Write();
180 fAnalysisManager->CloseFile();
187 fEdeptrue = Value(0);
189 fLimittrue= Value(2);
The primary generator action class with particle gun.
void SetVerbose(G4int val)
void BeginOfRunAction(const G4Run *)
void SetVerbose(G4int val)
virtual G4Run * GenerateRun()
G4GLOB_DLL std::ostream G4cout
void SetEdepAndRMS(G4ThreeVector)
void EndOfRunAction(const G4Run *)
G4ParticleGun * GetParticleGun()
static constexpr double GeV
Detector construction class to define materials and geometry.
void SetHistoName(G4String &val)
G4double GetParticleEnergy() const