35 #include "RunAction.hh"
36 #include "HistoManager.hh"
37 #include "PrimaryGeneratorAction.hh"
67 fDecayCount = fTimeCount = 0;
68 for (
G4int i=0; i<3; i++) fEkinTot[i] = fPbalance[i] = fEventTime[i] = 0. ;
74 if ( analysisManager->IsActive() ) {
75 analysisManager->OpenFile();
87 fParticleCount[
name]++;
90 if (fParticleCount[name] == 1) fEmin[
name] = fEmax[
name] = Ekin;
91 if (Ekin < fEmin[name]) fEmin[
name] = Ekin;
92 if (Ekin > fEmax[name]) fEmax[
name] = Ekin;
102 if (fDecayCount == 1) fEkinTot[1] = fEkinTot[2] = Ekin;
103 if (Ekin < fEkinTot[1]) fEkinTot[1] = Ekin;
104 if (Ekin > fEkinTot[2]) fEkinTot[2] = Ekin;
106 fPbalance[0] += Pbal;
108 if (fDecayCount == 1) fPbalance[1] = fPbalance[2] = Pbal;
109 if (Pbal < fPbalance[1]) fPbalance[1] = Pbal;
110 if (Pbal > fPbalance[2]) fPbalance[2] = Pbal;
118 fEventTime[0] += time;
119 if (fTimeCount == 1) fEventTime[1] = fEventTime[2] = time;
120 if (time < fEventTime[1]) fEventTime[1] = time;
121 if (time > fEventTime[2]) fEventTime[2] = time;
128 fPrimaryTime += ptime;
136 if (nbEvents == 0) {
return; }
143 G4cout <<
"\n ======================== run summary ======================";
144 G4cout <<
"\n The run was " << nbEvents <<
" " << partName <<
" of "
146 G4cout <<
"\n ===========================================================\n";
149 G4int prec = 4, wid = prec + 2;
156 std::map<G4String,G4int>::iterator it;
157 for (it = fParticleCount.begin(); it != fParticleCount.end(); it++) {
159 G4int count = it->second;
163 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
164 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
173 if (fDecayCount > 0) {
174 G4double Ebmean = fEkinTot[0]/fDecayCount;
175 G4double Pbmean = fPbalance[0]/fDecayCount;
177 G4cout <<
"\n Ekin Total (Q): mean = "
178 << std::setw(wid) <<
G4BestUnit(Ebmean,
"Energy")
179 <<
"\t( " <<
G4BestUnit(fEkinTot[1],
"Energy")
180 <<
" --> " <<
G4BestUnit(fEkinTot[2],
"Energy")
183 G4cout <<
"\n Momentum balance (excluding gamma desexcitation): mean = "
184 << std::setw(wid) <<
G4BestUnit(Pbmean,
"Energy")
185 <<
"\t( " <<
G4BestUnit(fPbalance[1],
"Energy")
186 <<
" --> " <<
G4BestUnit(fPbalance[2],
"Energy")
192 if (fTimeCount > 0) {
193 G4double Tmean = fEventTime[0]/fTimeCount;
194 G4double halfLife = Tmean*std::log(2.);
196 G4cout <<
"\n Total time of life : mean = "
197 << std::setw(wid) <<
G4BestUnit(Tmean,
"Time")
199 << std::setw(wid) <<
G4BestUnit(halfLife,
"Time")
201 <<
" --> " <<
G4BestUnit(fEventTime[2],
"Time")
207 G4double pTimeMean = fPrimaryTime/nbEvents;
210 G4double Activity_perUnitOfMass = 0.0;
212 { Activity_perUnitOfMass = nAtoms_perUnitOfMass/pTimeMean; }
214 G4cout <<
"\n Activity of " << partName <<
" = "
215 << std::setw(wid) << Activity_perUnitOfMass*
g/
becquerel
216 <<
" Bq/g (" << Activity_perUnitOfMass*
g/
curie
222 fParticleCount.clear();
223 fEmean.clear(); fEmin.clear(); fEmax.clear();
233 analysisManager->ScaleH1(1,factor);
234 analysisManager->ScaleH1(2,factor);
235 analysisManager->ScaleH1(3,factor);
236 analysisManager->ScaleH1(4,factor);
237 analysisManager->ScaleH1(5,factor);
238 if ( analysisManager->IsActive() ) {
239 analysisManager->Write();
240 analysisManager->CloseFile();