![]() |
Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
|
Base class for gas media. More...
#include <MediumGas.hh>
Classes | |
struct | ExcLevel |
struct | IonLevel |
Public Member Functions | |
MediumGas () | |
Constructor. | |
virtual | ~MediumGas () |
Destructor. | |
bool | SetComposition (const std::string &gas1, const double f1=1., const std::string &gas2="", const double f2=0., const std::string &gas3="", const double f3=0., const std::string &gas4="", const double f4=0., const std::string &gas5="", const double f5=0., const std::string &gas6="", const double f6=0.) |
Set the gas mixture. | |
void | GetComposition (std::string &gas1, double &f1, std::string &gas2, double &f2, std::string &gas3, double &f3, std::string &gas4, double &f4, std::string &gas5, double &f5, std::string &gas6, double &f6) const |
Retrieve the gas mixture. | |
bool | LoadGasFile (const std::string &filename, const bool quiet=false) |
Read table of gas properties (transport parameters) from file. | |
bool | WriteGasFile (const std::string &filename) |
Save the present table of gas properties (transport parameters) to a file. | |
bool | MergeGasFile (const std::string &filename, const bool replaceOld) |
Read table of gas properties from and merge with the existing dataset. | |
virtual bool | EnablePenningTransfer () |
Switch on simulation of Penning transfers, using pre-implemented parameterisations of the transfer probability (if available). | |
virtual bool | EnablePenningTransfer (const double r, const double lambda) |
Switch on simulation of Penning transfers by means of transfer probabilities, for all excitation levels in the mixture. | |
virtual bool | EnablePenningTransfer (const double r, const double lambda, std::string gasname) |
Switch on simulation of Penning transfers by means of transfer probabilities, for all excitations of a given component. | |
virtual void | DisablePenningTransfer () |
Switch the simulation of Penning transfers off globally. | |
virtual bool | DisablePenningTransfer (std::string gasname) |
Switch the simulation of Penning transfers off for a given component. | |
bool | GetPenningTransfer (const std::string &gasname, double &r, double &lambda) |
Retrieve the Penning transfer probability and distance for a specific component. | |
virtual void | PrintGas () |
Print information about the present gas mixture and available data. | |
bool | LoadIonMobility (const std::string &filename, const bool quiet=false) |
Read a table of (positive) ion mobilities vs. electric field from file. | |
bool | LoadNegativeIonMobility (const std::string &filename, const bool quiet=false) |
Read a table of negative ion mobilities vs. electric field from file. | |
bool | AdjustTownsendCoefficient () |
Adjust the Townsend coefficient using the excitation and ionisation rates stored in the gas table and the Penning transfer probabilities. | |
size_t | GetNumberOfIonisationLevels () const |
Return the number of ionisation levels in the table. | |
size_t | GetNumberOfExcitationLevels () const |
Return the number of excitation levels in the table. | |
void | GetIonisationLevel (const size_t level, std::string &label, double &energy) const |
Return the identifier and threshold of an ionisation level. | |
void | GetExcitationLevel (const size_t level, std::string &label, double &energy) const |
Return the identifier and energy of an excitation level. | |
bool | GetElectronIonisationRate (const size_t level, const size_t ie, const size_t ib, const size_t ia, double &f) const |
Get an entry in the table of ionisation rates. | |
bool | GetElectronExcitationRate (const size_t level, const size_t ie, const size_t ib, const size_t ia, double &f) const |
Get an entry in the table of excitation rates. | |
bool | IsGas () const override |
void | GetComponent (const unsigned int i, std::string &label, double &f) override |
void | SetAtomicNumber (const double z) override |
double | GetAtomicNumber () const override |
void | SetAtomicWeight (const double a) override |
double | GetAtomicWeight () const override |
void | SetNumberDensity (const double n) override |
double | GetNumberDensity () const override |
void | SetMassDensity (const double rho) override |
double | GetMassDensity () const override |
void | ResetTables () override |
void | SetExtrapolationMethodExcitationRates (const std::string &low, const std::string &high) |
void | SetExtrapolationMethodIonisationRates (const std::string &low, const std::string &high) |
void | SetInterpolationMethodExcitationRates (const unsigned int intrp) |
void | SetInterpolationMethodIonisationRates (const unsigned int intrp) |
double | ScaleElectricField (const double e) const override |
double | UnScaleElectricField (const double e) const override |
double | ScaleDiffusion (const double d) const override |
double | ScaleDiffusionTensor (const double d) const override |
double | ScaleTownsend (const double alpha) const override |
double | ScaleAttachment (const double eta) const override |
double | ScaleLorentzAngle (const double lor) const override |
bool | GetPhotoAbsorptionCrossSection (const double e, double &sigma, const unsigned int i) override |
virtual double | CreateGPUTransferObject (MediumGPU *&med_gpu) override |
Create and initialise GPU Transfer class. |
Static Public Member Functions | |
static void | PrintGases () |
Print a list of all available gases. |
Protected Member Functions | |
bool | LoadMobility (const std::string &filename, const bool quiet, const bool negative) |
bool | ReadHeader (std::ifstream &gasfile, int &version, std::bitset< 20 > &gasok, bool &is3d, std::vector< double > &mixture, std::vector< double > &efields, std::vector< double > &bfields, std::vector< double > &angles, std::vector< ExcLevel > &excLevels, std::vector< IonLevel > &ionLevels) |
void | ReadFooter (std::ifstream &gasfile, std::array< unsigned int, 13 > &extrapH, std::array< unsigned int, 13 > &extrapL, std::array< unsigned int, 13 > &interp, unsigned int &thrAlp, unsigned int &thrAtt, unsigned int &thrDis, double &ionDiffL, double &ionDiffT, double &pgas, double &tgas) |
void | ReadRecord3D (std::ifstream &gasfile, double &ve, double &vb, double &vx, double &dl, double &dt, double &alpha, double &alpha0, double &eta, double &mu, double &lor, double &dis, std::array< double, 6 > &dif, std::vector< double > &rexc, std::vector< double > &rion, std::bitset< 20 > gasok) |
void | ReadRecord1D (std::ifstream &gasfile, double &ve, double &vb, double &vx, double &wv, double &wr, double &dl, double &dt, double &alpha, double &alpha0, double &eta, double &riontof, double &ratttof, double &mu, double &lor, double &dis, std::array< double, 6 > &dif, std::vector< double > &rexc, std::vector< double > &rion, std::bitset< 20 > gasok) |
void | InsertE (const int ie, const int ne, const int nb, const int na) |
void | InsertB (const int ib, const int ne, const int nb, const int na) |
void | InsertA (const int ia, const int ne, const int nb, const int na) |
void | ZeroRowE (const int ie, const int nb, const int na) |
void | ZeroRowB (const int ib, const int ne, const int na) |
void | ZeroRowA (const int ia, const int ne, const int nb) |
bool | GetMixture (const std::vector< double > &mixture, const int version, std::vector< std::string > &gasnames, std::vector< double > &percentages) const |
void | GetGasBits (std::bitset< 20 > &gasok) const |
Static Protected Member Functions | |
static bool | GetGasInfo (const std::string &gasname, double &a, double &z, double &w, double &f) |
static std::string | GetGasName (const int gasnumber, const int version) |
static std::string | GetGasName (std::string input) |
static int | GetGasNumberGasFile (const std::string &input) |
static const std::vector< std::string > | GetAliases (const std::string &gas) |
Protected Attributes | |
std::array< std::string, m_nMaxGases > | m_gas |
std::array< double, m_nMaxGases > | m_fraction |
std::array< double, m_nMaxGases > | m_atWeight |
std::array< double, m_nMaxGases > | m_atNum |
bool | m_usePenning = false |
double | m_rPenningGlobal = 0. |
double | m_lambdaPenningGlobal = 0. |
std::array< double, m_nMaxGases > | m_rPenningGas |
std::array< double, m_nMaxGases > | m_lambdaPenningGas |
double | m_pressureTable |
double | m_temperatureTable |
std::vector< std::vector< std::vector< double > > > | m_eAlp0 |
std::vector< std::vector< std::vector< std::vector< double > > > > | m_excRates |
std::vector< std::vector< std::vector< std::vector< double > > > > | m_ionRates |
std::vector< ExcLevel > | m_excLevels |
std::vector< IonLevel > | m_ionLevels |
std::pair< unsigned int, unsigned int > | m_extrExc = {0, 1} |
std::pair< unsigned int, unsigned int > | m_extrIon = {0, 1} |
unsigned int | m_intpExc = 2 |
unsigned int | m_intpIon = 2 |
Static Protected Attributes | |
static constexpr unsigned int | m_nMaxGases = 6 |
Base class for gas media.
Definition at line 25 of file MediumGas.hh.
Garfield::MediumGas::MediumGas | ( | ) |
Constructor.
|
inlinevirtual |
bool Garfield::MediumGas::AdjustTownsendCoefficient | ( | ) |
Adjust the Townsend coefficient using the excitation and ionisation rates stored in the gas table and the Penning transfer probabilities.
|
overridevirtual |
Create and initialise GPU Transfer class.
Reimplemented in Garfield::MediumMagboltz.
|
virtual |
Switch the simulation of Penning transfers off globally.
Reimplemented in Garfield::MediumMagboltz.
|
virtual |
Switch the simulation of Penning transfers off for a given component.
Reimplemented in Garfield::MediumMagboltz.
|
virtual |
Switch on simulation of Penning transfers, using pre-implemented parameterisations of the transfer probability (if available).
Reimplemented in Garfield::MediumMagboltz.
|
virtual |
Switch on simulation of Penning transfers by means of transfer probabilities, for all excitation levels in the mixture.
r | transfer probability [0, 1] |
lambda | parameter for sampling the distance of the Penning electron with respect to the excitation. |
Reimplemented in Garfield::MediumMagboltz.
|
virtual |
Switch on simulation of Penning transfers by means of transfer probabilities, for all excitations of a given component.
Reimplemented in Garfield::MediumMagboltz.
|
staticprotected |
|
override |
|
override |
|
override |
void Garfield::MediumGas::GetComposition | ( | std::string & | gas1, |
double & | f1, | ||
std::string & | gas2, | ||
double & | f2, | ||
std::string & | gas3, | ||
double & | f3, | ||
std::string & | gas4, | ||
double & | f4, | ||
std::string & | gas5, | ||
double & | f5, | ||
std::string & | gas6, | ||
double & | f6 ) const |
Retrieve the gas mixture.
bool Garfield::MediumGas::GetElectronExcitationRate | ( | const size_t | level, |
const size_t | ie, | ||
const size_t | ib, | ||
const size_t | ia, | ||
double & | f ) const |
Get an entry in the table of excitation rates.
bool Garfield::MediumGas::GetElectronIonisationRate | ( | const size_t | level, |
const size_t | ie, | ||
const size_t | ib, | ||
const size_t | ia, | ||
double & | f ) const |
Get an entry in the table of ionisation rates.
void Garfield::MediumGas::GetExcitationLevel | ( | const size_t | level, |
std::string & | label, | ||
double & | energy ) const |
Return the identifier and energy of an excitation level.
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
void Garfield::MediumGas::GetIonisationLevel | ( | const size_t | level, |
std::string & | label, | ||
double & | energy ) const |
Return the identifier and threshold of an ionisation level.
|
override |
|
protected |
|
override |
|
inline |
|
inline |
bool Garfield::MediumGas::GetPenningTransfer | ( | const std::string & | gasname, |
double & | r, | ||
double & | lambda ) |
Retrieve the Penning transfer probability and distance for a specific component.
|
override |
|
protected |
|
protected |
|
protected |
|
inlineoverride |
Definition at line 110 of file MediumGas.hh.
bool Garfield::MediumGas::LoadGasFile | ( | const std::string & | filename, |
const bool | quiet = false ) |
Read table of gas properties (transport parameters) from file.
bool Garfield::MediumGas::LoadIonMobility | ( | const std::string & | filename, |
const bool | quiet = false ) |
Read a table of (positive) ion mobilities vs. electric field from file.
|
protected |
bool Garfield::MediumGas::LoadNegativeIonMobility | ( | const std::string & | filename, |
const bool | quiet = false ) |
Read a table of negative ion mobilities vs. electric field from file.
bool Garfield::MediumGas::MergeGasFile | ( | const std::string & | filename, |
const bool | replaceOld ) |
Read table of gas properties from and merge with the existing dataset.
|
virtual |
Print information about the present gas mixture and available data.
Reimplemented in Garfield::MediumMagboltz.
|
static |
Print a list of all available gases.
|
protected |
|
protected |
|
protected |
|
protected |
|
override |
|
inlineoverride |
Definition at line 158 of file MediumGas.hh.
|
inlineoverride |
Definition at line 149 of file MediumGas.hh.
|
inlineoverride |
Definition at line 152 of file MediumGas.hh.
|
inlineoverride |
Definition at line 143 of file MediumGas.hh.
|
inlineoverride |
Definition at line 161 of file MediumGas.hh.
|
inlineoverride |
Definition at line 155 of file MediumGas.hh.
|
override |
|
override |
bool Garfield::MediumGas::SetComposition | ( | const std::string & | gas1, |
const double | f1 = 1., | ||
const std::string & | gas2 = "", | ||
const double | f2 = 0., | ||
const std::string & | gas3 = "", | ||
const double | f3 = 0., | ||
const std::string & | gas4 = "", | ||
const double | f4 = 0., | ||
const std::string & | gas5 = "", | ||
const double | f5 = 0., | ||
const std::string & | gas6 = "", | ||
const double | f6 = 0. ) |
Set the gas mixture.
|
inline |
Definition at line 126 of file MediumGas.hh.
|
inline |
Definition at line 130 of file MediumGas.hh.
|
inline |
Definition at line 134 of file MediumGas.hh.
|
inline |
Definition at line 137 of file MediumGas.hh.
|
override |
|
override |
|
inlineoverride |
Definition at line 146 of file MediumGas.hh.
bool Garfield::MediumGas::WriteGasFile | ( | const std::string & | filename | ) |
Save the present table of gas properties (transport parameters) to a file.
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 181 of file MediumGas.hh.
|
protected |
Definition at line 180 of file MediumGas.hh.
|
protected |
Definition at line 201 of file MediumGas.hh.
|
protected |
Definition at line 215 of file MediumGas.hh.
|
protected |
Definition at line 204 of file MediumGas.hh.
|
protected |
Definition at line 224 of file MediumGas.hh.
|
protected |
Definition at line 225 of file MediumGas.hh.
|
protected |
Definition at line 179 of file MediumGas.hh.
|
protected |
Definition at line 178 of file MediumGas.hh.
|
protected |
Definition at line 226 of file MediumGas.hh.
|
protected |
Definition at line 227 of file MediumGas.hh.
|
protected |
Definition at line 221 of file MediumGas.hh.
|
protected |
Definition at line 205 of file MediumGas.hh.
|
protected |
Definition at line 193 of file MediumGas.hh.
|
protected |
Definition at line 189 of file MediumGas.hh.
|
staticconstexprprotected |
Definition at line 174 of file MediumGas.hh.
|
protected |
Definition at line 196 of file MediumGas.hh.
|
protected |
Definition at line 191 of file MediumGas.hh.
|
protected |
Definition at line 187 of file MediumGas.hh.
|
protected |
Definition at line 198 of file MediumGas.hh.
|
protected |
Definition at line 185 of file MediumGas.hh.