21 bool ReadFile(
const std::string& file);
94 bool NewTrack(
const double x0,
const double y0,
const double z0,
95 const double t0,
const double dx0,
const double dy0,
96 const double dz0)
override;
97 bool GetCluster(
double& xc,
double& yc,
double& zc,
double& tc,
int& nc,
98 double& ec,
double& extra)
override;
150 double Xi(
const double x,
const double beta2,
const double edens)
const;
151 double DedxEM(
const double e)
const;
152 double DedxHD(
const double e)
const;
153 bool PreciseLoss(
const double step,
const double estart,
double& deem,
156 double& stpmax)
const;
157 bool SmallestStep(
const double ekin,
const double edens,
158 double de,
double step,
double& stpmin);
160 double Terminate(
const std::array<double, 3>& x0,
161 const std::array<double, 3>& v0,
const double step0)
const;
163 const std::array<double, 3>& v0,
164 const double dt0,
const double vmag)
const;
166 const double step,
const double edens)
const;
Abstract base class for media.
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
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.
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)
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.
double m_work
Work function [eV] of the target.
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.
void SetWorkFunction(const double w)
Set the W value [eV].
bool m_useLongStraggle
Include longitudinal straggling.
double m_a
Effective A of the target.
bool GetCluster(double &xc, double &yc, double &zc, double &tc, int &nc, double &ec, double &extra) override
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.