![]() |
Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
|
Generate tracks based on SRIM energy loss, range and straggling tables. More...
#include <TrackSrim.hh>
Classes | |
| struct | Cluster |
Public Member Functions | |
| TrackSrim () | |
| Default constructor. | |
| TrackSrim (Sensor *sensor) | |
| Constructor. | |
| virtual | ~TrackSrim () |
| Destructor. | |
| bool | ReadFile (const std::string &file) |
| Load data from a SRIM file. | |
| void | Print () |
| Print the energy loss table. | |
| void | PlotEnergyLoss () |
| Plot the electromagnetic, hadronic, and total energy loss as function of the projectile energy. | |
| void | PlotRange () |
| Plot the projected range as function of the projectile energy. | |
| void | PlotStraggling () |
| Plot the transverse and longitudinal straggling as function of the projectile energy. | |
| void | SetModel (const int m) |
| Set the fluctuation model (0 = none, 1 = Landau, 2 = Vavilov, 3 = Gaussian, 4 = Combined). | |
| int | GetModel () const |
| Get the fluctuation model. | |
| void | SetTargetClusterSize (const int n) |
| Specify how many electrons should be grouped to a cluster. | |
| int | GetTargetClusterSize () const |
| Retrieve the target cluster size. | |
| void | SetClustersMaximum (const int n) |
| Set the max. number of clusters on a track. | |
| int | GetClustersMaximum () const |
| Retrieve the max. number of clusters on a track. | |
| void | SetWorkFunction (const double w) |
| Set the W value [eV]. | |
| double | GetWorkFunction () const |
| Get the W value [eV]. | |
| void | SetFanoFactor (const double f) |
| Set the Fano factor. | |
| void | UnsetFanoFactor () |
| Use the default Fano factor. | |
| double | GetFanoFactor () const |
| Get the Fano factor. | |
| void | SetDensity (const double density) |
| Set the density [g/cm3] of the target medium. | |
| double | GetDensity () const |
| Get the density [g/cm3] of the target medium. | |
| void | SetAtomicMassNumbers (const double a, const double z) |
| Set A and Z of the target medium. | |
| void | GetAtomicMassMumbers (double &a, double &z) const |
| Get A and Z of the target medium. | |
| void | EnableTransverseStraggling (const bool on=true) |
| Simulate transverse straggling (default: on). | |
| void | EnableLongitudinalStraggling (const bool on=true) |
| Simulate longitudinal straggling (default: off). | |
| bool | NewTrack (const double x0, const double y0, const double z0, const double t0, const double dx0, const double dy0, const double dz0) override |
| Calculate a new track starting from (x0, y0, z0) at time t0 in direction (dx0, dy0, dz0). | |
| const std::vector< Cluster > & | GetClusters () const |
| bool | GetCluster (double &xc, double &yc, double &zc, double &tc, int &nc, double &ec, double &extra) |
| Public Member Functions inherited from Garfield::Track | |
| Track ()=delete | |
| Default constructor. | |
| Track (const std::string &name) | |
| Constructor. | |
| virtual | ~Track () |
| Destructor. | |
| virtual void | SetParticle (const std::string &part) |
| Set the type of charged particle. | |
| void | SetEnergy (const double e) |
| Set the particle energy. | |
| void | SetBetaGamma (const double bg) |
| Set the relative momentum of the particle. | |
| void | SetBeta (const double beta) |
| Set the speed ( | |
| void | SetGamma (const double gamma) |
| Set the Lorentz factor of the particle. | |
| void | SetMomentum (const double p) |
| Set the particle momentum. | |
| void | SetKineticEnergy (const double ekin) |
| Set the kinetic energy of the particle. | |
| double | GetEnergy () const |
| Return the particle energy. | |
| double | GetBetaGamma () const |
| Return the | |
| double | GetBeta () const |
| Return the speed ( | |
| double | GetGamma () const |
| Return the Lorentz factor of the projectile. | |
| double | GetMomentum () const |
| Return the particle momentum. | |
| double | GetKineticEnergy () const |
| Return the kinetic energy of the projectile. | |
| double | GetCharge () const |
| Get the charge of the projectile. | |
| double | GetMass () const |
| Get the mass [eV / c2] of the projectile. | |
| void | SetSensor (Sensor *s) |
| Set the sensor through which to transport the particle. | |
| virtual double | GetClusterDensity () |
| Get the cluster density (number of ionizing collisions per cm or inverse mean free path for ionization). | |
| virtual double | GetStoppingPower () |
| Get the stopping power (mean energy loss [eV] per cm). | |
| void | EnablePlotting (ViewDrift *viewer) |
| Switch on plotting. | |
| void | DisablePlotting () |
| Switch off plotting. | |
| void | EnableDebugging () |
| Switch on debugging messages. | |
| void | DisableDebugging () |
| Switch off debugging messages. | |
Protected Member Functions | |
| double | Xi (const double x, const double beta2, const double edens) const |
| double | DedxEM (const double e) const |
| double | DedxHD (const double e) const |
| bool | PreciseLoss (const double step, const double estart, double &deem, double &dehd) const |
| bool | EstimateRange (const double ekin, const double step, double &stpmax) const |
| bool | SmallestStep (const double ekin, const double edens, double de, double step, double &stpmin) |
| Medium * | GetMedium (const std::array< double, 3 > &x) const |
| double | Terminate (const std::array< double, 3 > &x0, const std::array< double, 3 > &v0, const double step0) const |
| double | TerminateBfield (const std::array< double, 3 > &x0, const std::array< double, 3 > &v0, const double dt0, const double vmag) const |
| double | RndmEnergyLoss (const double ekin, const double de, const double step, const double edens) const |
| Protected Member Functions inherited from Garfield::Track | |
| void | PlotNewTrack (const double x0, const double y0, const double z0) |
| void | PlotCluster (const double x0, const double y0, const double z0) |
Protected Attributes | |
| bool | m_useTransStraggle = true |
| Include transverse straggling. | |
| bool | m_useLongStraggle = false |
| Include longitudinal straggling. | |
| bool | m_chargeset = false |
| Has the charge been defined? | |
| double | m_qion = 1. |
| Charge of the projectile. | |
| double | m_mion = -1. |
| Mass [MeV] of the projectile. | |
| double | m_rho = -1. |
| Mass density [g/cm3] of the target. | |
| double | m_work = -1. |
| Work function [eV] of the target. | |
| bool | m_fset = false |
| Has the Fano factor been set? | |
| double | m_fano = -1. |
| Fano factor [-] of the target. | |
| double | m_a = -1. |
| Effective A of the target. | |
| double | m_z = -1. |
| Effective Z of the target. | |
| int | m_maxclusters = -1 |
| Maximum number of clusters allowed (infinite if 0) | |
| std::vector< double > | m_ekin |
| Energy in energy loss table [MeV]. | |
| std::vector< double > | m_emloss |
| EM energy loss [MeV cm2/g]. | |
| std::vector< double > | m_hdloss |
| Hadronic energy loss [MeV cm2/g]. | |
| std::vector< double > | m_range |
| Projected range [cm]. | |
| std::vector< double > | m_transstraggle |
| Transverse straggling [cm]. | |
| std::vector< double > | m_longstraggle |
| Longitudinal straggling [cm]. | |
| size_t | m_currcluster = 0 |
| Index of the next cluster to be returned. | |
| unsigned int | m_model = 4 |
| Fluctuation model (0 = none, 1 = Landau, 2 = Vavilov, 3 = Gaussian, 4 = Combined) | |
| int | m_nsize = -1 |
| Targeted cluster size. | |
| std::vector< Cluster > | m_clusters |
| Protected Attributes inherited from Garfield::Track | |
| std::string | m_className = "Track" |
| double | m_q = -1. |
| int | m_spin = 1 |
| double | m_mass |
| double | m_energy = 0. |
| double | m_beta2 = 1. |
| bool | m_isElectron = false |
| std::string | m_particleName = "mu-" |
| Sensor * | m_sensor = nullptr |
| bool | m_isChanged = true |
| ViewDrift * | m_viewer = nullptr |
| bool | m_debug = false |
| size_t | m_plotId = 0 |
Additional Inherited Members | |
| Static Protected Member Functions inherited from Garfield::Track | |
| static std::array< double, 3 > | StepBfield (const double dt, const double qoverm, const double vmag, double bx, double by, double bz, std::array< double, 3 > &dir) |
Generate tracks based on SRIM energy loss, range and straggling tables.
Definition at line 14 of file TrackSrim.hh.
|
inline |
| Garfield::TrackSrim::TrackSrim | ( | Sensor * | sensor | ) |
Constructor.
|
inlinevirtual |
|
protected |
|
protected |
|
inline |
Simulate longitudinal straggling (default: off).
Definition at line 86 of file TrackSrim.hh.
|
inline |
Simulate transverse straggling (default: on).
Definition at line 82 of file TrackSrim.hh.
|
protected |
|
inline |
| bool Garfield::TrackSrim::GetCluster | ( | double & | xc, |
| double & | yc, | ||
| double & | zc, | ||
| double & | tc, | ||
| int & | nc, | ||
| double & | ec, | ||
| double & | extra ) |
|
inline |
Definition at line 100 of file TrackSrim.hh.
|
inline |
Retrieve the max. number of clusters on a track.
Definition at line 51 of file TrackSrim.hh.
|
inline |
Get the density [g/cm3] of the target medium.
Definition at line 69 of file TrackSrim.hh.
|
inline |
|
protected |
|
inline |
Get the fluctuation model.
Definition at line 41 of file TrackSrim.hh.
|
inline |
|
inline |
Get the W value [eV].
Definition at line 56 of file TrackSrim.hh.
|
overridevirtual |
Calculate a new track starting from (x0, y0, z0) at time t0 in direction (dx0, dy0, dz0).
Implements Garfield::Track.
| void Garfield::TrackSrim::PlotEnergyLoss | ( | ) |
Plot the electromagnetic, hadronic, and total energy loss as function of the projectile energy.
| void Garfield::TrackSrim::PlotRange | ( | ) |
Plot the projected range as function of the projectile energy.
| void Garfield::TrackSrim::PlotStraggling | ( | ) |
Plot the transverse and longitudinal straggling as function of the projectile energy.
|
protected |
| void Garfield::TrackSrim::Print | ( | ) |
Print the energy loss table.
| bool Garfield::TrackSrim::ReadFile | ( | const std::string & | file | ) |
Load data from a SRIM file.
|
protected |
|
inline |
Set A and Z of the target medium.
Definition at line 71 of file TrackSrim.hh.
|
inline |
Set the max. number of clusters on a track.
Definition at line 49 of file TrackSrim.hh.
|
inline |
Set the density [g/cm3] of the target medium.
Definition at line 67 of file TrackSrim.hh.
|
inline |
|
inline |
Set the fluctuation model (0 = none, 1 = Landau, 2 = Vavilov, 3 = Gaussian, 4 = Combined).
By default, the combined model (4) is used.
Definition at line 39 of file TrackSrim.hh.
|
inline |
Specify how many electrons should be grouped to a cluster.
Definition at line 44 of file TrackSrim.hh.
|
inline |
|
protected |
|
protected |
|
protected |
|
inline |
|
protected |
|
protected |
Effective A of the target.
Definition at line 125 of file TrackSrim.hh.
|
protected |
Has the charge been defined?
Definition at line 111 of file TrackSrim.hh.
|
protected |
Definition at line 151 of file TrackSrim.hh.
|
protected |
Index of the next cluster to be returned.
Definition at line 145 of file TrackSrim.hh.
|
protected |
Energy in energy loss table [MeV].
Definition at line 132 of file TrackSrim.hh.
|
protected |
EM energy loss [MeV cm2/g].
Definition at line 134 of file TrackSrim.hh.
|
protected |
Fano factor [-] of the target.
Definition at line 123 of file TrackSrim.hh.
|
protected |
Has the Fano factor been set?
Definition at line 121 of file TrackSrim.hh.
|
protected |
Hadronic energy loss [MeV cm2/g].
Definition at line 136 of file TrackSrim.hh.
|
protected |
Longitudinal straggling [cm].
Definition at line 142 of file TrackSrim.hh.
|
protected |
Maximum number of clusters allowed (infinite if 0)
Definition at line 130 of file TrackSrim.hh.
|
protected |
Mass [MeV] of the projectile.
Definition at line 115 of file TrackSrim.hh.
|
protected |
Fluctuation model (0 = none, 1 = Landau, 2 = Vavilov, 3 = Gaussian, 4 = Combined)
Definition at line 148 of file TrackSrim.hh.
|
protected |
Targeted cluster size.
Definition at line 150 of file TrackSrim.hh.
|
protected |
Charge of the projectile.
Definition at line 113 of file TrackSrim.hh.
|
protected |
Projected range [cm].
Definition at line 138 of file TrackSrim.hh.
|
protected |
Mass density [g/cm3] of the target.
Definition at line 117 of file TrackSrim.hh.
|
protected |
Transverse straggling [cm].
Definition at line 140 of file TrackSrim.hh.
|
protected |
Include longitudinal straggling.
Definition at line 108 of file TrackSrim.hh.
|
protected |
Include transverse straggling.
Definition at line 106 of file TrackSrim.hh.
|
protected |
Work function [eV] of the target.
Definition at line 119 of file TrackSrim.hh.
|
protected |
Effective Z of the target.
Definition at line 127 of file TrackSrim.hh.