34 #include "RunAction.hh"
35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
83 G4cout <<
"\n " << partName <<
" ("
85 << material->
GetName() <<
" (density: "
86 <<
G4BestUnit(density,
"Volumic Mass") <<
"; radiation length: "
92 G4cout <<
"\n Range cuts : \t gamma "
95 G4cout <<
"\n Energy cuts : \t gamma "
104 G4double moverM = electron_mass_c2/Mass_c2;
105 G4double gamM1 = energy/Mass_c2,
gam = gamM1 + 1., gamP1 = gam + 1.;
107 (2*electron_mass_c2*gamM1*gamP1)/(1.+2*gam*moverM+moverM*moverM);
118 std::vector<G4String> emName;
119 std::vector<G4double> enerCut;
120 size_t length = plist->
size();
121 for (
size_t j=0; j<length; j++) {
122 procName = (*plist)[j]->GetProcessName();
124 if ((procName ==
"eBrem")||(procName ==
"muBrems")) cut =
fEnergyCut[0];
126 (procName !=
"msc")) {
127 emName.push_back(procName);
128 enerCut.push_back(cut);
133 G4cout <<
"\n processes : ";
134 for (
size_t j=0; j<emName.size();j++)
135 G4cout <<
"\t" << std::setw(13) << emName[j] <<
"\t";
136 G4cout <<
"\t" << std::setw(13) <<
"total";
143 std::vector<G4double> sigma0;
146 for (
size_t j=0; j<emName.size();j++) {
148 (energy,particle,emName[j],Z,A,enerCut[j]);
150 sigma0.push_back(sig);
152 sigma0.push_back(sigtot);
154 G4cout <<
"\n \n cross section per atom : ";
155 for (
size_t j=0; j<sigma0.size();j++) {
162 std::vector<G4double> sigma0;
163 std::vector<G4double> sigma1;
164 std::vector<G4double> sigma2;
165 G4double Sig, SigtotComp = 0., Sigtot = 0.;
167 for (
size_t j=0; j<emName.size();j++) {
169 (energy,particle,emName[j],material,enerCut[j]);
171 sigma0.push_back(Sig);
174 sigma1.push_back(Sig);
175 sigma2.push_back(Sig/density);
177 sigma0.push_back(SigtotComp);
178 sigma1.push_back(Sigtot);
179 sigma2.push_back(Sigtot/density);
182 G4cout <<
"\n \n compCrossSectionPerVolume : ";
183 for (
size_t j=0; j<sigma0.size();j++) {
184 G4cout <<
"\t" << std::setw(13) << sigma0[j]*
cm <<
" cm^-1";
186 G4cout <<
"\n cross section per volume : ";
187 for (
size_t j=0; j<sigma1.size();j++) {
188 G4cout <<
"\t" << std::setw(13) << sigma1[j]*
cm <<
" cm^-1";
191 G4cout <<
"\n cross section per mass : ";
192 for (
size_t j=0; j<sigma2.size();j++) {
193 G4cout <<
"\t" << std::setw(13)
201 G4cout <<
"\n \n mean free path : ";
202 for (
size_t j=0; j<sigma1.size();j++) {
204 if (sigma1[j] > 0.) lambda = 1/sigma1[j];
209 G4cout <<
"\n (g/cm2) : ";
210 for (
size_t j=0; j<sigma2.size();j++) {
212 if (sigma2[j] > 0.) lambda = 1/sigma2[j];
219 G4cout <<
"\n-------------------------------------------------------------\n"
225 std::vector<G4double> dedx1;
226 std::vector<G4double> dedx2;
228 size_t nproc = emName.size();
230 for (
size_t j=0; j<nproc; j++) {
231 dedx = emCal.
ComputeDEDX(energy,particle,emName[j],material,enerCut[j]);
233 dedx1.push_back(dedx);
234 dedx2.push_back(dedx/density);
236 dedx1.push_back(dedxtot);
237 dedx2.push_back(dedxtot/density);
240 G4cout <<
"\n \n restricted dE/dx : ";
241 for (
size_t j=0; j<=nproc; j++) {
242 G4cout <<
"\t" << std::setw(13)
246 G4cout <<
"\n (MeV/g/cm2) : ";
247 for (
size_t j=0; j<=nproc; j++) {
248 G4cout <<
"\t" << std::setw(13)
249 <<
G4BestUnit(dedx2[j],
"Energy*Surface/Mass");
253 for (
size_t j=0; j<nproc; j++) {
254 dedx = emCal.
ComputeDEDX(energy,particle,emName[j],material,energy);
259 dedx1[nproc] = dedxtot;
260 dedx2[nproc] = dedxtot/
density;
263 G4cout <<
"\n \n unrestricted dE/dx : ";
264 for (
size_t j=0; j<=nproc; j++) {
268 G4cout <<
"\n (MeV/g/cm2) : ";
269 for (
size_t j=0; j<=nproc; j++) {
270 G4cout <<
"\t" << std::setw(13)
271 <<
G4BestUnit(dedx2[j],
"Energy*Surface/Mass");
279 G4cout <<
"\n \n range from restrict dE/dx: "
280 <<
"\t" << std::setw(8) <<
G4BestUnit(range1,
"Length")
281 <<
" (" << std::setw(8) <<
G4BestUnit(range2,
"Mass/Surface") <<
")";
288 G4cout <<
"\n range from full dE/dx : "
289 <<
"\t" << std::setw(8) <<
G4BestUnit(Range1,
"Length")
290 <<
" (" << std::setw(8) <<
G4BestUnit(Range2,
"Mass/Surface") <<
")";
298 G4cout <<
"\n \n transport mean free path : "
299 <<
"\t" << std::setw(8) <<
G4BestUnit(MSmfp1,
"Length")
300 <<
" (" << std::setw(8) <<
G4BestUnit(MSmfp2,
"Mass/Surface") <<
")";
304 G4cout <<
"\n-------------------------------------------------------------\n";
330 for (
size_t i=0; i<numOfCouples; i++) {
365 G4int iter = 0 , itermax = 10;
366 while (err > errmax && iter < itermax) {
370 err = std::abs(deioni - ekin)/ekin;
373 G4cout <<
"\n \n critical energy (Rossi) : "
374 <<
"\t" << std::setw(8) <<
G4BestUnit(ekin,
"Energy");
385 EcPdg = pdga[istat]/Zeff;
386 G4cout <<
"\t\t\t (from Pdg formula : "
387 << std::setw(8) <<
G4BestUnit(EcPdg,
"Energy") <<
")";
391 G4double rMolier1 = Es/ekin, rMolier2 = rMolier1*radl;
392 G4cout <<
"\n Moliere radius : "
393 <<
"\t" << std::setw(8) << rMolier1 <<
" X0 "
394 <<
"= " << std::setw(8) <<
G4BestUnit(rMolier2,
"Length");
398 G4cout <<
"\t (from Pdg formula : "
399 << std::setw(8) <<
G4BestUnit(rMPdg,
"Length") <<
")";
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
void BeginOfRunAction(const G4Run *)
const G4String & GetName() const
G4double GetDensity() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double GetCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, const G4Region *r=0)
G4ProcessManager * GetProcessManager() const
DetectorConstruction * fDetector
const G4String & GetParticleName() const
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
G4GLOB_DLL std::ostream G4cout
size_t GetTableSize() const
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=DBL_MAX)
G4Material * GetMaterial()
void EndOfRunAction(const G4Run *)
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition *, const G4Material *, const G4Region *r=0)
const std::vector< G4double > * GetRangeCutsVector(size_t pcIdx) const
static const G4double A[nN]
G4double GetRadlen() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4double GetPDGMass() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4ParticleGun * GetParticleGun()
G4double energy(const ThreeVector &p, const G4double m)
G4double ComputeCrossSectionPerVolume(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, const G4Material *, G4double cut=0.0)
G4ParticleDefinition * GetParticleDefinition() const
static G4Electron * Electron()
Detector construction class to demonstrate various ways of placement.
G4double ComputeCrossSectionPerAtom(G4double kinEnergy, const G4ParticleDefinition *, const G4String &processName, G4double Z, G4double A, G4double cut=0.0)
size_t GetNumberOfElements() const
G4double GetPDGCharge() const
G4double GetParticleEnergy() const
G4ProcessVector * GetProcessList() const
PrimaryGeneratorAction * fPrimary
const G4Material * GetMaterial() const