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,
87 const double t0,
const double e0,
88 const double dx0,
const double dy0,
89 const double dz0,
int& ne,
int& ni);
98 const double t0,
const double e0,
99 const double dx0,
const double dy0,
100 const double dz0,
int& ne);
109 void TransportPhoton(
const double x0,
const double y0,
const double z0,
110 const double t0,
const double e0,
const double dx0,
111 const double dy0,
const double dz0,
int& ne,
int& ni);
119 void TransportPhoton(
const double x0,
const double y0,
const double z0,
120 const double t0,
const double e0,
const double dx0,
121 const double dy0,
const double dz0,
int& ne);
143 const double stepAngleStraight,
144 const double stepAngleCurved) {
146 m_radStraight = radStraight;
147 m_stepAngleStraight = stepAngleStraight;
148 m_stepAngleCurved = stepAngleCurved;
151 double& stepAngleStraight,
double& stepAngleCurved) {
153 radStraight = m_radStraight;
154 stepAngleStraight = m_stepAngleStraight;
155 stepAngleCurved = m_stepAngleCurved;
165 m_usePhotonReabsorption = on;
170 m_usePacsOutput = on;
176 void SetEnergyMesh(
const double e0,
const double e1,
const int nsteps);
188 bool m_useOneStepFly =
false;
190 bool m_ready =
false;
191 bool m_hasActiveTrack =
false;
193 double m_mediumDensity = -1.;
194 std::string m_mediumName =
"";
196 bool m_usePhotonReabsorption =
true;
197 bool m_usePacsOutput =
false;
199 bool m_doDeltaTransport =
true;
200 struct deltaElectron {
205 std::vector<deltaElectron> m_deltaElectrons;
206 std::vector<Heed::HeedCondElectron> m_conductionElectrons;
207 std::vector<Heed::HeedCondElectron> m_conductionIons;
210 std::unique_ptr<Heed::HeedMatterDef> m_matter;
211 std::unique_ptr<Heed::GasDef> m_gas;
212 std::unique_ptr<Heed::MatterDef> m_material;
215 double m_emin = 2.e-6;
216 double m_emax = 2.e-1;
217 unsigned int m_nEnergyIntervals = 200;
218 std::unique_ptr<Heed::EnergyMesh> m_energyMesh;
221 std::unique_ptr<Heed::EnTransfCS> m_transferCs;
222 std::unique_ptr<Heed::ElElasticScat> m_elScat;
223 std::unique_ptr<Heed::ElElasticScatLowSigma> m_lowSigma;
224 std::unique_ptr<Heed::PairProd> m_pairProd;
225 std::unique_ptr<Heed::HeedDeltaElectronCS> m_deltaCs;
228 std::unique_ptr<HeedChamber> m_chamber;
229 std::unique_ptr<Heed::HeedFieldMap> m_fieldMap;
232 double m_lX = 0., m_lY = 0., m_lZ = 0.;
233 double m_cX = 0., m_cY = 0., m_cZ = 0.;
237 double m_maxStep = 100.;
239 double m_radStraight = 1000.;
241 double m_stepAngleStraight = 0.1;
243 double m_stepAngleCurved = 0.2;
245 std::vector<Heed::gparticle*> m_particleBank;
246 std::vector<Heed::gparticle*>::iterator m_bankIterator;
248 bool SetupGas(Medium* medium);
249 bool SetupMaterial(Medium* medium);
250 bool SetupDelta(
const std::string& databasePath);
251 std::string FindUnusedMaterialName(
const std::string& namein);
252 void ClearParticleBank();
253 bool IsInside(
const double x,
const double y,
const double z);
254 bool UpdateBoundingBox(
bool& update);
Abstract base class for media.
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.
double GetPhotoAbsorptionCrossSection(const double e) const
Return the photoabsorption cross-section at a given energy.
void EnableOneStepFly(const bool on)
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 Initialise(Medium *medium)
Compute the differential cross-section for a given medium.
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.