Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
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.);
16 SetAtomicWeight(12.01);
17 SetMassDensity(3.51);
18
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 // Hall mobility
61 const double muH = m_eHallFactor * mu;
62 const double muH2 = muH * muH;
63 const double eb = bx * ex + by * ey + bz * ez;
64 const double f = mu / (1. + muH2 * b2);
65 // Compute the drift velocity using the Langevin equation.
66 vx = f * (ex + muH * (ey * bz - ez * by) + muH2 * bx * eb);
67 vy = f * (ey + muH * (ez * bx - ex * bz) + muH2 * by * eb);
68 vz = f * (ez + muH * (ex * by - ey * bx) + muH2 * bz * eb);
69 }
70 return true;
71}
72
74 const double ex, const double ey, const double ez,
75 const double bx, const double by, const double bz, double& alpha) {
76 alpha = 0.;
77 if (!m_eAlp.empty()) {
78 // Interpolation in user table.
79 return Medium::ElectronTownsend(ex, ey, ez, bx, by, bz, alpha);
80 }
81 return false;
82}
83
85 const double ex, const double ey, const double ez,
86 const double bx, const double by, const double bz, double& eta) {
87 eta = 0.;
88 if (!m_eAtt.empty()) {
89 // Interpolation in user table.
90 return Medium::ElectronAttachment(ex, ey, ez, bx, by, bz, eta);
91 }
92 return true;
93}
94
96 const double ex, const double ey, const double ez,
97 const double bx, const double by, const double bz,
98 double& vx, double& vy, double& vz) {
99 vx = vy = vz = 0.;
100 if (m_isChanged) {
101 UpdateTransportParameters();
102 m_isChanged = false;
103 }
104 if (!m_hVelE.empty()) {
105 // Interpolation in user table.
106 return Medium::HoleVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
107 }
108 // Calculate the mobility
109 const double emag = sqrt(ex * ex + ey * ey + ez * ez);
110 const double mu = m_hMobility / (1. + m_hMobility * emag / m_hSatVel);
111 const double b2 = bx * bx + by * by + bz * bz;
112 if (b2 < Small) {
113 vx = mu * ex;
114 vy = mu * ey;
115 vz = mu * ez;
116 } else {
117 // Hall mobility
118 const double muH = m_hHallFactor * mu;
119 const double muH2 = muH * muH;
120 const double eb = bx * ex + by * ey + bz * ez;
121 const double f = muH / (1. + muH2 * b2);
122 // Compute the drift velocity using the Langevin equation.
123 vx = f * (ex + muH * (ey * bz - ez * by) + muH2 * bx * eb);
124 vy = f * (ey + muH * (ez * bx - ex * bz) + muH2 * by * eb);
125 vz = f * (ez + muH * (ex * by - ey * bx) + muH2 * bz * eb);
126 }
127 return true;
128}
129
131 const double ex, const double ey, const double ez,
132 const double bx, const double by, const double bz, double& alpha) {
133 alpha = 0.;
134 if (!m_hAlp.empty()) {
135 // Interpolation in user table.
136 return Medium::HoleTownsend(ex, ey, ez, bx, by, bz, alpha);
137 }
138 return false;
139}
140
142 const double ex, const double ey, const double ez,
143 const double bx, const double by, const double bz, double& eta) {
144 eta = 0.;
145 if (!m_hAtt.empty()) {
146 // Interpolation in user table.
147 return Medium::HoleAttachment(ex, ey, ez, bx, by, bz, eta);
148 }
149 return true;
150}
151
152void MediumDiamond::SetLowFieldMobility(const double mue, const double muh) {
153 if (mue <= 0. || muh <= 0.) {
154 std::cerr << m_className << "::SetLowFieldMobility:\n"
155 << " Mobility must be greater than zero.\n";
156 return;
157 }
158 m_eMobility = mue;
159 m_hMobility = muh;
160 m_userMobility = true;
161 m_isChanged = true;
162}
163
165 m_userMobility = false;
166 m_isChanged = true;
167}
168
170 const double vsath) {
171 std::lock_guard<std::mutex> guard(m_mutex);
172 if (vsate <= 0. || vsath <= 0.) {
173 std::cerr << m_className << "::SetSaturationVelocity:\n"
174 << " Velocity must be greater than zero.\n";
175 return;
176 }
177 m_eSatVel = vsate;
178 m_hSatVel = vsath;
179}
180
182 std::lock_guard<std::mutex> guard(m_mutex);
183 m_eSatVel = 2.6e-2;
184 m_hSatVel = 1.6e-2;
185}
186
187void MediumDiamond::UpdateTransportParameters() {
188 std::lock_guard<std::mutex> guard(m_mutex);
189
190 // M. Pomorski, Electronic Properties of Single Crystal CVD Diamond and
191 // Its Suitability for Particle Detection in Hadron Physics Experiments.
192 // Wolfgang von Goethe University, Frankfurt am Main
193 // E. Bossini, N. Miafra, Front. Phys. 8 (2020),
194 // https://doi.org/10.3389/fphy.2020.00248
195 if (!m_userMobility) {
196 const double t = m_temperature / 300.;
197 m_eMobility = 4.551e-6 * pow(t, -1.5);
198 m_hMobility = 2.750e-6 * pow(t, -1.5);
199 }
200}
201
202}
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.
Definition: MediumDiamond.cc:9
void SetLowFieldMobility(const double mue, const double muh)
Abstract base class for media.
Definition: Medium.hh:13
void SetTemperature(const double t)
Set the temperature [K].
Definition: Medium.cc:71
bool m_microscopic
Definition: Medium.hh:523
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:534
double m_fano
Definition: Medium.hh:519
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:513
std::vector< std::vector< std::vector< double > > > m_eAlp
Definition: Medium.hh:546
std::vector< std::vector< std::vector< double > > > m_hAlp
Definition: Medium.hh:558
virtual void EnableDrift(const bool on=true)
Switch electron/ion/hole on/off.
Definition: Medium.hh:67
std::string m_name
Definition: Medium.hh:502
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:379
virtual void EnablePrimaryIonisation(const bool on=true)
Make the medium ionisable or non-ionisable.
Definition: Medium.hh:69
virtual void SetAtomicNumber(const double z)
Set the effective atomic number.
Definition: Medium.cc:114
std::vector< std::vector< std::vector< double > > > m_eVelE
Definition: Medium.hh:541
void SetDielectricConstant(const double eps)
Set the relative static dielectric constant.
Definition: Medium.cc:91
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:403
std::vector< std::vector< std::vector< double > > > m_eAtt
Definition: Medium.hh:547
virtual void SetMassDensity(const double rho)
Set the mass density [g/cm3].
Definition: Medium.cc:144
std::vector< std::vector< std::vector< double > > > m_hVelE
Definition: Medium.hh:553
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:416
std::vector< std::vector< std::vector< double > > > m_hAtt
Definition: Medium.hh:559
virtual void SetAtomicWeight(const double a)
Set the effective atomic weight.
Definition: Medium.cc:124
std::string m_className
Definition: Medium.hh:493
bool m_isChanged
Definition: Medium.hh:527
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:547
double m_temperature
Definition: Medium.hh:504