47 :detector(det), primary(kin)
75 G4cout <<
"\n " << partName <<
" ("
77 << material->
GetName() <<
" (density: "
78 <<
G4BestUnit(density,
"Volumic Mass") <<
"; radiation length: "
84 G4cout <<
"\n Range cuts : \t gamma "
87 G4cout <<
"\n Energy cuts : \t gamma "
97 std::vector<G4String> emName;
98 std::vector<G4double> enerCut;
99 size_t length = plist->
size();
100 for (
size_t j=0; j<length; j++) {
101 procName = (*plist)[j]->GetProcessName();
103 if ((procName ==
"eBrem")||(procName ==
"muBrems")) cut =
energyCut[0];
105 (procName !=
"msc")) {
106 emName.push_back(procName);
107 enerCut.push_back(cut);
112 G4cout <<
"\n processes : ";
113 for (
size_t j=0; j<emName.size();j++)
114 G4cout <<
"\t" << std::setw(13) << emName[j] <<
"\t";
115 G4cout <<
"\t" << std::setw(13) <<
"total";
126 std::vector<G4double> sigma0;
129 for (
size_t j=0; j<emName.size();j++) {
131 (energy,particle,emName[j],Z,A,enerCut[j]);
133 sigma0.push_back(sig);
135 sigma0.push_back(sigtot);
137 G4cout <<
"\n \n cross section per atom : ";
138 for (
size_t j=0; j<sigma0.size();j++) {
145 std::vector<G4double> sigma1;
146 std::vector<G4double> sigma2;
149 for (
size_t j=0; j<emName.size();j++) {
152 (energy,particle,emName[j],material,enerCut[j]);
154 sigma1.push_back(Sig);
155 sigma2.push_back(Sig/density);
157 sigma1.push_back(Sigtot);
158 sigma2.push_back(Sigtot/density);
161 G4cout <<
"\n \n cross section per volume : ";
162 for (
size_t j=0; j<sigma1.size();j++) {
163 G4cout <<
"\t" << std::setw(13) << sigma1[j]*
cm <<
" cm^-1";
166 G4cout <<
"\n cross section per mass : ";
167 for (
size_t j=0; j<sigma2.size();j++) {
175 G4cout <<
"\n \n mean free path : ";
176 for (
size_t j=0; j<sigma1.size();j++) {
178 if (sigma1[j] > 0.) lambda = 1/sigma1[j];
183 G4cout <<
"\n (g/cm2) : ";
184 for (
size_t j=0; j<sigma2.size();j++) {
186 if (sigma2[j] > 0.) lambda = 1/sigma2[j];
193 G4cout <<
"\n-------------------------------------------------------------\n"
199 std::vector<G4double> dedx1;
200 std::vector<G4double> dedx2;
203 for (
size_t j=0; j<emName.size();j++) {
204 dedx = emCal.
ComputeDEDX(energy,particle,emName[j],material,enerCut[j]);
205 dedx1.push_back(dedx);
206 dedx2.push_back(dedx/density);
208 dedxtot = emCal.
GetDEDX(energy,particle,material);
209 dedx1.push_back(dedxtot);
210 dedx2.push_back(dedxtot/density);
213 G4cout <<
"\n \n restricted dE/dx : ";
214 for (
size_t j=0; j<sigma1.size();j++) {
218 G4cout <<
"\n (MeV/g/cm2) : ";
219 for (
size_t j=0; j<sigma2.size();j++) {
220 G4cout <<
"\t" << std::setw(13) <<
G4BestUnit(dedx2[j],
"Energy*Surface/Mass");
232 G4cout <<
"\n \n range from restrict dE/dx: "
233 <<
"\t" << std::setw(8) <<
G4BestUnit(range1,
"Length")
234 <<
" (" << std::setw(8) <<
G4BestUnit(range2,
"Mass/Surface") <<
")";
236 G4cout <<
"\n range from full dE/dx : "
237 <<
"\t" << std::setw(8) <<
G4BestUnit(Range1,
"Length")
238 <<
" (" << std::setw(8) <<
G4BestUnit(Range2,
"Mass/Surface") <<
")";
245 G4cout <<
"\n \n transport mean free path : "
246 <<
"\t" << std::setw(8) <<
G4BestUnit(MSmfp1,
"Length")
247 <<
" (" << std::setw(8) <<
G4BestUnit(MSmfp2,
"Mass/Surface") <<
")";
251 G4cout <<
"\n-------------------------------------------------------------\n";
277 for (
size_t i=0; i<numOfCouples; i++) {
312 G4int iter = 0 , itermax = 10;
313 while (err > errmax && iter < itermax) {
317 err = std::abs(deioni - ekin)/ekin;
320 G4cout <<
"\n \n critical energy (Rossi) : "
321 <<
"\t" << std::setw(8) <<
G4BestUnit(ekin,
"Energy");
332 EcPdg = pdga[istat]/Zeff;
333 G4cout <<
"\t\t\t (from Pdg formula : "
334 << std::setw(8) <<
G4BestUnit(EcPdg,
"Energy") <<
")";
338 G4double rMolier1 = Es/ekin, rMolier2 = rMolier1*radl;
339 G4cout <<
"\n Moliere radius : "
340 <<
"\t" << std::setw(8) << rMolier1 <<
" X0 "
341 <<
"= " << std::setw(8) <<
G4BestUnit(rMolier2,
"Length");
345 G4cout <<
"\t (from Pdg formula : "
346 << std::setw(8) <<
G4BestUnit(rMPdg,
"Length") <<
")";
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
void EndOfRunAction(const G4Run *)
static constexpr double MeV
DetectorConstruction * detector
G4double GetRadlen() const
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
const G4String & GetParticleName() const
G4double GetPDGCharge() const
G4ParticleGun * GetParticleGun()
G4ProcessVector * GetProcessList() const
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
void BeginOfRunAction(const G4Run *)
const G4String & GetName() const
double A(double temperature)
The primary generator action class with particle gun.
G4double ComputeCrossSectionPerAtom(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4double Z, G4double A, G4double cut=0.0)
static G4Electron * Electron()
size_t GetTableSize() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
static G4ProductionCutsTable * GetProductionCutsTable()
G4ProcessManager * GetProcessManager() const
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=nullptr)
G4double GetParticleEnergy() const
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=nullptr)
const std::vector< G4double > * GetRangeCutsVector(size_t pcIdx) const
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
PrimaryGeneratorAction * primary
const G4Material * GetMaterial() const
G4ParticleDefinition * GetParticleDefinition() const
G4Material * GetMaterial()
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
Simple detector construction with a box volume placed in a world.
size_t GetNumberOfElements() const
G4double GetDensity() const