Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::TrackTrim Class Reference

Generate tracks based on TRIM output files. More...

#include <TrackTrim.hh>

Inheritance diagram for Garfield::TrackTrim:
Garfield::Track

Classes

struct  Cluster

Public Member Functions

 TrackTrim ()
 Default constructor.
 TrackTrim (Sensor *sensor)
 Constructor.
virtual ~TrackTrim ()
 Destructor.
bool ReadFile (const std::string &file, const unsigned int nIons=0, const unsigned int nSkip=0)
 Load data from an EXYZ.txt file.
void Print ()
 Print a summary of the available TRIM data.
void SetCharge (const double q)
 Set the projectile charge [-].
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 EnableStepSizeLimit (const double dmax)
 Set a max. distance between subsequent steps.
void DisableStepSizeLimit ()
 Do not reduce the steps with respect to the TRIM input file (default).
void EnableEnergyLossLimit (const double emax)
 Set a max. energy loss per cluster.
void DisableEnergyLossLimit ()
 Do not limit the energy loss per cluster (default).
void SetParticle (const std::string &part) override
 Set the type of charged particle.
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.
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 ( $\beta = v/c$) of the particle.
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 $\beta\gamma$ of the projectile.
double GetBeta () const
 Return the speed ( $\beta = v/c$) of the projectile.
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

void AddIon (const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &z, const std::vector< float > &dedx, const std::vector< float > &ekin)
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

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_ekin = 0.
 Projectile energy [eV].
std::vector< std::vector< std::array< float, 6 > > > m_ions
 List of tracks.
size_t m_ion = 0
 Index of the current track.
std::vector< Clusterm_clusters
 Clusters on the current track.
size_t m_cluster = 0
 Index of the next cluster to be returned.
double m_maxStepSize = -1.
 Step size limit.
double m_maxLossPerStep = -1.
 Energy loss limit per step.
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
ViewDriftm_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)

Detailed Description

Generate tracks based on TRIM output files.

Definition at line 15 of file TrackTrim.hh.

Constructor & Destructor Documentation

◆ TrackTrim() [1/2]

Garfield::TrackTrim::TrackTrim ( )
inline

Default constructor.

Definition at line 18 of file TrackTrim.hh.

18: TrackTrim(nullptr) {}
TrackTrim()
Default constructor.
Definition TrackTrim.hh:18

◆ TrackTrim() [2/2]

Garfield::TrackTrim::TrackTrim ( Sensor * sensor)

Constructor.

◆ ~TrackTrim()

virtual Garfield::TrackTrim::~TrackTrim ( )
inlinevirtual

Destructor.

Definition at line 22 of file TrackTrim.hh.

22{}

Member Function Documentation

◆ AddIon()

void Garfield::TrackTrim::AddIon ( const std::vector< float > & x,
const std::vector< float > & y,
const std::vector< float > & z,
const std::vector< float > & dedx,
const std::vector< float > & ekin )
protected

◆ DisableEnergyLossLimit()

void Garfield::TrackTrim::DisableEnergyLossLimit ( )
inline

Do not limit the energy loss per cluster (default).

Each segment in the TRIM input file corresponds to one cluster.

Definition at line 56 of file TrackTrim.hh.

56{ m_maxLossPerStep = -1.; }
double m_maxLossPerStep
Energy loss limit per step.
Definition TrackTrim.hh:98

◆ DisableStepSizeLimit()

void Garfield::TrackTrim::DisableStepSizeLimit ( )
inline

Do not reduce the steps with respect to the TRIM input file (default).

Definition at line 51 of file TrackTrim.hh.

51{ m_maxStepSize = -1.; }
double m_maxStepSize
Step size limit.
Definition TrackTrim.hh:96

◆ EnableEnergyLossLimit()

void Garfield::TrackTrim::EnableEnergyLossLimit ( const double emax)
inline

Set a max. energy loss per cluster.

Definition at line 53 of file TrackTrim.hh.

53{ m_maxLossPerStep = emax; }

◆ EnableStepSizeLimit()

void Garfield::TrackTrim::EnableStepSizeLimit ( const double dmax)
inline

Set a max. distance between subsequent steps.

Definition at line 49 of file TrackTrim.hh.

49{ m_maxStepSize = dmax; }

◆ GetCluster()

bool Garfield::TrackTrim::GetCluster ( double & xc,
double & yc,
double & zc,
double & tc,
int & nc,
double & ec,
double & extra )

◆ GetClusters()

const std::vector< Cluster > & Garfield::TrackTrim::GetClusters ( ) const
inline

Definition at line 71 of file TrackTrim.hh.

71{ return m_clusters; }
std::vector< Cluster > m_clusters
Clusters on the current track.
Definition TrackTrim.hh:91

◆ GetFanoFactor()

double Garfield::TrackTrim::GetFanoFactor ( ) const
inline

Get the Fano factor.

Definition at line 46 of file TrackTrim.hh.

46{ return m_fano; }
double m_fano
Fano factor [-] of the target.
Definition TrackTrim.hh:81

◆ GetWorkFunction()

double Garfield::TrackTrim::GetWorkFunction ( ) const
inline

Get the W value [eV].

Definition at line 37 of file TrackTrim.hh.

37{ return m_work; }
double m_work
Work function [eV] of the target.
Definition TrackTrim.hh:77

◆ NewTrack()

bool Garfield::TrackTrim::NewTrack ( const double x0,
const double y0,
const double z0,
const double t0,
const double dx0,
const double dy0,
const double dz0 )
overridevirtual

Calculate a new track starting from (x0, y0, z0) at time t0 in direction (dx0, dy0, dz0).

Implements Garfield::Track.

◆ Print()

void Garfield::TrackTrim::Print ( )

Print a summary of the available TRIM data.

◆ ReadFile()

bool Garfield::TrackTrim::ReadFile ( const std::string & file,
const unsigned int nIons = 0,
const unsigned int nSkip = 0 )

Load data from an EXYZ.txt file.

◆ SetCharge()

void Garfield::TrackTrim::SetCharge ( const double q)
inline

Set the projectile charge [-].

Definition at line 31 of file TrackTrim.hh.

31 {
32 if (fabs(q) > 0.) m_q = q;
33 }
double m_q
Definition Track.hh:98

◆ SetFanoFactor()

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

Set the Fano factor.

Definition at line 39 of file TrackTrim.hh.

39 {
40 m_fano = f;
41 m_fset = true;
42 }
bool m_fset
Has the Fano factor been set?
Definition TrackTrim.hh:79

◆ SetParticle()

void Garfield::TrackTrim::SetParticle ( const std::string & part)
overridevirtual

Set the type of charged particle.

  • electron,e-
  • positron,e+
  • muon,mu-
  • mu+
  • pion,pi-
  • pi+
  • kaon,K-
  • K+
  • proton,p
  • anti-proton,p-bar
  • deuteron,d
  • alpha

Reimplemented from Garfield::Track.

◆ SetWorkFunction()

void Garfield::TrackTrim::SetWorkFunction ( const double w)
inline

Set the W value [eV].

Definition at line 35 of file TrackTrim.hh.

35{ m_work = w; }

◆ UnsetFanoFactor()

void Garfield::TrackTrim::UnsetFanoFactor ( )
inline

Use the default Fano factor.

Definition at line 44 of file TrackTrim.hh.

44{ m_fset = false; }

Member Data Documentation

◆ m_cluster

size_t Garfield::TrackTrim::m_cluster = 0
protected

Index of the next cluster to be returned.

Definition at line 93 of file TrackTrim.hh.

◆ m_clusters

std::vector<Cluster> Garfield::TrackTrim::m_clusters
protected

Clusters on the current track.

Definition at line 91 of file TrackTrim.hh.

◆ m_ekin

double Garfield::TrackTrim::m_ekin = 0.
protected

Projectile energy [eV].

Definition at line 84 of file TrackTrim.hh.

◆ m_fano

double Garfield::TrackTrim::m_fano = -1.
protected

Fano factor [-] of the target.

Definition at line 81 of file TrackTrim.hh.

◆ m_fset

bool Garfield::TrackTrim::m_fset = false
protected

Has the Fano factor been set?

Definition at line 79 of file TrackTrim.hh.

◆ m_ion

size_t Garfield::TrackTrim::m_ion = 0
protected

Index of the current track.

Definition at line 88 of file TrackTrim.hh.

◆ m_ions

std::vector<std::vector<std::array<float, 6> > > Garfield::TrackTrim::m_ions
protected

List of tracks.

Definition at line 86 of file TrackTrim.hh.

◆ m_maxLossPerStep

double Garfield::TrackTrim::m_maxLossPerStep = -1.
protected

Energy loss limit per step.

Definition at line 98 of file TrackTrim.hh.

◆ m_maxStepSize

double Garfield::TrackTrim::m_maxStepSize = -1.
protected

Step size limit.

Definition at line 96 of file TrackTrim.hh.

◆ m_work

double Garfield::TrackTrim::m_work = -1.
protected

Work function [eV] of the target.

Definition at line 77 of file TrackTrim.hh.


The documentation for this class was generated from the following file:
  • /builds/garfield/docs/source/Include/Garfield/TrackTrim.hh