13class HeedCondElectron;
22class ElElasticScatLowSigma;
24class HeedDeltaElectronCS;
42 bool NewTrack(
const double x0,
const double y0,
const double z0,
43 const double t0,
const double dx0,
const double dy0,
44 const double dz0)
override;
45 bool GetCluster(
double& xcls,
double& ycls,
double& zcls,
double& tcls,
46 int& n,
double& e,
double& extra)
override;
47 bool GetCluster(
double& xcls,
double& ycls,
double& zcls,
double& tcls,
48 int& ne,
int& ni,
double& e,
double& extra);
57 bool GetElectron(
const unsigned int i,
double& x,
double& y,
double& z,
58 double& t,
double& e,
double& dx,
double& dy,
double& dz);
64 bool GetIon(
const unsigned int i,
double& x,
double& y,
double& z,
82 const double t0,
const double e0,
83 const double dx0,
const double dy0,
84 const double dz0,
int& ne,
int& ni);
93 const double t0,
const double e0,
94 const double dx0,
const double dy0,
95 const double dz0,
int& ne);
104 void TransportPhoton(
const double x0,
const double y0,
const double z0,
105 const double t0,
const double e0,
const double dx0,
106 const double dy0,
const double dz0,
int& ne,
int& ni);
114 void TransportPhoton(
const double x0,
const double y0,
const double z0,
115 const double t0,
const double e0,
const double dx0,
116 const double dy0,
const double dz0,
int& ne);
138 const double stepAngleStraight,
139 const double stepAngleCurved) {
141 m_radStraight = radStraight;
142 m_stepAngleStraight = stepAngleStraight;
143 m_stepAngleCurved = stepAngleCurved;
146 double& stepAngleStraight,
double& stepAngleCurved) {
148 radStraight = m_radStraight;
149 stepAngleStraight = m_stepAngleStraight;
150 stepAngleCurved = m_stepAngleCurved;
160 m_usePhotonReabsorption = on;
165 m_usePacsOutput = on;
171 void SetEnergyMesh(
const double e0,
const double e1,
const int nsteps);
182 bool m_ready =
false;
183 bool m_hasActiveTrack =
false;
185 double m_mediumDensity = -1.;
186 std::string m_mediumName =
"";
188 bool m_usePhotonReabsorption =
true;
189 bool m_usePacsOutput =
false;
191 bool m_doDeltaTransport =
true;
192 struct deltaElectron {
197 std::vector<deltaElectron> m_deltaElectrons;
198 std::vector<Heed::HeedCondElectron> m_conductionElectrons;
199 std::vector<Heed::HeedCondElectron> m_conductionIons;
202 std::unique_ptr<Heed::HeedMatterDef> m_matter;
203 std::unique_ptr<Heed::GasDef> m_gas;
204 std::unique_ptr<Heed::MatterDef> m_material;
207 double m_emin = 2.e-6;
208 double m_emax = 2.e-1;
209 unsigned int m_nEnergyIntervals = 200;
210 std::unique_ptr<Heed::EnergyMesh> m_energyMesh;
213 std::unique_ptr<Heed::EnTransfCS> m_transferCs;
214 std::unique_ptr<Heed::ElElasticScat> m_elScat;
215 std::unique_ptr<Heed::ElElasticScatLowSigma> m_lowSigma;
216 std::unique_ptr<Heed::PairProd> m_pairProd;
217 std::unique_ptr<Heed::HeedDeltaElectronCS> m_deltaCs;
220 std::unique_ptr<HeedChamber> m_chamber;
221 std::unique_ptr<Heed::HeedFieldMap> m_fieldMap;
224 double m_lX = 0., m_lY = 0., m_lZ = 0.;
225 double m_cX = 0., m_cY = 0., m_cZ = 0.;
229 double m_maxStep = 100.;
231 double m_radStraight = 1000.;
233 double m_stepAngleStraight = 0.1;
235 double m_stepAngleCurved = 0.2;
238 std::vector<Heed::gparticle*> m_particleBank;
239 std::vector<Heed::gparticle*>::iterator m_bankIterator;
241 bool Setup(Medium* medium);
242 bool SetupGas(Medium* medium);
243 bool SetupMaterial(Medium* medium);
244 bool SetupDelta(
const std::string& databasePath);
245 std::string FindUnusedMaterialName(
const std::string& namein);
246 void ClearParticleBank();
247 bool IsInside(
const double x,
const double y,
const double z);
248 bool UpdateBoundingBox(
bool& update);
Generate tracks using Heed++.
void EnableMagneticField()
Take the magnetic field into account in the stepping algorithm.
void SetEnergyMesh(const double e0, const double e1, const int nsteps)
bool GetCluster(double &xcls, double &ycls, double &zcls, double &tcls, int &n, double &e, double &extra) override
void EnablePhotonReabsorption(const bool on=true)
Simulate (or not) the photons produced in the atomic relaxation cascade.
void EnablePhotoAbsorptionCrossSectionOutput(const bool on)
Write the photoabsorption cross-sections used to a text file.
void EnableElectricField()
Take the electric field into account in the stepping algorithm.
void DisableMagneticField()
Do not take the magnetic field into account in the stepping algorithm.
void TransportDeltaElectron(const double x0, const double y0, const double z0, const double t0, const double e0, const double dx0, const double dy0, const double dz0, int &ne, int &ni)
void DisableDeltaElectronTransport()
Switch simulation of delta electrons off.
double GetFanoFactor() const
Return the Fano factor of the medium (of the last simulated track).
bool NewTrack(const double x0, const double y0, const double z0, const double t0, const double dx0, const double dy0, const double dz0) override
void SetSteppingLimits(const double maxStep, const double radStraight, const double stepAngleStraight, const double stepAngleCurved)
void EnableDeltaElectronTransport()
Switch simulation of delta electrons on.
bool GetElectron(const unsigned int i, double &x, double &y, double &z, double &t, double &e, double &dx, double &dy, double &dz)
void TransportPhoton(const double x0, const double y0, const double z0, const double t0, const double e0, const double dx0, const double dy0, const double dz0, int &ne, int &ni)
bool GetIon(const unsigned int i, double &x, double &y, double &z, double &t) const
virtual ~TrackHeed()
Destructor.
double GetW() const
Return the W value of the medium (of the last simulated track).
void SetParticleUser(const double m, const double z)
double GetClusterDensity() override
void DisableElectricField()
Do not take the electric field into account in the stepping algorithm.
void GetSteppingLimits(double &maxStep, double &radStraight, double &stepAngleStraight, double &stepAngleCurved)
double GetStoppingPower() override
Get the stopping power (mean energy loss [eV] per cm).
Abstract base class for track generation.