34 #include "RunAction.hh"
36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
38 #include "RunActionMessenger.hh"
40 #include "EmAcceptance.hh"
56 fDet(det),fKin(kin),fRunMessenger(0), fAnalysisManager(0),fRun(0),
57 fVerbose(0), fEdeptrue(1.), fRmstrue(1.), fLimittrue(
DBL_MAX)
71 void RunAction::BookHisto()
77 fAnalysisManager = G4AnalysisManager::Instance();
81 fHistoName[0] =
"testem2";
83 fAnalysisManager->OpenFile(fHistoName[0]);
85 fAnalysisManager->SetVerboseLevel(1);
86 G4String extension = fAnalysisManager->GetFileType();
87 fHistoName[1] = fHistoName[0] +
"." + extension;
97 fAnalysisManager->SetFirstHistoId(1);
98 fAnalysisManager->CreateH1(
"h1",
"total energy deposit(percent of Einc)",
101 fAnalysisManager->CreateH1(
"h2",
"total charged tracklength (radl)",
102 110,0.,110.*Ekin/
GeV);
104 fAnalysisManager->CreateH1(
"h3",
"total neutral tracklength (radl)",
105 110,0.,1100.*Ekin/
GeV);
107 fAnalysisManager->CreateH1(
"h4",
"longit energy profile (% of E inc)",
108 nLbin,0.,nLbin*dLradl);
110 fAnalysisManager->CreateH1(
"h5",
"rms on longit Edep (% of E inc)",
111 nLbin,0.,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->CreateH1(
"h9",
"rms on radial Edep (% of E inc)",
124 nRbin,0.,nRbin*dRradl);
126 G4double Rmin=0.5*dRradl, Rmax=Rmin+nRbin*dRradl;
127 fAnalysisManager->CreateH1(
"h10",
"cumul radial energy dep (% of E inc)",
130 fAnalysisManager->CreateH1(
"h11",
"rms on cumul radial Edep (% of E inc)",
133 G4cout <<
"\n----> Histogram file is opened in " << fHistoName[1] <<
G4endl;
138 void RunAction::SaveHisto()
140 fAnalysisManager->Write();
141 fAnalysisManager->CloseFile();
143 delete fAnalysisManager;
150 fRun =
new Run(fDet, fKin);
164 G4Random::showEngineStatus();
181 G4Random::showEngineStatus();
191 fEdeptrue = Value(0);
193 fLimittrue= Value(2);
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()
G4double GetParticleEnergy() const