Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
TrackHeed.hh
Go to the documentation of this file.
1#ifndef G_TRACK_HEED_H
2#define G_TRACK_HEED_H
3
4#include <vector>
5#include <list>
6
7#include "Track.hh"
8#ifndef __CINT__
11#endif /* __CINT __ */
12
13namespace Heed {
14class gparticle;
15class HeedParticle;
16class HeedMatterDef;
17class GasDef;
18class MatterDef;
19class AtomPhotoAbsCS;
20class MolecPhotoAbsCS;
21class EnergyMesh;
22class EnTransfCS;
23class ElElasticScat;
24class ElElasticScatLowSigma;
25class PairProd;
26class HeedDeltaElectronCS;
27class HeedFieldMap;
28}
29
30namespace Garfield {
31
32class HeedChamber;
33class Medium;
34
35/// Generate tracks using Heed++.
36
37class TrackHeed : public Track {
38
39 public:
40 /// Constructor
41 TrackHeed();
42 /// Destructor
43 virtual ~TrackHeed();
44
45 virtual bool NewTrack(const double x0, const double y0, const double z0,
46 const double t0, const double dx0, const double dy0,
47 const double dz0);
48 virtual bool GetCluster(double& xcls, double& ycls, double& zcls, double& tcls,
49 int& n, double& e, double& extra);
50 bool GetCluster(double& xcls, double& ycls, double& zcls, double& tcls,
51 int& ne, int& ni, double& e, double& extra);
52 /** Retrieve the properties of a conduction or delta electron
53 * in the current cluster.
54 * \param i index of the electron
55 * \param x,y,z coordinates of the electron
56 * \param t time
57 * \param e kinetic energy (only meaningful for delta-electrons)
58 * \param dx,dy,dz direction vector (only meaningful for delta-electrons)
59 **/
60 bool GetElectron(const unsigned int i,
61 double& x, double& y, double& z, double& t,
62 double& e, double& dx, double& dy, double& dz);
63 /** Retrieve the properties of an ion in the current cluster.
64 * \param i index of the ion
65 * \param x,y,z coordinates of the ion
66 * \param t time
67 **/
68 bool GetIon(const unsigned int i,
69 double& x, double& y, double& z, double& t) const;
70
71 virtual double GetClusterDensity();
72 virtual double GetStoppingPower();
73 double GetW() const;
74 double GetFanoFactor() const;
75
76 void TransportDeltaElectron(const double x0, const double y0, const double z0,
77 const double t0, const double e0,
78 const double dx0, const double dy0,
79 const double dz0, int& nel, int& ni);
80 void TransportDeltaElectron(const double x0, const double y0, const double z0,
81 const double t0, const double e0,
82 const double dx0, const double dy0,
83 const double dz0, int& nel);
84
85 void TransportPhoton(const double x0, const double y0, const double z0,
86 const double t0, const double e0, const double dx0,
87 const double dy0, const double dz0, int& nel, int& ni);
88 void TransportPhoton(const double x0, const double y0, const double z0,
89 const double t0, const double e0, const double dx0,
90 const double dy0, const double dz0, int& nel);
91
92 // Specify whether the electric and magnetic field should be
93 // taken into account in the stepping algorithm.
98
99 void EnableDeltaElectronTransport() { m_doDeltaTransport = true; }
100 void DisableDeltaElectronTransport() { m_doDeltaTransport = false; }
101
102 void EnablePhotonReabsorption() { m_usePhotonReabsorption = true; }
103 void DisablePhotonReabsorption() { m_usePhotonReabsorption = false; }
104
105 void EnablePhotoAbsorptionCrossSectionOutput() { m_usePacsOutput = true; }
106 void DisablePhotoAbsorptionCrossSectionOutput() { m_usePacsOutput = false; }
107 void SetEnergyMesh(const double e0, const double e1, const int nsteps);
108
109 // Define particle mass and charge (for exotic particles).
110 // For standard particles Track::SetParticle should be used.
111 void SetParticleUser(const double m, const double z);
112
113 private:
114 // Prevent usage of copy constructor and assignment operator
115 TrackHeed(const TrackHeed& heed);
116 TrackHeed& operator=(const TrackHeed& heed);
117
118 bool m_ready;
119 bool m_hasActiveTrack;
120
121 double m_mediumDensity;
122 std::string m_mediumName;
123
124 bool m_usePhotonReabsorption;
125 bool m_usePacsOutput;
126
127 bool m_doDeltaTransport;
128 struct deltaElectron {
129 double x, y, z, t;
130 double e;
131 double dx, dy, dz;
132 };
133 std::vector<deltaElectron> m_deltaElectrons;
134 std::vector<Heed::HeedCondElectron> m_conductionElectrons;
135 std::vector<Heed::HeedCondElectron> m_conductionIons;
136
137 // Primary particle
138 Heed::HeedParticle* m_particle;
139
140 // Material properties
141 Heed::HeedMatterDef* m_matter;
142 Heed::GasDef* m_gas;
143 Heed::MatterDef* m_material;
144
145 // Photoabsorption cross-sections
146 Heed::AtomPhotoAbsCS** m_atPacs;
147 Heed::MolecPhotoAbsCS** m_molPacs;
148
149 // Energy mesh
150 double m_emin, m_emax;
151 int m_nEnergyIntervals;
152 Heed::EnergyMesh* m_energyMesh;
153
154 // Cross-sections
155 Heed::EnTransfCS* m_transferCs;
156 Heed::ElElasticScat* m_elScat;
157 Heed::ElElasticScatLowSigma* m_lowSigma;
158 Heed::PairProd* m_pairProd;
159 Heed::HeedDeltaElectronCS* m_deltaCs;
160
161 // Interface classes
162 HeedChamber* m_chamber;
163 Heed::HeedFieldMap m_fieldMap;
164
165 // Bounding box
166 double m_lX, m_lY, m_lZ;
167 double m_cX, m_cY, m_cZ;
168
169#ifndef __CINT__
170 std::vector<Heed::gparticle*> m_particleBank;
171 std::vector<Heed::gparticle*>::iterator m_bankIterator;
172#endif /* __CINT __ */
173 bool Setup(Medium* medium);
174 bool SetupGas(Medium* medium);
175 bool SetupMaterial(Medium* medium);
176 bool SetupDelta(const std::string& databasePath);
177 std::string FindUnusedMaterialName(const std::string& namein);
178 void ClearParticleBank();
179 bool IsInside(const double x, const double y, const double z);
180};
181}
182
183#endif
Generate tracks using Heed++.
Definition: TrackHeed.hh:37
void EnableMagneticField()
Definition: TrackHeed.cc:849
void SetEnergyMesh(const double e0, const double e1, const int nsteps)
Definition: TrackHeed.cc:852
virtual bool GetCluster(double &xcls, double &ycls, double &zcls, double &tcls, int &n, double &e, double &extra)
Definition: TrackHeed.cc:327
void EnablePhotoAbsorptionCrossSectionOutput()
Definition: TrackHeed.hh:105
void EnableElectricField()
Definition: TrackHeed.cc:847
void DisableMagneticField()
Definition: TrackHeed.cc:850
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 &nel, int &ni)
Definition: TrackHeed.cc:676
void DisableDeltaElectronTransport()
Definition: TrackHeed.hh:100
double GetFanoFactor() const
Definition: TrackHeed.cc:1271
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 &nel, int &ni)
Definition: TrackHeed.cc:535
virtual double GetClusterDensity()
Definition: TrackHeed.cc:293
void EnableDeltaElectronTransport()
Definition: TrackHeed.hh:99
bool GetElectron(const unsigned int i, double &x, double &y, double &z, double &t, double &e, double &dx, double &dy, double &dz)
Definition: TrackHeed.cc:465
void DisablePhotonReabsorption()
Definition: TrackHeed.hh:103
bool GetIon(const unsigned int i, double &x, double &y, double &z, double &t) const
Definition: TrackHeed.cc:510
virtual ~TrackHeed()
Destructor.
Definition: TrackHeed.cc:95
void EnablePhotonReabsorption()
Definition: TrackHeed.hh:102
void DisablePhotoAbsorptionCrossSectionOutput()
Definition: TrackHeed.hh:106
TrackHeed()
Constructor.
Definition: TrackHeed.cc:60
virtual bool NewTrack(const double x0, const double y0, const double z0, const double t0, const double dx0, const double dy0, const double dz0)
Definition: TrackHeed.cc:111
double GetW() const
Definition: TrackHeed.cc:1270
void SetParticleUser(const double m, const double z)
Definition: TrackHeed.cc:875
void DisableElectricField()
Definition: TrackHeed.cc:848
virtual double GetStoppingPower()
Get the stopping power (mean energy loss [eV] per cm).
Definition: TrackHeed.cc:310
Abstract base class for track generation.
Definition: Track.hh:14
Atomic photoabsorption cross-section abstract base class.
Definition: PhotoAbsCS.h:285
Retrieve electric and magnetic field from Sensor.
Definition: HeedFieldMap.h:15
Definition: BGMesh.cpp:5