Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
bethe_bloch.cpp
Go to the documentation of this file.
1#include <stdlib.h>
2#include <limits.h>
3#include <cmath>
8
9// 2002, I. Smirnov
10
11namespace Heed {
12
13using CLHEP::pi;
14using CLHEP::twopi;
15using CLHEP::classic_electr_radius;
16using CLHEP::electron_mass_c2;
17using CLHEP::Avogadro;
18using CLHEP::c_squared;
19
20double Bethe_Bloch_energy_loss(const double ratio_Z_to_A, const double I_eff,
21 const double beta, const double z) {
22
23 constexpr double coef1 = 4 * pi * classic_electr_radius *
24 classic_electr_radius * electron_mass_c2 * Avogadro;
25 const double beta2 = beta * beta;
26 const double gamma = lorgamma_1(beta) + 1.;
27 const double gamma2 = gamma * gamma;
28 const double coef2 = z * z * ratio_Z_to_A / beta2;
29 const double sum =
30 log(2. * electron_mass_c2 * beta2 * gamma2 / I_eff) - beta2;
31 return coef1 * coef2 * sum;
32}
33
34double Bethe_Bloch_energy_loss_gamma_1(const double ratio_Z_to_A,
35 const double I_eff, const double gamma_1,
36 const double z) {
37 // This constant should be 0.3071 according to PDG.
38 constexpr double coef1 = 4 * pi * classic_electr_radius *
39 classic_electr_radius * electron_mass_c2 * Avogadro;
40 const double beta = lorbeta(gamma_1);
41 const double beta2 = beta * beta;
42 const double gamma = gamma_1 + 1.0;
43 const double gamma2 = gamma * gamma;
44 const double coef2 = z * z * ratio_Z_to_A / beta2;
45 const double sum =
46 log(2. * electron_mass_c2 * beta2 * gamma2 / I_eff) - beta2;
47 return coef1 * coef2 * sum;
48}
49
51 const double ratio_Z_to_A, const double I_eff, const double m,
52 const double gamma_1, const double ecut, const double z) {
53
54 // TODO: 4 pi or 2 pi?
55 constexpr double coef1 = twopi * classic_electr_radius *
56 classic_electr_radius * electron_mass_c2 * Avogadro;
57 const double beta = lorbeta(gamma_1);
58 const double beta2 = beta * beta;
59 const double gamma = gamma_1 + 1.0;
60 const double gamma2 = gamma * gamma;
61 const double coef2 = z * z * ratio_Z_to_A / beta2;
62 const double mrat = electron_mass_c2 / (m * c_squared);
63 const double emax = 2.0 * electron_mass_c2 * beta2 * gamma2 /
64 (1.0 + 2.0 * gamma * mrat + mrat * mrat);
65 double sum = 0.;
66 if (ecut >= emax) {
67 sum = log(2.0 * electron_mass_c2 * beta2 * gamma2 * emax / (I_eff * I_eff)) -
68 2.0 * beta2;
69 } else {
70 sum = log(2.0 * electron_mass_c2 * beta2 * gamma2 * ecut / (I_eff * I_eff)) -
71 beta2 * (1.0 + ecut / emax);
72 }
73 return coef1 * coef2 * sum;
74}
75}
Definition: BGMesh.cpp:6
double Bethe_Bloch_energy_loss_gamma_1(const double ratio_Z_to_A, const double I_eff, const double gamma_1, const double z)
Safer version, using gamma - 1 instead of beta.
Definition: bethe_bloch.cpp:34
double lorbeta(const double gamma_1)
as function of .
Definition: lorgamma.cpp:23
double Bethe_Bloch_energy_loss(const double ratio_Z_to_A, const double I_eff, const double beta, const double z)
Definition: bethe_bloch.cpp:20
double lorgamma_1(double beta)
as function of .
Definition: lorgamma.cpp:10
double Bethe_Bloch_restricted_energy_loss_gamma_1(const double ratio_Z_to_A, const double I_eff, const double m, const double gamma_1, const double ecut, const double z)
Definition: bethe_bloch.cpp:50