Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MediumDiamond.cc
Go to the documentation of this file.
1#include <cmath>
2#include <iostream>
3
6
7namespace Garfield {
8
10 m_className = "MediumDiamond";
11 m_name = "Diamond";
12
13 SetTemperature(300.);
18
19 m_driftable = true;
20 m_ionisable = true;
21 m_microscopic = false;
22
23 m_w = 13.6;
24 // TODO:
25 m_fano = 0.1;
26}
27
28void MediumDiamond::GetComponent(const unsigned int i, std::string& label,
29 double& f) {
30 if (i == 0) {
31 label = "C";
32 f = 1.;
33 } else {
34 std::cerr << m_className << "::GetComponent: Index out of range.\n";
35 }
36}
37
39 const double ex, const double ey, const double ez,
40 const double bx, const double by, const double bz,
41 double& vx, double& vy, double& vz) {
42 vx = vy = vz = 0.;
43 if (m_isChanged) {
44 UpdateTransportParameters();
45 m_isChanged = false;
46 }
47 if (!m_eVelE.empty()) {
48 // Interpolation in user table.
49 return Medium::ElectronVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
50 }
51 // Calculate the mobility
52 const double emag = sqrt(ex * ex + ey * ey + ez * ez);
53 const double mu = -m_eMobility / (1. + m_eMobility * emag / m_eSatVel);
54 const double b2 = bx * bx + by * by + bz * bz;
55 if (b2 < Small) {
56 vx = mu * ex;
57 vy = mu * ey;
58 vz = mu * ez;
59 } else {
60 Langevin(ex, ey, ez, bx, by, bz, mu, m_eHallFactor * mu, vx, vy, vz);
61 }
62 return true;
63}
64
66 const double ex, const double ey, const double ez,
67 const double bx, const double by, const double bz, double& alpha) {
68 alpha = 0.;
69 if (!m_eAlp.empty()) {
70 // Interpolation in user table.
71 return Medium::ElectronTownsend(ex, ey, ez, bx, by, bz, alpha);
72 }
73 return false;
74}
75
77 const double ex, const double ey, const double ez,
78 const double bx, const double by, const double bz, double& eta) {
79 eta = 0.;
80 if (!m_eAtt.empty()) {
81 // Interpolation in user table.
82 return Medium::ElectronAttachment(ex, ey, ez, bx, by, bz, eta);
83 }
84 return true;
85}
86
88 const double ex, const double ey, const double ez,
89 const double bx, const double by, const double bz,
90 double& vx, double& vy, double& vz) {
91 vx = vy = vz = 0.;
92 if (m_isChanged) {
93 UpdateTransportParameters();
94 m_isChanged = false;
95 }
96 if (!m_hVelE.empty()) {
97 // Interpolation in user table.
98 return Medium::HoleVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
99 }
100 // Calculate the mobility
101 const double emag = sqrt(ex * ex + ey * ey + ez * ez);
102 const double mu = m_hMobility / (1. + m_hMobility * emag / m_hSatVel);
103 const double b2 = bx * bx + by * by + bz * bz;
104 if (b2 < Small) {
105 vx = mu * ex;
106 vy = mu * ey;
107 vz = mu * ez;
108 } else {
109 Langevin(ex, ey, ez, bx, by, bz, mu, m_hHallFactor * mu, vx, vy, vz);
110 }
111 return true;
112}
113
115 const double ex, const double ey, const double ez,
116 const double bx, const double by, const double bz, double& alpha) {
117 alpha = 0.;
118 if (!m_hAlp.empty()) {
119 // Interpolation in user table.
120 return Medium::HoleTownsend(ex, ey, ez, bx, by, bz, alpha);
121 }
122 return false;
123}
124
126 const double ex, const double ey, const double ez,
127 const double bx, const double by, const double bz, double& eta) {
128 eta = 0.;
129 if (!m_hAtt.empty()) {
130 // Interpolation in user table.
131 return Medium::HoleAttachment(ex, ey, ez, bx, by, bz, eta);
132 }
133 return true;
134}
135
136void MediumDiamond::SetLowFieldMobility(const double mue, const double muh) {
137 if (mue <= 0. || muh <= 0.) {
138 std::cerr << m_className << "::SetLowFieldMobility:\n"
139 << " Mobility must be greater than zero.\n";
140 return;
141 }
142 m_eMobility = mue;
143 m_hMobility = muh;
144 m_userMobility = true;
145 m_isChanged = true;
146}
147
149 m_userMobility = false;
150 m_isChanged = true;
151}
152
154 const double vsath) {
155 std::lock_guard<std::mutex> guard(m_mutex);
156 if (vsate <= 0. || vsath <= 0.) {
157 std::cerr << m_className << "::SetSaturationVelocity:\n"
158 << " Velocity must be greater than zero.\n";
159 return;
160 }
161 m_eSatVel = vsate;
162 m_hSatVel = vsath;
163}
164
166 std::lock_guard<std::mutex> guard(m_mutex);
167 m_eSatVel = 2.6e-2;
168 m_hSatVel = 1.6e-2;
169}
170
171void MediumDiamond::UpdateTransportParameters() {
172 std::lock_guard<std::mutex> guard(m_mutex);
173
174 // M. Pomorski, Electronic Properties of Single Crystal CVD Diamond and
175 // Its Suitability for Particle Detection in Hadron Physics Experiments.
176 // Wolfgang von Goethe University, Frankfurt am Main
177 // E. Bossini, N. Miafra, Front. Phys. 8 (2020),
178 // https://doi.org/10.3389/fphy.2020.00248
179 if (!m_userMobility) {
180 const double t = m_temperature / 300.;
181 m_eMobility = 4.551e-6 * pow(t, -1.5);
182 m_hMobility = 2.750e-6 * pow(t, -1.5);
183 }
184}
185
186}
bool HoleVelocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz) override
Drift velocity [cm / ns].
bool ElectronTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha) override
Ionisation coefficient [cm-1].
bool HoleTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha) override
Ionisation coefficient [cm-1].
bool ElectronAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta) override
Attachment coefficient [cm-1].
bool HoleAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta) override
Attachment coefficient [cm-1].
void SetSaturationVelocity(const double vsate, const double vsath)
bool ElectronVelocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz) override
Drift velocity [cm / ns].
void GetComponent(const unsigned int i, std::string &label, double &f) override
Get the name and fraction of a given component.
MediumDiamond()
Constructor.
void SetLowFieldMobility(const double mue, const double muh)
void SetTemperature(const double t)
Set the temperature [K].
Definition Medium.cc:72
virtual bool HoleTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
Ionisation coefficient [cm-1].
Definition Medium.cc:599
virtual bool HoleVelocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz)
Drift velocity [cm / ns].
Definition Medium.cc:578
std::vector< std::vector< std::vector< double > > > m_eAlp
Definition Medium.hh:582
std::vector< std::vector< std::vector< double > > > m_hAlp
Definition Medium.hh:594
std::string m_name
Definition Medium.hh:538
virtual bool ElectronVelocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz)
Drift velocity [cm / ns].
Definition Medium.cc:444
virtual void SetAtomicNumber(const double z)
Set the effective atomic number.
Definition Medium.cc:115
std::vector< std::vector< std::vector< double > > > m_eVelE
Definition Medium.hh:577
void SetDielectricConstant(const double eps)
Set the relative static dielectric constant.
Definition Medium.cc:92
virtual bool ElectronTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
Ionisation coefficient [cm-1].
Definition Medium.cc:468
std::vector< std::vector< std::vector< double > > > m_eAtt
Definition Medium.hh:583
virtual void SetMassDensity(const double rho)
Set the mass density [g/cm3].
Definition Medium.cc:145
Medium()
Constructor.
Definition Medium.cc:61
std::vector< std::vector< std::vector< double > > > m_hVelE
Definition Medium.hh:589
virtual bool ElectronAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
Attachment coefficient [cm-1].
Definition Medium.cc:481
std::vector< std::vector< std::vector< double > > > m_hAtt
Definition Medium.hh:595
virtual void SetAtomicWeight(const double a)
Set the effective atomic weight.
Definition Medium.cc:125
std::string m_className
Definition Medium.hh:529
virtual bool HoleAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
Attachment coefficient [cm-1].
Definition Medium.cc:612
double m_temperature
Definition Medium.hh:540
static void Langevin(const double ex, const double ey, const double ez, double bx, double by, double bz, const double mu, double &vx, double &vy, double &vz)
Definition Medium.cc:301