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;
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;
236 << material->
GetName() <<
" (density: "
245 std::map<G4String,G4int>::iterator it;
248 G4int count = it->second;
249 G4String space =
" ";
if (++index%3 == 0) space =
"\n";
250 G4cout <<
" " << std::setw(20) << procName <<
"="<< std::setw(7) << count
259 std::map<G4String,ParticleData>::iterator itc;
262 ParticleData data = itc->second;
263 G4int count = data.fCount;
268 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
269 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
280 if (rmsEdep>0.) rmsEdep = std::sqrt(rmsEdep);
283 G4cout <<
"\n Mean energy deposit per event = "
284 <<
G4BestUnit(fEnergyDeposit,
"Energy") <<
"; rms = "
292 if (rmsEflow>0.) rmsEflow = std::sqrt(rmsEflow);
295 G4cout <<
" Mean energy flow per event = "
296 <<
G4BestUnit(fEnergyFlow,
"Energy") <<
"; rms = "
302 G4cout <<
"\n List of particles emerging from the absorber :" <<
G4endl;
304 std::map<G4String,ParticleData>::iterator itn;
307 ParticleData data = itn->second;
308 G4int count = data.fCount;
312 G4double Eflow = data.fEmean/TotNbofEvents;
314 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
315 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
325 G4double binWidth = analysisManager->GetH1Width(ih);
327 analysisManager->ScaleH1(ih,fac);
std::map< G4String, ParticleData > fParticleDataMap1
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
DetectorConstruction * fDetector
static constexpr double MeV
std::vector< G4double > fEnergyDeposit[kMaxAbsor]
void AddEdep(G4double val)
static constexpr double mm
void ParticleFlux(G4String, G4double)
const G4String & GetParticleName() const
void AddEflow(G4double eflow)
static const G4double emax
std::vector< G4double > fEnergyFlow
void ParticleCount(G4String, G4double)
const XML_Char const XML_Char * data
const G4String & GetName() const
const G4String & GetProcessName() const
virtual void Merge(const G4Run *)
G4CsvAnalysisManager G4AnalysisManager
std::map< G4String, G4int > fProcCounter
G4ParticleDefinition * fParticle
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
std::map< G4String, ParticleData > fParticleDataMap2
void CountProcesses(G4String procName)
static const G4double fac
G4GLOB_DLL std::ostream G4cout
virtual void Merge(const G4Run *)
G4Material * GetMaterial()
Simple detector construction with a box volume placed in a world.
G4double GetDensity() const