Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
e_cont_enloss.cpp
Go to the documentation of this file.
1#include <stdlib.h>
2#include <limits.h>
3#include <cmath>
8
9// 2003, I. Smirnov
10
11namespace Heed {
12
13using CLHEP::twopi;
14using CLHEP::electron_mass_c2;
15using CLHEP::classic_electr_radius;
16using CLHEP::GeV;
17using CLHEP::gram;
18using CLHEP::mole;
19using CLHEP::Avogadro;
20using CLHEP::cm2;
21using CLHEP::cm3;
22
23double e_cont_enloss(double ratio_Z_to_A, // do not forget:
24 // 1.0/(gram/mole)
25 double I_eff, double density,
26 double Ekin, // in internal units
27 double Ecut, // in internal units
28 double z) {
29 mfunname("double e_cont_enloss(...)");
30 const double gamma_1 = Ekin / electron_mass_c2;
31 if (gamma_1 <= 0.0) return 0.;
32 const double gamma = gamma_1 + 1.;
33 const double gamma2 = gamma * gamma;
34
35 const double Tcme = Ecut / electron_mass_c2;
36 const double beta = lorbeta(gamma_1);
37 const double beta2 = beta * beta;
38 // calculation of F^+-
39 double F;
40 if (z > 0) {
41 // positron
42 const double y = 1.0 / (1.0 + gamma);
43 const double D = std::min(Tcme, gamma_1);
44 const double D2 = 0.5 * D * D;
45 const double D3 = 2.0 * D2 * D / 3.0;
46 const double D4 = D2 * D2;
47 F = log(gamma_1 * D) -
48 beta2 * (gamma_1 + 2.0 * D -
49 y * (3.0 * D2 + y * (D - D3 + y * (D2 - gamma_1 * D3 + D4)))) /
50 gamma_1;
51 } else {
52 // electron
53 const double D = std::min(Tcme, 0.5 * gamma_1);
54 F = -1.0 - beta2 + log((gamma_1 - D) * D) + gamma_1 / (gamma_1 - D) +
55 (0.5 * D * D + (1.0 + 2.0 * gamma_1) * log(1.0 - D / gamma_1)) / gamma2;
56 }
57 const double logI = log(I_eff / electron_mass_c2);
58 // Electron density (in 1 / [length^3])
59 const double eldens = ratio_Z_to_A * Avogadro * density;
60 // Dimensionless constant
61 double C = 1.0 + 2.0 * log((I_eff / GeV) /
62 (28.8e-9 * sqrt(density / (gram / cm3) *
63 ratio_Z_to_A * gram / mole)));
64 // Iprintn(mcout, density/(g/cm3));
65 // Iprintn(mcout, ratio_Z_to_A * gram/mole);
66 // Iprintn(mcout, C);
67 double x0, x1;
68 if (density > 0.05 * gram / cm3) {
69 // mcout<<"density > 0.05 * g/cm3\n";
70 if (I_eff < 1.0e-7 * GeV) {
71 if (C < 3.681) {
72 x0 = 1.0;
73 } else {
74 x0 = 0.326 * C - 1.0;
75 }
76 x1 = 2.0;
77 } else {
78 // mcout<<"I_eff >= 1.0e-7 * GeV\n";
79 if (C < 5.215) {
80 // mcout<<"C < 5.215\n";
81 x0 = 0.2;
82 } else {
83 x0 = 0.326 * C - 1.5;
84 }
85 x1 = 3.0;
86 }
87 } else {
88 // mcout<<"density <= 0.05 * g/cm3\n";
89 if (C <= 12.25) {
90 // mcout<<"C <= 12.25\n";
91 double ip = long((C - 10.0) / 0.5) + 1;
92 if (ip < 0) ip = 0;
93 if (ip > 4) ip = 4;
94 x0 = 1.6 + 0.1 * ip;
95 x1 = 4.0;
96 } else {
97 if (C <= 13.804) {
98 x0 = 2.0;
99 x1 = 5.0;
100 } else {
101 x0 = 0.326 * C - 2.5;
102 x1 = 5.0;
103 }
104 }
105 }
106 const double xa = C / 4.606;
107 const double aa = 4.606 * (xa - x0) / pow(x1 - x0, 3);
108 const double x = log(gamma_1 * (gamma + 1.0)) / 4.606;
109 double del = 0.0;
110 if (x > x0) {
111 del = 4.606 * x - C;
112 if (x <= x1) del = del + aa * pow(x1 - x, 3);
113 }
114 const double cons =
115 twopi * classic_electr_radius * classic_electr_radius * electron_mass_c2;
116 // double cons = 0.153536e-3 * GeV * cm2 / Avogadro;
117 double dedx =
118 cons * eldens * (log(2.0 * gamma_1 + 4.0) - 2.0 * logI + F - del) / beta2;
119 return dedx > 0. ? dedx : 0.;
120}
121}
#define mfunname(string)
Definition: FunNameStack.h:45
Definition: BGMesh.cpp:6
double lorbeta(const double gamma_1)
as function of .
Definition: lorgamma.cpp:23
DoubleAc pow(const DoubleAc &f, double p)
Definition: DoubleAc.cpp:337
double e_cont_enloss(double ratio_Z_to_A, double I_eff, double density, double Ekin, double Ecut, double z)
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314