Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::MediumCdTe Class Reference

Cadmium-Telluride. More...

#include <MediumCdTe.hh>

+ Inheritance diagram for Garfield::MediumCdTe:

Public Member Functions

 MediumCdTe ()
 Constructor.
 
virtual ~MediumCdTe ()
 Destructor.
 
bool IsSemiconductor () const
 
void GetComponent (const unsigned int i, std::string &label, double &f)
 
void SetTrapCrossSection (const double ecs, const double hcs)
 
void SetTrapDensity (const double n)
 
void SetTrappingTime (const double etau, const double htau)
 
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)
 
bool ElectronTownsend (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
 
bool ElectronAttachment (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
 
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)
 
bool HoleTownsend (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
 
bool HoleAttachment (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
 
void SetLowFieldMobility (const double mue, const double muh)
 
void SetSaturationVelocity (const double vsate, const double vsath)
 
bool GetOpticalDataRange (double &emin, double &emax, const unsigned int i=0)
 
bool GetDielectricFunction (const double e, double &eps1, double &eps2, const unsigned int i=0)
 
- Public Member Functions inherited from Garfield::Medium
 Medium ()
 
virtual ~Medium ()
 
int GetId () const
 
const std::string & GetName () const
 
virtual bool IsGas () const
 
virtual bool IsSemiconductor () const
 
void SetTemperature (const double t)
 
double GetTemperature () const
 
void SetPressure (const double p)
 
double GetPressure () const
 
void SetDielectricConstant (const double eps)
 
double GetDielectricConstant () const
 
unsigned int GetNumberOfComponents () const
 
virtual void GetComponent (const unsigned int i, std::string &label, double &f)
 
virtual void SetAtomicNumber (const double z)
 
virtual double GetAtomicNumber () const
 
virtual void SetAtomicWeight (const double a)
 
virtual double GetAtomicWeight () const
 
virtual void SetNumberDensity (const double n)
 
virtual double GetNumberDensity () const
 
virtual void SetMassDensity (const double rho)
 
virtual double GetMassDensity () const
 
virtual void EnableDrift ()
 
void DisableDrift ()
 
virtual void EnablePrimaryIonisation ()
 
void DisablePrimaryIonisation ()
 
bool IsDriftable () const
 
bool IsMicroscopic () const
 
bool IsIonisable () const
 
void SetW (const double w)
 
double GetW ()
 
void SetFanoFactor (const double f)
 
double GetFanoFactor ()
 
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)
 
virtual bool ElectronDiffusion (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &dl, double &dt)
 
virtual bool ElectronDiffusion (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double cov[3][3])
 
virtual bool ElectronTownsend (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
 
virtual bool ElectronAttachment (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
 
virtual bool ElectronLorentzAngle (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &lor)
 
virtual double GetElectronEnergy (const double px, const double py, const double pz, double &vx, double &vy, double &vz, const int band=0)
 
virtual void GetElectronMomentum (const double e, double &px, double &py, double &pz, int &band)
 
virtual double GetElectronNullCollisionRate (const int band=0)
 
virtual double GetElectronCollisionRate (const double e, const int band=0)
 
virtual bool GetElectronCollision (const double e, int &type, int &level, double &e1, double &dx, double &dy, double &dz, int &nion, int &ndxc, int &band)
 
virtual unsigned int GetNumberOfIonisationProducts () const
 
virtual bool GetIonisationProduct (const unsigned int i, int &type, double &energy) const
 
virtual unsigned int GetNumberOfDeexcitationProducts () const
 
virtual bool GetDeexcitationProduct (const unsigned int i, double &t, double &s, int &type, double &energy) const
 
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)
 
virtual bool HoleDiffusion (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &dl, double &dt)
 
virtual bool HoleDiffusion (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double cov[3][3])
 
virtual bool HoleTownsend (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
 
virtual bool HoleAttachment (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
 
virtual bool IonVelocity (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz)
 
virtual bool IonDiffusion (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &dl, double &dt)
 
virtual bool IonDissociation (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &diss)
 
void SetFieldGrid (double emin, double emax, int ne, bool logE, double bmin=0., double bmax=0., int nb=1, double amin=0., double amax=0., int na=1)
 
void SetFieldGrid (const std::vector< double > &efields, const std::vector< double > &bfields, const std::vector< double > &angles)
 
void GetFieldGrid (std::vector< double > &efields, std::vector< double > &bfields, std::vector< double > &angles)
 
bool GetElectronVelocityE (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
 
bool GetElectronVelocityExB (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
 
bool GetElectronVelocityB (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
 
bool GetElectronLongitudinalDiffusion (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dl)
 
bool GetElectronTransverseDiffusion (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dt)
 
bool GetElectronTownsend (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &alpha)
 
bool GetElectronAttachment (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &eta)
 
bool GetElectronLorentzAngle (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &lor)
 
bool GetHoleVelocityE (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
 
bool GetHoleVelocityExB (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
 
bool GetHoleVelocityB (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
 
bool GetHoleLongitudinalDiffusion (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dl)
 
bool GetHoleTransverseDiffusion (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dt)
 
bool GetHoleTownsend (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &alpha)
 
bool GetHoleAttachment (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &eta)
 
bool GetIonMobility (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &mu)
 
bool GetIonLongitudinalDiffusion (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dl)
 
bool GetIonTransverseDiffusion (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dt)
 
bool GetIonDissociation (const unsigned int ie, const unsigned int ib, const unsigned int ia, double &diss)
 
void ResetElectronVelocity ()
 
void ResetElectronDiffusion ()
 
void ResetElectronTownsend ()
 
void ResetElectronAttachment ()
 
void ResetElectronLorentzAngle ()
 
void ResetHoleVelocity ()
 
void ResetHoleDiffusion ()
 
void ResetHoleTownsend ()
 
void ResetHoleAttachment ()
 
void ResetIonMobility ()
 
void ResetIonDiffusion ()
 
void ResetIonDissociation ()
 
bool SetIonMobility (const unsigned int ie, const unsigned int ib, const unsigned int ia, const double mu)
 
bool SetIonMobility (const std::vector< double > &fields, const std::vector< double > &mobilities)
 
void SetExtrapolationMethodVelocity (const std::string &extrLow, const std::string &extrHigh)
 
void SetExtrapolationMethodDiffusion (const std::string &extrLow, const std::string &extrHigh)
 
void SetExtrapolationMethodTownsend (const std::string &extrLow, const std::string &extrHigh)
 
void SetExtrapolationMethodAttachment (const std::string &extrLow, const std::string &extrHigh)
 
void SetExtrapolationMethodIonMobility (const std::string &extrLow, const std::string &extrHigh)
 
void SetExtrapolationMethodIonDissociation (const std::string &extrLow, const std::string &extrHigh)
 
void SetInterpolationMethodVelocity (const unsigned int intrp)
 
void SetInterpolationMethodDiffusion (const unsigned int intrp)
 
void SetInterpolationMethodTownsend (const unsigned int intrp)
 
void SetInterpolationMethodAttachment (const unsigned int intrp)
 
void SetInterpolationMethodIonMobility (const unsigned int intrp)
 
void SetInterpolationMethodIonDissociation (const unsigned int intrp)
 
virtual double ScaleElectricField (const double e) const
 
virtual double UnScaleElectricField (const double e) const
 
virtual double ScaleVelocity (const double v) const
 
virtual double ScaleDiffusion (const double d) const
 
virtual double ScaleDiffusionTensor (const double d) const
 
virtual double ScaleTownsend (const double alpha) const
 
virtual double ScaleAttachment (const double eta) const
 
virtual double ScaleLorentzAngle (const double lor) const
 
virtual double ScaleDissociation (const double diss) const
 
virtual bool GetOpticalDataRange (double &emin, double &emax, const unsigned int i=0)
 
virtual bool GetDielectricFunction (const double e, double &eps1, double &eps2, const unsigned int i=0)
 
virtual bool GetPhotoAbsorptionCrossSection (const double e, double &sigma, const unsigned int i=0)
 
virtual double GetPhotonCollisionRate (const double e)
 
virtual bool GetPhotonCollision (const double e, int &type, int &level, double &e1, double &ctheta, int &nsec, double &esec)
 
void EnableDebugging ()
 
void DisableDebugging ()
 

Additional Inherited Members

- Protected Member Functions inherited from Garfield::Medium
double GetAngle (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const double e, const double b) const
 
double Interpolate1D (const double e, const std::vector< double > &table, const std::vector< double > &fields, const unsigned int intpMeth, const int jExtr, const int iExtr)
 
bool GetExtrapolationIndex (std::string extrStr, unsigned int &extrNb)
 
void CloneTable (std::vector< std::vector< std::vector< double > > > &tab, const std::vector< double > &efields, const std::vector< double > &bfields, const std::vector< double > &angles, const unsigned int intp, const unsigned int extrLow, const unsigned int extrHigh, const double init, const std::string &label)
 
void CloneTensor (std::vector< std::vector< std::vector< std::vector< double > > > > &tab, const unsigned int n, const std::vector< double > &efields, const std::vector< double > &bfields, const std::vector< double > &angles, const unsigned int intp, const unsigned int extrLow, const unsigned int extrHigh, const double init, const std::string &label)
 
void InitParamArrays (const unsigned int eRes, const unsigned int bRes, const unsigned int aRes, std::vector< std::vector< std::vector< double > > > &tab, const double val)
 
void InitParamTensor (const unsigned int eRes, const unsigned int bRes, const unsigned int aRes, const unsigned int tRes, std::vector< std::vector< std::vector< std::vector< double > > > > &tab, const double val)
 
- Protected Attributes inherited from Garfield::Medium
std::string m_className
 
int m_id
 
std::string m_name
 
double m_temperature
 
double m_pressure
 
double m_epsilon
 
unsigned int m_nComponents
 
double m_z
 
double m_a
 
double m_density
 
bool m_driftable
 
bool m_microscopic
 
bool m_ionisable
 
double m_w
 
double m_fano
 
bool m_isChanged
 
bool m_debug
 
std::vector< double > m_eFields
 
std::vector< double > m_bFields
 
std::vector< double > m_bAngles
 
bool m_map2d
 
bool m_hasElectronVelocityE
 
bool m_hasElectronVelocityB
 
bool m_hasElectronVelocityExB
 
bool m_hasElectronDiffLong
 
bool m_hasElectronDiffTrans
 
bool m_hasElectronDiffTens
 
bool m_hasElectronAttachment
 
bool m_hasElectronLorentzAngle
 
std::vector< std::vector< std::vector< double > > > tabElectronVelocityE
 
std::vector< std::vector< std::vector< double > > > tabElectronVelocityExB
 
std::vector< std::vector< std::vector< double > > > tabElectronVelocityB
 
std::vector< std::vector< std::vector< double > > > tabElectronDiffLong
 
std::vector< std::vector< std::vector< double > > > tabElectronDiffTrans
 
std::vector< std::vector< std::vector< double > > > tabElectronTownsend
 
std::vector< std::vector< std::vector< double > > > tabElectronAttachment
 
std::vector< std::vector< std::vector< double > > > tabElectronLorentzAngle
 
std::vector< std::vector< std::vector< std::vector< double > > > > tabElectronDiffTens
 
bool m_hasHoleVelocityE
 
bool m_hasHoleVelocityB
 
bool m_hasHoleVelocityExB
 
bool m_hasHoleDiffLong
 
bool m_hasHoleDiffTrans
 
bool m_hasHoleDiffTens
 
bool m_hasHoleTownsend
 
bool m_hasHoleAttachment
 
std::vector< std::vector< std::vector< double > > > tabHoleVelocityE
 
std::vector< std::vector< std::vector< double > > > tabHoleVelocityExB
 
std::vector< std::vector< std::vector< double > > > tabHoleVelocityB
 
std::vector< std::vector< std::vector< double > > > tabHoleDiffLong
 
std::vector< std::vector< std::vector< double > > > tabHoleDiffTrans
 
std::vector< std::vector< std::vector< double > > > tabHoleTownsend
 
std::vector< std::vector< std::vector< double > > > tabHoleAttachment
 
std::vector< std::vector< std::vector< std::vector< double > > > > tabHoleDiffTens
 
bool m_hasIonMobility
 
bool m_hasIonDiffLong
 
bool m_hasIonDiffTrans
 
bool m_hasIonDissociation
 
std::vector< std::vector< std::vector< double > > > tabIonMobility
 
std::vector< std::vector< std::vector< double > > > tabIonDiffLong
 
std::vector< std::vector< std::vector< double > > > tabIonDiffTrans
 
std::vector< std::vector< std::vector< double > > > tabIonDissociation
 
int thrElectronTownsend
 
int thrElectronAttachment
 
int thrHoleTownsend
 
int thrHoleAttachment
 
int thrIonDissociation
 
unsigned int m_extrLowVelocity
 
unsigned int m_extrHighVelocity
 
unsigned int m_extrLowDiffusion
 
unsigned int m_extrHighDiffusion
 
unsigned int m_extrLowTownsend
 
unsigned int m_extrHighTownsend
 
unsigned int m_extrLowAttachment
 
unsigned int m_extrHighAttachment
 
unsigned int m_extrLowLorentzAngle
 
unsigned int m_extrHighLorentzAngle
 
unsigned int m_extrLowMobility
 
unsigned int m_extrHighMobility
 
unsigned int m_extrLowDissociation
 
unsigned int m_extrHighDissociation
 
unsigned int m_intpVelocity
 
unsigned int m_intpDiffusion
 
unsigned int m_intpTownsend
 
unsigned int m_intpAttachment
 
unsigned int m_intpLorentzAngle
 
unsigned int m_intpMobility
 
unsigned int m_intpDissociation
 
- Static Protected Attributes inherited from Garfield::Medium
static int m_idCounter = -1
 

Detailed Description

Cadmium-Telluride.

Definition at line 10 of file MediumCdTe.hh.

Constructor & Destructor Documentation

◆ MediumCdTe()

Garfield::MediumCdTe::MediumCdTe ( )

Constructor.

Definition at line 15 of file MediumCdTe.cc.

16 : Medium(),
17 // m_bandGap(1.44),
18 m_eMobility(1.1e-6),
19 m_hMobility(0.1e-6),
20 m_eSatVel(1.02e-2),
21 m_hSatVel(0.72e-2),
22 m_eHallFactor(1.15),
23 m_hHallFactor(0.7),
24 m_eTrapCs(1.e-15),
25 m_hTrapCs(1.e-15),
26 m_eTrapDensity(1.e13),
27 m_hTrapDensity(1.e13),
28 m_eTrapTime(0.),
29 m_hTrapTime(0.),
30 m_trappingModel(0),
31 m_hasUserMobility(false),
32 m_hasUserSaturationVelocity(false),
33 m_opticalDataFile("OpticalData_CdTe.txt") {
34
35 m_className = "MediumCdTe";
36 m_name = "CdTe";
37
38 SetTemperature(300.);
40 SetAtomicNumber(48.52);
41 SetAtomicWeight(240.01);
42 SetMassDensity(5.85);
43
46 m_microscopic = false;
47
48 m_w = 4.43;
49 m_fano = 0.1;
50}
void SetTemperature(const double t)
Definition: Medium.cc:104
bool m_microscopic
Definition: Medium.hh:319
double m_fano
Definition: Medium.hh:323
std::string m_name
Definition: Medium.hh:301
virtual void SetAtomicNumber(const double z)
Definition: Medium.cc:154
void SetDielectricConstant(const double eps)
Definition: Medium.cc:126
virtual void EnableDrift()
Definition: Medium.hh:52
virtual void SetMassDensity(const double rho)
Definition: Medium.cc:187
virtual void EnablePrimaryIonisation()
Definition: Medium.hh:54
virtual void SetAtomicWeight(const double a)
Definition: Medium.cc:165
std::string m_className
Definition: Medium.hh:294

◆ ~MediumCdTe()

virtual Garfield::MediumCdTe::~MediumCdTe ( )
inlinevirtual

Destructor.

Definition at line 16 of file MediumCdTe.hh.

16{}

Member Function Documentation

◆ ElectronAttachment()

bool Garfield::MediumCdTe::ElectronAttachment ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  eta 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 164 of file MediumCdTe.cc.

167 {
168
169 eta = 0.;
171 // Interpolation in user table.
172 return Medium::ElectronAttachment(ex, ey, ez, bx, by, bz, eta);
173 }
174
175 switch (m_trappingModel) {
176 case 0:
177 eta = m_eTrapCs * m_eTrapDensity;
178 break;
179 case 1:
180 double vx, vy, vz;
181 ElectronVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
182 eta = m_eTrapTime * sqrt(vx * vx + vy * vy + vz * vz);
183 if (eta > 0.) eta = 1. / eta;
184 break;
185 default:
186 std::cerr << m_className << "::ElectronAttachment:\n"
187 << " Unknown model activated. Program bug!\n";
188 return false;
189 break;
190 }
191
192 return true;
193}
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)
Definition: MediumCdTe.cc:120
virtual bool ElectronAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
Definition: Medium.cc:544
bool m_hasElectronAttachment
Definition: Medium.hh:341
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314

◆ ElectronTownsend()

bool Garfield::MediumCdTe::ElectronTownsend ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  alpha 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 151 of file MediumCdTe.cc.

154 {
155
156 alpha = 0.;
157 if (!tabElectronTownsend.empty()) {
158 // Interpolation in user table.
159 return Medium::ElectronTownsend(ex, ey, ez, bx, by, bz, alpha);
160 }
161 return false;
162}
virtual bool ElectronTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
Definition: Medium.cc:490
std::vector< std::vector< std::vector< double > > > tabElectronTownsend
Definition: Medium.hh:348

◆ ElectronVelocity()

bool Garfield::MediumCdTe::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 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 120 of file MediumCdTe.cc.

123 {
124
125 vx = vy = vz = 0.;
127 // Interpolation in user table.
128 return Medium::ElectronVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
129 }
130 // Calculate the mobility
131 const double mu = -m_eMobility;
132 const double b2 = bx * bx + by * by + bz * bz;
133 if (b2 < Small) {
134 vx = mu * ex;
135 vy = mu * ey;
136 vz = mu * ez;
137 } else {
138 // Hall mobility
139 const double muH = m_eHallFactor * mu;
140 const double muH2 = muH * muH;
141 const double eb = bx * ex + by * ey + bz * ez;
142 const double nom = 1. + muH2 * b2;
143 // Compute the drift velocity using the Langevin equation.
144 vx = mu * (ex + muH * (ey * bz - ez * by) + muH2 * bx * eb) / nom;
145 vy = mu * (ey + muH * (ez * bx - ex * bz) + muH2 * by * eb) / nom;
146 vz = mu * (ez + muH * (ex * by - ey * bx) + muH2 * bz * eb) / nom;
147 }
148 return true;
149}
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)
Definition: Medium.cc:204
bool m_hasElectronVelocityE
Definition: Medium.hh:339

Referenced by ElectronAttachment().

◆ GetComponent()

void Garfield::MediumCdTe::GetComponent ( const unsigned int  i,
std::string &  label,
double &  f 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 52 of file MediumCdTe.cc.

53 {
54
55 if (i == 0) {
56 label = "Cd";
57 f = 0.5;
58 } else if (i == 1) {
59 label = "Te";
60 f = 0.5;
61 } else {
62 std::cerr << m_className << "::GetComponent:\n Index out of range.\n";
63 }
64}

◆ GetDielectricFunction()

bool Garfield::MediumCdTe::GetDielectricFunction ( const double  e,
double &  eps1,
double &  eps2,
const unsigned int  i = 0 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 319 of file MediumCdTe.cc.

320 {
321
322 if (i != 0) {
323 std::cerr << m_className << "::GetDielectricFunction:\n"
324 << " Medium has only one component.\n";
325 return false;
326 }
327
328 // Make sure the optical data table has been loaded.
329 if (m_opticalDataTable.empty()) {
330 if (!LoadOpticalData(m_opticalDataFile)) {
331 std::cerr << m_className << "::GetDielectricFunction:\n"
332 << " Optical data table could not be loaded.\n";
333 return false;
334 }
335 }
336
337 // Make sure the requested energy is within the range of the table.
338 const double emin = m_opticalDataTable[0].energy;
339 const double emax = m_opticalDataTable.back().energy;
340 if (e < emin || e > emax) {
341 std::cerr << m_className << "::GetDielectricFunction:\n"
342 << " Requested energy (" << e << " eV)"
343 << " is outside the range of the optical data table.\n"
344 << " " << emin << " < E [eV] < " << emax << "\n";
345 eps1 = eps2 = 0.;
346 return false;
347 }
348
349 // Locate the requested energy in the table.
350 int iLo = 0;
351 int iUp = m_opticalDataTable.size() - 1;
352 int iM;
353 while (iUp - iLo > 1) {
354 iM = (iUp + iLo) >> 1;
355 if (e >= m_opticalDataTable[iM].energy) {
356 iLo = iM;
357 } else {
358 iUp = iM;
359 }
360 }
361
362 // Interpolate the real part of dielectric function.
363 // Use linear interpolation if one of the values is negative,
364 // Otherwise use log-log interpolation.
365 const double logX0 = log(m_opticalDataTable[iLo].energy);
366 const double logX1 = log(m_opticalDataTable[iUp].energy);
367 const double logX = log(e);
368 if (m_opticalDataTable[iLo].eps1 <= 0. ||
369 m_opticalDataTable[iUp].eps1 <= 0.) {
370 eps1 = m_opticalDataTable[iLo].eps1 +
371 (e - m_opticalDataTable[iLo].energy) *
372 (m_opticalDataTable[iUp].eps1 - m_opticalDataTable[iLo].eps1) /
373 (m_opticalDataTable[iUp].energy - m_opticalDataTable[iLo].energy);
374 } else {
375 const double logY0 = log(m_opticalDataTable[iLo].eps1);
376 const double logY1 = log(m_opticalDataTable[iUp].eps1);
377 eps1 = logY0 + (logX - logX0) * (logY1 - logY0) / (logX1 - logX0);
378 eps1 = exp(eps1);
379 }
380
381 // Interpolate the imaginary part of dielectric function,
382 // using log-log interpolation.
383 const double logY0 = log(m_opticalDataTable[iLo].eps2);
384 const double logY1 = log(m_opticalDataTable[iUp].eps2);
385 eps2 = logY0 + (log(e) - logX0) * (logY1 - logY0) / (logX1 - logX0);
386 eps2 = exp(eps2);
387 return true;
388}
DoubleAc exp(const DoubleAc &f)
Definition: DoubleAc.cpp:377

◆ GetOpticalDataRange()

bool Garfield::MediumCdTe::GetOpticalDataRange ( double &  emin,
double &  emax,
const unsigned int  i = 0 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 293 of file MediumCdTe.cc.

294 {
295
296 if (i != 0) {
297 std::cerr << m_className << "::GetOpticalDataRange:\n"
298 << " Medium has only one component.\n";
299 }
300
301 // Make sure the optical data table has been loaded.
302 if (m_opticalDataTable.empty()) {
303 if (!LoadOpticalData(m_opticalDataFile)) {
304 std::cerr << m_className << "::GetOpticalDataRange:\n"
305 << " Optical data table could not be loaded.\n";
306 return false;
307 }
308 }
309
310 emin = m_opticalDataTable[0].energy;
311 emax = m_opticalDataTable.back().energy;
312 if (m_debug) {
313 std::cout << m_className << "::GetOpticalDataRange:\n "
314 << emin << " < E [eV] < " << emax << "\n";
315 }
316 return true;
317}

◆ HoleAttachment()

bool Garfield::MediumCdTe::HoleAttachment ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  eta 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 237 of file MediumCdTe.cc.

239 {
240
241 eta = 0.;
243 // Interpolation in user table.
244 return Medium::HoleAttachment(ex, ey, ez, bx, by, bz, eta);
245 }
246 switch (m_trappingModel) {
247 case 0:
248 eta = m_hTrapCs * m_hTrapDensity;
249 break;
250 case 1:
251 double vx, vy, vz;
252 HoleVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
253 eta = m_hTrapTime * sqrt(vx * vx + vy * vy + vz * vz);
254 if (eta > 0.) eta = 1. / eta;
255 break;
256 default:
257 std::cerr << m_className << "::HoleAttachment:\n"
258 << " Unknown model activated. Program bug!\n";
259 return false;
260 break;
261 }
262 return true;
263}
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)
Definition: MediumCdTe.cc:195
bool m_hasHoleAttachment
Definition: Medium.hh:358
virtual bool HoleAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
Definition: Medium.cc:1023

◆ HoleTownsend()

bool Garfield::MediumCdTe::HoleTownsend ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  alpha 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 225 of file MediumCdTe.cc.

227 {
228
229 alpha = 0.;
230 if (m_hasHoleTownsend) {
231 // Interpolation in user table.
232 return Medium::HoleTownsend(ex, ey, ez, bx, by, bz, alpha);
233 }
234 return false;
235}
virtual bool HoleTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
Definition: Medium.cc:971
bool m_hasHoleTownsend
Definition: Medium.hh:358

◆ HoleVelocity()

bool Garfield::MediumCdTe::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 
)
virtual

Reimplemented from Garfield::Medium.

Definition at line 195 of file MediumCdTe.cc.

197 {
198
199 vx = vy = vz = 0.;
200 if (m_hasHoleVelocityE) {
201 // Interpolation in user table.
202 return Medium::HoleVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
203 }
204 // Calculate the mobility
205 const double mu = m_hMobility;
206 const double b2 = bx * bx + by * by + bz * bz;
207 if (b2 < Small) {
208 vx = mu * ex;
209 vy = mu * ey;
210 vz = mu * ez;
211 } else {
212 // Hall mobility
213 const double muH = m_hHallFactor * mu;
214 const double muH2 = muH * muH;
215 const double eb = bx * ex + by * ey + bz * ez;
216 const double nom = 1. + muH2 * b2;
217 // Compute the drift velocity using the Langevin equation.
218 vx = mu * (ex + muH * (ey * bz - ez * by) + muH2 * bx * eb) / nom;
219 vy = mu * (ey + muH * (ez * bx - ex * bz) + muH2 * by * eb) / nom;
220 vz = mu * (ez + muH * (ex * by - ey * bx) + muH2 * bz * eb) / nom;
221 }
222 return true;
223}
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)
Definition: Medium.cc:704
bool m_hasHoleVelocityE
Definition: Medium.hh:356

Referenced by HoleAttachment().

◆ IsSemiconductor()

bool Garfield::MediumCdTe::IsSemiconductor ( ) const
inlinevirtual

Reimplemented from Garfield::Medium.

Definition at line 18 of file MediumCdTe.hh.

18{ return true; }

◆ SetLowFieldMobility()

void Garfield::MediumCdTe::SetLowFieldMobility ( const double  mue,
const double  muh 
)

Definition at line 265 of file MediumCdTe.cc.

265 {
266
267 if (mue <= 0. || muh <= 0.) {
268 std::cerr << m_className << "::SetLowFieldMobility:\n"
269 << " Mobility must be greater than zero.\n";
270 return;
271 }
272
273 m_eMobility = mue;
274 m_hMobility = muh;
275 m_hasUserMobility = true;
276 m_isChanged = true;
277}
bool m_isChanged
Definition: Medium.hh:326

◆ SetSaturationVelocity()

void Garfield::MediumCdTe::SetSaturationVelocity ( const double  vsate,
const double  vsath 
)

Definition at line 279 of file MediumCdTe.cc.

279 {
280
281 if (vsate <= 0. || vsath <= 0.) {
282 std::cout << m_className << "::SetSaturationVelocity:\n"
283 << " Restoring default values.\n";
284 m_hasUserSaturationVelocity = false;
285 } else {
286 m_eSatVel = vsate;
287 m_hSatVel = vsath;
288 m_hasUserSaturationVelocity = true;
289 }
290 m_isChanged = true;
291}

◆ SetTrapCrossSection()

void Garfield::MediumCdTe::SetTrapCrossSection ( const double  ecs,
const double  hcs 
)

Definition at line 66 of file MediumCdTe.cc.

66 {
67
68 if (ecs < 0.) {
69 std::cerr << m_className << "::SetTrapCrossSection:\n"
70 << " Capture cross-section [cm2] must positive.\n";
71 } else {
72 m_eTrapCs = ecs;
73 }
74
75 if (hcs < 0.) {
76 std::cerr << m_className << "::SetTrapCrossSection:\n"
77 << " Capture cross-section [cm2] must be positive.n";
78 } else {
79 m_hTrapCs = hcs;
80 }
81
82 m_trappingModel = 0;
83 m_isChanged = true;
84}

◆ SetTrapDensity()

void Garfield::MediumCdTe::SetTrapDensity ( const double  n)

Definition at line 86 of file MediumCdTe.cc.

86 {
87
88 if (n < 0.) {
89 std::cerr << m_className << "::SetTrapDensity:\n"
90 << " Trap density [cm-3] must be greater than zero.\n";
91 } else {
92 m_eTrapDensity = n;
93 m_hTrapDensity = n;
94 }
95
96 m_trappingModel = 0;
97 m_isChanged = true;
98}

◆ SetTrappingTime()

void Garfield::MediumCdTe::SetTrappingTime ( const double  etau,
const double  htau 
)

Definition at line 100 of file MediumCdTe.cc.

100 {
101
102 if (etau <= 0.) {
103 std::cerr << m_className << "::SetTrappingTime:\n"
104 << " Trapping time [ns-1] must be greater than zero.\n";
105 } else {
106 m_eTrapTime = etau;
107 }
108
109 if (htau <= 0.) {
110 std::cerr << m_className << "::SetTrappingTime:\n"
111 << " Trapping time [ns-1] must be greater than zero.\n";
112 } else {
113 m_hTrapTime = htau;
114 }
115
116 m_trappingModel = 1;
117 m_isChanged = true;
118}

The documentation for this class was generated from the following files: