Garfield++ v1r0
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

#include <MediumCdTe.hh>

+ Inheritance diagram for Garfield::MediumCdTe:

Public Member Functions

 MediumCdTe ()
 
 ~MediumCdTe ()
 
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
 
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 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 int GetNumberOfIonisationProducts ()
 
virtual bool GetIonisationProduct (const int i, int &type, double &energy)
 
virtual int GetNumberOfDeexcitationProducts ()
 
virtual bool GetDeexcitationProduct (const int i, double &t, double &s, int &type, double &energy)
 
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 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 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 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 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
 
unsigned int m_nEfields
 
unsigned int m_nBfields
 
unsigned int m_nAngles
 
std::vector< double > eFields
 
std::vector< double > bFields
 
std::vector< double > bAngles
 
bool m_map2d
 
bool m_hasElectronVelocityE
 
bool m_hasElectronVelocityB
 
bool m_hasElectronVelocityExB
 
bool m_hasElectronDiffLong
 
bool m_hasElectronDiffTrans
 
bool m_hasElectronDiffTens
 
bool m_hasElectronTownsend
 
bool m_hasElectronAttachment
 
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< 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_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_intpMobility
 
unsigned int m_intpDissociation
 
- Static Protected Attributes inherited from Garfield::Medium
static int m_idCounter = -1
 

Detailed Description

Definition at line 9 of file MediumCdTe.hh.

Constructor & Destructor Documentation

◆ MediumCdTe()

Garfield::MediumCdTe::MediumCdTe ( )

Definition at line 15 of file MediumCdTe.cc.

16 : Medium(),
17 // bandGap(1.44),
18 eMobility(1.1e-6),
19 hMobility(0.1e-6),
20 eSatVel(1.02e-2),
21 hSatVel(0.72e-2),
22 eHallFactor(1.15),
23 hHallFactor(0.7),
24 eTrapCs(1.e-15),
25 hTrapCs(1.e-15),
26 eTrapDensity(1.e13),
27 hTrapDensity(1.e13),
28 eTrapTime(0.),
29 hTrapTime(0.),
30 trappingModel(0),
31 m_hasUserMobility(false),
32 m_hasUserSaturationVelocity(false),
33 m_hasOpticalData(false),
34 opticalDataFile("OpticalData_Si.txt") {
35
36 m_className = "MediumCdTe";
37 m_name = "CdTe";
38
39 SetTemperature(300.);
41 SetAtomicNumber(48.52);
42 SetAtomicWeight(240.01);
43 SetMassDensity(5.85);
44
47 m_microscopic = false;
48
49 m_w = 4.43;
50 m_fano = 0.1;
51}
bool m_microscopic
Definition: Medium.hh:309
virtual void SetAtomicWeight(const double &a)
Definition: Medium.cc:178
virtual void SetMassDensity(const double &rho)
Definition: Medium.cc:200
double m_fano
Definition: Medium.hh:313
std::string m_name
Definition: Medium.hh:291
virtual void SetAtomicNumber(const double &z)
Definition: Medium.cc:167
virtual void EnableDrift()
Definition: Medium.hh:52
void SetTemperature(const double &t)
Definition: Medium.cc:117
void SetDielectricConstant(const double &eps)
Definition: Medium.cc:139
virtual void EnablePrimaryIonisation()
Definition: Medium.hh:54
std::string m_className
Definition: Medium.hh:284

◆ ~MediumCdTe()

Garfield::MediumCdTe::~MediumCdTe ( )
inline

Definition at line 15 of file MediumCdTe.hh.

15{}

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 163 of file MediumCdTe.cc.

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

◆ 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 150 of file MediumCdTe.cc.

153 {
154
155 alpha = 0.;
157 // Interpolation in user table.
158 return Medium::ElectronTownsend(ex, ey, ez, bx, by, bz, alpha);
159 }
160 return false;
161}
bool m_hasElectronTownsend
Definition: Medium.hh:335
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:542

◆ 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 119 of file MediumCdTe.cc.

122 {
123
124 vx = vy = vz = 0.;
126 // Interpolation in user table.
127 return Medium::ElectronVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
128 }
129 // Calculate the mobility
130 double mu = eMobility;
131 mu = -mu;
132 const double b = sqrt(bx * bx + by * by + bz * bz);
133 if (b < Small) {
134 vx = mu * ex;
135 vy = mu * ey;
136 vz = mu * ez;
137 } else {
138 // Hall mobility
139 const double muH = eHallFactor * mu;
140 const double eb = bx * ex + by * ey + bz * ez;
141 const double nom = 1. + pow(muH * b, 2);
142 // Compute the drift velocity using the Langevin equation.
143 vx = mu * (ex + muH * (ey * bz - ez * by) + muH * muH * bx * eb) / nom;
144 vy = mu * (ey + muH * (ez * bx - ex * bz) + muH * muH * by * eb) / nom;
145 vz = mu * (ez + muH * (ex * by - ey * bx) + muH * muH * bz * eb) / nom;
146 }
147 return true;
148}
DoubleAc pow(const DoubleAc &f, double p)
Definition: DoubleAc.cpp:336
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:217
bool m_hasElectronVelocityE
Definition: Medium.hh:333

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 53 of file MediumCdTe.cc.

54 {
55
56 if (i == 0) {
57 label = "Cd";
58 f = 0.5;
59 } else if (i == 1) {
60 label = "Te";
61 f = 0.5;
62 }
63}

◆ 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 318 of file MediumCdTe.cc.

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

◆ GetOpticalDataRange()

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

Reimplemented from Garfield::Medium.

Definition at line 291 of file MediumCdTe.cc.

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

◆ 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 235 of file MediumCdTe.cc.

237 {
238
239 eta = 0.;
241 // Interpolation in user table.
242 return Medium::HoleAttachment(ex, ey, ez, bx, by, bz, eta);
243 }
244 switch (trappingModel) {
245 case 0:
246 eta = hTrapCs * hTrapDensity;
247 break;
248 case 1:
249 double vx, vy, vz;
250 HoleVelocity(ex, ey, ez, bx, by, bz, vx, vy, vz);
251 eta = hTrapTime * sqrt(vx * vx + vy * vy + vz * vz);
252 if (eta > 0.) eta = 1. / eta;
253 break;
254 default:
255 std::cerr << m_className << "::HoleAttachment:\n";
256 std::cerr << " Unknown model activated. Program bug!\n";
257 return false;
258 break;
259 }
260 return true;
261}
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:194
bool m_hasHoleAttachment
Definition: Medium.hh:350
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:1144

◆ 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 223 of file MediumCdTe.cc.

225 {
226
227 alpha = 0.;
228 if (m_hasHoleTownsend) {
229 // Interpolation in user table.
230 return Medium::HoleTownsend(ex, ey, ez, bx, by, bz, alpha);
231 }
232 return false;
233}
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:1079
bool m_hasHoleTownsend
Definition: Medium.hh:350

◆ 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 194 of file MediumCdTe.cc.

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

Referenced by HoleAttachment().

◆ IsSemiconductor()

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

Reimplemented from Garfield::Medium.

Definition at line 17 of file MediumCdTe.hh.

17{ return true; }

◆ SetLowFieldMobility()

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

Definition at line 263 of file MediumCdTe.cc.

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

◆ SetSaturationVelocity()

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

Definition at line 277 of file MediumCdTe.cc.

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

◆ SetTrapCrossSection()

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

Definition at line 65 of file MediumCdTe.cc.

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

◆ SetTrapDensity()

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

Definition at line 85 of file MediumCdTe.cc.

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

◆ SetTrappingTime()

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

Definition at line 99 of file MediumCdTe.cc.

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

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