Garfield++ 3.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.);
15 SetAtomicNumber(48.52);
16 SetAtomicWeight(240.01);
17 SetMassDensity(5.85);
18
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 // Hall mobility
62 const double muH = m_eHallFactor * mu;
63 const double muH2 = muH * muH;
64 const double eb = bx * ex + by * ey + bz * ez;
65 const double f = mu / (1. + muH2 * b2);
66 // Compute the drift velocity using the Langevin equation.
67 vx = f * (ex + muH * (ey * bz - ez * by) + muH2 * bx * eb);
68 vy = f * (ey + muH * (ez * bx - ex * bz) + muH2 * by * eb);
69 vz = f * (ez + muH * (ex * by - ey * bx) + muH2 * bz * eb);
70 }
71 return true;
72}
73
74bool MediumCdTe::ElectronTownsend(const double ex, const double ey,
75 const double ez, const double bx,
76 const double by, const double bz,
77 double& alpha) {
78 alpha = 0.;
79 if (!m_eAlp.empty()) {
80 // Interpolation in user table.
81 return Medium::ElectronTownsend(ex, ey, ez, bx, by, bz, alpha);
82 }
83 return false;
84}
85
86bool MediumCdTe::ElectronAttachment(const double ex, const double ey,
87 const double ez, const double bx,
88 const double by, const double bz,
89 double& eta) {
90 eta = 0.;
91 if (!m_eAtt.empty()) {
92 // Interpolation in user table.
93 return Medium::ElectronAttachment(ex, ey, ez, bx, by, bz, eta);
94 }
95 return true;
96}
97
98bool MediumCdTe::HoleVelocity(const double ex, const double ey, const double ez,
99 const double bx, const double by, const double bz,
100 double& vx, double& vy, double& vz) {
101 vx = vy = vz = 0.;
102 if (m_isChanged) {
103 UpdateTransportParameters();
104 m_isChanged = false;
105 }
106 if (!m_hVelE.empty()) {
107 // Interpolation in user table.
108 return Medium::HoleVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
109 }
110 // Calculate the mobility
111 const double mu = m_hMobility;
112 const double b2 = bx * bx + by * by + bz * bz;
113 if (b2 < Small) {
114 vx = mu * ex;
115 vy = mu * ey;
116 vz = mu * ez;
117 } else {
118 // Hall mobility
119 const double muH = m_hHallFactor * mu;
120 const double muH2 = muH * muH;
121 const double eb = bx * ex + by * ey + bz * ez;
122 const double f = muH / (1. + muH2 * b2);
123 // Compute the drift velocity using the Langevin equation.
124 vx = f * (ex + muH * (ey * bz - ez * by) + muH2 * bx * eb);
125 vy = f * (ey + muH * (ez * bx - ex * bz) + muH2 * by * eb);
126 vz = f * (ez + muH * (ex * by - ey * bx) + muH2 * bz * eb);
127 }
128 return true;
129}
130
131bool MediumCdTe::HoleTownsend(const double ex, const double ey, const double ez,
132 const double bx, const double by, const double bz,
133 double& alpha) {
134 alpha = 0.;
135 if (!m_hAlp.empty()) {
136 // Interpolation in user table.
137 return Medium::HoleTownsend(ex, ey, ez, bx, by, bz, alpha);
138 }
139 return false;
140}
141
142bool MediumCdTe::HoleAttachment(const double ex, const double ey,
143 const double ez, const double bx,
144 const double by, const double bz, double& eta) {
145 eta = 0.;
146 if (!m_hAtt.empty()) {
147 // Interpolation in user table.
148 return Medium::HoleAttachment(ex, ey, ez, bx, by, bz, eta);
149 }
150 return true;
151}
152
153void MediumCdTe::SetLowFieldMobility(const double mue, const double muh) {
154 if (mue <= 0. || muh <= 0.) {
155 std::cerr << m_className << "::SetLowFieldMobility:\n"
156 << " Mobility must be greater than zero.\n";
157 return;
158 }
159 m_eMobility = mue;
160 m_hMobility = muh;
161 m_userMobility = true;
162 m_isChanged = true;
163}
164
166 m_userMobility = false;
167 m_isChanged = true;
168}
169
170void MediumCdTe::UpdateTransportParameters() {
171
172 if (!m_userMobility) {
173 const double t = m_temperature / 300.;
174 m_eMobility = 1.05e-6 * pow(t, -1.7);
175 m_hMobility = 0.1e-6 * pow(t, 1.67);
176 }
177}
178
179}
void UnsetLowFieldMobility()
Definition: MediumCdTe.cc:165
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:86
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:74
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].
Definition: MediumCdTe.cc:131
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:98
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].
Definition: MediumCdTe.cc:142
MediumCdTe()
Constructor.
Definition: MediumCdTe.cc:9
void SetLowFieldMobility(const double mue, const double muh)
Definition: MediumCdTe.cc:153
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
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:531
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:537
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:558
std::vector< std::vector< std::vector< double > > > m_hAlp
Definition: Medium.hh:570
virtual void EnableDrift(const bool on=true)
Switch electron/ion/hole on/off.
Definition: Medium.hh:67
std::string m_name
Definition: Medium.hh:513
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:553
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:559
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:565
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:571
virtual void SetAtomicWeight(const double a)
Set the effective atomic weight.
Definition: Medium.cc:124
std::string m_className
Definition: Medium.hh:506
bool m_isChanged
Definition: Medium.hh:540
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:515