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

Abstract base class for media. More...

#include <Medium.hh>

+ Inheritance diagram for Garfield::Medium:

Public Member Functions

 Medium ()
 Constructor.
 
virtual ~Medium ()
 Destructor.
 
int GetId () const
 Return the id number of the class instance.
 
const std::string & GetName () const
 Get the medium name/identifier.
 
virtual bool IsGas () const
 Is this medium a gas?
 
virtual bool IsSemiconductor () const
 Is this medium a semiconductor?
 
virtual bool IsConductor () const
 Is this medium a conductor?
 
void SetTemperature (const double t)
 Set the temperature [K].
 
double GetTemperature () const
 Get the temperature [K].
 
void SetPressure (const double p)
 
double GetPressure () const
 
void SetDielectricConstant (const double eps)
 Set the relative static dielectric constant.
 
double GetDielectricConstant () const
 Get the relative static dielectric constant.
 
unsigned int GetNumberOfComponents () const
 Get number of components of the medium.
 
virtual void GetComponent (const unsigned int i, std::string &label, double &f)
 Get the name and fraction of a given component.
 
virtual void SetAtomicNumber (const double z)
 Set the effective atomic number.
 
virtual double GetAtomicNumber () const
 Get the effective atomic number.
 
virtual void SetAtomicWeight (const double a)
 Set the effective atomic weight.
 
virtual double GetAtomicWeight () const
 Get the effective atomic weight.
 
virtual void SetNumberDensity (const double n)
 Set the number density [cm-3].
 
virtual double GetNumberDensity () const
 Get the number density [cm-3].
 
virtual void SetMassDensity (const double rho)
 Set the mass density [g/cm3].
 
virtual double GetMassDensity () const
 Get the mass density [g/cm3].
 
virtual void EnableDrift (const bool on=true)
 Switch electron/ion/hole on/off.
 
virtual void EnablePrimaryIonisation (const bool on=true)
 Make the medium ionisable or non-ionisable.
 
bool IsDriftable () const
 Is charge carrier transport enabled in this medium?
 
bool IsMicroscopic () const
 Does the medium have electron scattering rates?
 
bool IsIonisable () const
 Is charge deposition by charged particles/photon enabled in this medium?
 
void SetW (const double w)
 Set the W value (average energy to produce an electron/ion or e/h pair).
 
double GetW ()
 Get the W value.
 
void SetFanoFactor (const double f)
 Set the Fano factor.
 
double GetFanoFactor ()
 Get the Fano factor.
 
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].
 
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)
 Longitudinal and transverse diffusion coefficients [cm1/2].
 
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)
 Ionisation coefficient [cm-1].
 
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].
 
virtual bool ElectronLorentzAngle (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &lor)
 Lorentz angle.
 
virtual double ElectronMobility ()
 Low-field mobility [cm2 V-1 ns-1].
 
virtual double GetElectronEnergy (const double px, const double py, const double pz, double &vx, double &vy, double &vz, const int band=0)
 Dispersion relation (energy vs. wave vector)
 
virtual void GetElectronMomentum (const double e, double &px, double &py, double &pz, int &band)
 
virtual double GetElectronNullCollisionRate (const int band=0)
 Null-collision rate [ns-1].
 
virtual double GetElectronCollisionRate (const double e, const int band=0)
 Collision rate [ns-1] for given electron energy.
 
virtual bool GetElectronCollision (const double e, int &type, int &level, double &e1, double &dx, double &dy, double &dz, std::vector< std::pair< int, double > > &secondaries, int &ndxc, int &band)
 Sample the collision type. Update energy and direction vector.
 
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)
 Drift velocity [cm / ns].
 
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)
 Longitudinal and transverse diffusion coefficients [cm1/2].
 
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])
 Diffusion tensor.
 
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].
 
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].
 
virtual double HoleMobility ()
 Low-field mobility [cm2 V-1 ns-1].
 
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)
 Drift velocity [cm / ns].
 
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)
 Longitudinal and transverse diffusion coefficients [cm1/2].
 
virtual bool IonDissociation (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &diss)
 Dissociation coefficient.
 
virtual double IonMobility ()
 Low-field mobility [cm2 V-1 ns-1].
 
void SetFieldGrid (double emin, double emax, const size_t ne, bool logE, double bmin=0., double bmax=0., const size_t nb=1, double amin=HalfPi, double amax=HalfPi, const size_t na=1)
 Set the range of fields to be covered by the transport tables.
 
void SetFieldGrid (const std::vector< double > &efields, const std::vector< double > &bfields, const std::vector< double > &angles)
 Set the fields and E-B angles to be used in the transport tables.
 
void GetFieldGrid (std::vector< double > &efields, std::vector< double > &bfields, std::vector< double > &angles)
 Get the fields and E-B angles used in the transport tables.
 
bool SetElectronVelocityE (const size_t ie, const size_t ib, const size_t ia, const double v)
 Set an entry in the table of drift speeds along E.
 
bool GetElectronVelocityE (const size_t ie, const size_t ib, const size_t ia, double &v)
 Get an entry in the table of drift speeds along E.
 
bool SetElectronVelocityExB (const size_t ie, const size_t ib, const size_t ia, const double v)
 Set an entry in the table of drift speeds along ExB.
 
bool GetElectronVelocityExB (const size_t ie, const size_t ib, const size_t ia, double &v)
 Get an entry in the table of drift speeds along ExB.
 
bool SetElectronVelocityB (const size_t ie, const size_t ib, const size_t ia, const double v)
 Set an entry in the table of drift speeds along Btrans.
 
bool GetElectronVelocityB (const size_t ie, const size_t ib, const size_t ia, double &v)
 Get an entry in the table of drift speeds along Btrans.
 
bool SetElectronLongitudinalDiffusion (const size_t ie, const size_t ib, const size_t ia, const double dl)
 Set an entry in the table of longitudinal diffusion coefficients.
 
bool GetElectronLongitudinalDiffusion (const size_t ie, const size_t ib, const size_t ia, double &dl)
 Get an entry in the table of longitudinal diffusion coefficients.
 
bool SetElectronTransverseDiffusion (const size_t ie, const size_t ib, const size_t ia, const double dt)
 Set an entry in the table of transverse diffusion coefficients.
 
bool GetElectronTransverseDiffusion (const size_t ie, const size_t ib, const size_t ia, double &dt)
 Get an entry in the table of transverse diffusion coefficients.
 
bool SetElectronTownsend (const size_t ie, const size_t ib, const size_t ia, const double alpha)
 Set an entry in the table of Townsend coefficients.
 
bool GetElectronTownsend (const size_t ie, const size_t ib, const size_t ia, double &alpha)
 Get an entry in the table of Townsend coefficients.
 
bool SetElectronAttachment (const size_t ie, const size_t ib, const size_t ia, const double eta)
 Set an entry in the table of attachment coefficients.
 
bool GetElectronAttachment (const size_t ie, const size_t ib, const size_t ia, double &eta)
 Get an entry in the table of attachment coefficients.
 
bool SetElectronLorentzAngle (const size_t ie, const size_t ib, const size_t ia, const double lor)
 Set an entry in the table of Lorentz angles.
 
bool GetElectronLorentzAngle (const size_t ie, const size_t ib, const size_t ia, double &lor)
 Get an entry in the table of Lorentz angles.
 
bool SetHoleVelocityE (const size_t ie, const size_t ib, const size_t ia, const double v)
 Set an entry in the table of drift speeds along E.
 
bool GetHoleVelocityE (const size_t ie, const size_t ib, const size_t ia, double &v)
 Get an entry in the table of drift speeds along E.
 
bool SetHoleVelocityExB (const size_t ie, const size_t ib, const size_t ia, const double v)
 Set an entry in the table of drift speeds along ExB.
 
bool GetHoleVelocityExB (const size_t ie, const size_t ib, const size_t ia, double &v)
 Get an entry in the table of drift speeds along ExB.
 
bool SetHoleVelocityB (const size_t ie, const size_t ib, const size_t ia, const double v)
 Set an entry in the table of drift speeds along Btrans.
 
bool GetHoleVelocityB (const size_t ie, const size_t ib, const size_t ia, double &v)
 Get an entry in the table of drift speeds along Btrans.
 
bool SetHoleLongitudinalDiffusion (const size_t ie, const size_t ib, const size_t ia, const double dl)
 Set an entry in the table of longitudinal diffusion coefficients.
 
bool GetHoleLongitudinalDiffusion (const size_t ie, const size_t ib, const size_t ia, double &dl)
 Get an entry in the table of longitudinal diffusion coefficients.
 
bool SetHoleTransverseDiffusion (const size_t ie, const size_t ib, const size_t ia, const double dt)
 Set an entry in the table of transverse diffusion coefficients.
 
bool GetHoleTransverseDiffusion (const size_t ie, const size_t ib, const size_t ia, double &dt)
 Get an entry in the table of transverse diffusion coefficients.
 
bool SetHoleTownsend (const size_t ie, const size_t ib, const size_t ia, const double alpha)
 Set an entry in the table of Townsend coefficients.
 
bool GetHoleTownsend (const size_t ie, const size_t ib, const size_t ia, double &alpha)
 Get an entry in the table of Townsend coefficients.
 
bool SetHoleAttachment (const size_t ie, const size_t ib, const size_t ia, const double eta)
 Set an entry in the table of attachment coefficients.
 
bool GetHoleAttachment (const size_t ie, const size_t ib, const size_t ia, double &eta)
 Get an entry in the table of attachment coefficients.
 
bool SetIonMobility (const std::vector< double > &fields, const std::vector< double > &mobilities)
 
bool SetIonMobility (const size_t ie, const size_t ib, const size_t ia, const double mu)
 Set an entry in the table of ion mobilities.
 
bool GetIonMobility (const size_t ie, const size_t ib, const size_t ia, double &mu)
 Get an entry in the table of ion mobilities.
 
bool SetIonLongitudinalDiffusion (const size_t ie, const size_t ib, const size_t ia, const double dl)
 Set an entry in the table of longitudinal diffusion coefficients.
 
bool GetIonLongitudinalDiffusion (const size_t ie, const size_t ib, const size_t ia, double &dl)
 Get an entry in the table of longitudinal diffusion coefficients.
 
bool SetIonTransverseDiffusion (const size_t ie, const size_t ib, const size_t ia, const double dt)
 Set an entry in the table of transverse diffusion coefficients.
 
bool GetIonTransverseDiffusion (const size_t ie, const size_t ib, const size_t ia, double &dt)
 Get an entry in the table of transverse diffusion coefficients.
 
bool SetIonDissociation (const size_t ie, const size_t ib, const size_t ia, const double diss)
 Set an entry in the table of dissociation coefficients.
 
bool GetIonDissociation (const size_t ie, const size_t ib, const size_t ia, double &diss)
 Get an entry in the table of dissociation coefficients.
 
virtual void ResetTables ()
 Reset all tables of transport parameters.
 
void ResetElectronVelocity ()
 
void ResetElectronDiffusion ()
 
void ResetElectronTownsend ()
 
void ResetElectronAttachment ()
 
void ResetElectronLorentzAngle ()
 
void ResetHoleVelocity ()
 
void ResetHoleDiffusion ()
 
void ResetHoleTownsend ()
 
void ResetHoleAttachment ()
 
void ResetIonMobility ()
 
void ResetIonDiffusion ()
 
void ResetIonDissociation ()
 
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)
 Set the degree of polynomial interpolation (usually 2).
 
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)
 Get the energy range [eV] of the available optical data.
 
virtual bool GetDielectricFunction (const double e, double &eps1, double &eps2, const unsigned int i=0)
 Get the complex dielectric function at a given energy.
 
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 ()
 Switch on/off debugging messages.
 
void DisableDebugging ()
 

Protected Member Functions

bool Velocity (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &velE, const std::vector< std::vector< std::vector< double > > > &velB, const std::vector< std::vector< std::vector< double > > > &velX, const double q, double &vx, double &vy, double &vz) const
 
bool Diffusion (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &difL, const std::vector< std::vector< std::vector< double > > > &difT, double &dl, double &dt) const
 
bool Diffusion (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< std::vector< double > > > > &diff, double cov[3][3]) const
 
bool Alpha (const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &tab, unsigned int intp, const unsigned int thr, const std::pair< unsigned int, unsigned int > &extr, double &alpha) const
 
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
 
bool Interpolate (const double e, const double b, const double a, const std::vector< std::vector< std::vector< double > > > &table, double &y, const unsigned int intp, const std::pair< unsigned int, unsigned int > &extr) const
 
double Interpolate1D (const double e, const std::vector< double > &table, const std::vector< double > &fields, const unsigned int intpMeth, const std::pair< unsigned int, unsigned int > &extr) const
 
bool SetEntry (const size_t i, const size_t j, const size_t k, const std::string &fcn, std::vector< std::vector< std::vector< double > > > &tab, const double val)
 
bool GetEntry (const size_t i, const size_t j, const size_t k, const std::string &fcn, const std::vector< std::vector< std::vector< double > > > &tab, double &val) const
 
void SetExtrapolationMethod (const std::string &low, const std::string &high, std::pair< unsigned int, unsigned int > &extr, const std::string &fcn)
 
bool GetExtrapolationIndex (std::string str, unsigned int &nb) const
 
size_t SetThreshold (const std::vector< std::vector< std::vector< double > > > &tab) const
 
void Clone (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 std::pair< unsigned int, unsigned int > &extr, const double init, const std::string &label)
 
void Clone (std::vector< std::vector< std::vector< std::vector< double > > > > &tab, const size_t n, const std::vector< double > &efields, const std::vector< double > &bfields, const std::vector< double > &angles, const unsigned int intp, const std::pair< unsigned int, unsigned int > &extr, const double init, const std::string &label)
 
void Init (const size_t nE, const size_t nB, const size_t nA, std::vector< std::vector< std::vector< double > > > &tab, const double val)
 
void Init (const size_t nE, const size_t nB, const size_t nA, const size_t nT, std::vector< std::vector< std::vector< std::vector< double > > > > &tab, const double val)
 

Protected Attributes

std::string m_className = "Medium"
 
int m_id
 
unsigned int m_nComponents = 1
 
std::string m_name = ""
 
double m_temperature = 293.15
 
double m_pressure = 760.
 
double m_epsilon = 1.
 
double m_z = 1.
 
double m_a = 0.
 
double m_density = 0.
 
double m_w = 0.
 
double m_fano = 0.
 
bool m_driftable = false
 
bool m_microscopic = false
 
bool m_ionisable = false
 
bool m_isChanged = true
 
bool m_debug = false
 
bool m_tab2d = false
 
std::vector< double > m_eFields
 
std::vector< double > m_bFields
 
std::vector< double > m_bAngles
 
std::vector< std::vector< std::vector< double > > > m_eVelE
 
std::vector< std::vector< std::vector< double > > > m_eVelX
 
std::vector< std::vector< std::vector< double > > > m_eVelB
 
std::vector< std::vector< std::vector< double > > > m_eDifL
 
std::vector< std::vector< std::vector< double > > > m_eDifT
 
std::vector< std::vector< std::vector< double > > > m_eAlp
 
std::vector< std::vector< std::vector< double > > > m_eAtt
 
std::vector< std::vector< std::vector< double > > > m_eLor
 
std::vector< std::vector< std::vector< std::vector< double > > > > m_eDifM
 
std::vector< std::vector< std::vector< double > > > m_hVelE
 
std::vector< std::vector< std::vector< double > > > m_hVelX
 
std::vector< std::vector< std::vector< double > > > m_hVelB
 
std::vector< std::vector< std::vector< double > > > m_hDifL
 
std::vector< std::vector< std::vector< double > > > m_hDifT
 
std::vector< std::vector< std::vector< double > > > m_hAlp
 
std::vector< std::vector< std::vector< double > > > m_hAtt
 
std::vector< std::vector< std::vector< std::vector< double > > > > m_hDifM
 
std::vector< std::vector< std::vector< double > > > m_iMob
 
std::vector< std::vector< std::vector< double > > > m_iDifL
 
std::vector< std::vector< std::vector< double > > > m_iDifT
 
std::vector< std::vector< std::vector< double > > > m_iDis
 
unsigned int m_eThrAlp = 0
 
unsigned int m_eThrAtt = 0
 
unsigned int m_hThrAlp = 0
 
unsigned int m_hThrAtt = 0
 
unsigned int m_iThrDis = 0
 
std::pair< unsigned int, unsigned int > m_extrVel = {0, 1}
 
std::pair< unsigned int, unsigned int > m_extrDif = {0, 1}
 
std::pair< unsigned int, unsigned int > m_extrAlp = {0, 1}
 
std::pair< unsigned int, unsigned int > m_extrAtt = {0, 1}
 
std::pair< unsigned int, unsigned int > m_extrLor = {0, 1}
 
std::pair< unsigned int, unsigned int > m_extrMob = {0, 1}
 
std::pair< unsigned int, unsigned int > m_extrDis = {0, 1}
 
unsigned int m_intpVel = 2
 
unsigned int m_intpDif = 2
 
unsigned int m_intpAlp = 2
 
unsigned int m_intpAtt = 2
 
unsigned int m_intpLor = 2
 
unsigned int m_intpMob = 2
 
unsigned int m_intpDis = 2
 

Static Protected Attributes

static int m_idCounter = -1
 

Detailed Description

Abstract base class for media.

Definition at line 13 of file Medium.hh.

Constructor & Destructor Documentation

◆ Medium()

Garfield::Medium::Medium ( )

Constructor.

Definition at line 60 of file Medium.cc.

60 : m_id(++m_idCounter) {
61 // Initialise the transport tables.
62 m_bFields.assign(1, 0.);
63 m_bAngles.assign(1, HalfPi);
64
65 // Set the default grid.
66 SetFieldGrid(100., 100000., 20, true, 0., 0., 1, HalfPi, HalfPi, 1);
67}
std::vector< double > m_bFields
Definition: Medium.hh:537
static int m_idCounter
Definition: Medium.hh:495
void SetFieldGrid(double emin, double emax, const size_t ne, bool logE, double bmin=0., double bmax=0., const size_t nb=1, double amin=HalfPi, double amax=HalfPi, const size_t na=1)
Set the range of fields to be covered by the transport tables.
Definition: Medium.cc:693
std::vector< double > m_bAngles
Definition: Medium.hh:538

◆ ~Medium()

Garfield::Medium::~Medium ( )
virtual

Destructor.

Definition at line 69 of file Medium.cc.

69{}

Member Function Documentation

◆ Alpha()

bool Garfield::Medium::Alpha ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
const std::vector< std::vector< std::vector< double > > > &  tab,
unsigned int  intp,
const unsigned int  thr,
const std::pair< unsigned int, unsigned int > &  extr,
double &  alpha 
) const
protected

Definition at line 348 of file Medium.cc.

353 {
354
355 alpha = 0.;
356 if (tab.empty()) return false;
357
358 // Compute the magnitude of the electric field.
359 const double e = sqrt(ex * ex + ey * ey + ez * ez);
360 const double e0 = ScaleElectricField(e);
361 if (e < Small || e0 < Small) return true;
362
363 // Compute the magnitude of the magnetic field.
364 const double b = m_tab2d ? sqrt(bx * bx + by * by + bz * bz) : 0.;
365 // Compute the angle between B field and E field.
366 const double ebang = m_tab2d ? GetAngle(ex, ey, ez, bx, by, bz, e, b) : 0.;
367
368 // Interpolate.
369 if (e0 < m_eFields[thr]) intp = 1;
370 if (!Interpolate(e0, b, ebang, tab, alpha, intp, extr)) alpha = -30.;
371 if (alpha < -20.) {
372 alpha = 0.;
373 } else {
374 alpha = exp(alpha);
375 }
376 return true;
377}
bool Interpolate(const double e, const double b, const double a, const std::vector< std::vector< std::vector< double > > > &table, double &y, const unsigned int intp, const std::pair< unsigned int, unsigned int > &extr) const
Definition: Medium.cc:1201
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
Definition: Medium.cc:1185
virtual double ScaleElectricField(const double e) const
Definition: Medium.hh:463
std::vector< double > m_eFields
Definition: Medium.hh:536
DoubleAc exp(const DoubleAc &f)
Definition: DoubleAc.cpp:377
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314

Referenced by ElectronAttachment(), ElectronTownsend(), HoleAttachment(), HoleTownsend(), and IonDissociation().

◆ Clone() [1/2]

void Garfield::Medium::Clone ( 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 std::pair< unsigned int, unsigned int > &  extr,
const double  init,
const std::string &  label 
)
protected

Definition at line 918 of file Medium.cc.

924 {
925 if (m_debug) {
926 std::cout << m_className << "::Clone: Copying " << lbl << " to new grid.\n";
927 }
928
929 if (tab.empty()) {
930 if (m_debug) std::cout << m_className << "::Clone: Table is empty.\n";
931 return;
932 }
933 // Get the dimensions of the new grid.
934 const auto nE = efields.size();
935 const auto nB = bfields.size();
936 const auto nA = angles.size();
937
938 // Create a temporary table to store the values at the new grid points.
939 std::vector<std::vector<std::vector<double> > > tabClone;
940 Init(nE, nB, nA, tabClone, init);
941
942 // Fill the temporary table.
943 for (size_t i = 0; i < nE; ++i) {
944 const double e = efields[i];
945 for (size_t j = 0; j < nB; ++j) {
946 const double b = bfields[j];
947 for (size_t k = 0; k < nA; ++k) {
948 const double a = angles[k];
949 double val = 0.;
950 if (!Interpolate(e, b, a, tab, val, intp, extr)) {
951 std::cerr << m_className << "::Clone:\n"
952 << " Interpolation of " << lbl << " failed.\n"
953 << " Cannot copy value to new grid at E = " << e
954 << ", B = " << b << ", angle: " << a << "\n";
955 continue;
956 }
957 tabClone[k][j][i] = val;
958 }
959 }
960 }
961 // Copy the values to the original table.
962 tab.swap(tabClone);
963}
void Init(const size_t nE, const size_t nB, const size_t nA, std::vector< std::vector< std::vector< double > > > &tab, const double val)
Definition: Medium.cc:1295
std::string m_className
Definition: Medium.hh:493

Referenced by SetFieldGrid().

◆ Clone() [2/2]

void Garfield::Medium::Clone ( std::vector< std::vector< std::vector< std::vector< double > > > > &  tab,
const size_t  n,
const std::vector< double > &  efields,
const std::vector< double > &  bfields,
const std::vector< double > &  angles,
const unsigned int  intp,
const std::pair< unsigned int, unsigned int > &  extr,
const double  init,
const std::string &  label 
)
protected

Definition at line 965 of file Medium.cc.

970 {
971 // If the table does not exist, do nothing.
972 if (tab.empty()) return;
973
974 // Get the dimensions of the new grid.
975 const auto nE = efields.size();
976 const auto nB = bfields.size();
977 const auto nA = angles.size();
978
979 // Create a temporary table to store the values at the new grid points.
980 std::vector<std::vector<std::vector<std::vector<double> > > > tabClone;
981 Init(nE, nB, nA, n, tabClone, init);
982
983 // Fill the temporary table.
984 for (size_t l = 0; l < n; ++l) {
985 for (size_t i = 0; i < nE; ++i) {
986 const double e = efields[i];
987 for (size_t j = 0; j < nB; ++j) {
988 const double b = bfields[j];
989 for (size_t k = 0; k < nA; ++k) {
990 const double a = angles[k];
991 double val = 0.;
992 if (!Interpolate(e, b, a, tab[l], val, intp, extr)) {
993 std::cerr << m_className << "::Clone:\n"
994 << " Interpolation of " << lbl << " failed.\n"
995 << " Cannot copy value to new grid at index " << l
996 << ", E = " << e << ", B = " << b << ", angle: " << a
997 << "\n";
998 continue;
999 }
1000 tabClone[l][k][j][i] = val;
1001 }
1002 }
1003 }
1004 }
1005 // Copy the values to the original table.
1006 tab.swap(tabClone);
1007}

◆ Diffusion() [1/2]

bool Garfield::Medium::Diffusion ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
const std::vector< std::vector< std::vector< double > > > &  difL,
const std::vector< std::vector< std::vector< double > > > &  difT,
double &  dl,
double &  dt 
) const
protected

Definition at line 269 of file Medium.cc.

273 {
274
275 dl = dt = 0.;
276 // Compute the magnitude of the electric field.
277 const double e = sqrt(ex * ex + ey * ey + ez * ez);
278 const double e0 = ScaleElectricField(e);
279 if (e < Small || e0 < Small) return true;
280
281 // Compute the magnitude of the magnetic field.
282 const double b = m_tab2d ? sqrt(bx * bx + by * by + bz * bz) : 0.;
283 // Compute the angle between B field and E field.
284 const double ebang = m_tab2d ? GetAngle(ex, ey, ez, bx, by, bz, e, b) : 0.;
285
286 // Interpolate.
287 if (!difL.empty()) {
288 if (!Interpolate(e0, b, ebang, difL, dl, m_intpDif, m_extrDif)) dl = 0.;
289 }
290 if (!difT.empty()) {
291 if (!Interpolate(e0, b, ebang, difT, dt, m_intpDif, m_extrDif)) dt = 0.;
292 }
293
294 // If no data available, calculate
295 // the diffusion coefficients using the Einstein relation
296 if (difL.empty() || difT.empty()) {
297 const double d = sqrt(2. * BoltzmannConstant * m_temperature / e);
298 if (difL.empty()) dl = d;
299 if (difT.empty()) dt = d;
300 }
301 // Verify values and apply scaling.
302 dl = ScaleDiffusion(std::max(dl, 0.));
303 dt = ScaleDiffusion(std::max(dt, 0.));
304 return true;
305}
virtual double ScaleDiffusion(const double d) const
Definition: Medium.hh:466
unsigned int m_intpDif
Definition: Medium.hh:587
std::pair< unsigned int, unsigned int > m_extrDif
Definition: Medium.hh:578
double m_temperature
Definition: Medium.hh:504

Referenced by ElectronDiffusion(), HoleDiffusion(), and IonDiffusion().

◆ Diffusion() [2/2]

bool Garfield::Medium::Diffusion ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
const std::vector< std::vector< std::vector< std::vector< double > > > > &  diff,
double  cov[3][3] 
) const
protected

Definition at line 307 of file Medium.cc.

310 {
311
312 // Initialise the tensor.
313 cov[0][0] = cov[0][1] = cov[0][2] = 0.;
314 cov[1][0] = cov[1][1] = cov[1][2] = 0.;
315 cov[2][0] = cov[2][1] = cov[2][2] = 0.;
316
317 if (diff.empty()) return false;
318
319 // Compute the magnitude of the electric field.
320 const double e = sqrt(ex * ex + ey * ey + ez * ez);
321 const double e0 = ScaleElectricField(e);
322 if (e < Small || e0 < Small) return true;
323
324 // Compute the magnitude of the magnetic field.
325 const double b = m_tab2d ? sqrt(bx * bx + by * by + bz * bz) : 0.;
326 // Compute the angle between B field and E field.
327 const double ebang = m_tab2d ? GetAngle(ex, ey, ez, bx, by, bz, e, b) : 0.;
328
329 for (int j = 0; j < 6; ++j) {
330 // Interpolate.
331 double y = 0.;
332 if (!Interpolate(e0, b, ebang, diff[j], y, m_intpDif, m_extrDif)) y = 0.;
333 // Apply scaling.
335 if (j < 3) {
336 cov[j][j] = y;
337 } else if (j == 3) {
338 cov[0][1] = cov[1][0] = y;
339 } else if (j == 4) {
340 cov[0][2] = cov[2][0] = y;
341 } else if (j == 5) {
342 cov[1][2] = cov[2][1] = y;
343 }
344 }
345 return true;
346}
virtual double ScaleDiffusionTensor(const double d) const
Definition: Medium.hh:467

◆ DisableDebugging()

void Garfield::Medium::DisableDebugging ( )
inline

Definition at line 490 of file Medium.hh.

490{ m_debug = false; }

◆ ElectronAttachment()

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

Attachment coefficient [cm-1].

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 416 of file Medium.cc.

418 {
419
420 if (!Alpha(ex, ey, ez, bx, by, bz, m_eAtt, m_intpAtt, m_eThrAtt, m_extrAtt,
421 eta)) {
422 return false;
423 }
424 // Apply scaling.
425 eta = ScaleAttachment(eta);
426 return true;
427}
virtual double ScaleAttachment(const double eta) const
Definition: Medium.hh:469
std::pair< unsigned int, unsigned int > m_extrAtt
Definition: Medium.hh:580
std::vector< std::vector< std::vector< double > > > m_eAtt
Definition: Medium.hh:547
bool Alpha(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &tab, unsigned int intp, const unsigned int thr, const std::pair< unsigned int, unsigned int > &extr, double &alpha) const
Definition: Medium.cc:348
unsigned int m_intpAtt
Definition: Medium.hh:589
unsigned int m_eThrAtt
Definition: Medium.hh:571

Referenced by Garfield::MediumCdTe::ElectronAttachment(), Garfield::MediumDiamond::ElectronAttachment(), Garfield::MediumGaAs::ElectronAttachment(), Garfield::MediumGaN::ElectronAttachment(), and Garfield::MediumSilicon::ElectronAttachment().

◆ ElectronDiffusion() [1/2]

bool Garfield::Medium::ElectronDiffusion ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  dl,
double &  dt 
)
virtual

Longitudinal and transverse diffusion coefficients [cm1/2].

Definition at line 387 of file Medium.cc.

390 {
391
392 return Diffusion(ex, ey, ez, bx, by, bz, m_eDifL, m_eDifT, dl, dt);
393}
bool Diffusion(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &difL, const std::vector< std::vector< std::vector< double > > > &difT, double &dl, double &dt) const
Definition: Medium.cc:269
std::vector< std::vector< std::vector< double > > > m_eDifL
Definition: Medium.hh:544
std::vector< std::vector< std::vector< double > > > m_eDifT
Definition: Medium.hh:545

◆ ElectronDiffusion() [2/2]

bool Garfield::Medium::ElectronDiffusion ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double  cov[3][3] 
)
virtual

Diffusion tensor: diagonal elements are the diffusion coefficients [cm] along e, btrans, e x b, off-diagonal elements are the covariances

Definition at line 395 of file Medium.cc.

398 {
399
400 return Diffusion(ex, ey, ez, bx, by, bz, m_eDifM, cov);
401}
std::vector< std::vector< std::vector< std::vector< double > > > > m_eDifM
Definition: Medium.hh:550

◆ ElectronLorentzAngle()

bool Garfield::Medium::ElectronLorentzAngle ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  lor 
)
virtual

Lorentz angle.

Definition at line 429 of file Medium.cc.

432 {
433 lor = 0.;
434 if (m_eLor.empty()) return false;
435
436 // Compute the magnitude of the electric field.
437 const double e = sqrt(ex * ex + ey * ey + ez * ez);
438 const double e0 = ScaleElectricField(e);
439 if (e < Small || e0 < Small) return true;
440
441 // Compute the magnitude of the magnetic field.
442 const double b = m_tab2d ? sqrt(bx * bx + by * by + bz * bz) : 0.;
443 // Compute the angle between B field and E field.
444 const double ebang = m_tab2d ? GetAngle(ex, ey, ez, bx, by, bz, e, b) : 0.;
445
446 // Interpolate.
447 if (!Interpolate(e0, b, ebang, m_eLor, lor, m_intpLor, m_extrLor)) lor = 0.;
448 // Apply scaling.
449 lor = ScaleLorentzAngle(lor);
450 return true;
451}
virtual double ScaleLorentzAngle(const double lor) const
Definition: Medium.hh:470
std::vector< std::vector< std::vector< double > > > m_eLor
Definition: Medium.hh:548
std::pair< unsigned int, unsigned int > m_extrLor
Definition: Medium.hh:581
unsigned int m_intpLor
Definition: Medium.hh:590

◆ ElectronMobility()

double Garfield::Medium::ElectronMobility ( )
virtual

Low-field mobility [cm2 V-1 ns-1].

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 453 of file Medium.cc.

453 {
454 if (m_eVelE.empty()) return -1.;
455 return m_eVelE[0][0][0] / UnScaleElectricField(m_eFields[0]);
456}
virtual double UnScaleElectricField(const double e) const
Definition: Medium.hh:464
std::vector< std::vector< std::vector< double > > > m_eVelE
Definition: Medium.hh:541

◆ ElectronTownsend()

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

Ionisation coefficient [cm-1].

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 403 of file Medium.cc.

405 {
406
407 if (!Alpha(ex, ey, ez, bx, by, bz, m_eAlp, m_intpAlp, m_eThrAlp, m_extrAlp,
408 alpha)) {
409 return false;
410 }
411 // Apply scaling.
412 alpha = ScaleTownsend(alpha);
413 return true;
414}
std::vector< std::vector< std::vector< double > > > m_eAlp
Definition: Medium.hh:546
virtual double ScaleTownsend(const double alpha) const
Definition: Medium.hh:468
std::pair< unsigned int, unsigned int > m_extrAlp
Definition: Medium.hh:579
unsigned int m_eThrAlp
Definition: Medium.hh:570
unsigned int m_intpAlp
Definition: Medium.hh:588

Referenced by Garfield::MediumCdTe::ElectronTownsend(), Garfield::MediumDiamond::ElectronTownsend(), Garfield::MediumGaAs::ElectronTownsend(), Garfield::MediumGaN::ElectronTownsend(), and Garfield::MediumSilicon::ElectronTownsend().

◆ ElectronVelocity()

bool Garfield::Medium::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

Drift velocity [cm / ns].

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 379 of file Medium.cc.

381 {
382
383 return Velocity(ex, ey, ez, bx, by, bz, m_eVelE, m_eVelB, m_eVelX, -1.,
384 vx, vy, vz);
385}
std::vector< std::vector< std::vector< double > > > m_eVelX
Definition: Medium.hh:542
std::vector< std::vector< std::vector< double > > > m_eVelB
Definition: Medium.hh:543
bool Velocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &velE, const std::vector< std::vector< std::vector< double > > > &velB, const std::vector< std::vector< std::vector< double > > > &velX, const double q, double &vx, double &vy, double &vz) const
Definition: Medium.cc:160

Referenced by Garfield::MediumCdTe::ElectronVelocity(), Garfield::MediumDiamond::ElectronVelocity(), Garfield::MediumGaAs::ElectronVelocity(), Garfield::MediumGaN::ElectronVelocity(), and Garfield::MediumSilicon::ElectronVelocity().

◆ EnableDebugging()

void Garfield::Medium::EnableDebugging ( )
inline

Switch on/off debugging messages.

Definition at line 489 of file Medium.hh.

489{ m_debug = true; }

◆ EnableDrift()

virtual void Garfield::Medium::EnableDrift ( const bool  on = true)
inlinevirtual

◆ EnablePrimaryIonisation()

virtual void Garfield::Medium::EnablePrimaryIonisation ( const bool  on = true)
inlinevirtual

◆ GetAngle()

double Garfield::Medium::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
protected

Definition at line 1185 of file Medium.cc.

1187 {
1188 const double eb = e * b;
1189 if (eb <= 0.) return m_bAngles[0];
1190 const double einb = fabs(ex * bx + ey * by + ez * bz);
1191 if (einb > 0.2 * eb) {
1192 const double ebxy = ex * by - ey * bx;
1193 const double ebxz = ex * bz - ez * bx;
1194 const double ebzy = ez * by - ey * bz;
1195 return asin(
1196 std::min(1., sqrt(ebxy * ebxy + ebxz * ebxz + ebzy * ebzy) / eb));
1197 }
1198 return acos(std::min(1., einb / eb));
1199}
DoubleAc acos(const DoubleAc &f)
Definition: DoubleAc.cpp:490
DoubleAc fabs(const DoubleAc &f)
Definition: DoubleAc.h:615
DoubleAc asin(const DoubleAc &f)
Definition: DoubleAc.cpp:470

Referenced by Alpha(), Diffusion(), ElectronLorentzAngle(), IonVelocity(), and Velocity().

◆ GetAtomicNumber()

virtual double Garfield::Medium::GetAtomicNumber ( ) const
inlinevirtual

Get the effective atomic number.

Reimplemented in Garfield::MediumGas.

Definition at line 52 of file Medium.hh.

52{ return m_z; }

◆ GetAtomicWeight()

virtual double Garfield::Medium::GetAtomicWeight ( ) const
inlinevirtual

Get the effective atomic weight.

Reimplemented in Garfield::MediumGas.

Definition at line 56 of file Medium.hh.

56{ return m_a; }

◆ GetComponent()

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

Get the name and fraction of a given component.

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumGas.

Definition at line 105 of file Medium.cc.

105 {
106 if (i >= m_nComponents) {
107 std::cerr << m_className << "::GetComponent: Index out of range.\n";
108 }
109
110 label = m_name;
111 f = 1.;
112}
std::string m_name
Definition: Medium.hh:502
unsigned int m_nComponents
Definition: Medium.hh:500

◆ GetDeexcitationProduct()

bool Garfield::Medium::GetDeexcitationProduct ( const unsigned int  i,
double &  t,
double &  s,
int &  type,
double &  energy 
) const
virtual

Reimplemented in Garfield::MediumMagboltz.

Definition at line 504 of file Medium.cc.

506 {
507 if (m_debug) PrintNotImplemented(m_className, "GetDeexcitationProduct");
508 t = s = energy = 0.;
509 type = 0;
510 return false;
511}

◆ GetDielectricConstant()

double Garfield::Medium::GetDielectricConstant ( ) const
inline

Get the relative static dielectric constant.

Definition at line 42 of file Medium.hh.

42{ return m_epsilon; }
double m_epsilon
Definition: Medium.hh:508

Referenced by Garfield::ComponentNeBem3d::GetVolume(), Garfield::ComponentNeBem2d::Initialise(), and Garfield::ComponentNeBem3d::Initialise().

◆ GetDielectricFunction()

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

Get the complex dielectric function at a given energy.

Reimplemented in Garfield::MediumSilicon.

Definition at line 636 of file Medium.cc.

637 {
638 if (i >= m_nComponents) {
639 std::cerr << m_className << "::GetDielectricFunction: Index out of range.\n";
640 return false;
641 }
642
643 if (e < 0.) {
644 std::cerr << m_className << "::GetDielectricFunction: Energy must be > 0.\n";
645 return false;
646 }
647
648 if (m_debug) PrintNotImplemented(m_className, "GetDielectricFunction");
649 eps1 = 1.;
650 eps2 = 0.;
651 return false;
652}

◆ GetElectronAttachment()

bool Garfield::Medium::GetElectronAttachment ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  eta 
)
inline

Get an entry in the table of attachment coefficients.

Definition at line 268 of file Medium.hh.

269 {
270 return GetEntry(ie, ib, ia, "ElectronAttachment", m_eAtt, eta);
271 }
bool GetEntry(const size_t i, const size_t j, const size_t k, const std::string &fcn, const std::vector< std::vector< std::vector< double > > > &tab, double &val) const
Definition: Medium.cc:884

◆ GetElectronCollision()

bool Garfield::Medium::GetElectronCollision ( const double  e,
int &  type,
int &  level,
double &  e1,
double &  dx,
double &  dy,
double &  dz,
std::vector< std::pair< int, double > > &  secondaries,
int &  ndxc,
int &  band 
)
virtual

Sample the collision type. Update energy and direction vector.

Reimplemented in Garfield::MediumMagboltz, and Garfield::MediumSilicon.

Definition at line 491 of file Medium.cc.

494 {
495 type = level = -1;
496 e1 = e;
497 ndxc = band = 0;
498 RndmDirection(dx, dy, dz);
499
500 if (m_debug) PrintNotImplemented(m_className, "GetElectronCollision");
501 return false;
502}
void RndmDirection(double &dx, double &dy, double &dz, const double length=1.)
Draw a random (isotropic) direction vector.
Definition: Random.hh:107

◆ GetElectronCollisionRate()

double Garfield::Medium::GetElectronCollisionRate ( const double  e,
const int  band = 0 
)
virtual

Collision rate [ns-1] for given electron energy.

Reimplemented in Garfield::MediumMagboltz, and Garfield::MediumSilicon.

Definition at line 485 of file Medium.cc.

486 {
487 if (m_debug) PrintNotImplemented(m_className, "GetElectronCollisionRate");
488 return 0.;
489}

◆ GetElectronEnergy()

double Garfield::Medium::GetElectronEnergy ( const double  px,
const double  py,
const double  pz,
double &  vx,
double &  vy,
double &  vz,
const int  band = 0 
)
virtual

Dispersion relation (energy vs. wave vector)

Reimplemented in Garfield::MediumSilicon.

Definition at line 458 of file Medium.cc.

460 {
461 if (band > 0) {
462 std::cerr << m_className << "::GetElectronEnergy:\n";
463 std::cerr << " Unknown band index.\n";
464 }
465
466 vx = SpeedOfLight * px / ElectronMass;
467 vy = SpeedOfLight * py / ElectronMass;
468 vz = SpeedOfLight * pz / ElectronMass;
469
470 return 0.5 * (px * px + py * py + pz * pz) / ElectronMass;
471}

◆ GetElectronLongitudinalDiffusion()

bool Garfield::Medium::GetElectronLongitudinalDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  dl 
)
inline

Get an entry in the table of longitudinal diffusion coefficients.

Definition at line 238 of file Medium.hh.

239 {
240 return GetEntry(ie, ib, ia, "ElectronLongitudinalDiffusion", m_eDifL, dl);
241 }

◆ GetElectronLorentzAngle()

bool Garfield::Medium::GetElectronLorentzAngle ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  lor 
)
inline

Get an entry in the table of Lorentz angles.

Definition at line 279 of file Medium.hh.

280 {
281 return GetEntry(ie, ib, ia, "ElectronLorentzAngle", m_eLor, lor);
282 }

◆ GetElectronMomentum()

void Garfield::Medium::GetElectronMomentum ( const double  e,
double &  px,
double &  py,
double &  pz,
int &  band 
)
virtual

Sample the momentum vector for a given energy (only meaningful in semiconductors).

Reimplemented in Garfield::MediumSilicon.

Definition at line 473 of file Medium.cc.

474 {
475 const double p = sqrt(2. * ElectronMass * e) / SpeedOfLight;
476 RndmDirection(px, py, pz, p);
477 band = -1;
478}

◆ GetElectronNullCollisionRate()

double Garfield::Medium::GetElectronNullCollisionRate ( const int  band = 0)
virtual

Null-collision rate [ns-1].

Reimplemented in Garfield::MediumMagboltz, and Garfield::MediumSilicon.

Definition at line 480 of file Medium.cc.

480 {
481 if (m_debug) PrintNotImplemented(m_className, "GetElectronNullCollisionRate");
482 return 0.;
483}

◆ GetElectronTownsend()

bool Garfield::Medium::GetElectronTownsend ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  alpha 
)
inline

Get an entry in the table of Townsend coefficients.

Definition at line 258 of file Medium.hh.

259 {
260 return GetEntry(ie, ib, ia, "ElectronTownsend", m_eAlp, alpha);
261 }

◆ GetElectronTransverseDiffusion()

bool Garfield::Medium::GetElectronTransverseDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  dt 
)
inline

Get an entry in the table of transverse diffusion coefficients.

Definition at line 248 of file Medium.hh.

249 {
250 return GetEntry(ie, ib, ia, "ElectronTransverseDiffusion", m_eDifT, dt);
251 }

◆ GetElectronVelocityB()

bool Garfield::Medium::GetElectronVelocityB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  v 
)
inline

Get an entry in the table of drift speeds along Btrans.

Definition at line 228 of file Medium.hh.

229 {
230 return GetEntry(ie, ib, ia, "ElectronVelocityB", m_eVelB, v);
231 }

◆ GetElectronVelocityE()

bool Garfield::Medium::GetElectronVelocityE ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  v 
)
inline

Get an entry in the table of drift speeds along E.

Definition at line 208 of file Medium.hh.

209 {
210 return GetEntry(ie, ib, ia, "ElectronVelocityE", m_eVelE, v);
211 }

◆ GetElectronVelocityExB()

bool Garfield::Medium::GetElectronVelocityExB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  v 
)
inline

Get an entry in the table of drift speeds along ExB.

Definition at line 218 of file Medium.hh.

219 {
220 return GetEntry(ie, ib, ia, "ElectronVelocityExB", m_eVelX, v);
221 }

◆ GetEntry()

bool Garfield::Medium::GetEntry ( const size_t  i,
const size_t  j,
const size_t  k,
const std::string &  fcn,
const std::vector< std::vector< std::vector< double > > > &  tab,
double &  val 
) const
protected

Definition at line 884 of file Medium.cc.

887 {
888 val = 0.;
889 if (i >= m_eFields.size() || j >= m_bFields.size() || k >= m_bAngles.size()) {
890 PrintOutOfRange(m_className, "Get" + fcn, i, j, k);
891 return false;
892 }
893 if (tab.empty()) {
894 if (m_debug) PrintDataNotAvailable(m_className, "Get" + fcn);
895 return false;
896 }
897 val = tab[k][j][i];
898 return true;
899}

Referenced by GetElectronAttachment(), GetElectronLongitudinalDiffusion(), GetElectronLorentzAngle(), GetElectronTownsend(), GetElectronTransverseDiffusion(), GetElectronVelocityB(), GetElectronVelocityE(), GetElectronVelocityExB(), GetHoleAttachment(), GetHoleLongitudinalDiffusion(), GetHoleTownsend(), GetHoleTransverseDiffusion(), GetHoleVelocityB(), GetHoleVelocityE(), GetHoleVelocityExB(), GetIonDissociation(), GetIonLongitudinalDiffusion(), GetIonMobility(), and GetIonTransverseDiffusion().

◆ GetExtrapolationIndex()

bool Garfield::Medium::GetExtrapolationIndex ( std::string  str,
unsigned int &  nb 
) const
protected

Definition at line 1120 of file Medium.cc.

1120 {
1121 // Convert to upper-case.
1122 std::transform(str.begin(), str.end(), str.begin(), toupper);
1123
1124 if (str == "CONST" || str == "CONSTANT") {
1125 nb = 0;
1126 } else if (str == "LIN" || str == "LINEAR") {
1127 nb = 1;
1128 } else if (str == "EXP" || str == "EXPONENTIAL") {
1129 nb = 2;
1130 } else {
1131 return false;
1132 }
1133
1134 return true;
1135}

Referenced by SetExtrapolationMethod().

◆ GetFanoFactor()

double Garfield::Medium::GetFanoFactor ( )
inline

Get the Fano factor.

Definition at line 87 of file Medium.hh.

87{ return m_fano; }
double m_fano
Definition: Medium.hh:519

◆ GetFieldGrid()

void Garfield::Medium::GetFieldGrid ( std::vector< double > &  efields,
std::vector< double > &  bfields,
std::vector< double > &  angles 
)

Get the fields and E-B angles used in the transport tables.

Definition at line 860 of file Medium.cc.

862 {
863 efields = m_eFields;
864 bfields = m_bFields;
865 angles = m_bAngles;
866}

◆ GetHoleAttachment()

bool Garfield::Medium::GetHoleAttachment ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  eta 
)
inline

Get an entry in the table of attachment coefficients.

Definition at line 351 of file Medium.hh.

352 {
353 return GetEntry(ie, ib, ia, "HoleAttachment", m_hAtt, eta);
354 }
std::vector< std::vector< std::vector< double > > > m_hAtt
Definition: Medium.hh:559

◆ GetHoleLongitudinalDiffusion()

bool Garfield::Medium::GetHoleLongitudinalDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  dl 
)
inline

Get an entry in the table of longitudinal diffusion coefficients.

Definition at line 321 of file Medium.hh.

322 {
323 return GetEntry(ie, ib, ia, "HoleLongitudinalDiffusion", m_hDifL, dl);
324 }
std::vector< std::vector< std::vector< double > > > m_hDifL
Definition: Medium.hh:556

◆ GetHoleTownsend()

bool Garfield::Medium::GetHoleTownsend ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  alpha 
)
inline

Get an entry in the table of Townsend coefficients.

Definition at line 341 of file Medium.hh.

342 {
343 return GetEntry(ie, ib, ia, "HoleTownsend", m_hAlp, alpha);
344 }
std::vector< std::vector< std::vector< double > > > m_hAlp
Definition: Medium.hh:558

◆ GetHoleTransverseDiffusion()

bool Garfield::Medium::GetHoleTransverseDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  dt 
)
inline

Get an entry in the table of transverse diffusion coefficients.

Definition at line 331 of file Medium.hh.

332 {
333 return GetEntry(ie, ib, ia, "HoleTransverseDiffusion", m_hDifT, dt);
334 }
std::vector< std::vector< std::vector< double > > > m_hDifT
Definition: Medium.hh:557

◆ GetHoleVelocityB()

bool Garfield::Medium::GetHoleVelocityB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  v 
)
inline

Get an entry in the table of drift speeds along Btrans.

Definition at line 310 of file Medium.hh.

311 {
312 return GetEntry(ie, ib, ia, "HoleVelocityB", m_hVelB, v);
313 }
std::vector< std::vector< std::vector< double > > > m_hVelB
Definition: Medium.hh:555

◆ GetHoleVelocityE()

bool Garfield::Medium::GetHoleVelocityE ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  v 
)
inline

Get an entry in the table of drift speeds along E.

Definition at line 290 of file Medium.hh.

291 {
292 return GetEntry(ie, ib, ia, "HoleVelocityE", m_hVelE, v);
293 }
std::vector< std::vector< std::vector< double > > > m_hVelE
Definition: Medium.hh:553

◆ GetHoleVelocityExB()

bool Garfield::Medium::GetHoleVelocityExB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  v 
)
inline

Get an entry in the table of drift speeds along ExB.

Definition at line 300 of file Medium.hh.

301 {
302 return GetEntry(ie, ib, ia, "HoleVelocityExB", m_hVelX, v);
303 }
std::vector< std::vector< std::vector< double > > > m_hVelX
Definition: Medium.hh:554

◆ GetId()

int Garfield::Medium::GetId ( ) const
inline

Return the id number of the class instance.

Definition at line 21 of file Medium.hh.

21{ return m_id; }

Referenced by Garfield::ComponentNeBem3d::GetVolume(), and Garfield::ViewGeometry::Plot3d().

◆ GetIonDissociation()

bool Garfield::Medium::GetIonDissociation ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  diss 
)
inline

Get an entry in the table of dissociation coefficients.

Definition at line 397 of file Medium.hh.

398 {
399 return GetEntry(ie, ib, ia, "IonDissociation", m_iDis, diss);
400 }
std::vector< std::vector< std::vector< double > > > m_iDis
Definition: Medium.hh:567

◆ GetIonLongitudinalDiffusion()

bool Garfield::Medium::GetIonLongitudinalDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  dl 
)
inline

Get an entry in the table of longitudinal diffusion coefficients.

Definition at line 377 of file Medium.hh.

378 {
379 return GetEntry(ie, ib, ia, "IonLongitudinalDiffusion", m_iDifL, dl);
380 }
std::vector< std::vector< std::vector< double > > > m_iDifL
Definition: Medium.hh:565

◆ GetIonMobility()

bool Garfield::Medium::GetIonMobility ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  mu 
)
inline

Get an entry in the table of ion mobilities.

Definition at line 366 of file Medium.hh.

367 {
368 return GetEntry(ie, ib, ia, "IonMobility", m_iMob, mu);
369 }
std::vector< std::vector< std::vector< double > > > m_iMob
Definition: Medium.hh:564

◆ GetIonTransverseDiffusion()

bool Garfield::Medium::GetIonTransverseDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
double &  dt 
)
inline

Get an entry in the table of transverse diffusion coefficients.

Definition at line 387 of file Medium.hh.

388 {
389 return GetEntry(ie, ib, ia, "IonTransverseDiffusion", m_iDifT, dt);
390 }
std::vector< std::vector< std::vector< double > > > m_iDifT
Definition: Medium.hh:566

◆ GetMassDensity()

double Garfield::Medium::GetMassDensity ( ) const
virtual

Get the mass density [g/cm3].

Reimplemented in Garfield::MediumGas.

Definition at line 101 of file Medium.cc.

101 {
102 return m_density * AtomicMassUnit * m_a;
103}
double m_density
Definition: Medium.hh:514

Referenced by Garfield::TrackHeed::NewTrack(), Garfield::GeometryRoot::SetMedium(), Garfield::TrackHeed::TransportDeltaElectron(), and Garfield::TrackHeed::TransportPhoton().

◆ GetName()

◆ GetNumberDensity()

virtual double Garfield::Medium::GetNumberDensity ( ) const
inlinevirtual

Get the number density [cm-3].

Reimplemented in Garfield::MediumGas.

Definition at line 60 of file Medium.hh.

60{ return m_density; }

Referenced by Garfield::TrackElectron::GetCluster(), Garfield::TrackPAI::GetCluster(), and Garfield::TrackPAI::NewTrack().

◆ GetNumberOfComponents()

unsigned int Garfield::Medium::GetNumberOfComponents ( ) const
inline

Get number of components of the medium.

Definition at line 45 of file Medium.hh.

45{ return m_nComponents; }

◆ GetNumberOfDeexcitationProducts()

virtual unsigned int Garfield::Medium::GetNumberOfDeexcitationProducts ( ) const
inlinevirtual

Reimplemented in Garfield::MediumMagboltz.

Definition at line 144 of file Medium.hh.

144{ return 0; }

◆ GetOpticalDataRange()

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

Get the energy range [eV] of the available optical data.

Reimplemented in Garfield::MediumSilicon.

Definition at line 624 of file Medium.cc.

625 {
626 if (i >= m_nComponents) {
627 std::cerr << m_className << "::GetOpticalDataRange: Index out of range.\n";
628 return false;
629 }
630
631 if (m_debug) PrintNotImplemented(m_className, "GetOpticalDataRange");
632 emin = emax = 0.;
633 return false;
634}

◆ GetPhotoAbsorptionCrossSection()

bool Garfield::Medium::GetPhotoAbsorptionCrossSection ( const double  e,
double &  sigma,
const unsigned int  i = 0 
)
virtual

Reimplemented in Garfield::MediumGas.

Definition at line 654 of file Medium.cc.

655 {
656 if (i >= m_nComponents) {
657 std::cerr << m_className << "::GetPhotoAbsorptionCrossSection:\n";
658 std::cerr << " Component " << i << " does not exist.\n";
659 return false;
660 }
661
662 if (e < 0.) {
663 std::cerr << m_className << "::GetPhotoAbsorptionCrossSection:\n";
664 std::cerr << " Energy must be > 0.\n";
665 return false;
666 }
667
668 if (m_debug) {
669 PrintNotImplemented(m_className, "GetPhotoAbsorptionCrossSection");
670 }
671 sigma = 0.;
672 return false;
673}

Referenced by GetPhotonCollisionRate().

◆ GetPhotonCollision()

bool Garfield::Medium::GetPhotonCollision ( const double  e,
int &  type,
int &  level,
double &  e1,
double &  ctheta,
int &  nsec,
double &  esec 
)
virtual

Reimplemented in Garfield::MediumMagboltz.

Definition at line 682 of file Medium.cc.

684 {
685 type = level = -1;
686 e1 = e;
687 ctheta = 1.;
688 nsec = 0;
689 esec = 0.;
690 return false;
691}

◆ GetPhotonCollisionRate()

double Garfield::Medium::GetPhotonCollisionRate ( const double  e)
virtual

Reimplemented in Garfield::MediumMagboltz.

Definition at line 675 of file Medium.cc.

675 {
676 double sigma = 0.;
677 if (!GetPhotoAbsorptionCrossSection(e, sigma)) return 0.;
678
679 return sigma * m_density * SpeedOfLight;
680}
virtual bool GetPhotoAbsorptionCrossSection(const double e, double &sigma, const unsigned int i=0)
Definition: Medium.cc:654

◆ GetPressure()

double Garfield::Medium::GetPressure ( ) const
inline

Definition at line 38 of file Medium.hh.

38{ return m_pressure; }
double m_pressure
Definition: Medium.hh:506

◆ GetTemperature()

double Garfield::Medium::GetTemperature ( ) const
inline

Get the temperature [K].

Definition at line 34 of file Medium.hh.

34{ return m_temperature; }

◆ GetW()

double Garfield::Medium::GetW ( )
inline

Get the W value.

Definition at line 83 of file Medium.hh.

83{ return m_w; }

◆ HoleAttachment()

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

Attachment coefficient [cm-1].

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 547 of file Medium.cc.

549 {
550
551 if (!Alpha(ex, ey, ez, bx, by, bz, m_hAtt, m_intpAtt, m_hThrAtt, m_extrAtt,
552 eta)) {
553 return false;
554 }
555 // Apply scaling.
556 eta = ScaleAttachment(eta);
557 return true;
558}
unsigned int m_hThrAtt
Definition: Medium.hh:573

Referenced by Garfield::MediumCdTe::HoleAttachment(), Garfield::MediumDiamond::HoleAttachment(), Garfield::MediumGaAs::HoleAttachment(), Garfield::MediumGaN::HoleAttachment(), and Garfield::MediumSilicon::HoleAttachment().

◆ HoleDiffusion() [1/2]

bool Garfield::Medium::HoleDiffusion ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  dl,
double &  dt 
)
virtual

Longitudinal and transverse diffusion coefficients [cm1/2].

Definition at line 521 of file Medium.cc.

523 {
524 return Diffusion(ex, ey, ez, bx, by, bz, m_hDifL, m_hDifT, dl, dt);
525}

◆ HoleDiffusion() [2/2]

bool Garfield::Medium::HoleDiffusion ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double  cov[3][3] 
)
virtual

Diffusion tensor.

Definition at line 527 of file Medium.cc.

529 {
530
531 return Diffusion(ex, ey, ez, bx, by, bz, m_hDifM, cov);
532}
std::vector< std::vector< std::vector< std::vector< double > > > > m_hDifM
Definition: Medium.hh:561

◆ HoleMobility()

double Garfield::Medium::HoleMobility ( )
virtual

Low-field mobility [cm2 V-1 ns-1].

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 560 of file Medium.cc.

560 {
561 if (m_hVelE.empty()) return -1.;
562 return m_hVelE[0][0][0] / UnScaleElectricField(m_eFields[0]);
563}

◆ HoleTownsend()

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

Ionisation coefficient [cm-1].

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 534 of file Medium.cc.

536 {
537
538 if (!Alpha(ex, ey, ez, bx, by, bz, m_hAlp, m_intpAlp, m_hThrAlp, m_extrAlp,
539 alpha)) {
540 return false;
541 }
542 // Apply scaling.
543 alpha = ScaleTownsend(alpha);
544 return true;
545}
unsigned int m_hThrAlp
Definition: Medium.hh:572

Referenced by Garfield::MediumCdTe::HoleTownsend(), Garfield::MediumDiamond::HoleTownsend(), Garfield::MediumGaAs::HoleTownsend(), Garfield::MediumGaN::HoleTownsend(), and Garfield::MediumSilicon::HoleTownsend().

◆ HoleVelocity()

bool Garfield::Medium::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

◆ Init() [1/2]

void Garfield::Medium::Init ( const size_t  nE,
const size_t  nB,
const size_t  nA,
const size_t  nT,
std::vector< std::vector< std::vector< std::vector< double > > > > &  tab,
const double  val 
)
protected

Definition at line 1306 of file Medium.cc.

1309 {
1310 if (nE == 0 || nB == 0 || nA == 0 || nT == 0) {
1311 std::cerr << m_className << "::Init: Invalid grid.\n";
1312 return;
1313 }
1314
1315 tab.assign(nT, std::vector<std::vector<std::vector<double> > >(
1316 nA, std::vector<std::vector<double> >(
1317 nB, std::vector<double>(nE, val))));
1318}

◆ Init() [2/2]

void Garfield::Medium::Init ( const size_t  nE,
const size_t  nB,
const size_t  nA,
std::vector< std::vector< std::vector< double > > > &  tab,
const double  val 
)
protected

Definition at line 1295 of file Medium.cc.

1297 {
1298 if (nE == 0 || nB == 0 || nA == 0) {
1299 std::cerr << m_className << "::Init: Invalid grid.\n";
1300 return;
1301 }
1302 tab.assign(
1303 nA, std::vector<std::vector<double> >(nB, std::vector<double>(nE, val)));
1304}

Referenced by Clone(), Garfield::MediumMagboltz::GenerateGasTable(), Garfield::MediumGas::LoadGasFile(), Garfield::MediumGas::MergeGasFile(), SetEntry(), and SetIonMobility().

◆ Interpolate()

bool Garfield::Medium::Interpolate ( const double  e,
const double  b,
const double  a,
const std::vector< std::vector< std::vector< double > > > &  table,
double &  y,
const unsigned int  intp,
const std::pair< unsigned int, unsigned int > &  extr 
) const
protected

Definition at line 1201 of file Medium.cc.

1205 {
1206 if (table.empty()) {
1207 y = 0.;
1208 return false; // TODO: true!
1209 }
1210
1211 if (m_tab2d) {
1213 m_bAngles.size(), m_bFields.size(), m_eFields.size(),
1214 a, b, e, y, intp);
1215 } else {
1216 y = Interpolate1D(e, table[0][0], m_eFields, intp, extr);
1217 }
1218 return true;
1219}
double Interpolate1D(const double e, const std::vector< double > &table, const std::vector< double > &fields, const unsigned int intpMeth, const std::pair< unsigned int, unsigned int > &extr) const
Definition: Medium.cc:1221
bool Boxin3(const std::vector< std::vector< std::vector< double > > > &value, const std::vector< double > &xAxis, const std::vector< double > &yAxis, const std::vector< double > &zAxis, const int nx, const int ny, const int nz, const double xx, const double yy, const double zz, double &f, const int iOrder)
Definition: Numerics.cc:1496

Referenced by Alpha(), Clone(), Diffusion(), ElectronLorentzAngle(), IonVelocity(), and Velocity().

◆ Interpolate1D()

double Garfield::Medium::Interpolate1D ( const double  e,
const std::vector< double > &  table,
const std::vector< double > &  fields,
const unsigned int  intpMeth,
const std::pair< unsigned int, unsigned int > &  extr 
) const
protected

Definition at line 1221 of file Medium.cc.

1224 {
1225 // This function is a generalized version of the Fortran functions
1226 // GASVEL, GASVT1, GASVT2, GASLOR, GASMOB, GASDFT, and GASDFL
1227 // for the case of a 1D table. All variables are generic.
1228
1229 const auto nSizeTable = fields.size();
1230
1231 if (e < 0. || nSizeTable < 1) return 0.;
1232
1233 double result = 0.;
1234
1235 if (nSizeTable == 1) {
1236 // Only one point
1237 result = table[0];
1238 } else if (e < fields[0]) {
1239 // Extrapolation towards small fields
1240 if (fields[0] >= fields[1]) {
1241 if (m_debug) {
1242 std::cerr << m_className << "::Interpolate1D:\n";
1243 std::cerr << " First two field values coincide.\n";
1244 std::cerr << " No extrapolation to lower fields.\n";
1245 }
1246 result = table[0];
1247 } else if (extr.first == 1) {
1248 // Linear extrapolation
1249 const double extr4 = (table[1] - table[0]) / (fields[1] - fields[0]);
1250 const double extr3 = table[0] - extr4 * fields[0];
1251 result = extr3 + extr4 * e;
1252 } else if (extr.first == 2) {
1253 // Logarithmic extrapolation
1254 const double extr4 = log(table[1] / table[0]) / (fields[1] - fields[0]);
1255 const double extr3 = log(table[0] - extr4 * fields[0]);
1256 result = std::exp(std::min(50., extr3 + extr4 * e));
1257 } else {
1258 result = table[0];
1259 }
1260 } else if (e > fields[nSizeTable - 1]) {
1261 // Extrapolation towards large fields
1262 if (fields[nSizeTable - 1] <= fields[nSizeTable - 2]) {
1263 if (m_debug) {
1264 std::cerr << m_className << "::Interpolate1D:\n";
1265 std::cerr << " Last two field values coincide.\n";
1266 std::cerr << " No extrapolation to higher fields.\n";
1267 }
1268 result = table[nSizeTable - 1];
1269 } else if (extr.second == 1) {
1270 // Linear extrapolation
1271 const double extr2 = (table[nSizeTable - 1] - table[nSizeTable - 2]) /
1272 (fields[nSizeTable - 1] - fields[nSizeTable - 2]);
1273 const double extr1 =
1274 table[nSizeTable - 1] - extr2 * fields[nSizeTable - 1];
1275 result = extr1 + extr2 * e;
1276 } else if (extr.second == 2) {
1277 // Logarithmic extrapolation
1278 const double extr2 = log(table[nSizeTable - 1] / table[nSizeTable - 2]) /
1279 (fields[nSizeTable - 1] - fields[nSizeTable - 2]);
1280 const double extr1 =
1281 log(table[nSizeTable - 1]) - extr2 * fields[nSizeTable - 1];
1282 result = exp(std::min(50., extr1 + extr2 * e));
1283 } else {
1284 result = table[nSizeTable - 1];
1285 }
1286 } else {
1287 // Intermediate points, spline interpolation (not implemented).
1288 // Intermediate points, Newtonian interpolation
1289 result = Numerics::Divdif(table, fields, nSizeTable, e, intpMeth);
1290 }
1291
1292 return result;
1293}
double Divdif(const std::vector< double > &f, const std::vector< double > &a, int nn, double x, int mm)
Definition: Numerics.cc:1206

Referenced by Interpolate(), and SetIonMobility().

◆ IonDiffusion()

bool Garfield::Medium::IonDiffusion ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  dl,
double &  dt 
)
virtual

Longitudinal and transverse diffusion coefficients [cm1/2].

Definition at line 600 of file Medium.cc.

602 {
603
604 return Diffusion(ex, ey, ez, bx, by, bz, m_iDifL, m_iDifT, dl, dt);
605}

◆ IonDissociation()

bool Garfield::Medium::IonDissociation ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
double &  diss 
)
virtual

Dissociation coefficient.

Definition at line 607 of file Medium.cc.

609 {
610
611 if (!Alpha(ex, ey, ez, bx, by, bz, m_iDis, m_intpDis, m_iThrDis, m_extrDis,
612 diss)) {
613 return false;
614 }
615 // Apply scaling.
616 diss = ScaleDissociation(diss);
617 return true;
618}
unsigned int m_intpDis
Definition: Medium.hh:592
virtual double ScaleDissociation(const double diss) const
Definition: Medium.hh:471
std::pair< unsigned int, unsigned int > m_extrDis
Definition: Medium.hh:583
unsigned int m_iThrDis
Definition: Medium.hh:574

◆ IonMobility()

double Garfield::Medium::IonMobility ( )
virtual

Low-field mobility [cm2 V-1 ns-1].

Definition at line 620 of file Medium.cc.

620 {
621 return m_iMob.empty() ? -1. : m_iMob[0][0][0];
622}

◆ IonVelocity()

bool Garfield::Medium::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

Drift velocity [cm / ns].

Definition at line 565 of file Medium.cc.

567 {
568 vx = vy = vz = 0.;
569 if (m_iMob.empty()) return false;
570 // Compute the magnitude of the electric field.
571 const double e = sqrt(ex * ex + ey * ey + ez * ez);
572 const double e0 = ScaleElectricField(e);
573 if (e < Small || e0 < Small) return true;
574 // Compute the magnitude of the electric field.
575 const double b = sqrt(bx * bx + by * by + bz * bz);
576
577 // Compute the angle between B field and E field.
578 const double ebang = m_tab2d ? GetAngle(ex, ey, ez, bx, by, bz, e, b) : 0.;
579 double mu = 0.;
580 if (!Interpolate(e0, b, ebang, m_iMob, mu, m_intpMob, m_extrMob)) mu = 0.;
581
582 constexpr double q = 1.;
583 mu *= q;
584 if (b < Small) {
585 vx = mu * ex;
586 vy = mu * ey;
587 vz = mu * ez;
588 } else {
589 const double eb = bx * ex + by * ey + bz * ez;
590 const double mu2 = mu * mu;
591 const double f = mu / (1. + mu2 * b * b);
592 vx = f * (ex + mu * (ey * bz - ez * by) + mu2 * bx * eb);
593 vy = f * (ey + mu * (ez * bx - ex * bz) + mu2 * by * eb);
594 vz = f * (ez + mu * (ex * by - ey * bx) + mu2 * bz * eb);
595 }
596
597 return true;
598}
unsigned int m_intpMob
Definition: Medium.hh:591
std::pair< unsigned int, unsigned int > m_extrMob
Definition: Medium.hh:582

◆ IsConductor()

virtual bool Garfield::Medium::IsConductor ( ) const
inlinevirtual

Is this medium a conductor?

Reimplemented in Garfield::MediumConductor.

Definition at line 29 of file Medium.hh.

29{ return false; }

Referenced by Garfield::ComponentNeBem3d::Initialise().

◆ IsDriftable()

◆ IsGas()

virtual bool Garfield::Medium::IsGas ( ) const
inlinevirtual

Is this medium a gas?

Reimplemented in Garfield::MediumGas.

Definition at line 25 of file Medium.hh.

25{ return false; }

Referenced by Garfield::TrackHeed::Initialise(), Garfield::TrackElectron::NewTrack(), and Garfield::ViewGeometry::Plot3d().

◆ IsIonisable()

◆ IsMicroscopic()

bool Garfield::Medium::IsMicroscopic ( ) const
inline

Does the medium have electron scattering rates?

Definition at line 76 of file Medium.hh.

76{ return m_microscopic; }
bool m_microscopic
Definition: Medium.hh:523

◆ IsSemiconductor()

virtual bool Garfield::Medium::IsSemiconductor ( ) const
inlinevirtual

Is this medium a semiconductor?

Reimplemented in Garfield::MediumCdTe, Garfield::MediumDiamond, Garfield::MediumGaAs, Garfield::MediumGaN, and Garfield::MediumSilicon.

Definition at line 27 of file Medium.hh.

27{ return false; }

Referenced by Garfield::ViewGeometry::Plot3d().

◆ ResetElectronAttachment()

void Garfield::Medium::ResetElectronAttachment ( )
inline

Definition at line 416 of file Medium.hh.

416{ m_eAtt.clear(); }

Referenced by ResetTables().

◆ ResetElectronDiffusion()

void Garfield::Medium::ResetElectronDiffusion ( )
inline

Definition at line 410 of file Medium.hh.

410 {
411 m_eDifL.clear();
412 m_eDifT.clear();
413 m_eDifM.clear();
414 }

Referenced by ResetTables().

◆ ResetElectronLorentzAngle()

void Garfield::Medium::ResetElectronLorentzAngle ( )
inline

Definition at line 417 of file Medium.hh.

417{ m_eLor.clear(); }

Referenced by ResetTables().

◆ ResetElectronTownsend()

void Garfield::Medium::ResetElectronTownsend ( )
inline

Definition at line 415 of file Medium.hh.

415{ m_eAlp.clear(); }

Referenced by ResetTables().

◆ ResetElectronVelocity()

void Garfield::Medium::ResetElectronVelocity ( )
inline

Definition at line 405 of file Medium.hh.

405 {
406 m_eVelE.clear();
407 m_eVelB.clear();
408 m_eVelX.clear();
409 }

Referenced by ResetTables().

◆ ResetHoleAttachment()

void Garfield::Medium::ResetHoleAttachment ( )
inline

Definition at line 430 of file Medium.hh.

430{ m_hAtt.clear(); }

Referenced by ResetTables().

◆ ResetHoleDiffusion()

void Garfield::Medium::ResetHoleDiffusion ( )
inline

Definition at line 424 of file Medium.hh.

424 {
425 m_hDifL.clear();
426 m_hDifT.clear();
427 m_hDifM.clear();
428 }

Referenced by ResetTables().

◆ ResetHoleTownsend()

void Garfield::Medium::ResetHoleTownsend ( )
inline

Definition at line 429 of file Medium.hh.

429{ m_hAlp.clear(); }

Referenced by ResetTables().

◆ ResetHoleVelocity()

void Garfield::Medium::ResetHoleVelocity ( )
inline

Definition at line 419 of file Medium.hh.

419 {
420 m_hVelE.clear();
421 m_hVelB.clear();
422 m_hVelX.clear();
423 }

Referenced by ResetTables().

◆ ResetIonDiffusion()

void Garfield::Medium::ResetIonDiffusion ( )
inline

Definition at line 433 of file Medium.hh.

433 {
434 m_iDifL.clear();
435 m_iDifT.clear();
436 }

Referenced by ResetTables().

◆ ResetIonDissociation()

void Garfield::Medium::ResetIonDissociation ( )
inline

Definition at line 437 of file Medium.hh.

437{ m_iDis.clear(); }

Referenced by ResetTables().

◆ ResetIonMobility()

void Garfield::Medium::ResetIonMobility ( )
inline

Definition at line 432 of file Medium.hh.

432{ m_iMob.clear(); }

Referenced by ResetTables(), and SetIonMobility().

◆ ResetTables()

void Garfield::Medium::ResetTables ( )
virtual

Reset all tables of transport parameters.

Reimplemented in Garfield::MediumGas.

Definition at line 901 of file Medium.cc.

901 {
907
912
916}
void ResetHoleAttachment()
Definition: Medium.hh:430
void ResetIonMobility()
Definition: Medium.hh:432
void ResetElectronAttachment()
Definition: Medium.hh:416
void ResetIonDiffusion()
Definition: Medium.hh:433
void ResetElectronLorentzAngle()
Definition: Medium.hh:417
void ResetHoleVelocity()
Definition: Medium.hh:419
void ResetIonDissociation()
Definition: Medium.hh:437
void ResetElectronDiffusion()
Definition: Medium.hh:410
void ResetHoleDiffusion()
Definition: Medium.hh:424
void ResetElectronTownsend()
Definition: Medium.hh:415
void ResetHoleTownsend()
Definition: Medium.hh:429
void ResetElectronVelocity()
Definition: Medium.hh:405

Referenced by Garfield::MediumGas::ResetTables().

◆ ScaleAttachment()

virtual double Garfield::Medium::ScaleAttachment ( const double  eta) const
inlinevirtual

Reimplemented in Garfield::MediumGas.

Definition at line 469 of file Medium.hh.

469{ return eta; }

Referenced by ElectronAttachment(), and HoleAttachment().

◆ ScaleDiffusion()

virtual double Garfield::Medium::ScaleDiffusion ( const double  d) const
inlinevirtual

Reimplemented in Garfield::MediumGas.

Definition at line 466 of file Medium.hh.

466{ return d; }

Referenced by Diffusion().

◆ ScaleDiffusionTensor()

virtual double Garfield::Medium::ScaleDiffusionTensor ( const double  d) const
inlinevirtual

Reimplemented in Garfield::MediumGas.

Definition at line 467 of file Medium.hh.

467{ return d; }

Referenced by Diffusion().

◆ ScaleDissociation()

virtual double Garfield::Medium::ScaleDissociation ( const double  diss) const
inlinevirtual

Definition at line 471 of file Medium.hh.

471{ return diss; }

Referenced by IonDissociation().

◆ ScaleElectricField()

virtual double Garfield::Medium::ScaleElectricField ( const double  e) const
inlinevirtual

Reimplemented in Garfield::MediumGas.

Definition at line 463 of file Medium.hh.

463{ return e; }

Referenced by Alpha(), Diffusion(), ElectronLorentzAngle(), IonVelocity(), and Velocity().

◆ ScaleLorentzAngle()

virtual double Garfield::Medium::ScaleLorentzAngle ( const double  lor) const
inlinevirtual

Reimplemented in Garfield::MediumGas.

Definition at line 470 of file Medium.hh.

470{ return lor; }

Referenced by ElectronLorentzAngle().

◆ ScaleTownsend()

virtual double Garfield::Medium::ScaleTownsend ( const double  alpha) const
inlinevirtual

Reimplemented in Garfield::MediumGas.

Definition at line 468 of file Medium.hh.

468{ return alpha; }

Referenced by ElectronTownsend(), and HoleTownsend().

◆ ScaleVelocity()

virtual double Garfield::Medium::ScaleVelocity ( const double  v) const
inlinevirtual

Definition at line 465 of file Medium.hh.

465{ return v; }

◆ SetAtomicNumber()

void Garfield::Medium::SetAtomicNumber ( const double  z)
virtual

Set the effective atomic number.

Reimplemented in Garfield::MediumGas.

Definition at line 114 of file Medium.cc.

114 {
115 if (z < 1.) {
116 std::cerr << m_className << "::SetAtomicNumber:\n"
117 << " Atomic number must be >= 1.\n";
118 return;
119 }
120 m_z = z;
121 m_isChanged = true;
122}
bool m_isChanged
Definition: Medium.hh:527

Referenced by Garfield::MediumCdTe::MediumCdTe(), Garfield::MediumDiamond::MediumDiamond(), Garfield::MediumGaAs::MediumGaAs(), Garfield::MediumGaN::MediumGaN(), and Garfield::MediumSilicon::MediumSilicon().

◆ SetAtomicWeight()

void Garfield::Medium::SetAtomicWeight ( const double  a)
virtual

Set the effective atomic weight.

Reimplemented in Garfield::MediumGas.

Definition at line 124 of file Medium.cc.

124 {
125 if (a <= 0.) {
126 std::cerr << m_className << "::SetAtomicWeight:\n"
127 << " Atomic weight must be greater than zero.\n";
128 return;
129 }
130 m_a = a;
131 m_isChanged = true;
132}

Referenced by Garfield::MediumCdTe::MediumCdTe(), Garfield::MediumDiamond::MediumDiamond(), Garfield::MediumGaAs::MediumGaAs(), Garfield::MediumGaN::MediumGaN(), and Garfield::MediumSilicon::MediumSilicon().

◆ SetDielectricConstant()

void Garfield::Medium::SetDielectricConstant ( const double  eps)

Set the relative static dielectric constant.

Definition at line 91 of file Medium.cc.

91 {
92 if (eps < 1.) {
93 std::cerr << m_className << "::SetDielectricConstant:\n"
94 << " Dielectric constant must be >= 1.\n";
95 return;
96 }
97 m_epsilon = eps;
98 m_isChanged = true;
99}

Referenced by Garfield::MediumCdTe::MediumCdTe(), Garfield::MediumDiamond::MediumDiamond(), Garfield::MediumGaAs::MediumGaAs(), Garfield::MediumGaN::MediumGaN(), and Garfield::MediumSilicon::MediumSilicon().

◆ SetElectronAttachment()

bool Garfield::Medium::SetElectronAttachment ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  eta 
)
inline

Set an entry in the table of attachment coefficients.

Definition at line 263 of file Medium.hh.

264 {
265 return SetEntry(ie, ib, ia, "ElectronAttachment", m_eAtt, eta);
266 }
bool SetEntry(const size_t i, const size_t j, const size_t k, const std::string &fcn, std::vector< std::vector< std::vector< double > > > &tab, const double val)
Definition: Medium.cc:868

◆ SetElectronLongitudinalDiffusion()

bool Garfield::Medium::SetElectronLongitudinalDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  dl 
)
inline

Set an entry in the table of longitudinal diffusion coefficients.

Definition at line 233 of file Medium.hh.

234 {
235 return SetEntry(ie, ib, ia, "ElectronLongitudinalDiffusion", m_eDifL, dl);
236 }

◆ SetElectronLorentzAngle()

bool Garfield::Medium::SetElectronLorentzAngle ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  lor 
)
inline

Set an entry in the table of Lorentz angles.

Definition at line 274 of file Medium.hh.

275 {
276 return SetEntry(ie, ib, ia, "ElectronLorentzAngle", m_eLor, lor);
277 }

◆ SetElectronTownsend()

bool Garfield::Medium::SetElectronTownsend ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  alpha 
)
inline

Set an entry in the table of Townsend coefficients.

Definition at line 253 of file Medium.hh.

254 {
255 return SetEntry(ie, ib, ia, "ElectronTownsend", m_eAlp, alpha);
256 }

◆ SetElectronTransverseDiffusion()

bool Garfield::Medium::SetElectronTransverseDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  dt 
)
inline

Set an entry in the table of transverse diffusion coefficients.

Definition at line 243 of file Medium.hh.

244 {
245 return SetEntry(ie, ib, ia, "ElectronTransverseDiffusion", m_eDifT, dt);
246 }

◆ SetElectronVelocityB()

bool Garfield::Medium::SetElectronVelocityB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  v 
)
inline

Set an entry in the table of drift speeds along Btrans.

Definition at line 223 of file Medium.hh.

224 {
225 return SetEntry(ie, ib, ia, "ElectronVelocityB", m_eVelB, v);
226 }

◆ SetElectronVelocityE()

bool Garfield::Medium::SetElectronVelocityE ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  v 
)
inline

Set an entry in the table of drift speeds along E.

Definition at line 203 of file Medium.hh.

204 {
205 return SetEntry(ie, ib, ia, "ElectronVelocityE", m_eVelE, v);
206 }

◆ SetElectronVelocityExB()

bool Garfield::Medium::SetElectronVelocityExB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  v 
)
inline

Set an entry in the table of drift speeds along ExB.

Definition at line 213 of file Medium.hh.

214 {
215 return SetEntry(ie, ib, ia, "ElectronVelocityExB", m_eVelX, v);
216 }

◆ SetEntry()

bool Garfield::Medium::SetEntry ( const size_t  i,
const size_t  j,
const size_t  k,
const std::string &  fcn,
std::vector< std::vector< std::vector< double > > > &  tab,
const double  val 
)
protected

◆ SetExtrapolationMethod()

void Garfield::Medium::SetExtrapolationMethod ( const std::string &  low,
const std::string &  high,
std::pair< unsigned int, unsigned int > &  extr,
const std::string &  fcn 
)
protected

Definition at line 1100 of file Medium.cc.

1103 {
1104 unsigned int i = 0;
1105 if (GetExtrapolationIndex(low, i)) {
1106 extr.first = i;
1107 } else {
1108 std::cerr << m_className << "::SetExtrapolationMethod" << fcn << ":\n"
1109 << " Unknown extrapolation method (" << low << ")\n";
1110 }
1111 unsigned int j = 0;
1112 if (GetExtrapolationIndex(high, j)) {
1113 extr.second = j;
1114 } else {
1115 std::cerr << m_className << "::SetExtrapolationMethod" << fcn << ":\n"
1116 << " Unknown extrapolation method (" << high << ")\n";
1117 }
1118}
bool GetExtrapolationIndex(std::string str, unsigned int &nb) const
Definition: Medium.cc:1120

Referenced by SetExtrapolationMethodAttachment(), SetExtrapolationMethodDiffusion(), Garfield::MediumGas::SetExtrapolationMethodExcitationRates(), SetExtrapolationMethodIonDissociation(), Garfield::MediumGas::SetExtrapolationMethodIonisationRates(), SetExtrapolationMethodIonMobility(), SetExtrapolationMethodTownsend(), and SetExtrapolationMethodVelocity().

◆ SetExtrapolationMethodAttachment()

void Garfield::Medium::SetExtrapolationMethodAttachment ( const std::string &  extrLow,
const std::string &  extrHigh 
)

Definition at line 1085 of file Medium.cc.

1086 {
1087 SetExtrapolationMethod(low, high, m_extrAtt, "Attachment");
1088}
void SetExtrapolationMethod(const std::string &low, const std::string &high, std::pair< unsigned int, unsigned int > &extr, const std::string &fcn)
Definition: Medium.cc:1100

◆ SetExtrapolationMethodDiffusion()

void Garfield::Medium::SetExtrapolationMethodDiffusion ( const std::string &  extrLow,
const std::string &  extrHigh 
)

Definition at line 1075 of file Medium.cc.

1076 {
1077 SetExtrapolationMethod(low, high, m_extrDif, "Diffusion");
1078}

◆ SetExtrapolationMethodIonDissociation()

void Garfield::Medium::SetExtrapolationMethodIonDissociation ( const std::string &  extrLow,
const std::string &  extrHigh 
)

Definition at line 1095 of file Medium.cc.

1096 {
1097 SetExtrapolationMethod(low, high, m_extrDis, "IonDissociation");
1098}

◆ SetExtrapolationMethodIonMobility()

void Garfield::Medium::SetExtrapolationMethodIonMobility ( const std::string &  extrLow,
const std::string &  extrHigh 
)

Definition at line 1090 of file Medium.cc.

1091 {
1092 SetExtrapolationMethod(low, high, m_extrMob, "IonMobility");
1093}

◆ SetExtrapolationMethodTownsend()

void Garfield::Medium::SetExtrapolationMethodTownsend ( const std::string &  extrLow,
const std::string &  extrHigh 
)

Definition at line 1080 of file Medium.cc.

1081 {
1082 SetExtrapolationMethod(low, high, m_extrAlp, "Townsend");
1083}

◆ SetExtrapolationMethodVelocity()

void Garfield::Medium::SetExtrapolationMethodVelocity ( const std::string &  extrLow,
const std::string &  extrHigh 
)

Select the extrapolation method for fields below/above the table range. Possible options are "constant", "linear", and "exponential".

Definition at line 1070 of file Medium.cc.

1071 {
1072 SetExtrapolationMethod(low, high, m_extrVel, "Velocity");
1073}
std::pair< unsigned int, unsigned int > m_extrVel
Definition: Medium.hh:577

◆ SetFanoFactor()

void Garfield::Medium::SetFanoFactor ( const double  f)
inline

Set the Fano factor.

Definition at line 85 of file Medium.hh.

85{ m_fano = f; }

◆ SetFieldGrid() [1/2]

void Garfield::Medium::SetFieldGrid ( const std::vector< double > &  efields,
const std::vector< double > &  bfields,
const std::vector< double > &  angles 
)

Set the fields and E-B angles to be used in the transport tables.

Definition at line 784 of file Medium.cc.

786 {
787 const std::string hdr = m_className + "::SetFieldGrid";
788 if (!CheckFields(efields, hdr, "E-fields")) return;
789 if (!CheckFields(bfields, hdr, "B-fields")) return;
790 if (!CheckFields(angles, hdr, "angles")) return;
791
792 if (m_debug) {
793 std::cout << m_className << "::SetFieldGrid:\n E-fields:\n";
794 for (const auto efield : efields) std::cout << " " << efield << "\n";
795 std::cout << " B-fields:\n";
796 for (const auto bfield : bfields) std::cout << " " << bfield << "\n";
797 std::cout << " Angles:\n";
798 for (const auto angle : angles) std::cout << " " << angle << "\n";
799 }
800
801 // Clone the existing tables.
802 // Electrons
803 Clone(m_eVelE, efields, bfields, angles, m_intpVel, m_extrVel, 0.,
804 "electron velocity along E");
805 Clone(m_eVelB, efields, bfields, angles, m_intpVel, m_extrVel, 0.,
806 "electron velocity along Bt");
807 Clone(m_eVelX, efields, bfields, angles, m_intpVel, m_extrVel, 0.,
808 "electron velocity along ExB");
809 Clone(m_eDifL, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
810 "electron longitudinal diffusion");
811 Clone(m_eDifT, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
812 "electron transverse diffusion");
813 Clone(m_eAlp, efields, bfields, angles, m_intpAlp, m_extrAlp, -30.,
814 "electron Townsend coefficient");
815 Clone(m_eAtt, efields, bfields, angles, m_intpAtt, m_extrAtt, -30.,
816 "electron attachment coefficient");
817 Clone(m_eLor, efields, bfields, angles, m_intpLor, m_extrLor, 0.,
818 "electron Lorentz angle");
819 if (!m_eDifM.empty()) {
820 Clone(m_eDifM, 6, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
821 "electron diffusion tensor");
822 }
823
824 // Holes
825 Clone(m_hVelE, efields, bfields, angles, m_intpVel, m_extrVel, 0.,
826 "hole velocity along E");
827 Clone(m_hVelB, efields, bfields, angles, m_intpVel, m_extrVel, 0.,
828 "hole velocity along Bt");
829 Clone(m_hVelX, efields, bfields, angles, m_intpVel, m_extrVel, 0.,
830 "hole velocity along ExB");
831 Clone(m_hDifL, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
832 "hole longitudinal diffusion");
833 Clone(m_hDifT, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
834 "hole transverse diffusion");
835 Clone(m_hAlp, efields, bfields, angles, m_intpAlp, m_extrAlp, -30.,
836 "hole Townsend coefficient");
837 Clone(m_hAtt, efields, bfields, angles, m_intpAtt, m_extrAtt, -30.,
838 "hole attachment coefficient");
839 if (!m_hDifM.empty()) {
840 Clone(m_hDifM, 6, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
841 "hole diffusion tensor");
842 }
843
844 // Ions
845 Clone(m_iMob, efields, bfields, angles, m_intpMob, m_extrMob, 0.,
846 "ion mobility");
847 Clone(m_iDifL, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
848 "ion longitudinal diffusion");
849 Clone(m_iDifT, efields, bfields, angles, m_intpDif, m_extrDif, 0.,
850 "ion transverse diffusion");
851 Clone(m_iDis, efields, bfields, angles, m_intpDis, m_extrDis, -30.,
852 "ion dissociation");
853
854 if (bfields.size() > 1 || angles.size() > 1) m_tab2d = true;
855 m_eFields = efields;
856 m_bFields = bfields;
857 m_bAngles = angles;
858}
unsigned int m_intpVel
Definition: Medium.hh:586
void Clone(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 std::pair< unsigned int, unsigned int > &extr, const double init, const std::string &label)
Definition: Medium.cc:918

◆ SetFieldGrid() [2/2]

void Garfield::Medium::SetFieldGrid ( double  emin,
double  emax,
const size_t  ne,
bool  logE,
double  bmin = 0.,
double  bmax = 0.,
const size_t  nb = 1,
double  amin = HalfPi,
double  amax = HalfPi,
const size_t  na = 1 
)

Set the range of fields to be covered by the transport tables.

Definition at line 693 of file Medium.cc.

695 {
696 // Check if the requested E-field range makes sense.
697 if (ne <= 0) {
698 std::cerr << m_className << "::SetFieldGrid:\n"
699 << " Number of E-fields must be > 0.\n";
700 return;
701 }
702
703 if (emin < 0. || emax < 0.) {
704 std::cerr << m_className << "::SetFieldGrid:\n"
705 << " Electric fields must be positive.\n";
706 return;
707 }
708
709 if (emax < emin) {
710 std::cerr << m_className << "::SetFieldGrid: Swapping min./max. E-field.\n";
711 std::swap(emin, emax);
712 }
713
714 double estep = 0.;
715 if (logE) {
716 // Logarithmic scale
717 if (emin < Small) {
718 std::cerr << m_className << "::SetFieldGrid:\n"
719 << " Min. E-field must be non-zero for log. scale.\n";
720 return;
721 }
722 if (ne == 1) {
723 std::cerr << m_className << "::SetFieldGrid:\n"
724 << " Number of E-fields must be > 1 for log. scale.\n";
725 return;
726 }
727 estep = pow(emax / emin, 1. / (ne - 1.));
728 } else {
729 // Linear scale
730 if (ne > 1) estep = (emax - emin) / (ne - 1.);
731 }
732
733 // Check if the requested B-field range makes sense.
734 if (nb <= 0) {
735 std::cerr << m_className << "::SetFieldGrid:\n"
736 << " Number of B-fields must be > 0.\n";
737 return;
738 }
739 if (bmax < 0. || bmin < 0.) {
740 std::cerr << m_className << "::SetFieldGrid:\n"
741 << " Magnetic fields must be positive.\n";
742 return;
743 }
744 if (bmax < bmin) {
745 std::cerr << m_className << "::SetFieldGrid: Swapping min./max. B-field.\n";
746 std::swap(bmin, bmax);
747 }
748
749 const double bstep = nb > 1 ? (bmax - bmin) / (nb - 1.) : 0.;
750
751 // Check if the requested angular range makes sense.
752 if (na <= 0) {
753 std::cerr << m_className << "::SetFieldGrid:\n"
754 << " Number of angles must be > 0.\n";
755 return;
756 }
757 if (amax < 0. || amin < 0.) {
758 std::cerr << m_className << "::SetFieldGrid:"
759 << " Angles must be positive.\n";
760 return;
761 }
762 if (amax < amin) {
763 std::cerr << m_className << "::SetFieldGrid: Swapping min./max. angle.\n";
764 std::swap(amin, amax);
765 }
766 const double astep = na > 1 ? (amax - amin) / (na - 1.) : 0;
767
768 // Setup the field grids.
769 std::vector<double> eFields(ne);
770 std::vector<double> bFields(nb);
771 std::vector<double> bAngles(na);
772 for (size_t i = 0; i < ne; ++i) {
773 eFields[i] = logE ? emin * pow(estep, i) : emin + i * estep;
774 }
775 for (size_t i = 0; i < nb; ++i) {
776 bFields[i] = bmin + i * bstep;
777 }
778 for (size_t i = 0; i < na; ++i) {
779 bAngles[i] = amin + i * astep;
780 }
781 SetFieldGrid(eFields, bFields, bAngles);
782}
DoubleAc pow(const DoubleAc &f, double p)
Definition: DoubleAc.cpp:337

Referenced by Medium(), and SetFieldGrid().

◆ SetHoleAttachment()

bool Garfield::Medium::SetHoleAttachment ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  eta 
)
inline

Set an entry in the table of attachment coefficients.

Definition at line 346 of file Medium.hh.

347 {
348 return SetEntry(ie, ib, ia, "HoleAttachment", m_hAtt, eta);
349 }

◆ SetHoleLongitudinalDiffusion()

bool Garfield::Medium::SetHoleLongitudinalDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  dl 
)
inline

Set an entry in the table of longitudinal diffusion coefficients.

Definition at line 316 of file Medium.hh.

317 {
318 return SetEntry(ie, ib, ia, "HoleLongitudinalDiffusion", m_hDifL, dl);
319 }

◆ SetHoleTownsend()

bool Garfield::Medium::SetHoleTownsend ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  alpha 
)
inline

Set an entry in the table of Townsend coefficients.

Definition at line 336 of file Medium.hh.

337 {
338 return SetEntry(ie, ib, ia, "HoleTownsend", m_hAlp, alpha);
339 }

◆ SetHoleTransverseDiffusion()

bool Garfield::Medium::SetHoleTransverseDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  dt 
)
inline

Set an entry in the table of transverse diffusion coefficients.

Definition at line 326 of file Medium.hh.

327 {
328 return SetEntry(ie, ib, ia, "HoleTransverseDiffusion", m_hDifT, dt);
329 }

◆ SetHoleVelocityB()

bool Garfield::Medium::SetHoleVelocityB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  v 
)
inline

Set an entry in the table of drift speeds along Btrans.

Definition at line 305 of file Medium.hh.

306 {
307 return SetEntry(ie, ib, ia, "HoleVelocityB", m_hVelB, v);
308 }

◆ SetHoleVelocityE()

bool Garfield::Medium::SetHoleVelocityE ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  v 
)
inline

Set an entry in the table of drift speeds along E.

Definition at line 285 of file Medium.hh.

286 {
287 return SetEntry(ie, ib, ia, "HoleVelocityE", m_hVelE, v);
288 }

◆ SetHoleVelocityExB()

bool Garfield::Medium::SetHoleVelocityExB ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  v 
)
inline

Set an entry in the table of drift speeds along ExB.

Definition at line 295 of file Medium.hh.

296 {
297 return SetEntry(ie, ib, ia, "HoleVelocityExB", m_hVelX, v);
298 }

◆ SetInterpolationMethodAttachment()

void Garfield::Medium::SetInterpolationMethodAttachment ( const unsigned int  intrp)

Definition at line 1173 of file Medium.cc.

1173 {
1174 if (intrp > 0) m_intpAtt = intrp;
1175}

◆ SetInterpolationMethodDiffusion()

void Garfield::Medium::SetInterpolationMethodDiffusion ( const unsigned int  intrp)

Definition at line 1165 of file Medium.cc.

1165 {
1166 if (intrp > 0) m_intpDif = intrp;
1167}

◆ SetInterpolationMethodIonDissociation()

void Garfield::Medium::SetInterpolationMethodIonDissociation ( const unsigned int  intrp)

Definition at line 1181 of file Medium.cc.

1181 {
1182 if (intrp > 0) m_intpDis = intrp;
1183}

◆ SetInterpolationMethodIonMobility()

void Garfield::Medium::SetInterpolationMethodIonMobility ( const unsigned int  intrp)

Definition at line 1177 of file Medium.cc.

1177 {
1178 if (intrp > 0) m_intpMob = intrp;
1179}

◆ SetInterpolationMethodTownsend()

void Garfield::Medium::SetInterpolationMethodTownsend ( const unsigned int  intrp)

Definition at line 1169 of file Medium.cc.

1169 {
1170 if (intrp > 0) m_intpAlp = intrp;
1171}

◆ SetInterpolationMethodVelocity()

void Garfield::Medium::SetInterpolationMethodVelocity ( const unsigned int  intrp)

Set the degree of polynomial interpolation (usually 2).

Definition at line 1161 of file Medium.cc.

1161 {
1162 if (intrp > 0) m_intpVel = intrp;
1163}

◆ SetIonDissociation()

bool Garfield::Medium::SetIonDissociation ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  diss 
)
inline

Set an entry in the table of dissociation coefficients.

Definition at line 392 of file Medium.hh.

393 {
394 return SetEntry(ie, ib, ia, "IonDissociation", m_iDis, diss);
395 }

◆ SetIonLongitudinalDiffusion()

bool Garfield::Medium::SetIonLongitudinalDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  dl 
)
inline

Set an entry in the table of longitudinal diffusion coefficients.

Definition at line 372 of file Medium.hh.

373 {
374 return SetEntry(ie, ib, ia, "IonLongitudinalDiffusion", m_iDifL, dl);
375 }

◆ SetIonMobility() [1/2]

bool Garfield::Medium::SetIonMobility ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  mu 
)

Set an entry in the table of ion mobilities.

Definition at line 1009 of file Medium.cc.

1010 {
1011 // Check the index.
1012 if (ie >= m_eFields.size() || ib >= m_bFields.size() ||
1013 ia >= m_bAngles.size()) {
1014 PrintOutOfRange(m_className, "SetIonMobility", ie, ib, ia);
1015 return false;
1016 }
1017
1018 if (m_iMob.empty()) {
1019 std::cerr << m_className << "::SetIonMobility:\n"
1020 << " Ion mobility table not initialised.\n";
1021 return false;
1022 }
1023
1024 if (mu == 0.) {
1025 std::cerr << m_className << "::SetIonMobility: Zero value not allowed.\n";
1026 return false;
1027 }
1028
1029 m_iMob[ia][ib][ie] = mu;
1030 if (m_debug) {
1031 std::cout << m_className << "::SetIonMobility:\n Ion mobility at E = "
1032 << m_eFields[ie] << " V/cm, B = "
1033 << m_bFields[ib] << " T, angle "
1034 << m_bAngles[ia] << " set to " << mu << " cm2/(V ns).\n";
1035 }
1036 return true;
1037}

◆ SetIonMobility() [2/2]

bool Garfield::Medium::SetIonMobility ( const std::vector< double > &  fields,
const std::vector< double > &  mobilities 
)

Initialise the table of ion mobilities from a list of electric fields and corresponding mobilities. The mobilities will be interpolated at the electric fields of the currently set grid.

Definition at line 1039 of file Medium.cc.

1040 {
1041 if (efields.size() != mobs.size()) {
1042 std::cerr << m_className << "::SetIonMobility:\n"
1043 << " E-field and mobility arrays have different sizes.\n";
1044 return false;
1045 }
1046
1048 const auto nE = m_eFields.size();
1049 const auto nB = m_bFields.size();
1050 const auto nA = m_bAngles.size();
1051 Init(nE, nB, nA, m_iMob, 0.);
1052 for (size_t i = 0; i < nE; ++i) {
1053 const double e = m_eFields[i];
1054 const double mu = Interpolate1D(e, mobs, efields, m_intpMob, m_extrMob);
1055 m_iMob[0][0][i] = mu;
1056 }
1057
1058 if (m_tab2d) {
1059 for (size_t i = 0; i < nA; ++i) {
1060 for (size_t j = 0; j < nB; ++j) {
1061 for (size_t k = 0; k < nE; ++k) {
1062 m_iMob[i][j][k] = m_iMob[0][0][k];
1063 }
1064 }
1065 }
1066 }
1067 return true;
1068}

Referenced by Garfield::MediumGas::LoadIonMobility().

◆ SetIonTransverseDiffusion()

bool Garfield::Medium::SetIonTransverseDiffusion ( const size_t  ie,
const size_t  ib,
const size_t  ia,
const double  dt 
)
inline

Set an entry in the table of transverse diffusion coefficients.

Definition at line 382 of file Medium.hh.

383 {
384 return SetEntry(ie, ib, ia, "IonTransverseDiffusion", m_iDifT, dt);
385 }

◆ SetMassDensity()

void Garfield::Medium::SetMassDensity ( const double  rho)
virtual

Set the mass density [g/cm3].

Reimplemented in Garfield::MediumGas.

Definition at line 144 of file Medium.cc.

144 {
145 if (rho <= 0.) {
146 std::cerr << m_className << "::SetMassDensity:\n"
147 << " Density [g/cm3] must be greater than zero.\n";
148 return;
149 }
150
151 if (m_a <= 0.) {
152 std::cerr << m_className << "::SetMassDensity:\n"
153 << " Atomic weight is not defined.\n";
154 return;
155 }
156 m_density = rho / (AtomicMassUnit * m_a);
157 m_isChanged = true;
158}

Referenced by Garfield::MediumCdTe::MediumCdTe(), Garfield::MediumDiamond::MediumDiamond(), Garfield::MediumGaAs::MediumGaAs(), Garfield::MediumGaN::MediumGaN(), and Garfield::MediumSilicon::MediumSilicon().

◆ SetNumberDensity()

void Garfield::Medium::SetNumberDensity ( const double  n)
virtual

Set the number density [cm-3].

Reimplemented in Garfield::MediumGas.

Definition at line 134 of file Medium.cc.

134 {
135 if (n <= 0.) {
136 std::cerr << m_className << "::SetNumberDensity:\n"
137 << " Density [cm-3] must be greater than zero.\n";
138 return;
139 }
140 m_density = n;
141 m_isChanged = true;
142}

◆ SetPressure()

void Garfield::Medium::SetPressure ( const double  p)

Definition at line 81 of file Medium.cc.

81 {
82 if (p <= 0.) {
83 std::cerr << m_className << "::SetPressure:\n"
84 << " Pressure [Torr] must be greater than zero.\n";
85 return;
86 }
87 m_pressure = p;
88 m_isChanged = true;
89}

Referenced by GarfieldPhysics::InitializePhysics(), and main().

◆ SetTemperature()

void Garfield::Medium::SetTemperature ( const double  t)

Set the temperature [K].

Definition at line 71 of file Medium.cc.

71 {
72 if (t <= 0.) {
73 std::cerr << m_className << "::SetTemperature:\n"
74 << " Temperature [K] must be greater than zero.\n";
75 return;
76 }
77 m_temperature = t;
78 m_isChanged = true;
79}

Referenced by GarfieldPhysics::InitializePhysics(), main(), Garfield::MediumCdTe::MediumCdTe(), Garfield::MediumDiamond::MediumDiamond(), Garfield::MediumGaAs::MediumGaAs(), Garfield::MediumGaN::MediumGaN(), and Garfield::MediumSilicon::MediumSilicon().

◆ SetThreshold()

size_t Garfield::Medium::SetThreshold ( const std::vector< std::vector< std::vector< double > > > &  tab) const
protected

Definition at line 1137 of file Medium.cc.

1138 {
1139
1140 if (tab.empty()) return 0;
1141 const auto nE = m_eFields.size();
1142 const auto nB = m_bFields.size();
1143 const auto nA = m_bAngles.size();
1144 for (size_t i = 0; i < nE; ++i) {
1145 bool below = false;
1146 for (size_t k = 0; k < nA; ++k) {
1147 for (size_t j = 0; j < nB; ++j) {
1148 if (tab[k][j][i] < -20.) {
1149 below = true;
1150 break;
1151 }
1152 }
1153 if (below) break;
1154 }
1155 if (below) continue;
1156 return i;
1157 }
1158 return nE - 1;
1159}

Referenced by Garfield::MediumGas::AdjustTownsendCoefficient(), Garfield::MediumMagboltz::GenerateGasTable(), and Garfield::MediumGas::MergeGasFile().

◆ SetW()

void Garfield::Medium::SetW ( const double  w)
inline

Set the W value (average energy to produce an electron/ion or e/h pair).

Definition at line 81 of file Medium.hh.

81{ m_w = w; }

◆ UnScaleElectricField()

virtual double Garfield::Medium::UnScaleElectricField ( const double  e) const
inlinevirtual

Reimplemented in Garfield::MediumGas.

Definition at line 464 of file Medium.hh.

464{ return e; }

Referenced by ElectronMobility(), and HoleMobility().

◆ Velocity()

bool Garfield::Medium::Velocity ( const double  ex,
const double  ey,
const double  ez,
const double  bx,
const double  by,
const double  bz,
const std::vector< std::vector< std::vector< double > > > &  velE,
const std::vector< std::vector< std::vector< double > > > &  velB,
const std::vector< std::vector< std::vector< double > > > &  velX,
const double  q,
double &  vx,
double &  vy,
double &  vz 
) const
protected

Definition at line 160 of file Medium.cc.

165 {
166
167 vx = vy = vz = 0.;
168 // Make sure there is at least a table of velocities along E.
169 if (velE.empty()) return false;
170
171 // Compute the magnitude of the electric field.
172 const double e = sqrt(ex * ex + ey * ey + ez * ez);
173 const double e0 = ScaleElectricField(e);
174 if (e < Small || e0 < Small) return false;
175
176 // Compute the magnitude of the magnetic field.
177 const double b = sqrt(bx * bx + by * by + bz * bz);
178 // Compute the angle between B field and E field.
179 const double ebang = GetAngle(ex, ey, ez, bx, by, bz, e, b);
180
181 // Calculate the velocity along E.
182 double ve = 0.;
183 if (!Interpolate(e0, b, ebang, velE, ve, m_intpVel, m_extrVel)) {
184 std::cerr << m_className << "::Velocity: Interpolation along E failed.\n";
185 return false;
186 }
187 if (b < Small) {
188 // No magnetic field.
189 const double mu = q * ve / e;
190 vx = mu * ex;
191 vy = mu * ey;
192 vz = mu * ez;
193 return true;
194 } else if (velX.empty() || velB.empty()) {
195 // Magnetic field, velocities along ExB, Bt not available.
196 const double mu = q * ve / e;
197 const double mu2 = mu * mu;
198 const double eb = bx * ex + by * ey + bz * ez;
199 const double f = mu / (1. + mu2 * b * b);
200 vx = f * (ex + mu * (ey * bz - ez * by) + mu2 * bx * eb);
201 vy = f * (ey + mu * (ez * bx - ex * bz) + mu2 * by * eb);
202 vz = f * (ez + mu * (ex * by - ey * bx) + mu2 * bz * eb);
203 return true;
204 }
205
206 // Magnetic field, velocities along ExB and Bt available.
207 // Compute unit vectors along E, E x B and Bt.
208 double ue[3] = {ex / e, ey / e, ez / e};
209 double uexb[3] = {ey * bz - ez * by, ez * bx - ex * bz, ex * by - ey * bx};
210 const double exb =
211 sqrt(uexb[0] * uexb[0] + uexb[1] * uexb[1] + uexb[2] * uexb[2]);
212 if (exb > 0.) {
213 uexb[0] /= exb;
214 uexb[1] /= exb;
215 uexb[2] /= exb;
216 } else {
217 uexb[0] = ue[0];
218 uexb[1] = ue[1];
219 uexb[2] = ue[2];
220 }
221
222 double ubt[3] = {uexb[1] * ez - uexb[2] * ey, uexb[2] * ex - uexb[0] * ez,
223 uexb[0] * ey - uexb[1] * ex};
224 const double bt = sqrt(ubt[0] * ubt[0] + ubt[1] * ubt[1] + ubt[2] * ubt[2]);
225 if (bt > 0.) {
226 ubt[0] /= bt;
227 ubt[1] /= bt;
228 ubt[2] /= bt;
229 } else {
230 ubt[0] = ue[0];
231 ubt[1] = ue[1];
232 ubt[2] = ue[2];
233 }
234
235 if (m_debug) {
236 std::cout << std::setprecision(5);
237 std::cout << m_className << "::Velocity:\n"
238 << " unit vector along E: (" << ue[0] << ", " << ue[1]
239 << ", " << ue[2] << ")\n";
240 std::cout << " unit vector along E x B: (" << uexb[0] << ", "
241 << uexb[1] << ", " << uexb[2] << ")\n";
242 std::cout << " unit vector along Bt: (" << ubt[0] << ", " << ubt[1]
243 << ", " << ubt[2] << ")\n";
244 }
245
246 // Calculate the velocities in all directions.
247 double vexb = 0.;
248 if (!Interpolate(e0, b, ebang, velX, vexb, m_intpVel, m_extrVel)) {
249 std::cerr << m_className << "::Velocity: Interpolation along ExB failed.\n";
250 return false;
251 }
252 double vbt = 0.;
253 if (!Interpolate(e0, b, ebang, velB, vbt, m_intpVel, m_extrVel)) {
254 std::cerr << m_className << "::Velocity: Interpolation along Bt failed.\n";
255 return false;
256 }
257 if (ex * bx + ey * by + ez * bz > 0.) {
258 vbt = fabs(vbt);
259 } else {
260 vbt = -fabs(vbt);
261 }
262 vx = q * (ve * ue[0] + q * q * vbt * ubt[0] + q * vexb * uexb[0]);
263 vy = q * (ve * ue[1] + q * q * vbt * ubt[1] + q * vexb * uexb[1]);
264 vz = q * (ve * ue[2] + q * q * vbt * ubt[2] + q * vexb * uexb[2]);
265
266 return true;
267}

Referenced by ElectronVelocity(), and HoleVelocity().

Member Data Documentation

◆ m_a

double Garfield::Medium::m_a = 0.
protected

Definition at line 512 of file Medium.hh.

Referenced by GetAtomicWeight(), GetMassDensity(), SetAtomicWeight(), and SetMassDensity().

◆ m_bAngles

◆ m_bFields

◆ m_className

std::string Garfield::Medium::m_className = "Medium"
protected

Definition at line 493 of file Medium.hh.

Referenced by Garfield::MediumGas::AdjustTownsendCoefficient(), Clone(), Garfield::MediumMagboltz::ComputeDeexcitation(), Garfield::MediumGas::DisablePenningTransfer(), Garfield::MediumMagboltz::DisablePenningTransfer(), Garfield::MediumSilicon::ElectronAttachment(), Garfield::MediumSilicon::ElectronTownsend(), Garfield::MediumSilicon::ElectronVelocity(), Garfield::MediumMagboltz::EnableDeexcitation(), Garfield::MediumGas::EnablePenningTransfer(), Garfield::MediumMagboltz::EnablePenningTransfer(), Garfield::MediumMagboltz::EnableRadiationTrapping(), Garfield::MediumMagboltz::GenerateGasTable(), GetComponent(), Garfield::MediumCdTe::GetComponent(), Garfield::MediumDiamond::GetComponent(), Garfield::MediumGas::GetComponent(), Garfield::MediumSilicon::GetConductionBandDensityOfStates(), GetDeexcitationProduct(), GetDielectricFunction(), Garfield::MediumSilicon::GetDielectricFunction(), Garfield::MediumSilicon::GetElectronBandPopulation(), GetElectronCollision(), Garfield::MediumMagboltz::GetElectronCollision(), Garfield::MediumSilicon::GetElectronCollision(), Garfield::MediumMagboltz::GetElectronCollisionRate(), Garfield::MediumSilicon::GetElectronCollisionRate(), GetElectronCollisionRate(), GetElectronEnergy(), Garfield::MediumSilicon::GetElectronEnergy(), Garfield::MediumSilicon::GetElectronMomentum(), Garfield::MediumMagboltz::GetElectronNullCollisionRate(), Garfield::MediumSilicon::GetElectronNullCollisionRate(), GetElectronNullCollisionRate(), GetEntry(), Garfield::MediumGas::GetGasName(), Garfield::MediumGas::GetGasNumberGasFile(), Garfield::MediumMagboltz::GetLevel(), Garfield::MediumGas::GetMixture(), Garfield::MediumMagboltz::GetNumberOfElectronCollisions(), Garfield::MediumSilicon::GetNumberOfElectronCollisions(), Garfield::MediumMagboltz::GetNumberOfLevels(), GetOpticalDataRange(), Garfield::MediumSilicon::GetOpticalDataRange(), Garfield::MediumGas::GetPhotoAbsorptionCrossSection(), GetPhotoAbsorptionCrossSection(), Garfield::MediumMagboltz::GetPhotonCollision(), Garfield::MediumMagboltz::GetPhotonCollisionRate(), Garfield::MediumSilicon::GetValenceBandDensityOfStates(), Garfield::MediumSilicon::HoleAttachment(), Garfield::MediumSilicon::HoleTownsend(), Garfield::MediumSilicon::HoleVelocity(), Init(), Garfield::MediumSilicon::Initialise(), Garfield::MediumMagboltz::Initialise(), Interpolate1D(), Garfield::MediumGas::LoadGasFile(), Garfield::MediumGas::LoadIonMobility(), Garfield::MediumCdTe::MediumCdTe(), Garfield::MediumConductor::MediumConductor(), Garfield::MediumDiamond::MediumDiamond(), Garfield::MediumGaAs::MediumGaAs(), Garfield::MediumGaN::MediumGaN(), Garfield::MediumGas::MediumGas(), Garfield::MediumMagboltz::MediumMagboltz(), Garfield::MediumPlastic::MediumPlastic(), Garfield::MediumSilicon::MediumSilicon(), Garfield::MediumGas::MergeGasFile(), Garfield::MediumGas::PrintGas(), Garfield::MediumGas::ReadHeader(), Garfield::MediumMagboltz::RunMagboltz(), SetAtomicNumber(), Garfield::MediumGas::SetAtomicNumber(), SetAtomicWeight(), Garfield::MediumGas::SetAtomicWeight(), Garfield::MediumGas::SetComposition(), SetDielectricConstant(), Garfield::MediumSilicon::SetDoping(), Garfield::MediumGaN::SetElectronConcentration(), SetEntry(), Garfield::MediumMagboltz::SetExcitationScaling(), SetExtrapolationMethod(), SetFieldGrid(), SetIonMobility(), Garfield::MediumCdTe::SetLowFieldMobility(), Garfield::MediumDiamond::SetLowFieldMobility(), Garfield::MediumGaAs::SetLowFieldMobility(), Garfield::MediumGaN::SetLowFieldMobility(), Garfield::MediumSilicon::SetLowFieldMobility(), SetMassDensity(), Garfield::MediumGas::SetMassDensity(), Garfield::MediumMagboltz::SetMaxElectronEnergy(), Garfield::MediumSilicon::SetMaxElectronEnergy(), Garfield::MediumMagboltz::SetMaxPhotonEnergy(), SetNumberDensity(), Garfield::MediumGas::SetNumberDensity(), SetPressure(), Garfield::MediumDiamond::SetSaturationVelocity(), Garfield::MediumSilicon::SetSaturationVelocity(), Garfield::MediumMagboltz::SetSplittingFunctionGreenSawada(), SetTemperature(), Garfield::MediumSilicon::SetTrapCrossSection(), Garfield::MediumSilicon::SetTrapDensity(), Garfield::MediumSilicon::SetTrappingTime(), Velocity(), and Garfield::MediumGas::WriteGasFile().

◆ m_debug

◆ m_density

double Garfield::Medium::m_density = 0.
protected

◆ m_driftable

bool Garfield::Medium::m_driftable = false
protected

Definition at line 522 of file Medium.hh.

Referenced by EnableDrift(), and IsDriftable().

◆ m_eAlp

◆ m_eAtt

◆ m_eDifL

◆ m_eDifM

◆ m_eDifT

◆ m_eFields

◆ m_eLor

◆ m_epsilon

double Garfield::Medium::m_epsilon = 1.
protected

Definition at line 508 of file Medium.hh.

Referenced by GetDielectricConstant(), and SetDielectricConstant().

◆ m_eThrAlp

unsigned int Garfield::Medium::m_eThrAlp = 0
protected

◆ m_eThrAtt

unsigned int Garfield::Medium::m_eThrAtt = 0
protected

◆ m_eVelB

◆ m_eVelE

◆ m_eVelX

◆ m_extrAlp

std::pair<unsigned int, unsigned int> Garfield::Medium::m_extrAlp = {0, 1}
protected

◆ m_extrAtt

◆ m_extrDif

std::pair<unsigned int, unsigned int> Garfield::Medium::m_extrDif = {0, 1}
protected

◆ m_extrDis

std::pair<unsigned int, unsigned int> Garfield::Medium::m_extrDis = {0, 1}
protected

◆ m_extrLor

std::pair<unsigned int, unsigned int> Garfield::Medium::m_extrLor = {0, 1}
protected

◆ m_extrMob

std::pair<unsigned int, unsigned int> Garfield::Medium::m_extrMob = {0, 1}
protected

◆ m_extrVel

std::pair<unsigned int, unsigned int> Garfield::Medium::m_extrVel = {0, 1}
protected

◆ m_fano

◆ m_hAlp

◆ m_hAtt

◆ m_hDifL

std::vector<std::vector<std::vector<double> > > Garfield::Medium::m_hDifL
protected

◆ m_hDifM

std::vector<std::vector<std::vector<std::vector<double> > > > Garfield::Medium::m_hDifM
protected

Definition at line 561 of file Medium.hh.

Referenced by HoleDiffusion(), ResetHoleDiffusion(), and SetFieldGrid().

◆ m_hDifT

std::vector<std::vector<std::vector<double> > > Garfield::Medium::m_hDifT
protected

◆ m_hThrAlp

unsigned int Garfield::Medium::m_hThrAlp = 0
protected

Definition at line 572 of file Medium.hh.

Referenced by HoleTownsend().

◆ m_hThrAtt

unsigned int Garfield::Medium::m_hThrAtt = 0
protected

Definition at line 573 of file Medium.hh.

Referenced by HoleAttachment().

◆ m_hVelB

std::vector<std::vector<std::vector<double> > > Garfield::Medium::m_hVelB
protected

◆ m_hVelE

◆ m_hVelX

std::vector<std::vector<std::vector<double> > > Garfield::Medium::m_hVelX
protected

◆ m_id

int Garfield::Medium::m_id
protected

Definition at line 498 of file Medium.hh.

Referenced by GetId().

◆ m_idCounter

int Garfield::Medium::m_idCounter = -1
staticprotected

Definition at line 495 of file Medium.hh.

◆ m_iDifL

◆ m_iDifT

◆ m_iDis

◆ m_iMob

◆ m_intpAlp

◆ m_intpAtt

◆ m_intpDif

◆ m_intpDis

◆ m_intpLor

◆ m_intpMob

◆ m_intpVel

◆ m_ionisable

bool Garfield::Medium::m_ionisable = false
protected

Definition at line 524 of file Medium.hh.

Referenced by EnablePrimaryIonisation(), and IsIonisable().

◆ m_isChanged

bool Garfield::Medium::m_isChanged = true
protected

Definition at line 527 of file Medium.hh.

Referenced by Garfield::MediumMagboltz::ComputeDeexcitation(), Garfield::MediumSilicon::ElectronAttachment(), Garfield::MediumGaAs::ElectronTownsend(), Garfield::MediumGaN::ElectronTownsend(), Garfield::MediumSilicon::ElectronTownsend(), Garfield::MediumCdTe::ElectronVelocity(), Garfield::MediumDiamond::ElectronVelocity(), Garfield::MediumGaAs::ElectronVelocity(), Garfield::MediumGaN::ElectronVelocity(), Garfield::MediumSilicon::ElectronVelocity(), Garfield::MediumMagboltz::EnableAnisotropicScattering(), Garfield::MediumMagboltz::EnableDeexcitation(), Garfield::MediumMagboltz::EnablePenningTransfer(), Garfield::MediumMagboltz::EnableRadiationTrapping(), Garfield::MediumMagboltz::GetElectronCollision(), Garfield::MediumSilicon::GetElectronCollision(), Garfield::MediumMagboltz::GetElectronCollisionRate(), Garfield::MediumSilicon::GetElectronCollisionRate(), Garfield::MediumMagboltz::GetElectronNullCollisionRate(), Garfield::MediumSilicon::GetElectronNullCollisionRate(), Garfield::MediumMagboltz::GetLevel(), Garfield::MediumMagboltz::GetNumberOfLevels(), Garfield::MediumMagboltz::GetPhotonCollision(), Garfield::MediumMagboltz::GetPhotonCollisionRate(), Garfield::MediumSilicon::HoleAttachment(), Garfield::MediumGaAs::HoleTownsend(), Garfield::MediumGaN::HoleTownsend(), Garfield::MediumSilicon::HoleTownsend(), Garfield::MediumCdTe::HoleVelocity(), Garfield::MediumDiamond::HoleVelocity(), Garfield::MediumGaAs::HoleVelocity(), Garfield::MediumGaN::HoleVelocity(), Garfield::MediumSilicon::HoleVelocity(), Garfield::MediumSilicon::Initialise(), Garfield::MediumMagboltz::Initialise(), Garfield::MediumGas::LoadGasFile(), Garfield::MediumGas::MediumGas(), Garfield::MediumMagboltz::MediumMagboltz(), Garfield::MediumMagboltz::PrintGas(), SetAtomicNumber(), SetAtomicWeight(), Garfield::MediumGas::SetComposition(), SetDielectricConstant(), Garfield::MediumSilicon::SetDoping(), Garfield::MediumSilicon::SetDopingMobilityModelMasetti(), Garfield::MediumSilicon::SetDopingMobilityModelMinimos(), Garfield::MediumMagboltz::SetExcitationScaling(), Garfield::MediumSilicon::SetHighFieldMobilityModelCanali(), Garfield::MediumSilicon::SetHighFieldMobilityModelMinimos(), Garfield::MediumSilicon::SetHighFieldMobilityModelReggiani(), Garfield::MediumSilicon::SetImpactIonisationModelGrant(), Garfield::MediumSilicon::SetImpactIonisationModelMassey(), Garfield::MediumSilicon::SetImpactIonisationModelVanOverstraetenDeMan(), Garfield::MediumSilicon::SetLatticeMobilityModelMinimos(), Garfield::MediumSilicon::SetLatticeMobilityModelReggiani(), Garfield::MediumSilicon::SetLatticeMobilityModelSentaurus(), Garfield::MediumCdTe::SetLowFieldMobility(), Garfield::MediumDiamond::SetLowFieldMobility(), Garfield::MediumGaAs::SetLowFieldMobility(), Garfield::MediumGaN::SetLowFieldMobility(), Garfield::MediumSilicon::SetLowFieldMobility(), SetMassDensity(), Garfield::MediumMagboltz::SetMaxElectronEnergy(), Garfield::MediumSilicon::SetMaxElectronEnergy(), Garfield::MediumMagboltz::SetMaxPhotonEnergy(), SetNumberDensity(), SetPressure(), Garfield::MediumSilicon::SetSaturationVelocity(), Garfield::MediumSilicon::SetSaturationVelocityModelCanali(), Garfield::MediumSilicon::SetSaturationVelocityModelMinimos(), Garfield::MediumSilicon::SetSaturationVelocityModelReggiani(), Garfield::MediumMagboltz::SetSplittingFunctionGreenSawada(), SetTemperature(), Garfield::MediumSilicon::SetTrapCrossSection(), Garfield::MediumSilicon::SetTrapDensity(), Garfield::MediumSilicon::SetTrappingTime(), Garfield::MediumCdTe::UnsetLowFieldMobility(), Garfield::MediumDiamond::UnsetLowFieldMobility(), Garfield::MediumGaAs::UnsetLowFieldMobility(), and Garfield::MediumGaN::UnsetLowFieldMobility().

◆ m_iThrDis

unsigned int Garfield::Medium::m_iThrDis = 0
protected

◆ m_microscopic

◆ m_name

◆ m_nComponents

◆ m_pressure

◆ m_tab2d

◆ m_temperature

◆ m_w

◆ m_z

double Garfield::Medium::m_z = 1.
protected

Definition at line 510 of file Medium.hh.

Referenced by GetAtomicNumber(), and SetAtomicNumber().


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