35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
38 #include "EmAcceptance.hh"
57 fParticle(nullptr), fEkin(0.),
58 fChargedStep(0), fNeutralStep(0),
59 fN_gamma(0), fN_elec(0), fN_pos(0),
145 const Run* localRun =
static_cast<const Run*
>(run);
161 for (
G4int k=0; k<nbPlanes; k++) {
191 if(norm > 0) norm = 1./
norm;
202 G4double MeanEAbs,MeanEAbs2,rmsEAbs,resolution,rmsres;
203 G4double MeanLAbs,MeanLAbs2,rmsLAbs;
205 std::ios::fmtflags mode =
G4cout.flags();
207 G4cout <<
"\n------------------------------------------------------------\n";
208 G4cout << std::setw(14) <<
"material"
209 << std::setw(17) <<
"Edep RMS"
210 << std::setw(33) <<
"sqrt(E0(GeV))*rmsE/Emean"
211 << std::setw(23) <<
"total tracklen \n \n";
217 rmsEAbs = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs));
226 for(
G4int i=0; i<nEvt; i++) {
228 if(std::abs(e - MeanEAbs) < lim) {
235 if(norm1 > 0.0) norm1 = 1.0/norm1;
236 MeanEAbs = sume*norm1;
237 MeanEAbs2 = sume2*norm1;
238 rmsEAbs = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs));
241 resolution= 100.*sqbeam*rmsEAbs/MeanEAbs;
242 rmsres = resolution*qnorm;
250 rmsLAbs = std::sqrt(std::abs(MeanLAbs2 - MeanLAbs*MeanLAbs));
256 << std::setprecision(5)
257 << std::setw(6) <<
G4BestUnit(MeanEAbs,
"Energy") <<
" : "
258 << std::setprecision(4)
259 << std::setw(5) <<
G4BestUnit( rmsEAbs,
"Energy")
260 << std::setw(10) << resolution <<
" +- "
261 << std::setw(5) << rmsres <<
" %"
262 << std::setprecision(3)
263 << std::setw(10) <<
G4BestUnit(MeanLAbs,
"Length") <<
" +- "
264 << std::setw(4) <<
G4BestUnit( rmsLAbs,
"Length")
267 G4cout <<
"\n------------------------------------------------------------\n";
269 G4cout <<
" Beam particle "
275 G4cout << std::setprecision(6)
278 G4cout <<
"------------------------------------------------------------\n";
284 for (
G4int Id=1; Id<=Idmax+1; Id++) {
295 for (
G4int Id=1; Id<=Idmax; Id++) {
296 G4int iAbsor = Id%nbOfAbsor;
if (iAbsor==0) iAbsor = nbOfAbsor;
300 G4cout << std::setprecision(3)
301 <<
"\n Energy deposition from Energy flow balance : \n"
302 << std::setw(10) <<
" material \t Total Edep \n \n";
305 for (
G4int k=1; k<=nbOfAbsor; k++) {
308 <<
"\t " <<
G4BestUnit(EdepTot [k],
"Energy") <<
"\n";
311 G4cout <<
"\n------------------------------------------------------------\n"
337 analysis->ScaleH1(ih,norm/
MeV);
340 G4cout.setf(mode,std::ios::floatfield);
348 if (i>=0 && i<kMaxAbsor) {
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
DetectorConstruction * fDetector
static constexpr double MeV
std::vector< G4double > fEnergyDeposit[kMaxAbsor]
G4double fSumEAbs[kMaxAbsor]
G4double fLimittrue[kMaxAbsor]
G4double fSum2LAbs[kMaxAbsor]
const G4String & GetParticleName() const
std::vector< G4double > fEnergyFlow
G4double fSum2EAbs[kMaxAbsor]
G4ParticleDefinition * GetDefinition() const
G4Material * GetAbsorMaterial(G4int i)
const G4String & GetName() const
void SumEnergyFlow(G4int plane, G4double Eflow)
G4double fSumLAbs[kMaxAbsor]
virtual void Merge(const G4Run *)
static G4Positron * Positron()
G4CsvAnalysisManager G4AnalysisManager
static G4Electron * Electron()
G4double fEdeptrue[kMaxAbsor]
G4ParticleDefinition * fParticle
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SumLateralEleak(G4int cell, G4double Eflow)
void SetApplyLimit(G4bool)
G4double fRmstrue[kMaxAbsor]
void EmAcceptanceGauss(const G4String &title, G4int stat, G4double avr, G4double avr0, G4double rms, G4double limit)
G4GLOB_DLL std::ostream G4cout
void AddSecondaryTrack(const G4Track *)
void SetEdepAndRMS(G4int, G4double, G4double, G4double)
virtual void Merge(const G4Run *)
void BeginOfAcceptance(const G4String &title, G4int stat)
std::vector< G4double > fLateralEleak
static constexpr double GeV
Simple detector construction with a box volume placed in a world.