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