46:detector(det), primary(kin)
74 G4cout <<
"\n " << partName <<
" ("
76 <<
material->GetName() <<
" (density: "
77 <<
G4BestUnit(density,
"Volumic Mass") <<
"; radiation length: "
83 G4cout <<
"\n Range cuts : \t gamma "
86 G4cout <<
"\n Energy cuts : \t gamma "
96 std::vector<G4String> emName;
97 std::vector<G4double> enerCut;
98 size_t length = plist->
size();
99 for (
size_t j=0; j<length; j++) {
100 procName = (*plist)[j]->GetProcessName();
102 if ((procName ==
"eBrem")||(procName ==
"muBrems")) cut =
energyCut[0];
104 (procName !=
"msc")) {
105 emName.push_back(procName);
106 enerCut.push_back(cut);
111 G4cout <<
"\n processes : ";
112 for (
size_t j=0; j<emName.size();j++)
113 G4cout <<
"\t" << std::setw(13) << emName[j] <<
"\t";
114 G4cout <<
"\t" << std::setw(13) <<
"total";
121 if (
material->GetNumberOfElements() == 1) {
125 std::vector<G4double> sigma0;
128 for (
size_t j=0; j<emName.size();j++) {
130 (
energy,particle,emName[j],
Z,
A,enerCut[j]);
132 sigma0.push_back(sig);
134 sigma0.push_back(sigtot);
136 G4cout <<
"\n \n cross section per atom : ";
137 for (
size_t j=0; j<sigma0.size();j++) {
144 std::vector<G4double> sigma1;
145 std::vector<G4double> sigma2;
148 for (
size_t j=0; j<emName.size();j++) {
153 sigma1.push_back(Sig);
154 sigma2.push_back(Sig/density);
156 sigma1.push_back(Sigtot);
157 sigma2.push_back(Sigtot/density);
160 G4cout <<
"\n \n cross section per volume : ";
161 for (
size_t j=0; j<sigma1.size();j++) {
162 G4cout <<
"\t" << std::setw(13) << sigma1[j]*
cm <<
" cm^-1";
165 G4cout <<
"\n cross section per mass : ";
166 for (
size_t j=0; j<sigma2.size();j++) {
174 G4cout <<
"\n \n mean free path : ";
175 for (
size_t j=0; j<sigma1.size();j++) {
177 if (sigma1[j] > 0.)
lambda = 1/sigma1[j];
182 G4cout <<
"\n (g/cm2) : ";
183 for (
size_t j=0; j<sigma2.size();j++) {
185 if (sigma2[j] > 0.)
lambda = 1/sigma2[j];
192 G4cout <<
"\n-------------------------------------------------------------\n"
198 std::vector<G4double> dedx1;
199 std::vector<G4double> dedx2;
202 for (
size_t j=0; j<emName.size();j++) {
204 dedx1.push_back(dedx);
205 dedx2.push_back(dedx/density);
208 dedx1.push_back(dedxtot);
209 dedx2.push_back(dedxtot/density);
212 G4cout <<
"\n \n restricted dE/dx : ";
213 for (
size_t j=0; j<sigma1.size();j++) {
217 G4cout <<
"\n (MeV/g/cm2) : ";
218 for (
size_t j=0; j<sigma2.size();j++) {
219 G4cout <<
"\t" << std::setw(13) <<
G4BestUnit(dedx2[j],
"Energy*Surface/Mass");
231 G4cout <<
"\n \n range from restrict dE/dx: "
232 <<
"\t" << std::setw(8) <<
G4BestUnit(range1,
"Length")
233 <<
" (" << std::setw(8) <<
G4BestUnit(range2,
"Mass/Surface") <<
")";
235 G4cout <<
"\n range from full dE/dx : "
236 <<
"\t" << std::setw(8) <<
G4BestUnit(Range1,
"Length")
237 <<
" (" << std::setw(8) <<
G4BestUnit(Range2,
"Mass/Surface") <<
")";
244 G4cout <<
"\n \n transport mean free path : "
245 <<
"\t" << std::setw(8) <<
G4BestUnit(MSmfp1,
"Length")
246 <<
" (" << std::setw(8) <<
G4BestUnit(MSmfp2,
"Mass/Surface") <<
")";
250 G4cout <<
"\n-------------------------------------------------------------\n";
276 for (
size_t i=0; i<numOfCouples; i++) {
311 G4int iter = 0 , itermax = 10;
312 while (err > errmax && iter < itermax) {
316 err = std::abs(deioni - ekin)/ekin;
319 G4cout <<
"\n \n critical energy (Rossi) : "
320 <<
"\t" << std::setw(8) <<
G4BestUnit(ekin,
"Energy");
327 if (
material->GetNumberOfElements() == 1) {
331 EcPdg = pdga[istat]/Zeff;
332 G4cout <<
"\t\t\t (from Pdg formula : "
333 << std::setw(8) <<
G4BestUnit(EcPdg,
"Energy") <<
")";
337 G4double rMolier1 = Es/ekin, rMolier2 = rMolier1*radl;
338 G4cout <<
"\n Moliere radius : "
339 <<
"\t" << std::setw(8) << rMolier1 <<
" X0 "
340 <<
"= " << std::setw(8) <<
G4BestUnit(rMolier2,
"Length");
342 if (
material->GetNumberOfElements() == 1) {
344 G4cout <<
"\t (from Pdg formula : "
345 << std::setw(8) <<
G4BestUnit(rMPdg,
"Length") <<
")";
static constexpr double MeV
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
G4Material * GetMaterial()
static G4Electron * Electron()
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
G4double ComputeCrossSectionPerAtom(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4double Z, G4double A, G4double cut=0.0)
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
const G4Material * GetMaterial() const
G4ProcessManager * GetProcessManager() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4ParticleDefinition * GetParticleDefinition() const
G4double GetParticleEnergy() const
G4ProcessVector * GetProcessList() const
const std::vector< G4double > * GetRangeCutsVector(std::size_t pcIdx) const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
const std::vector< G4double > * GetEnergyCutsVector(std::size_t pcIdx) const
static G4ProductionCutsTable * GetProductionCutsTable()
G4ParticleGun * GetParticleGun()
void BeginOfRunAction(const G4Run *)
void EndOfRunAction(const G4Run *)
PrimaryGeneratorAction * primary
DetectorConstruction * detector
RunAction(DetectorConstruction *, PrimaryGeneratorAction *)
G4double energy(const ThreeVector &p, const G4double m)