35 #include "PrimaryGeneratorAction.hh"
36 #include "HistoManager.hh"
46 fParticle(0), fEkin(0.),
47 fDecayCount(0), fTimeCount(0), fPrimaryTime(0.),
48 fTimeWindow1(0.), fTimeWindow2(0.)
76 ParticleData&
data = it->second;
81 if (Ekin < emin) data.fEmin = Ekin;
83 if (Ekin > emax) data.fEmax = Ekin;
84 data.fTmean = meanLife;
101 std::map<G4String, ActivityData>::iterator it =
fActivityMap.find(name);
103 G4int n1(0), n2(0), nd(0);
167 const Run* localRun =
static_cast<const Run*
>(run);
203 std::map<G4String,ParticleData>::const_iterator itn;
208 const ParticleData& localData = itn->second;
211 = ParticleData(localData.fCount,
219 data.fCount += localData.fCount;
220 data.fEmean += localData.fEmean;
222 if (emin < data.fEmin) data.fEmin = emin;
224 if (emax > data.fEmax) data.fEmax =
emax;
225 data.fTmean = localData.fTmean;
233 std::map<G4String,ActivityData>::const_iterator ita;
238 const ActivityData& localData = ita->second;
241 = ActivityData(localData.fNlife_t1,
243 localData.fNdecay_t1t2);
246 data.fNlife_t1 += localData.fNlife_t1;
247 data.fNlife_t2 += localData.fNlife_t2;
248 data.fNdecay_t1t2 += localData.fNdecay_t1t2;
262 G4cout <<
"\n ======================== run summary ======================";
263 G4cout <<
"\n The run was " << nbEvents <<
" " << partName <<
" of "
265 G4cout <<
"\n ===========================================================\n";
267 if (nbEvents == 0) {
return; }
276 std::map<G4String,ParticleData>::iterator it;
279 ParticleData data = it->second;
280 G4int count = data.fCount;
286 G4cout <<
" " << std::setw(15) << name <<
": " << std::setw(7) << count
287 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
289 <<
" --> " <<
G4BestUnit(eMax,
"Energy") <<
")";
303 G4cout <<
"\n Ekin Total (Q single decay): mean = "
304 << std::setw(wid) <<
G4BestUnit(Ebmean,
"Energy")
309 G4cout <<
"\n Momentum balance (excluding gamma desexcitation): mean = "
310 << std::setw(wid) <<
G4BestUnit(Pbmean,
"Energy")
320 G4double halfLife = Tmean*std::log(2.);
322 G4cout <<
"\n Total time of life (full chain): mean = "
323 << std::setw(wid) <<
G4BestUnit(Tmean,
"Time")
325 << std::setw(wid) <<
G4BestUnit(halfLife,
"Time")
336 G4cout <<
"\n Total visible energy (full chain) : mean = "
337 << std::setw(wid) <<
G4BestUnit(Evmean,
"Energy")
348 G4double Activity_perUnitOfMass = 0.0;
350 { Activity_perUnitOfMass = nAtoms_perUnitOfMass/pTimeMean; }
352 G4cout <<
"\n Activity of " << partName <<
" = "
353 << std::setw(wid) << Activity_perUnitOfMass*
g/
becquerel
354 <<
" Bq/g (" << Activity_perUnitOfMass*
g/
curie
363 G4cout <<
" Activities in time window [t1, t2] = ["
368 std::map<G4String,ActivityData>::iterator ita;
371 ActivityData data = ita->second;
372 G4int n1 = data.fNlife_t1;
373 G4int n2 = data.fNlife_t2;
374 G4int ndecay = data.fNdecay_t1t2;
377 G4cout <<
" " << std::setw(15) << name <<
": "
378 <<
" n(t1) = " << std::setw(7) << n1
379 <<
"\tn(t2) = " << std::setw(7) << n2
380 <<
"\t decays = " << std::setw(7) << ndecay
381 <<
" ---> <actv> = " <<
G4BestUnit(actv,
"Activity") <<
"\n";
390 analysisManager->ScaleH1(1,factor);
391 analysisManager->ScaleH1(2,factor);
392 analysisManager->ScaleH1(3,factor);
393 analysisManager->ScaleH1(4,factor);
394 analysisManager->ScaleH1(5,factor);
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
std::map< G4String, ParticleData > fParticleDataMap
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
const G4String & GetParticleName() const
static const G4double emax
void ParticleCount(G4String, G4double)
const XML_Char const XML_Char * data
static constexpr double g
static constexpr double Avogadro
std::map< G4String, ActivityData > fActivityMap
virtual void Merge(const G4Run *)
G4CsvAnalysisManager G4AnalysisManager
static constexpr double curie
void CountInTimeWindow(G4String, G4bool, G4bool, G4bool)
static constexpr double becquerel
void PrimaryTiming(G4double)
G4ParticleDefinition * fParticle
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetTimeWindow(G4double, G4double)
void EventTiming(G4double)
G4int GetAtomicMass() const
G4GLOB_DLL std::ostream G4cout
static constexpr double mole
virtual void Merge(const G4Run *)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments