Garfield++ v1r0
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// Energy loss calculation using the Photoabsorption-Ionisation Model
2
3#ifndef G_TRACK_PAI
4#define G_TRACK_PAI
5
6#include <string>
7#include <vector>
8
9#include "Track.hh"
10
11namespace Garfield {
12
13class TrackPAI : public Track {
14
15 public:
16 // Constructor
17 TrackPAI();
18 // Destructor
20
21 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 bool GetCluster(double& xcls, double& ycls, double& zcls, double& tcls,
26 int& ncls, double& ecls, double& extra);
27
28 double GetClusterDensity();
29 double GetStoppingPower();
30
31 private:
32 bool ready;
33
34 // Particle coordinates and direction
35 double x, y, z, t;
36 double dx, dy, dz;
37 // Particle energy and speed
38 double e;
39 double speed;
40 // Max. energy transfer in a collision
41 double emax;
42
43 // Total inelastic mean free path
44 double imfp;
45 // Stopping power
46 double dedx;
47
48 // Dielectric function
49 int nSteps;
50 struct opticalData {
51 double eps1, eps2;
52 double integral;
53 };
54 std::vector<opticalData> opticalDataTable;
55
56 // Tables for interpolation of cumulative distribution functions
57 std::vector<double> energies;
58 std::vector<double> cdf;
59 std::vector<double> 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> electrons;
70 std::vector<electron> holes;
71
72 // Medium properties
73 std::string mediumName;
74 double mediumDensity;
75 double 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 SampleAsymptoticCs(double u);
86 double SampleAsymptoticCsSpinZero(const double emin, double u);
87 double SampleAsymptoticCsSpinHalf(const double emin, double u);
88 double SampleAsymptoticCsSpinOne(const double emin, double u);
89 double SampleAsymptoticCsElectron(const double emin, double u);
90 double SampleAsymptoticCsPositron(const double emin, double u);
91
92 double LossFunction(const double eps1, const double eps2);
93};
94}
95
96#endif
bool GetCluster(double &xcls, double &ycls, double &zcls, double &tcls, int &ncls, double &ecls, double &extra)
Definition: TrackPAI.cc:115
double GetStoppingPower()
Definition: TrackPAI.cc:330
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:38
double GetClusterDensity()
Definition: TrackPAI.cc:309