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;
100 std::map<G4String, ActivityData>::iterator it =
fActivityMap.find(name);
102 G4int n1(0), n2(0), nd(0);
166 const Run* localRun =
static_cast<const Run*
>(run);
202 std::map<G4String,ParticleData>::const_iterator itn;
207 const ParticleData& localData = itn->second;
210 = ParticleData(localData.fCount,
217 data.fCount += localData.fCount;
218 data.fEmean += localData.fEmean;
220 if (emin < data.fEmin) data.fEmin = emin;
222 if (emax > data.fEmax) data.fEmax =
emax;
230 std::map<G4String,ActivityData>::const_iterator ita;
235 const ActivityData& localData = ita->second;
238 = ActivityData(localData.fNlife_t1,
240 localData.fNdecay_t1t2);
243 data.fNlife_t1 += localData.fNlife_t1;
244 data.fNlife_t2 += localData.fNlife_t2;
245 data.fNdecay_t1t2 += localData.fNdecay_t1t2;
259 G4cout <<
"\n ======================== run summary ======================";
260 G4cout <<
"\n The run was " << nbEvents <<
" " << partName <<
" of "
262 G4cout <<
"\n ===========================================================\n";
264 if (nbEvents == 0) {
return; }
273 std::map<G4String,ParticleData>::iterator it;
276 ParticleData data = it->second;
277 G4int count = data.fCount;
282 G4cout <<
" " << std::setw(15) << name <<
": " << std::setw(7) << count
283 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
296 G4cout <<
"\n Ekin Total (Q single decay): mean = "
297 << std::setw(wid) <<
G4BestUnit(Ebmean,
"Energy")
302 G4cout <<
"\n Momentum balance (excluding gamma desexcitation): mean = "
303 << std::setw(wid) <<
G4BestUnit(Pbmean,
"Energy")
313 G4double halfLife = Tmean*std::log(2.);
315 G4cout <<
"\n Total time of life (full chain): mean = "
316 << std::setw(wid) <<
G4BestUnit(Tmean,
"Time")
318 << std::setw(wid) <<
G4BestUnit(halfLife,
"Time")
329 G4cout <<
"\n Total visible energy (full chain) : mean = "
330 << std::setw(wid) <<
G4BestUnit(Evmean,
"Energy")
340 G4double nAtoms_perUnitOfMass = Avogadro/molMass;
341 G4double Activity_perUnitOfMass = 0.0;
343 { Activity_perUnitOfMass = nAtoms_perUnitOfMass/pTimeMean; }
345 G4cout <<
"\n Activity of " << partName <<
" = "
346 << std::setw(wid) << Activity_perUnitOfMass*
g/
becquerel
347 <<
" Bq/g (" << Activity_perUnitOfMass*
g/
curie
356 G4cout <<
" Activities in time window [t1, t2] = ["
361 std::map<G4String,ActivityData>::iterator ita;
364 ActivityData data = ita->second;
365 G4int n1 = data.fNlife_t1;
366 G4int n2 = data.fNlife_t2;
367 G4int ndecay = data.fNdecay_t1t2;
370 G4cout <<
" " << std::setw(15) << name <<
": "
371 <<
" n(t1) = " << std::setw(7) << n1
372 <<
"\tn(t2) = " << std::setw(7) << n2
373 <<
"\t decays = " << std::setw(7) << ndecay
374 <<
" ---> <actv> = " <<
G4BestUnit(actv,
"Activity") <<
"\n";
383 analysisManager->ScaleH1(1,factor);
384 analysisManager->ScaleH1(2,factor);
385 analysisManager->ScaleH1(3,factor);
386 analysisManager->ScaleH1(4,factor);
387 analysisManager->ScaleH1(5,factor);
std::map< G4String, ParticleData > fParticleDataMap
virtual void Merge(const G4Run *)
void PrimaryTiming(G4double)
void CountInTimeWindow(G4String, G4bool, G4bool, G4bool)
static constexpr double becquerel
void EventTiming(G4double)
const char * name(G4int ptype)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static constexpr double g
const G4String & GetParticleName() const
void SetTimeWindow(G4double, G4double)
G4GLOB_DLL std::ostream G4cout
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
G4int GetAtomicMass() const
static const G4double emax
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4ParticleDefinition * fParticle
std::map< G4String, ActivityData > fActivityMap
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
static constexpr double curie
virtual void Merge(const G4Run *)
G4CsvAnalysisManager G4AnalysisManager
static constexpr double mole
void ParticleCount(G4String, G4double)