![]() |
Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
|
Calculation of drift lines based on macroscopic transport coefficients using Runge-Kutta-Fehlberg integration. More...
#include <DriftLineRKF.hh>
Public Member Functions | |
DriftLineRKF () | |
Default constructor. | |
DriftLineRKF (Sensor *sensor) | |
Constructor. | |
~DriftLineRKF () | |
Destructor. | |
void | SetSensor (Sensor *s) |
Set the sensor. | |
void | EnablePlotting (ViewDrift *view) |
Switch on drift line plotting. | |
void | DisablePlotting () |
Switch off drift line plotting. | |
void | EnableSignalCalculation (const bool on=true) |
Switch calculation of induced currents on or off (default: enabled). | |
void | SetSignalAveragingOrder (const unsigned int navg) |
Set the number of points to be used when averaging the delayed signal vector over a time bin in the Sensor class. | |
void | UseWeightingPotential (const bool on=true) |
Use the weighting potential (as opposed to the weighting field) for calculating the induced signal. | |
void | SetIntegrationAccuracy (const double eps) |
Set the accuracy of the Runge Kutta Fehlberg drift line integration. | |
void | SetMaximumStepSize (const double ms) |
Set (explicitly) the maximum step size that is allowed. | |
void | SetMaximumStepSize () |
Try to set an upper limit to the allowable step size based on the feature size of the sensor. | |
void | UnsetMaximumStepSize () |
Do not apply an upper limit to the allowable step size. | |
void | RejectKinks (const bool on=true) |
Request (or not) the drift line calculation to be aborted if the drift line makes a bend sharper than 90 degrees. | |
void | SetElectronSignalScalingFactor (const double scale) |
Set multiplication factor for the signal induced by electrons. | |
void | SetHoleSignalScalingFactor (const double scale) |
Set multiplication factor for the signal induced by holes. | |
void | SetIonSignalScalingFactor (const double scale) |
Set multiplication factor for the signal induced by ions. | |
void | EnableAvalanche (const bool on=true) |
Enable/disable simulation electron multiplication (default: on). | |
void | EnableIonTail (const bool on=true) |
Enable/disable simulation of the ion tail (default: on). | |
void | EnableNegativeIonTail (const bool on=true) |
Enable/disable simulation of the negative ion tail (default: off). | |
void | SetGainFluctuationsFixed (const double gain=-1.) |
Do not randomize the avalanche size. | |
void | SetGainFluctuationsPolya (const double theta, const double mean=-1., const bool quiet=false) |
Sample the avalanche size from a Polya distribution with shape parameter theta. | |
void | EnableTownsendMap (const bool on=true) |
Retrieve the Townsend coefficient from the component. | |
void | EnableVelocityMap (const bool on=true) |
Retrieve the drift velocity from the component. | |
bool | DriftElectron (const double x, const double y, const double z, const double t, const size_t w=1) |
Simulate the drift line of an electron with a given starting point. | |
bool | DriftHole (const double x, const double y, const double z, const double t, const size_t w=1) |
Simulate the drift line of a hole with a given starting point. | |
bool | DriftIon (const double x, const double y, const double z, const double t, const size_t w=1) |
Simulate the drift line of an ion with a given starting point. | |
bool | DriftPositron (const double x, const double y, const double z, const double t, const size_t w=1) |
Simulate the drift line of an electron with a given starting point, assuming that it has positive charge. | |
bool | DriftNegativeIon (const double x, const double y, const double z, const double t, const size_t w=1) |
Simulate the drift line of an ion with a given starting point, assuming that it has negative charge. | |
void | PrintDriftLine () const |
Print the trajectory of the most recent drift line. | |
void | GetEndPoint (double &x, double &y, double &z, double &t, int &st) const |
Get the end point and status flag of the most recent drift line. | |
size_t | GetNumberOfDriftLinePoints () const |
Get the number of points of the most recent drift line. | |
void | GetDriftLinePoint (const size_t i, double &x, double &y, double &z, double &t) const |
Get the coordinates and time of a point along the most recent drift line. | |
double | GetArrivalTimeSpread (const double eps=1.e-4) const |
Compute the sigma of the arrival time distribution for the current drift line by integrating the longitudinal diffusion coefficient. | |
double | GetGain (const double eps=1.e-4) const |
Compute the multiplication factor for the current drift line. | |
double | GetLoss (const double eps=1.e-4) const |
Compute the attachment loss factor for the current drift line. | |
double | GetDriftTime () const |
Get the cumulative drift time. | |
double | GetPathLength () const |
Get the cumulative path length. | |
void | GetAvalancheSize (double &ne, double &ni) const |
Return the number of electrons and ions in the avalanche. | |
std::pair< double, double > | GetAvalancheSize () const |
Return the number of electrons and ions in the avalanche. | |
bool | FieldLine (const double xi, const double yi, const double zi, std::vector< std::array< float, 3 > > &xl, const bool electron=true) const |
Compute an electric field line. | |
void | EnableDebugging (const bool on=true) |
Switch debugging messages on/off (default: off). |
Private Types | |
enum class | GainFluctuations { None = 0 , Polya } |
Private Member Functions | |
bool | DriftLine (const std::array< double, 3 > &x0, const double t0, const Particle particle, std::vector< double > &ts, std::vector< std::array< double, 3 > > &xs, int &status) const |
bool | Avalanche (const Particle particle, const std::vector< std::array< double, 3 > > &xs, std::vector< double > &ne, std::vector< double > &ni, std::vector< double > &nn, double &scale) const |
bool | AddIonTail (const std::vector< double > &te, const std::vector< std::array< double, 3 > > &xe, const std::vector< double > &ni, const double scale) const |
bool | AddNegativeIonTail (const std::vector< double > &te, const std::vector< std::array< double, 3 > > &xe, const std::vector< double > &nn, const double scale) const |
int | GetField (const std::array< double, 3 > &x, double &ex, double &ey, double &ez, double &bx, double &by, double &bz, Medium *&medium) const |
std::array< double, 3 > | GetVelocity (const std::array< double, 3 > &x, const Particle particle, int &status) const |
bool | GetDiffusion (const std::array< double, 3 > &x, const Particle particle, double &dl, double &dt) const |
double | GetVar (const std::array< double, 3 > &x, const Particle particle) const |
double | GetAlpha (const std::array< double, 3 > &x, const Particle particle) const |
double | GetEta (const std::array< double, 3 > &x, const Particle particle) const |
bool | Terminate (const std::array< double, 3 > &xx0, const std::array< double, 3 > &xx1, const Particle particle, std::vector< double > &ts, std::vector< std::array< double, 3 > > &xs) const |
bool | DriftToWire (const double xw, const double yw, const double rw, const Particle particle, std::vector< double > &ts, std::vector< std::array< double, 3 > > &xs, int &stat) const |
double | ComputeSigma (const std::vector< std::array< double, 3 > > &x, const Particle particle, const double eps) const |
double | ComputeGain (const std::vector< std::array< double, 3 > > &x, const Particle particle, const double eps) const |
double | ComputeLoss (const std::vector< std::array< double, 3 > > &x, const Particle particle, const double eps) const |
double | IntegrateDiffusion (const std::array< double, 3 > &xi, const std::array< double, 3 > &xe, const Particle particle, const double tol) const |
double | IntegrateAlpha (const std::array< double, 3 > &xi, const std::array< double, 3 > &xe, const Particle particle, const double tol) const |
double | IntegrateEta (const std::array< double, 3 > &xi, const std::array< double, 3 > &xe, const Particle particle, const double tol) const |
void | ComputeSignal (const Particle particle, const double scale, const std::vector< double > &ts, const std::vector< std::array< double, 3 > > &xs, const std::vector< double > &ne) const |
void | Terminate (const std::array< double, 3 > &xx0, const std::array< double, 3 > &xx1, std::vector< std::array< float, 3 > > &xs) const |
Static Private Member Functions | |
static double | Charge (const Particle particle) |
Private Attributes | |
std::string | m_className = "DriftLineRKF" |
Sensor * | m_sensor = nullptr |
Particle | m_particle = Particle::Electron |
double | m_maxStepSize = 0. |
double | m_accuracy = 1.e-8 |
bool | m_rejectKinks = true |
bool | m_useStepSizeLimit = false |
ViewDrift * | m_view = nullptr |
std::vector< std::array< double, 3 > > | m_x |
std::vector< double > | m_t |
int | m_status = 0 |
bool | m_doSignal = true |
unsigned int | m_navg = 2 |
bool | m_useWeightingPotential = true |
double | m_scaleE = 1. |
double | m_scaleH = 1. |
double | m_scaleI = 1. |
bool | m_useVelocityMap = false |
bool | m_useTownsendMap = false |
bool | m_doAvalanche = true |
GainFluctuations | m_gainFluctuations = GainFluctuations::None |
double | m_theta = 0. |
double | m_gain = -1. |
bool | m_doIonTail = true |
bool | m_doIonTailAuto = true |
bool | m_doNegativeIonTail = false |
double | m_nE = 0. |
double | m_nI = 0. |
bool | m_debug = false |
Calculation of drift lines based on macroscopic transport coefficients using Runge-Kutta-Fehlberg integration.
Definition at line 18 of file DriftLineRKF.hh.
|
strongprivate |
|
inline |
Garfield::DriftLineRKF::DriftLineRKF | ( | Sensor * | sensor | ) |
Constructor.
|
inline |
|
private |
|
private |
|
private |
|
inlinestaticprivate |
Definition at line 301 of file DriftLineRKF.hh.
|
private |
|
private |
|
private |
|
private |
void Garfield::DriftLineRKF::DisablePlotting | ( | ) |
Switch off drift line plotting.
bool Garfield::DriftLineRKF::DriftElectron | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | t, | ||
const size_t | w = 1 ) |
Simulate the drift line of an electron with a given starting point.
bool Garfield::DriftLineRKF::DriftHole | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | t, | ||
const size_t | w = 1 ) |
Simulate the drift line of a hole with a given starting point.
bool Garfield::DriftLineRKF::DriftIon | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | t, | ||
const size_t | w = 1 ) |
Simulate the drift line of an ion with a given starting point.
|
private |
bool Garfield::DriftLineRKF::DriftNegativeIon | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | t, | ||
const size_t | w = 1 ) |
Simulate the drift line of an ion with a given starting point, assuming that it has negative charge.
bool Garfield::DriftLineRKF::DriftPositron | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | t, | ||
const size_t | w = 1 ) |
Simulate the drift line of an electron with a given starting point, assuming that it has positive charge.
|
private |
|
inline |
Enable/disable simulation electron multiplication (default: on).
Definition at line 70 of file DriftLineRKF.hh.
|
inline |
Switch debugging messages on/off (default: off).
Definition at line 152 of file DriftLineRKF.hh.
|
inline |
Enable/disable simulation of the ion tail (default: on).
Definition at line 72 of file DriftLineRKF.hh.
|
inline |
Enable/disable simulation of the negative ion tail (default: off).
Definition at line 77 of file DriftLineRKF.hh.
void Garfield::DriftLineRKF::EnablePlotting | ( | ViewDrift * | view | ) |
Switch on drift line plotting.
|
inline |
Switch calculation of induced currents on or off (default: enabled).
Definition at line 36 of file DriftLineRKF.hh.
|
inline |
Retrieve the Townsend coefficient from the component.
Definition at line 86 of file DriftLineRKF.hh.
|
inline |
Retrieve the drift velocity from the component.
Definition at line 88 of file DriftLineRKF.hh.
bool Garfield::DriftLineRKF::FieldLine | ( | const double | xi, |
const double | yi, | ||
const double | zi, | ||
std::vector< std::array< float, 3 > > & | xl, | ||
const bool | electron = true ) const |
Compute an electric field line.
xi,yi,zi | starting point |
xl | points along the field line |
electron | flag to set the direction in which to follow the field |
|
private |
double Garfield::DriftLineRKF::GetArrivalTimeSpread | ( | const double | eps = 1.e-4 | ) | const |
Compute the sigma of the arrival time distribution for the current drift line by integrating the longitudinal diffusion coefficient.
|
inline |
Return the number of electrons and ions in the avalanche.
Definition at line 138 of file DriftLineRKF.hh.
|
inline |
Return the number of electrons and ions in the avalanche.
Definition at line 133 of file DriftLineRKF.hh.
|
private |
void Garfield::DriftLineRKF::GetDriftLinePoint | ( | const size_t | i, |
double & | x, | ||
double & | y, | ||
double & | z, | ||
double & | t ) const |
Get the coordinates and time of a point along the most recent drift line.
|
inline |
void Garfield::DriftLineRKF::GetEndPoint | ( | double & | x, |
double & | y, | ||
double & | z, | ||
double & | t, | ||
int & | st ) const |
Get the end point and status flag of the most recent drift line.
|
private |
|
private |
double Garfield::DriftLineRKF::GetGain | ( | const double | eps = 1.e-4 | ) | const |
Compute the multiplication factor for the current drift line.
double Garfield::DriftLineRKF::GetLoss | ( | const double | eps = 1.e-4 | ) | const |
Compute the attachment loss factor for the current drift line.
|
inline |
Get the number of points of the most recent drift line.
Definition at line 113 of file DriftLineRKF.hh.
double Garfield::DriftLineRKF::GetPathLength | ( | ) | const |
Get the cumulative path length.
|
private |
|
private |
|
private |
|
private |
|
private |
void Garfield::DriftLineRKF::PrintDriftLine | ( | ) | const |
Print the trajectory of the most recent drift line.
|
inline |
Request (or not) the drift line calculation to be aborted if the drift line makes a bend sharper than 90 degrees.
Definition at line 60 of file DriftLineRKF.hh.
|
inline |
Set multiplication factor for the signal induced by electrons.
Definition at line 63 of file DriftLineRKF.hh.
void Garfield::DriftLineRKF::SetGainFluctuationsFixed | ( | const double | gain = -1. | ) |
Do not randomize the avalanche size.
void Garfield::DriftLineRKF::SetGainFluctuationsPolya | ( | const double | theta, |
const double | mean = -1., | ||
const bool | quiet = false ) |
Sample the avalanche size from a Polya distribution with shape parameter theta.
|
inline |
Set multiplication factor for the signal induced by holes.
Definition at line 65 of file DriftLineRKF.hh.
void Garfield::DriftLineRKF::SetIntegrationAccuracy | ( | const double | eps | ) |
Set the accuracy of the Runge Kutta Fehlberg drift line integration.
|
inline |
Set multiplication factor for the signal induced by ions.
Definition at line 67 of file DriftLineRKF.hh.
void Garfield::DriftLineRKF::SetMaximumStepSize | ( | ) |
Try to set an upper limit to the allowable step size based on the feature size of the sensor.
void Garfield::DriftLineRKF::SetMaximumStepSize | ( | const double | ms | ) |
Set (explicitly) the maximum step size that is allowed.
void Garfield::DriftLineRKF::SetSensor | ( | Sensor * | s | ) |
Set the sensor.
|
inline |
Set the number of points to be used when averaging the delayed signal vector over a time bin in the Sensor class.
The averaging is done with a
Definition at line 41 of file DriftLineRKF.hh.
|
private |
|
private |
|
inline |
Do not apply an upper limit to the allowable step size.
Definition at line 57 of file DriftLineRKF.hh.
|
inline |
Use the weighting potential (as opposed to the weighting field) for calculating the induced signal.
By default, the weighting potential is used.
Definition at line 45 of file DriftLineRKF.hh.
|
private |
Definition at line 166 of file DriftLineRKF.hh.
|
private |
Definition at line 155 of file DriftLineRKF.hh.
|
private |
Definition at line 221 of file DriftLineRKF.hh.
|
private |
Definition at line 202 of file DriftLineRKF.hh.
|
private |
Definition at line 212 of file DriftLineRKF.hh.
|
private |
Definition at line 214 of file DriftLineRKF.hh.
|
private |
Definition at line 216 of file DriftLineRKF.hh.
|
private |
Definition at line 183 of file DriftLineRKF.hh.
|
private |
Definition at line 209 of file DriftLineRKF.hh.
|
private |
Definition at line 205 of file DriftLineRKF.hh.
|
private |
Definition at line 164 of file DriftLineRKF.hh.
|
private |
Definition at line 185 of file DriftLineRKF.hh.
|
private |
Definition at line 218 of file DriftLineRKF.hh.
|
private |
Definition at line 218 of file DriftLineRKF.hh.
|
private |
Definition at line 161 of file DriftLineRKF.hh.
|
private |
Definition at line 168 of file DriftLineRKF.hh.
|
private |
Definition at line 190 of file DriftLineRKF.hh.
|
private |
Definition at line 192 of file DriftLineRKF.hh.
|
private |
Definition at line 194 of file DriftLineRKF.hh.
|
private |
Definition at line 158 of file DriftLineRKF.hh.
|
private |
Definition at line 180 of file DriftLineRKF.hh.
|
private |
Definition at line 178 of file DriftLineRKF.hh.
|
private |
Definition at line 207 of file DriftLineRKF.hh.
|
private |
Definition at line 170 of file DriftLineRKF.hh.
|
private |
Definition at line 199 of file DriftLineRKF.hh.
|
private |
Definition at line 197 of file DriftLineRKF.hh.
|
private |
Definition at line 187 of file DriftLineRKF.hh.
|
private |
Definition at line 173 of file DriftLineRKF.hh.
|
private |
Definition at line 176 of file DriftLineRKF.hh.