97 bool NewTrack(
const double x0,
const double y0,
const double z0,
98 const double t0,
const double dx0,
const double dy0,
99 const double dz0)
override;
101 bool GetCluster(
double& xc,
double& yc,
double& zc,
double& tc,
int& nc,
102 double& ec,
double& extra);
153 double Xi(
const double x,
const double beta2,
const double edens)
const;
156 bool PreciseLoss(
const double step,
const double estart,
double& deem,
159 double& stpmax)
const;
161 double step,
double& stpmin);
162 Medium*
GetMedium(
const std::array<double, 3>& x)
const;
164 const std::array<double, 3>& v0,
const double step0)
const;
166 const std::array<double, 3>& v0,
const double dt0,
167 const double vmag)
const;
169 const double edens)
const;
std::vector< double > m_longstraggle
Longitudinal straggling [cm].
void SetClustersMaximum(const int n)
Set the max. number of clusters on a track.
void GetAtomicMassMumbers(double &a, double &z) const
Get A and Z of the target medium.
void Print()
Print the energy loss table.
double Xi(const double x, const double beta2, const double edens) const
double m_qion
Charge of the projectile.
double m_z
Effective Z of the target.
std::vector< double > m_hdloss
Hadronic energy loss [MeV cm2/g].
void SetDensity(const double density)
Set the density [g/cm3] of the target medium.
const std::vector< Cluster > & GetClusters() const
std::vector< double > m_range
Projected range [cm].
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,...
double DedxHD(const double e) const
bool EstimateRange(const double ekin, const double step, double &stpmax) const
std::vector< Cluster > m_clusters
size_t m_currcluster
Index of the next cluster to be returned.
double GetFanoFactor() const
Get the Fano factor.
void EnableTransverseStraggling(const bool on=true)
Simulate transverse straggling (default: on).
std::vector< double > m_emloss
EM energy loss [MeV cm2/g].
void SetTargetClusterSize(const int n)
Specify how many electrons should be grouped to a cluster.
void PlotStraggling()
Plot the transverse and longitudinal straggling as function of the projectile energy.
bool m_chargeset
Has the charge been defined?
int GetModel() const
Get the fluctuation model.
double m_fano
Fano factor [-] of the target.
void SetModel(const int m)
Set the fluctuation model (0 = none, 1 = Landau, 2 = Vavilov, 3 = Gaussian, 4 = Combined).
void EnableLongitudinalStraggling(const bool on=true)
Simulate longitudinal straggling (default: off).
TrackSrim()
Default constructor.
Medium * GetMedium(const std::array< double, 3 > &x) const
double RndmEnergyLoss(const double ekin, const double de, const double step, const double edens) const
double m_mion
Mass [MeV] of the projectile.
bool PreciseLoss(const double step, const double estart, double &deem, double &dehd) const
void UnsetFanoFactor()
Use the default Fano factor.
void PlotEnergyLoss()
Plot the electromagnetic, hadronic, and total energy loss as function of the projectile energy.
double m_work
Work function [eV] of the target.
unsigned int m_model
Fluctuation model (0 = none, 1 = Landau, 2 = Vavilov, 3 = Gaussian, 4 = Combined)
bool GetCluster(double &xc, double &yc, double &zc, double &tc, int &nc, double &ec, double &extra)
bool m_useTransStraggle
Include transverse straggling.
int m_nsize
Targeted cluster size.
void SetAtomicMassNumbers(const double a, const double z)
Set A and Z of the target medium.
std::vector< double > m_ekin
Energy in energy loss table [MeV].
std::vector< double > m_transstraggle
Transverse straggling [cm].
double Terminate(const std::array< double, 3 > &x0, const std::array< double, 3 > &v0, const double step0) const
double GetDensity() const
Get the density [g/cm3] of the target medium.
int GetClustersMaximum() const
Retrieve the max. number of clusters on a track.
double m_rho
Mass density [g/cm3] of the target.
virtual ~TrackSrim()
Destructor.
TrackSrim(Sensor *sensor)
Constructor.
void SetWorkFunction(const double w)
Set the W value [eV].
bool m_useLongStraggle
Include longitudinal straggling.
double m_a
Effective A of the target.
void PlotRange()
Plot the projected range as function of the projectile energy.
bool m_fset
Has the Fano factor been set?
int m_maxclusters
Maximum number of clusters allowed (infinite if 0)
double DedxEM(const double e) const
bool SmallestStep(const double ekin, const double edens, double de, double step, double &stpmin)
void SetFanoFactor(const double f)
Set the Fano factor.
double GetWorkFunction() const
Get the W value [eV].
double TerminateBfield(const std::array< double, 3 > &x0, const std::array< double, 3 > &v0, const double dt0, const double vmag) const
int GetTargetClusterSize() const
Retrieve the target cluster size.
bool ReadFile(const std::string &file)
Load data from a SRIM file.
Track()=delete
Default constructor.
int n
Number of electrons in this cluster.
double kinetic
Ion energy when cluster was created.
double t
Cluster location and time.
double energy
Energy spent to make the cluster.