35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
49 fParticle(0), fEkin(0.)
88 const Run* localRun =
static_cast<const Run*
>(run);
135 if (TotNbofEvents == 0)
return;
138 EnergyBalance /= TotNbofEvents;
142 if (rmsEdep>0.) rmsEdep = std::sqrt(rmsEdep/TotNbofEvents);
147 if (rmsTLCh>0.) rmsTLCh = std::sqrt(rmsTLCh/TotNbofEvents);
152 if (rmsTLNe>0.) rmsTLNe = std::sqrt(rmsTLNe/TotNbofEvents);
157 if (rmsStCh>0.) rmsStCh = std::sqrt(rmsTLCh/TotNbofEvents);
162 if (rmsStNe>0.) rmsStNe = std::sqrt(rmsTLCh/TotNbofEvents);
170 transmit[0] = 100.*
fTransmit[0]/TotNbofEvents;
171 transmit[1] = 100.*
fTransmit[1]/TotNbofEvents;
174 reflect[0] = 100.*
fReflect[0]/TotNbofEvents;
175 reflect[1] = 100.*
fReflect[1]/TotNbofEvents;
181 if (rmsMsc > 0.) { rmsMsc = std::sqrt(rmsMsc); }
187 fEnergyLeak[0] /= TotNbofEvents;
fEnergyLeak2[0] /= TotNbofEvents;
189 if (rmsEl0>0.) rmsEl0 = std::sqrt(rmsEl0/TotNbofEvents);
192 fEnergyLeak[1] /= TotNbofEvents;
fEnergyLeak2[1] /= TotNbofEvents;
194 if (rmsEl1>0.) rmsEl1 = std::sqrt(rmsEl1/TotNbofEvents);
206 G4double dEdxTable = 0., dEdxFull = 0.;
216 G4double meandEdx = fEnergyDeposit/length;
219 G4cout <<
"\n ======================== run summary ======================\n";
223 G4cout <<
"\n The run was " << TotNbofEvents <<
" " << partName <<
" of "
226 << material->
GetName() <<
" (density: "
231 G4cout <<
"\n Total energy deposit in absorber per event = "
232 <<
G4BestUnit(fEnergyDeposit,
"Energy") <<
" +- "
236 G4cout <<
"\n -----> Mean dE/dx = " << meandEdx/(
MeV/
cm) <<
" MeV/cm"
237 <<
"\t(" << stopPower/(
MeV*
cm2/
g) <<
" MeV*cm2/g)"
241 G4cout <<
" restricted dEdx = " << dEdxTable/(
MeV/
cm) <<
" MeV/cm"
242 <<
"\t(" << stopTable/(
MeV*
cm2/
g) <<
" MeV*cm2/g)"
245 G4cout <<
" full dEdx = " << dEdxFull/(
MeV/
cm) <<
" MeV/cm"
246 <<
"\t(" << stopFull/(
MeV*
cm2/
g) <<
" MeV*cm2/g)"
249 G4cout <<
"\n Leakage : primary = "
250 <<
G4BestUnit(fEnergyLeak[0],
"Energy") <<
" +- "
253 <<
G4BestUnit(fEnergyLeak[1],
"Energy") <<
" +- "
257 G4cout <<
" Energy balance : edep + eleak = "
261 G4cout <<
"\n Total track length (charged) in absorber per event = "
262 <<
G4BestUnit(fTrakLenCharged,
"Length") <<
" +- "
265 G4cout <<
" Total track length (neutral) in absorber per event = "
266 <<
G4BestUnit(fTrakLenNeutral,
"Length") <<
" +- "
269 G4cout <<
"\n Number of steps (charged) in absorber per event = "
270 << fNbStepsCharged <<
" +- " << rmsStCh <<
G4endl;
272 G4cout <<
" Number of steps (neutral) in absorber per event = "
273 << fNbStepsNeutral <<
" +- " << rmsStNe <<
G4endl;
275 G4cout <<
"\n Number of secondaries per event : Gammas = " << Gamma
276 <<
"; electrons = " << Elect
277 <<
"; positrons = " << Posit <<
G4endl;
279 G4cout <<
"\n Number of events with the primary particle transmitted = "
280 << transmit[1] <<
" %" <<
G4endl;
282 G4cout <<
" Number of events with at least 1 particle transmitted "
283 <<
"(same charge as primary) = " << transmit[0] <<
" %" <<
G4endl;
285 G4cout <<
"\n Number of events with the primary particle reflected = "
286 << reflect[1] <<
" %" <<
G4endl;
288 G4cout <<
" Number of events with at least 1 particle reflected "
289 <<
"(same charge as primary) = " << reflect[0] <<
" %" <<
G4endl;
293 G4cout <<
"\n MultipleScattering:"
294 <<
"\n rms proj angle of transmit primary particle = "
295 << rmsMsc/
mrad <<
" mrad (central part only)" <<
G4endl;
297 G4cout <<
" computed theta0 (Highland formula) = "
300 G4cout <<
" central part defined as +- "
302 <<
" Tail ratio = " << tailMsc <<
" %" <<
G4endl;
325 G4double teta0 = 13.6*
MeV*z*std::sqrt(t)*(1.+0.038*std::log(t))/bpc;
virtual void Merge(const G4Run *)
G4double fMscThetaCentral
G4double fTrakLenNeutral2
const G4String & GetName() const
G4double ComputeMscHighland()
G4double GetDensity() const
G4double fNbStepsCharged2
G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, G4double cut=DBL_MAX)
G4double fTrakLenCharged2
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetParticleName() const
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
G4GLOB_DLL std::ostream G4cout
void PrintSummary() const
G4Material * GetAbsorberMaterial()
G4double fMscProjecTheta2
G4double GetAbsorberThickness()
G4double GetRadlen() const
G4double GetPDGMass() const
G4double energy(const ThreeVector &p, const G4double m)
DetectorConstruction * fDetector
Detector construction class to demonstrate various ways of placement.
G4ParticleDefinition * fParticle
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
static const double eplus
G4double GetPDGCharge() const
G4double fNbStepsNeutral2
virtual void Merge(const G4Run *)
Run(DetectorConstruction *)