91 if(t0 >=
tm)
return 0.0;
94 Shell(
Z, shell)->BindingEnergy();
103 if(
verbose > 1 || (
Z==4 && e>= 1.0 && e<= 0.0)) {
104 G4cout <<
"G4eIonisationSpectrum::Probability: Z= " <<
Z
105 <<
"; shell= " << shell
106 <<
"; E(keV)= " << e/
keV
124 if(p[3] > 0.5) p[3] = 0.5;
127 p.push_back((2.0*gLocal - 1.0)/(gLocal*gLocal));
135 G4cout <<
"WARNING: G4eIonisationSpectrum::Probability "
136 <<
"parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
137 <<
Z <<
". Please check and/or update it " <<
G4endl;
140 if(e >= 1. && e <= 0. &&
Z == 4) p.push_back(0.0);
147 if(
verbose > 1 || (
Z==4 && e>= 1.0 && e<= 0.0)) {
148 G4cout <<
"tcut= " << tMin
149 <<
"; tMax= " << tMax
165 if(nor > 0.0) val /= nor;
186 if(t0 >=
tm)
return 0.0;
189 Shell(
Z, shell)->BindingEnergy();
199 G4cout <<
"G4eIonisationSpectrum::AverageEnergy: Z= " <<
Z
200 <<
"; shell= " << shell
201 <<
"; E(keV)= " << e/
keV
218 if(p[3] > 0.5) p[3] = 0.5;
221 p.push_back((2.0*gLocal2 - 1.0)/(gLocal2*gLocal2));
230 G4cout <<
"WARNING: G4eIonisationSpectrum::AverageEnergy "
231 <<
"parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
232 <<
Z <<
". Please check and/or update it " <<
G4endl;
242 <<
"; tMax(MeV)= " << tMax/
MeV
257 if(nor > 0.0) val /= nor;
275 if(t0 >
tm)
return tDelta;
278 Shell(
Z, shell)->BindingEnergy();
286 if(x1 >= x2)
return tDelta;
289 G4cout <<
"G4eIonisationSpectrum::SampleEnergy: Z= " <<
Z
290 <<
"; shell= " << shell
291 <<
"; E(keV)= " << e/
keV
306 if(p[3] > 0.5) p[3] = 0.5;
309 p.push_back((2.0*gLocal3 - 1.0)/(gLocal3*gLocal3));
318 G4cout <<
"WARNING: G4eIonisationSpectrum::SampleSpectrum "
319 <<
"parameter p[3] <= 0. G4LEDATA dabatase might be corrupted for Z = "
320 <<
Z <<
". Please check and/or update it " <<
G4endl;
333 G4double amaj, fun, q, x, z1, z2, dx, dx1;
341 if(p[j] > amaj) amaj = p[j];
353 dx = (p[2] - p[1]) / 3.0;
354 dx1=
G4Exp(std::log(p[3]/p[2]) / 16.0);
355 for (i=4; i<
iMax-1; i++) {
359 }
else if(
iMax-2 == i) {
365 if(x >= z1 && x <= z2)
break;
368 fun = p[i] + (x - z1) * (p[i+1] - p[i])/(z2 - z1);
371 G4cout <<
"WARNING in G4eIonisationSpectrum::SampleEnergy:"
372 <<
" Majoranta " << amaj
374 <<
" in the first aria at x= " << x
396 G4cout <<
"WARNING in G4eIonisationSpectrum::SampleEnergy:"
397 <<
" Majoranta " << amaj
399 <<
" in the second aria at x= " << x
415 <<
"; tMax(MeV)= " << tMax/
MeV
423 <<
"; tDelta= " << tDelta
438 if(xMin >= xMax)
return sum;
440 G4double x1, x2, xs1, xs2, y1, y2, ys1, ys2, q;
451 for (
size_t i=0; i<19; i++) {
466 }
else if (xMin < x2) {
476 ys1 += (xs1 - x1)*(y2 - y1)/(x2 - x1);
480 ys2 += (xs2 - x2)*(y1 - y2)/(x1 - x2);
483 q = (ys1*xs2 - ys2*xs1)/(xs1*xs2)
484 + std::log(xs2/xs1)*(ys2 - ys1)/(xs2 - xs1);
486 if(p.size() == 26)
G4cout <<
"i= " << i <<
" q= " << q <<
" sum= " << sum <<
G4endl;
498 if(x1 >= xMax)
return sum;
503 q = (xs1 - xs2)*(1.0 - p[0])
504 - p[
iMax]*std::log(x2/x1)
505 + (1. - p[
iMax])*(x2 - x1)
506 + 1./(1. - x2) - 1./(1. - x1)
507 + p[
iMax]*std::log((1. - x2)/(1. - x1))
508 + 0.25*p[0]*(xs1*xs1 - xs2*xs2);
510 if(p.size() == 26)
G4cout <<
"param... q= " << q <<
" sum= " << sum <<
G4endl;
521 if(xMin >= xMax)
return sum;
523 G4double x1, x2, xs1, xs2, y1, y2, ys1, ys2;
534 for (
size_t i=0; i<19; i++) {
548 }
else if (xMin < x2) {
558 ys1 += (xs1 - x1)*(y2 - y1)/(x2 - x1);
562 ys2 += (xs2 - x2)*(y1 - y2)/(x1 - x2);
565 sum += std::log(xs2/xs1)*(ys1*xs2 - ys2*xs1)/(xs2 - xs1)
579 if(x1 >= xMax)
return sum;
585 sum += std::log(x2/x1)*(1.0 - p[0])
586 + 0.5*(1. - p[
iMax])*(x2*x2 - x1*x1)
587 + 1./(1. - x2) - 1./(1. - x1)
588 + (1. + p[
iMax])*std::log((1. - x2)/(1. - x1))
589 + 0.5*p[0]*(xs1 - xs2);
604 return 0.5 * kineticEnergy;
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static constexpr double keV
static constexpr double eV
static constexpr double MeV
G4GLOB_DLL std::ostream G4cout
static G4AtomicTransitionManager * Instance()
G4double Parameter(G4int Z, G4int shellIndex, G4int parameterIndex, G4double e) const
G4double AverageEnergy(G4int Z, G4double tMin, G4double tMax, G4double kineticEnergy, G4int shell, const G4ParticleDefinition *pd=0) const
G4double IntSpectrum(G4double xMin, G4double xMax, const G4DataVector &p) const
G4eIonisationParameters * theParam
G4double SampleEnergy(G4int Z, G4double tMin, G4double tMax, G4double kineticEnergy, G4int shell, const G4ParticleDefinition *pd=0) const
G4double MaxEnergyOfSecondaries(G4double kineticEnergy, G4int Z=0, const G4ParticleDefinition *pd=0) const
G4double Function(G4double x, const G4DataVector &p) const
G4double AverageValue(G4double xMin, G4double xMax, const G4DataVector &p) const
G4double Probability(G4int Z, G4double tMin, G4double tMax, G4double kineticEnergy, G4int shell, const G4ParticleDefinition *pd=0) const
G4double energy(const ThreeVector &p, const G4double m)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double bindingEnergy(G4int A, G4int Z)