Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
MediumCdTe.cc
Go to the documentation of this file.
1#include <cmath>
2#include <iostream>
3
6
7namespace Garfield {
8
10 m_className = "MediumCdTe";
11 m_name = "CdTe";
12
13 SetTemperature(300.);
18
19 m_driftable = true;
20 m_ionisable = true;
21 m_microscopic = false;
22
23 m_w = 4.43;
24 m_fano = 0.1;
25}
26
27void MediumCdTe::GetComponent(const unsigned int i, std::string& label,
28 double& f) {
29 if (i == 0) {
30 label = "Cd";
31 f = 0.5;
32 } else if (i == 1) {
33 label = "Te";
34 f = 0.5;
35 } else {
36 std::cerr << m_className << "::GetComponent: Index out of range.\n";
37 }
38}
39
40bool MediumCdTe::ElectronVelocity(const double ex, const double ey,
41 const double ez, const double bx,
42 const double by, const double bz, double& vx,
43 double& vy, double& vz) {
44 vx = vy = vz = 0.;
45 if (m_isChanged) {
46 UpdateTransportParameters();
47 m_isChanged = false;
48 }
49 if (!m_eVelE.empty()) {
50 // Interpolation in user table.
51 return Medium::ElectronVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
52 }
53 // Calculate the mobility
54 const double mu = -m_eMobility;
55 const double b2 = bx * bx + by * by + bz * bz;
56 if (b2 < Small) {
57 vx = mu * ex;
58 vy = mu * ey;
59 vz = mu * ez;
60 } else {
61 Langevin(ex, ey, ez, bx, by, bz, mu, m_eHallFactor * mu, vx, vy, vz);
62 }
63 return true;
64}
65
66bool MediumCdTe::ElectronTownsend(const double ex, const double ey,
67 const double ez, const double bx,
68 const double by, const double bz,
69 double& alpha) {
70 alpha = 0.;
71 if (!m_eAlp.empty()) {
72 // Interpolation in user table.
73 return Medium::ElectronTownsend(ex, ey, ez, bx, by, bz, alpha);
74 }
75 return false;
76}
77
78bool MediumCdTe::ElectronAttachment(const double ex, const double ey,
79 const double ez, const double bx,
80 const double by, const double bz,
81 double& eta) {
82 eta = 0.;
83 if (!m_eAtt.empty()) {
84 // Interpolation in user table.
85 return Medium::ElectronAttachment(ex, ey, ez, bx, by, bz, eta);
86 }
87 return true;
88}
89
90bool MediumCdTe::HoleVelocity(const double ex, const double ey, const double ez,
91 const double bx, const double by, const double bz,
92 double& vx, double& vy, double& vz) {
93 vx = vy = vz = 0.;
94 if (m_isChanged) {
95 UpdateTransportParameters();
96 m_isChanged = false;
97 }
98 if (!m_hVelE.empty()) {
99 // Interpolation in user table.
100 return Medium::HoleVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
101 }
102 // Calculate the mobility
103 const double mu = m_hMobility;
104 const double b2 = bx * bx + by * by + bz * bz;
105 if (b2 < Small) {
106 vx = mu * ex;
107 vy = mu * ey;
108 vz = mu * ez;
109 } else {
110 Langevin(ex, ey, ez, bx, by, bz, mu, m_hHallFactor * mu, vx, vy, vz);
111 }
112 return true;
113}
114
115bool MediumCdTe::HoleTownsend(const double ex, const double ey, const double ez,
116 const double bx, const double by, const double bz,
117 double& alpha) {
118 alpha = 0.;
119 if (!m_hAlp.empty()) {
120 // Interpolation in user table.
121 return Medium::HoleTownsend(ex, ey, ez, bx, by, bz, alpha);
122 }
123 return false;
124}
125
126bool MediumCdTe::HoleAttachment(const double ex, const double ey,
127 const double ez, const double bx,
128 const double by, const double bz, double& eta) {
129 eta = 0.;
130 if (!m_hAtt.empty()) {
131 // Interpolation in user table.
132 return Medium::HoleAttachment(ex, ey, ez, bx, by, bz, eta);
133 }
134 return true;
135}
136
137void MediumCdTe::SetLowFieldMobility(const double mue, const double muh) {
138 if (mue <= 0. || muh <= 0.) {
139 std::cerr << m_className << "::SetLowFieldMobility:\n"
140 << " Mobility must be greater than zero.\n";
141 return;
142 }
143 m_eMobility = mue;
144 m_hMobility = muh;
145 m_userMobility = true;
146 m_isChanged = true;
147}
148
150 m_userMobility = false;
151 m_isChanged = true;
152}
153
154void MediumCdTe::UpdateTransportParameters() {
155
156 if (!m_userMobility) {
157 const double t = m_temperature / 300.;
158 m_eMobility = 1.05e-6 * pow(t, -1.7);
159 m_hMobility = 0.1e-6 * pow(t, 1.67);
160 }
161}
162
163}
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].
Definition MediumCdTe.cc:78
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].
Definition MediumCdTe.cc:66
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 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].
Definition MediumCdTe.cc:40
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].
Definition MediumCdTe.cc:90
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].
MediumCdTe()
Constructor.
Definition MediumCdTe.cc:9
void SetLowFieldMobility(const double mue, const double muh)
void GetComponent(const unsigned int i, std::string &label, double &f) override
Get the name and fraction of a given component.
Definition MediumCdTe.cc:27
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