35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
46 fDetector(det), fParticle(0), fEkin(0.)
70 std::map<G4String,G4int>::iterator it =
fProcCounter.find(procName);
88 ParticleData& data = it->second;
93 if (Ekin < emin) data.fEmin = Ekin;
95 if (Ekin > emax) data.fEmax = Ekin;
123 ParticleData& data = it->second;
128 if (Ekin < emin) data.fEmin = Ekin;
130 if (Ekin > emax) data.fEmax = Ekin;
138 const Run* localRun =
static_cast<const Run*
>(run);
153 std::map<G4String,G4int>::const_iterator itp;
158 G4int localCount = itp->second;
168 std::map<G4String,ParticleData>::const_iterator itc;
173 const ParticleData& localData = itc->second;
176 = ParticleData(localData.fCount,
183 data.fCount += localData.fCount;
184 data.fEmean += localData.fEmean;
186 if (emin < data.fEmin) data.fEmin = emin;
188 if (emax > data.fEmax) data.fEmax =
emax;
193 std::map<G4String,ParticleData>::const_iterator itn;
198 const ParticleData& localData = itn->second;
201 = ParticleData(localData.fCount,
208 data.fCount += localData.fCount;
209 data.fEmean += localData.fEmean;
211 if (emin < data.fEmin) data.fEmin = emin;
213 if (emax > data.fEmax) data.fEmax =
emax;
233 << material->
GetName() <<
" (D = "
243 std::map<G4String,G4int>::iterator it;
246 G4int count = it->second;
247 G4String space =
" ";
if (++index%3 == 0) space =
"\n";
248 G4cout <<
" " << std::setw(20) << procName <<
"="<< std::setw(7) << count
257 std::map<G4String,ParticleData>::iterator itc;
260 ParticleData data = itc->second;
261 G4int count = data.fCount;
266 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
267 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
278 if (rmsEdep>0.) rmsEdep = std::sqrt(rmsEdep);
281 G4cout <<
"\n Mean energy deposit per event = "
282 <<
G4BestUnit(fEnergyDeposit,
"Energy") <<
"; rms = "
290 if (rmsEflow>0.) rmsEflow = std::sqrt(rmsEflow);
293 G4cout <<
" Mean energy flow per event = "
294 <<
G4BestUnit(fEnergyFlow,
"Energy") <<
"; rms = "
300 G4cout <<
"\n List of particles emerging from the container :" <<
G4endl;
302 std::map<G4String,ParticleData>::iterator itn;
305 ParticleData data = itn->second;
306 G4int count = data.fCount;
310 G4double Eflow = data.fEmean/TotNbofEvents;
312 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
313 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
321 for (
G4int ih=1; ih<14; ih++) {
322 G4double binWidth = analysisManager->GetH1Width(ih);
323 G4double unit = analysisManager->GetH1Unit(ih);
325 analysisManager->ScaleH1(ih,fac);
virtual void Merge(const G4Run *)
void CountProcesses(G4String procName)
std::vector< G4double > fEnergyFlow
const G4String & GetName() const
void ParticleFlux(G4String, G4double)
const char * name(G4int ptype)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4String & GetParticleName() const
G4Material * GetAbsorMaterial(G4int i)
void AddEdep(G4double val)
G4GLOB_DLL std::ostream G4cout
G4double GetAbsorLength()
G4double GetAbsorRadius()
std::vector< G4double > fEnergyDeposit[kMaxAbsor]
const G4String & GetProcessName() const
static const G4double emax
std::map< G4String, G4int > fProcCounter
G4double energy(const ThreeVector &p, const G4double m)
std::map< G4String, ParticleData > fParticleDataMap1
std::map< G4String, ParticleData > fParticleDataMap2
DetectorConstruction * fDetector
static const G4double fac
Detector construction class to demonstrate various ways of placement.
G4ParticleDefinition * fParticle
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
virtual void Merge(const G4Run *)
G4CsvAnalysisManager G4AnalysisManager
void AddEflow(G4double eflow)
void ParticleCount(G4String, G4double)