35 #include "DetectorConstruction.hh"
37 #include "EventAction.hh"
38 #include "HistoManager.hh"
39 #include "PrimaryGeneratorAction.hh"
52 fParticle(0), fEkin(0.)
79 std::map<G4String,G4int>::iterator it =
fProcCounter.find(procName);
92 std::map<G4String, ParticleData>::iterator it =
fParticleDataMap[k].find(name);
102 if (Ekin < emin) data.
fEmin = Ekin;
104 if (Ekin > emax) data.
fEmax = Ekin;
141 const Run* localRun =
static_cast<const Run*
>(run);
150 for (
G4int i=1; i<=nbOfAbsor; ++i) {
154 min = localRun->
fEmin[i]; max = localRun->
fEmax[i];
169 std::map<G4String,G4int>::const_iterator itp;
174 G4int localCount = itp->second;
184 for (
G4int k=0; k<=nbOfAbsor; ++k) {
185 std::map<G4String,ParticleData>::const_iterator itc;
190 const ParticleData& localData = itc->second;
193 = ParticleData(localData.fCount,
200 data.fCount += localData.fCount;
201 data.fEmean += localData.fEmean;
203 if (emin < data.fEmin) data.fEmin = emin;
205 if (emax > data.fEmax) data.fEmax =
emax;
225 G4cout <<
"\n ======================== run summary =====================\n";
227 <<
"\n The run is " <<
numberOfEvent <<
" "<< partName <<
" of "
229 <<
" through " << nbOfAbsor <<
" absorbers: \n";
230 for (
G4int i=1; i<= nbOfAbsor; i++) {
234 G4cout << std::setw(5) << i
235 << std::setw(10) <<
G4BestUnit(thickness,
"Length") <<
" of "
236 << material->
GetName() <<
" (density: "
248 std::map<G4String,G4int>::iterator it;
251 G4int count = it->second;
252 G4String space =
" ";
if (++index%3 == 0) space =
"\n";
253 G4cout <<
" " << std::setw(20) << procName <<
"="<< std::setw(7) << count
260 for (
G4int i=1; i<= nbOfAbsor; i++) {
264 <<
"\n Edep in absorber " << i <<
" = "
283 for (
G4int k=1; k<= nbOfAbsor; k++) {
284 G4cout <<
"\n List of generated particles in absorber " << k <<
":" <<
G4endl;
286 std::map<G4String,ParticleData>::iterator itc;
290 ParticleData
data = itc->second;
291 G4int count = data.fCount;
296 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
297 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
305 G4cout <<
"\n List of particles emerging from absorbers :" <<
G4endl;
307 std::map<G4String,ParticleData>::iterator itc;
311 ParticleData
data = itc->second;
312 G4int count = data.fCount;
317 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
318 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
333 <<
"\n Nb of events with primary absorbed = " << absorbed <<
" %,"
334 <<
" transmit = " << transmit <<
" %,"
335 <<
" reflected = " << reflected <<
" %" <<
G4endl;
341 G4double binWidth = analysisManager->GetH1Width(ih)
342 *analysisManager->GetH1Unit(ih);
344 analysisManager->ScaleH1(ih,fac);
T max(const T t1, const T t2)
brief Return the largest of the two arguments
std::map< G4String, ParticleData > fParticleDataMap
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
DetectorConstruction * fDetector
static constexpr double MeV
void AddEdep(G4double val)
static constexpr double mm
void AddTotEdep(G4double e)
void AddTrackStatus(G4int i)
const G4String & GetParticleName() const
static const G4double emax
void ParticleCount(G4String, G4double)
G4Material * GetAbsorMaterial(G4int i)
const XML_Char const XML_Char * data
const G4String & GetName() const
G4double fEmin[kMaxAbsor]
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
void CountProcesses(G4String procName)
static const G4double fac
static constexpr double joule
G4GLOB_DLL std::ostream G4cout
G4double GetAbsorThickness(G4int i)
virtual void Merge(const G4Run *)
G4double fEdeposit[kMaxAbsor]
Simple detector construction with a box volume placed in a world.
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double fEmax[kMaxAbsor]
G4double GetDensity() const