35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
60 fDetector(det), fParticle(nullptr), fEkin(0.)
73 void Run::Merge(std::map<G4String, ParticleData>& destinationMap,
74 const std::map<G4String, ParticleData>& sourceMap)
const
76 for (
const auto& particleData : sourceMap ) {
79 if ( destinationMap.find(name) == destinationMap.end()) {
113 std::map<G4String,G4int>::iterator it =
fProcCounter.find(procName);
136 if (Ekin < emin) data.
fEmin = Ekin;
138 if (Ekin > emax) data.
fEmax = Ekin;
167 ParticleData&
data = it->second;
172 if (Ekin < emin) data.fEmin = Ekin;
174 if (Ekin > emax) data.fEmax = Ekin;
186 std::map<G4String,G4int>::const_iterator it =
fgIonMap.find(ionName);
198 const Run* localRun =
static_cast<const Run*
>(run);
213 for (
const auto& procCounter : localRun->
fProcCounter ) {
215 G4int localCount = procCounter.second;
249 << material->
GetName() <<
" (density: "
260 G4int count = procCounter.second;
261 G4String space =
" ";
if (++index%3 == 0) space =
"\n";
262 G4cout <<
" " << std::setw(20) << procName <<
"="<< std::setw(7) << count
273 ParticleData data = particleData.second;
274 G4int count = data.fCount;
280 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
281 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
283 <<
" --> " <<
G4BestUnit(eMax,
"Energy") <<
")";
294 if (rmsEdep>0.) rmsEdep = std::sqrt(rmsEdep);
297 G4cout <<
"\n Mean energy deposit per event = "
298 <<
G4BestUnit(fEnergyDeposit,
"Energy") <<
"; rms = "
306 if (rmsEflow>0.) rmsEflow = std::sqrt(rmsEflow);
309 G4cout <<
" Mean energy flow per event = "
310 <<
G4BestUnit(fEnergyFlow,
"Energy") <<
"; rms = "
316 G4cout <<
"\n List of particles emerging from the target :" <<
G4endl;
320 ParticleData data = particleData.second;
321 G4int count = data.fCount;
325 G4double Eflow = data.fEmean/TotNbofEvents;
327 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
328 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
341 for (
const auto& ionMapElement :
fgIonMap ) {
343 G4int h1Id = ionMapElement.second;
345 G4cout <<
" " << std::setw(20) << ionName <<
" id = "<< std::setw(3) << h1Id
349 if ( ! analysisManager->GetH1(h1Id) )
continue;
352 G4String title = analysisManager->GetH1Title(h1Id);
353 title = ionName + title;
354 analysisManager->SetH1Title(h1Id, title);
360 G4double binWidth = analysisManager->GetH1Width(ih);
362 analysisManager->ScaleH1(ih,fac);
364 for (ih=14; ih<24; ih++) {
365 binWidth = analysisManager->GetH1Width(ih);
366 G4double unit = analysisManager->GetH1Unit(ih);
367 fac = (
second/(binWidth*unit));
368 analysisManager->ScaleH1(ih,fac);
372 fProcCounter.clear();
373 fParticleDataMap1.clear();
374 fParticleDataMap2.clear();
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
static constexpr double second
void ParticleCount(G4String, G4double)
G4Material * GetAbsorMaterial(G4int i)
const XML_Char const XML_Char * data
const G4String & GetName() const
static std::map< G4String, G4int > fgIonMap
#define G4MUTEX_INITIALIZER
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
G4double GetAbsorThickness(G4int i)
virtual void Merge(const G4Run *)
Simple detector construction with a box volume placed in a world.
G4double GetDensity() const