35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
46 fDetector(det), fParticle(0), fEkin(0.),
47 fNbStep1(0), fNbStep2(0),
48 fTrackLen1(0.), fTrackLen2(0.),
69 std::map<G4String,G4int>::iterator it = fProcCounter.find(procName);
70 if ( it == fProcCounter.end()) {
71 fProcCounter[procName] = 1;
74 fProcCounter[procName]++;
82 std::map<G4String, ParticleData>::iterator it = fParticleDataMap.find(name);
83 if ( it == fParticleDataMap.end()) {
84 fParticleDataMap[
name] = ParticleData(1, Ekin, Ekin, Ekin);
87 ParticleData&
data = it->second;
92 if (Ekin < emin) data.fEmin = Ekin;
94 if (Ekin > emax) data.fEmax = Ekin;
104 fNbStep1 += nstep1; fNbStep2 += nstep2;
105 fTrackLen1 += trackl1; fTrackLen2 += trackl2;
106 fTime1 += time1; fTime2 += time2;
113 const Run* localRun =
static_cast<const Run*
>(run);
117 fParticle = localRun->fParticle;
118 fEkin = localRun->fEkin;
122 fNbStep1 += localRun->fNbStep1;
123 fNbStep2 += localRun->fNbStep2;
124 fTrackLen1 += localRun->fTrackLen1;
125 fTrackLen2 += localRun->fTrackLen2;
126 fTime1 += localRun->fTime1;
127 fTime2 += localRun->fTime2;
130 std::map<G4String,G4int>::const_iterator itp;
131 for ( itp = localRun->fProcCounter.begin();
132 itp != localRun->fProcCounter.end(); ++itp ) {
135 G4int localCount = itp->second;
136 if ( fProcCounter.find(procName) == fProcCounter.end()) {
137 fProcCounter[procName] = localCount;
140 fProcCounter[procName] += localCount;
145 std::map<G4String,ParticleData>::const_iterator itn;
146 for (itn = localRun->fParticleDataMap.begin();
147 itn != localRun->fParticleDataMap.end(); ++itn) {
150 const ParticleData& localData = itn->second;
151 if ( fParticleDataMap.find(name) == fParticleDataMap.end()) {
152 fParticleDataMap[
name]
153 = ParticleData(localData.fCount,
159 ParticleData& data = fParticleDataMap[
name];
160 data.fCount += localData.fCount;
161 data.fEmean += localData.fEmean;
163 if (emin < data.fEmin) data.fEmin = emin;
165 if (emax > data.fEmax) data.fEmax =
emax;
188 << material->
GetName() <<
" (density: "
197 std::map<G4String,G4int>::iterator it;
198 for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
200 G4int count = it->second;
201 G4cout <<
"\t" << procName <<
"= " << count;
202 if (procName ==
"Transportation") survive = count;
207 G4cout <<
"\n Nb of incident particles surviving after "
214 G4cout <<
"\n Parcours of incident neutron:";
218 G4double meanCollisTota = meanCollision1 + meanCollision2;
220 G4cout <<
"\n nb of collisions E>1*eV= " << meanCollision1
221 <<
" E<1*eV= " << meanCollision2
222 <<
" total= " << meanCollisTota;
226 G4double meanTrackLtot = meanTrackLen1 + meanTrackLen2;
229 <<
"\n track length E>1*eV= " <<
G4BestUnit(meanTrackLen1,
"Length")
230 <<
" E<1*eV= " <<
G4BestUnit(meanTrackLen2,
"Length")
231 <<
" total= " <<
G4BestUnit(meanTrackLtot,
"Length");
235 G4double meanTimeTo = meanTime1 + meanTime2;
238 <<
"\n time of flight E>1*eV= " <<
G4BestUnit(meanTime1,
"Time")
239 <<
" E<1*eV= " <<
G4BestUnit(meanTime2,
"Time")
246 std::map<G4String,ParticleData>::iterator itn;
247 for (itn = fParticleDataMap.begin(); itn != fParticleDataMap.end(); itn++) {
249 ParticleData data = itn->second;
250 G4int count = data.fCount;
255 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
256 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
268 fProcCounter.clear();
269 fParticleDataMap.clear();
virtual void Merge(const G4Run *)
void CountProcesses(G4String procName)
const G4String & GetName() const
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetParticleName() const
const XML_Char const XML_Char * data
void SumTrackLength(G4int, G4int, G4double, G4double, G4double, G4double)
G4GLOB_DLL std::ostream G4cout
G4Material * GetMaterial()
const G4String & GetProcessName() const
static const G4double emax
G4double energy(const ThreeVector &p, const G4double m)
Detector construction class to define materials and geometry.
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
virtual void Merge(const G4Run *)
void ParticleCount(G4String, G4double)