35 #include "DetectorConstruction.hh"
45 fNbStep1(0), fNbStep2(0),
46 fTrackLen1(0.), fTrackLen2(0.),
58 std::map<const G4VProcess*,G4int>::iterator it = fProcCounter.find(process);
59 if ( it == fProcCounter.end()) {
60 fProcCounter[process] = 1;
63 fProcCounter[process]++;
71 std::map<G4String, ParticleData>::iterator it = fParticleDataMap.find(name);
72 if ( it == fParticleDataMap.end()) {
73 fParticleDataMap[
name] = ParticleData(1, Ekin, Ekin, Ekin);
76 ParticleData&
data = it->second;
81 if (Ekin < emin) data.fEmin = Ekin;
83 if (Ekin > emax) data.fEmax = Ekin;
93 fNbStep1 += nstep1; fNbStep2 += nstep2;
94 fTrackLen1 += trackl1; fTrackLen2 += trackl2;
95 fTime1 += time1; fTime2 += time2;
102 G4int prec = 5, wid = prec + 2;
107 G4cout <<
"\n Process calls frequency --->";
109 std::map<const G4VProcess*,G4int>::iterator it;
110 for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
112 G4int count = it->second;
113 G4cout <<
"\t" << procName <<
"= " << count;
114 if (procName ==
"Transportation") survive = count;
119 G4cout <<
"\n Nb of incident particles surviving after "
126 G4cout <<
"\n Parcours of incident neutron:";
130 G4double meanCollisTota = meanCollision1 + meanCollision2;
132 G4cout <<
"\n nb of collisions E>1*eV= " << meanCollision1
133 <<
" E<1*eV= " << meanCollision2
134 <<
" total= " << meanCollisTota;
138 G4double meanTrackLtot = meanTrackLen1 + meanTrackLen2;
141 <<
"\n track length E>1*eV= " <<
G4BestUnit(meanTrackLen1,
"Length")
142 <<
" E<1*eV= " <<
G4BestUnit(meanTrackLen2,
"Length")
143 <<
" total= " <<
G4BestUnit(meanTrackLtot,
"Length");
147 G4double meanTimeTo = meanTime1 + meanTime2;
150 <<
"\n time of flight E>1*eV= " <<
G4BestUnit(meanTime1,
"Time")
151 <<
" E<1*eV= " <<
G4BestUnit(meanTime2,
"Time")
158 std::map<G4String,ParticleData>::iterator itn;
159 for (itn = fParticleDataMap.begin(); itn != fParticleDataMap.end(); itn++) {
161 ParticleData
data = itn->second;
162 G4int count = data.fCount;
167 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
168 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
178 fProcCounter.clear();
180 fParticleDataMap.clear();
187 const Run* localRun =
static_cast<const Run*
>(run);
191 fNbStep1 += localRun->fNbStep1;
192 fNbStep2 += localRun->fNbStep2;
193 fTrackLen1 += localRun->fTrackLen1;
194 fTrackLen2 += localRun->fTrackLen2;
195 fTime1 += localRun->fTime1;
196 fTime2 += localRun->fTime2;
199 std::map<const G4VProcess*,G4int>::const_iterator itp;
200 for ( itp = localRun->fProcCounter.begin();
201 itp != localRun->fProcCounter.end(); ++itp ) {
204 G4int localCount = itp->second;
205 if ( fProcCounter.find(process) == fProcCounter.end()) {
206 fProcCounter[process] = localCount;
209 fProcCounter[process] += localCount;
213 std::map<G4String,ParticleData>::const_iterator itn;
214 for (itn = localRun->fParticleDataMap.begin();
215 itn != localRun->fParticleDataMap.end(); ++itn) {
218 const ParticleData& localData = itn->second;
219 if ( fParticleDataMap.find(name) == fParticleDataMap.end()) {
220 fParticleDataMap[
name]
221 = ParticleData(localData.fCount,
227 ParticleData&
data = fParticleDataMap[
name];
228 data.fCount += localData.fCount;
229 data.fEmean += localData.fEmean;
231 if (emin < data.fEmin) data.fEmin = emin;
233 if (emax > data.fEmax) data.fEmax = emax;
virtual void Merge(const G4Run *)
void CountProcesses(G4String procName)
const G4String & GetName() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SumTrackLength(G4int, G4int, G4double, G4double, G4double, G4double)
G4GLOB_DLL std::ostream G4cout
G4Material * GetMaterial()
virtual void Merge(const G4Run *)
const XML_Char const XML_Char * data
void ParticleCount(G4String, G4double)
Run(DetectorConstruction *)