34 #include "RunAction.hh"
36 #include "DetectorConstruction.hh"
37 #include "PrimaryGeneratorAction.hh"
38 #include "HistoManager.hh"
84 if ( analysisManager->IsActive() ) {
85 analysisManager->OpenFile();
96 while ((i<nbProc)&&((*
fProcCounter)[i]->GetName()!=procName)) i++;
99 (*fProcCounter)[i]->Count();
107 if (NbOfEvents == 0)
return;
118 G4cout <<
"\n The run consists of " << NbOfEvents <<
" "<< Particle <<
" of "
121 << material->
GetName() <<
" (density: "
125 G4cout <<
"\n Process calls frequency --->";
127 G4String procName = (*fProcCounter)[i]->GetName();
128 G4int count = (*fProcCounter)[i]->GetCounter();
129 G4cout <<
"\t" << procName <<
" = " << count;
138 G4double rmsTPL = std::sqrt(std::fabs(MeanTPL2 - MeanTPL*MeanTPL));
142 G4double rmsGPL = std::sqrt(std::fabs(MeanGPL2 - MeanGPL*MeanGPL));
146 G4double rmsLaD = std::sqrt(std::fabs(MeanLaD2 - MeanLaD*MeanLaD));
150 G4double rmsPsi = std::sqrt(std::fabs(MeanPsi2 - MeanPsi*MeanPsi));
154 G4double rmsTeta = std::sqrt(std::fabs(MeanTeta2 - MeanTeta*MeanTeta));
159 std::sqrt(std::fabs(MeanCorrel2-MeanCorrel*MeanCorrel));
163 <<
"\n geomPathLength :\t" <<
G4BestUnit(MeanGPL,
"Length")
165 <<
"\n lateralDisplac :\t" <<
G4BestUnit(MeanLaD,
"Length")
167 <<
"\n Psi :\t" << MeanPsi/
mrad <<
" mrad"
168 <<
" +- " << rmsPsi /
mrad <<
" mrad"
169 <<
" (" << MeanPsi/
deg <<
" deg"
170 <<
" +- " << rmsPsi /
deg <<
" deg)"
173 G4cout <<
"\n Theta_plane :\t" << rmsTeta/
mrad <<
" mrad"
174 <<
" (" << rmsTeta/
deg <<
" deg)"
175 <<
"\n phi correlation:\t" << MeanCorrel
176 <<
" +- " << rmsCorrel
177 <<
" (std::cos(phi_pos - phi_dir))"
183 G4cout <<
"\n Verification from G4EmCalculator. \n";
195 if (MeanTPL/range >= 0.99) efFacrange = 1.;
198 <<
"\n range from restrict dE/dx:\t" <<
G4BestUnit(range,
"Length")
199 <<
"\n ---> effective facRange :\t" << efFacrange
202 G4cout <<
"\n compute theta0 from Highland :\t"
223 if ( analysisManager->IsActive() ) {
224 analysisManager->Write();
225 analysisManager->CloseFile();
249 G4double teta0 = 13.6*
MeV*z*std::sqrt(t)*(1.+0.038*std::log(t))/bpc;
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void EndOfRunAction(const G4Run *)
static constexpr double MeV
ProcessesCount * fProcCounter
std::vector< OneProcessCount * > ProcessesCount
G4double GetRadlen() const
const G4String & GetParticleName() const
G4double GetPDGCharge() const
G4ParticleGun * GetParticleGun()
G4double GetPDGMass() const
HistoManager * fHistoManager
void BeginOfRunAction(const G4Run *)
G4int GetNumberOfEvent() const
const G4String & GetName() const
void CountProcesses(G4String)
G4double ComputeMscHighland(G4double pathLength)
const G4ParticleDefinition const G4Material *G4double range
static constexpr double deg
The primary generator action class with particle gun.
G4CsvAnalysisManager G4AnalysisManager
DetectorConstruction * fDetector
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static constexpr double eplus
G4double GetParticleEnergy() const
PrimaryGeneratorAction * fPrimary
G4GLOB_DLL std::ostream G4cout
static constexpr double mrad
G4ParticleDefinition * GetParticleDefinition() const
G4Material * GetMaterial()
static void showEngineStatus()
Simple detector construction with a box volume placed in a world.
G4double GetDensity() const