Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
TrackPAI.hh
Go to the documentation of this file.
1#ifndef G_TRACK_PAI
2#define G_TRACK_PAI
3
4#include <string>
5#include <vector>
6
7#include "Track.hh"
8
9namespace Garfield {
10
11/// Energy loss calculation using the Photoabsorption-Ionisation Model.
12
13class TrackPAI : public Track {
14
15 public:
16 // Constructor
17 TrackPAI();
18 // Destructor
19 virtual ~TrackPAI() {}
20
21 virtual bool NewTrack(const double x0, const double y0, const double z0,
22 const double t0, const double dx0, const double dy0,
23 const double dz0);
24
25 virtual bool GetCluster(double& xcls, double& ycls, double& zcls,
26 double& tcls, int& ncls, double& ecls, double& extra);
27
28 virtual double GetClusterDensity();
29 virtual double GetStoppingPower();
30
31 private:
32 bool m_ready;
33
34 // Particle coordinates and direction
35 double m_x, m_y, m_z, m_t;
36 double m_dx, m_dy, m_dz;
37 // Particle energy and speed
38 double m_e;
39 double m_speed;
40 // Max. energy transfer in a collision
41 double m_emax;
42
43 // Total inelastic mean free path
44 double m_imfp;
45 // Stopping power
46 double m_dedx;
47
48 // Dielectric function
49 int m_nSteps;
50 struct opticalData {
51 double eps1, eps2;
52 double integral;
53 };
54 std::vector<opticalData> m_opticalDataTable;
55
56 // Tables for interpolation of cumulative distribution functions
57 std::vector<double> m_energies;
58 std::vector<double> m_cdf;
59 std::vector<double> m_rutherford;
60
61 struct electron {
62 // Direction
63 double dx, dy, dz;
64 // Energy
65 double energy;
66 // Type (electron, hole)
67 int type;
68 };
69 std::vector<electron> m_electrons;
70 std::vector<electron> m_holes;
71
72 // Medium properties
73 std::string m_mediumName;
74 double m_mediumDensity;
75 double m_electronDensity;
76
77 bool SetupMedium(Medium* medium);
78 bool SetupCrossSectionTable();
79
80 double ComputeMaxTransfer() const;
81
82 double ComputeCsTail(const double emin, const double emax);
83 double ComputeDeDxTail(const double emin, const double emax);
84
85 double SampleEnergyDeposit(const double u, double& f) const;
86 double SampleAsymptoticCs(double u) const;
87 double SampleAsymptoticCsSpinZero(const double emin, double u) const;
88 double SampleAsymptoticCsSpinHalf(const double emin, double u) const;
89 double SampleAsymptoticCsSpinOne(const double emin, double u) const;
90 double SampleAsymptoticCsElectron(const double emin, double u) const;
91 double SampleAsymptoticCsPositron(const double emin, double u) const;
92
93 double LossFunction(const double eps1, const double eps2) const {
94 const double eps = eps1 * eps1 + eps2 * eps2;
95 return eps > 0. ? eps2 / eps : 0.;
96 }
97};
98}
99
100#endif
Energy loss calculation using the Photoabsorption-Ionisation Model.
Definition: TrackPAI.hh:13
virtual bool GetCluster(double &xcls, double &ycls, double &zcls, double &tcls, int &ncls, double &ecls, double &extra)
Definition: TrackPAI.cc:105
virtual double GetStoppingPower()
Get the stopping power (mean energy loss [eV] per cm).
Definition: TrackPAI.cc:321
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: TrackPAI.cc:36
virtual double GetClusterDensity()
Definition: TrackPAI.cc:300
virtual ~TrackPAI()
Definition: TrackPAI.hh:19
Abstract base class for track generation.
Definition: Track.hh:14