35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
48 fDetector(det), fParticle(0), fEkin(0.),
49 fTotalCount(0), fGammaCount(0),
50 fSumTrack(0.), fSumTrack2(0.),
81 std::map<G4String,G4int>::iterator it =
fProcCounter.find(procName);
101 std::map<G4String, NuclChannel>::iterator it =
fNuclChannelMap.find(name);
116 std::map<G4String, ParticleData>::iterator it =
fParticleDataMap.find(name);
126 if (Ekin < emin) data.
fEmin = Ekin;
128 if (Ekin > emax) data.
fEmax = Ekin;
158 const Run* localRun =
static_cast<const Run*
>(run);
174 std::map<G4String,G4int>::const_iterator itp;
179 G4int localCount = itp->second;
189 std::map<G4String,NuclChannel>::const_iterator itc;
194 const NuclChannel& localData = itc->second;
197 = NuclChannel(localData.fCount, localData.fQ);
201 data.fCount += localData.fCount;
202 data.fQ += localData.fQ;
207 std::map<G4String,ParticleData>::const_iterator itn;
212 const ParticleData& localData = itn->second;
215 = ParticleData(localData.fCount,
222 data.fCount += localData.fCount;
223 data.fEmean += localData.fEmean;
225 if (emin < data.fEmin) data.fEmin = emin;
227 if (emax > data.fEmax) data.fEmax =
emax;
250 << material->
GetName() <<
" (density: "
259 std::map<G4String,G4int>::iterator it;
262 G4int count = it->second;
263 G4cout <<
"\t" << procName <<
"= " << count;
264 if (procName ==
"Transportation") survive = count;
269 G4cout <<
"\n Nb of incident particles surviving after "
280 G4double rms = std::sqrt(std::fabs(MeanTrack2 - MeanFreePath*MeanFreePath));
282 if(MeanFreePath > 0.0) { CrossSection = 1./MeanFreePath; }
283 G4double massicMFP = MeanFreePath*density;
285 if(massicMFP > 0.0) { massicCS = 1./massicMFP; }
289 <<
"\tmassic: " <<
G4BestUnit(massicMFP,
"Mass/Surface")
290 <<
"\n CrossSection:\t" << CrossSection*
cm <<
" cm^-1 "
291 <<
"\t\tmassic: " <<
G4BestUnit(massicCS,
"Surface/Mass")
298 G4double crossSection = CrossSection/nbAtoms;
299 G4cout <<
" crossSection per atom:\t"
304 G4cout <<
"\n Verification: "
305 <<
"crossSections from G4HadronicProcessStore:";
322 G4cout <<
"\n" << std::setw(20) << procName <<
"= "
323 <<
G4BestUnit(massSigma,
"Surface/Mass") <<
"\t"
327 G4cout <<
"\n" << std::setw(20) <<
"total" <<
"= "
338 G4cout <<
"\n" << std::setw(20) << procName <<
"= "
341 G4cout <<
"\n" << std::setw(20) <<
"total" <<
"= "
348 std::map<G4String,NuclChannel>::iterator ic;
355 G4cout <<
" " << std::setw(60) << name <<
": " << std::setw(7) << count
356 <<
" Q = " << std::setw(wid) <<
G4BestUnit(Q,
"Energy")
363 G4cout <<
"\n" << std::setw(58) <<
"number of gamma or e- (ic): N = "
369 <<
"\n --> NOTE: XXXX because neutronHP is unable to return target nucleus"
377 std::map<G4String,ParticleData>::iterator itn;
386 G4cout <<
" " << std::setw(13) << name <<
": " << std::setw(7) << count
387 <<
" Emean = " << std::setw(wid) <<
G4BestUnit(eMean,
"Energy")
397 G4cout <<
"\n Momentum balance: Pmean = "
398 << std::setw(wid) <<
G4BestUnit(Pbmean,
"Energy")
void print(G4double elem)
std::map< G4String, ParticleData > fParticleDataMap
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
DetectorConstruction * fDetector
G4double GetCrossSectionPerAtom(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Element *element, const G4Material *material=nullptr)
const G4String & GetParticleName() const
void SetTargetXXX(G4bool)
static const G4double emax
static G4ProcessTable * GetProcessTable()
void ParticleCount(G4String, G4double)
const XML_Char const XML_Char * data
const G4String & GetName() const
const G4String & GetProcessName() const
virtual void Merge(const G4Run *)
std::map< G4String, G4int > fProcCounter
static G4HadronicProcessStore * Instance()
G4ParticleDefinition * fParticle
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void CountProcesses(G4String procName)
G4double GetCrossSectionPerVolume(const G4ParticleDefinition *particle, G4double kineticEnergy, const G4VProcess *process, const G4Material *material)
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
virtual void Merge(const G4Run *)
G4double GetTotNbOfAtomsPerVolume() const
void CountNuclearChannel(G4String, G4double)
G4Material * GetMaterial()
const G4Element * GetElement(G4int iel) const
void SumTrack(G4double track)
Simple detector construction with a box volume placed in a world.
size_t GetNumberOfElements() const
std::map< G4String, NuclChannel > fNuclChannelMap
G4double GetDensity() const