Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#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 () |
void | PlotRange () |
Plot the projected range as function of the projectile energy. | |
void | PlotStraggling () |
void | SetModel (const int m) |
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 |
bool | GetCluster (double &xc, double &yc, double &zc, double &tc, int &nc, double &ec, double &extra) override |
const std::vector< Cluster > & | GetClusters () const |
![]() | |
Track ()=delete | |
Default constructor. | |
Track (const std::string &name) | |
Constructor. | |
virtual | ~Track () |
Destructor. | |
virtual void | SetParticle (const std::string &part) |
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 () |
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 |
![]() | |
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 |
int | m_nsize = -1 |
Targeted cluster size. | |
std::vector< Cluster > | m_clusters |
![]() | |
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 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 11 of file TrackSrim.hh.
|
inline |
Garfield::TrackSrim::TrackSrim | ( | Sensor * | sensor | ) |
|
inlinevirtual |
|
protected |
Definition at line 443 of file TrackSrim.cc.
Referenced by NewTrack(), and PreciseLoss().
|
protected |
Definition at line 447 of file TrackSrim.cc.
Referenced by NewTrack(), and PreciseLoss().
|
inline |
Simulate longitudinal straggling (default: off).
Definition at line 83 of file TrackSrim.hh.
|
inline |
Simulate transverse straggling (default: on).
Definition at line 79 of file TrackSrim.hh.
|
protected |
Definition at line 534 of file TrackSrim.cc.
Referenced by NewTrack().
|
inline |
|
overridevirtual |
Get the next "cluster" (ionising collision of the charged particle).
xc,yc,zc | coordinates of the collision |
tc | time of the collision |
nc | number of electrons produced |
ec | deposited energy |
extra | additional information (not always implemented) |
Implements Garfield::Track.
Definition at line 1328 of file TrackSrim.cc.
|
inline |
Definition at line 99 of file TrackSrim.hh.
|
inline |
Retrieve the max. number of clusters on a track.
Definition at line 48 of file TrackSrim.hh.
|
inline |
Get the density [g/cm3] of the target medium.
Definition at line 66 of file TrackSrim.hh.
|
inline |
|
protected |
Definition at line 631 of file TrackSrim.cc.
Referenced by NewTrack(), Terminate(), and TerminateBfield().
|
inline |
|
inline |
|
inline |
Get the W value [eV].
Definition at line 53 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.
Definition at line 639 of file TrackSrim.cc.
void Garfield::TrackSrim::PlotEnergyLoss | ( | ) |
Plot the electromagnetic, hadronic, and total energy loss as function of the projectile energy.
Definition at line 320 of file TrackSrim.cc.
void Garfield::TrackSrim::PlotRange | ( | ) |
Plot the projected range as function of the projectile energy.
Definition at line 376 of file TrackSrim.cc.
void Garfield::TrackSrim::PlotStraggling | ( | ) |
Plot the transverse and longitudinal straggling as function of the projectile energy.
Definition at line 400 of file TrackSrim.cc.
|
protected |
Definition at line 460 of file TrackSrim.cc.
Referenced by EstimateRange(), and NewTrack().
void Garfield::TrackSrim::Print | ( | ) |
Print the energy loss table.
Definition at line 287 of file TrackSrim.cc.
bool Garfield::TrackSrim::ReadFile | ( | const std::string & | file | ) |
Load data from a SRIM file.
Definition at line 79 of file TrackSrim.cc.
|
protected |
Definition at line 1229 of file TrackSrim.cc.
Referenced by NewTrack().
|
inline |
Set A and Z of the target medium.
Definition at line 68 of file TrackSrim.hh.
|
inline |
Set the max. number of clusters on a track.
Definition at line 46 of file TrackSrim.hh.
|
inline |
Set the density [g/cm3] of the target medium.
Definition at line 64 of file TrackSrim.hh.
Referenced by ReadFile().
|
inline |
Set the Fano factor.
Definition at line 55 of file TrackSrim.hh.
|
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 36 of file TrackSrim.hh.
|
inline |
Specify how many electrons should be grouped to a cluster.
Definition at line 41 of file TrackSrim.hh.
|
inline |
|
protected |
Definition at line 1057 of file TrackSrim.cc.
Referenced by NewTrack().
|
protected |
Definition at line 1011 of file TrackSrim.cc.
Referenced by NewTrack().
|
protected |
Definition at line 1030 of file TrackSrim.cc.
Referenced by NewTrack().
|
inline |
|
protected |
Definition at line 451 of file TrackSrim.cc.
Referenced by RndmEnergyLoss(), and SmallestStep().
|
protected |
Effective A of the target.
Definition at line 122 of file TrackSrim.hh.
Referenced by GetAtomicMassMumbers(), NewTrack(), Print(), and SetAtomicMassNumbers().
|
protected |
Has the charge been defined?
Definition at line 108 of file TrackSrim.hh.
Referenced by NewTrack(), and ReadFile().
|
protected |
Definition at line 148 of file TrackSrim.hh.
Referenced by GetCluster(), GetClusters(), and NewTrack().
|
protected |
Index of the next cluster to be returned.
Definition at line 142 of file TrackSrim.hh.
Referenced by GetCluster(), and NewTrack().
|
protected |
Energy in energy loss table [MeV].
Definition at line 129 of file TrackSrim.hh.
Referenced by DedxEM(), DedxHD(), NewTrack(), PlotEnergyLoss(), PlotRange(), PlotStraggling(), Print(), and ReadFile().
|
protected |
EM energy loss [MeV cm2/g].
Definition at line 131 of file TrackSrim.hh.
Referenced by DedxEM(), PlotEnergyLoss(), Print(), and ReadFile().
|
protected |
Fano factor [-] of the target.
Definition at line 120 of file TrackSrim.hh.
Referenced by GetFanoFactor(), NewTrack(), Print(), and SetFanoFactor().
|
protected |
Has the Fano factor been set?
Definition at line 118 of file TrackSrim.hh.
Referenced by NewTrack(), Print(), SetFanoFactor(), and UnsetFanoFactor().
|
protected |
Hadronic energy loss [MeV cm2/g].
Definition at line 133 of file TrackSrim.hh.
Referenced by DedxHD(), PlotEnergyLoss(), Print(), and ReadFile().
|
protected |
Longitudinal straggling [cm].
Definition at line 139 of file TrackSrim.hh.
Referenced by NewTrack(), PlotStraggling(), Print(), and ReadFile().
|
protected |
Maximum number of clusters allowed (infinite if 0)
Definition at line 127 of file TrackSrim.hh.
Referenced by GetClustersMaximum(), NewTrack(), and SetClustersMaximum().
|
protected |
Mass [MeV] of the projectile.
Definition at line 112 of file TrackSrim.hh.
Referenced by NewTrack(), Print(), ReadFile(), RndmEnergyLoss(), SmallestStep(), and TerminateBfield().
|
protected |
Fluctuation model (0 = none, 1 = Landau, 2 = Vavilov, 3 = Gaussian, 4 = Combined)
Definition at line 145 of file TrackSrim.hh.
Referenced by GetModel(), RndmEnergyLoss(), SetModel(), and SmallestStep().
|
protected |
Targeted cluster size.
Definition at line 147 of file TrackSrim.hh.
Referenced by GetTargetClusterSize(), NewTrack(), and SetTargetClusterSize().
|
protected |
Charge of the projectile.
Definition at line 110 of file TrackSrim.hh.
Referenced by NewTrack(), Print(), ReadFile(), RndmEnergyLoss(), SmallestStep(), TerminateBfield(), and Xi().
|
protected |
Projected range [cm].
Definition at line 135 of file TrackSrim.hh.
Referenced by NewTrack(), PlotRange(), Print(), and ReadFile().
|
protected |
Mass density [g/cm3] of the target.
Definition at line 114 of file TrackSrim.hh.
Referenced by GetDensity(), NewTrack(), PlotEnergyLoss(), PreciseLoss(), Print(), and SetDensity().
|
protected |
Transverse straggling [cm].
Definition at line 137 of file TrackSrim.hh.
Referenced by NewTrack(), PlotStraggling(), Print(), and ReadFile().
|
protected |
Include longitudinal straggling.
Definition at line 105 of file TrackSrim.hh.
Referenced by EnableLongitudinalStraggling(), and NewTrack().
|
protected |
Include transverse straggling.
Definition at line 103 of file TrackSrim.hh.
Referenced by EnableTransverseStraggling(), and NewTrack().
|
protected |
Work function [eV] of the target.
Definition at line 116 of file TrackSrim.hh.
Referenced by GetWorkFunction(), NewTrack(), Print(), and SetWorkFunction().
|
protected |
Effective Z of the target.
Definition at line 124 of file TrackSrim.hh.
Referenced by GetAtomicMassMumbers(), NewTrack(), Print(), and SetAtomicMassNumbers().