Garfield++ v1r0
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// Track generation using Heed++
2
3#ifndef G_TRACK_HEED_H
4#define G_TRACK_HEED_H
5
6#include <vector>
7
8#include "Track.hh"
9
10namespace Heed {
11class HeedParticle;
12class HeedMatterDef;
13class GasDef;
14class MatterDef;
15class AtomPhotoAbsCS;
16class MolecPhotoAbsCS;
17class EnergyMesh;
18class EnTransfCS;
19class ElElasticScat;
20class ElElasticScatLowSigma;
21class PairProd;
22class HeedDeltaElectronCS;
23}
24
25namespace Garfield {
26
27class HeedChamber;
28class Medium;
29
30class TrackHeed : public Track {
31
32 public:
33 // Constructor
34 TrackHeed();
35 // Destructor
36 ~TrackHeed();
37
38 bool NewTrack(const double x0, const double y0, const double z0,
39 const double t0, const double dx0, const double dy0,
40 const double dz0);
41 bool GetCluster(double& xcls, double& ycls, double& zcls, double& tcls,
42 int& n, double& e, double& extra);
43 bool GetElectron(const int i, double& x, double& y, double& z, double& t,
44 double& e, double& dx, double& dy, double& dz);
45
46 double GetClusterDensity();
47 double GetStoppingPower();
48 double GetW() const;
49 double GetFanoFactor() const;
50
51 void TransportDeltaElectron(const double x0, const double y0, const double z0,
52 const double t0, const double e0,
53 const double dx0, const double dy0,
54 const double dz0, int& nel);
55
56 void TransportPhoton(const double x0, const double y0, const double z0,
57 const double t0, const double e0, const double dx0,
58 const double dy0, const double dz0, int& nel);
59
60 // Specify whether the electric and magnetic field should be
61 // taken into account in the stepping algorithm.
66
67 void EnableDeltaElectronTransport() { useDelta = true; }
68 void DisableDeltaElectronTransport() { useDelta = false; }
69
70 void EnablePhotonReabsorption() { usePhotonReabsorption = true; }
71 void DisablePhotonReabsorption() { usePhotonReabsorption = false; }
72
73 void EnablePhotoAbsorptionCrossSectionOutput() { usePacsOutput = true; }
74 void DisablePhotoAbsorptionCrossSectionOutput() { usePacsOutput = false; }
75 void SetEnergyMesh(const double e0, const double e1, const int nsteps);
76
77 // Define particle mass and charge (for exotic particles).
78 // For standard particles Track::SetParticle should be used.
79 void SetParticleUser(const double m, const double z);
80
81 private:
82 // Prevent usage of copy constructor and assignment operator
83 TrackHeed(const TrackHeed& heed);
84 TrackHeed& operator=(const TrackHeed& heed);
85
86 bool ready;
87 bool hasActiveTrack;
88
89 double mediumDensity;
90 std::string mediumName;
91
92 bool usePhotonReabsorption;
93 bool usePacsOutput;
94
95 bool useDelta;
96 int nDeltas;
97 struct deltaElectron {
98 double x, y, z, t;
99 double e;
100 double dx, dy, dz;
101 };
102 std::vector<deltaElectron> deltaElectrons;
103
104 // Primary particle
105 Heed::HeedParticle* particle;
106
107 // Material properties
108 Heed::HeedMatterDef* matter;
109 Heed::GasDef* gas;
110 Heed::MatterDef* material;
111
112 // Photoabsorption cross-sections
113 Heed::AtomPhotoAbsCS** m_atPacs;
114 Heed::MolecPhotoAbsCS** m_molPacs;
115
116 // Energy mesh
117 double emin, emax;
118 int nEnergyIntervals;
119 Heed::EnergyMesh* energyMesh;
120
121 // Cross-sections
122 Heed::EnTransfCS* transferCs;
123 Heed::ElElasticScat* elScat;
125 Heed::PairProd* pairProd;
127
128 HeedChamber* chamber;
129 // Bounding box
130 double lX, lY, lZ;
131 double cX, cY, cZ;
132
133 bool Setup(Medium* medium);
134 bool SetupGas(Medium* medium);
135 bool SetupMaterial(Medium* medium);
136 bool SetupDelta(const std::string databasePath);
137};
138}
139
140#endif
void EnableMagneticField()
Definition: TrackHeed.cc:946
void SetEnergyMesh(const double e0, const double e1, const int nsteps)
Definition: TrackHeed.cc:950
bool GetCluster(double &xcls, double &ycls, double &zcls, double &tcls, int &n, double &e, double &extra)
Definition: TrackHeed.cc:383
void EnablePhotoAbsorptionCrossSectionOutput()
Definition: TrackHeed.hh:73
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)
Definition: TrackHeed.cc:615
void EnableElectricField()
Definition: TrackHeed.cc:942
void DisableMagneticField()
Definition: TrackHeed.cc:948
bool GetElectron(const int i, double &x, double &y, double &z, double &t, double &e, double &dx, double &dy, double &dz)
Definition: TrackHeed.cc:566
void DisableDeltaElectronTransport()
Definition: TrackHeed.hh:68
double GetFanoFactor() const
Definition: TrackHeed.cc:1371
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)
Definition: TrackHeed.cc:743
double GetClusterDensity()
Definition: TrackHeed.cc:349
void EnableDeltaElectronTransport()
Definition: TrackHeed.hh:67
void DisablePhotonReabsorption()
Definition: TrackHeed.hh:71
void EnablePhotonReabsorption()
Definition: TrackHeed.hh:70
void DisablePhotoAbsorptionCrossSectionOutput()
Definition: TrackHeed.hh:74
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:158
double GetW() const
Definition: TrackHeed.cc:1370
void SetParticleUser(const double m, const double z)
Definition: TrackHeed.cc:973
void DisableElectricField()
Definition: TrackHeed.cc:944
double GetStoppingPower()
Definition: TrackHeed.cc:366
Definition: BGMesh.cpp:3