Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
DriftLineRKF.hh
Go to the documentation of this file.
1#ifndef G_DRIFTLINE_RKF_H
2#define G_DRIFTLINE_RKF_H
3
4#include <vector>
5#include <string>
6
7#include "Sensor.hh"
8#include "ViewDrift.hh"
9#include "Medium.hh"
10#include "GeometryBase.hh"
11
12namespace Garfield {
13
15
16 public:
19
20 void SetSensor(Sensor* s);
21 void SetIntegrationAccuracy(const double a);
22 void SetMaximumStepSize(const double ms);
23
24 void EnablePlotting(ViewDrift* view);
25 void DisablePlotting();
26
27 void SetMaxSteps(const unsigned int& m) { m_maxSteps = m; }
28
29 void SetElectronSignalScalingFactor(const double scale) { m_scaleElectronSignal = scale; }
30 void SetHoleSignalScalingFactor(const double scale) { m_scaleHoleSignal = scale; }
31 void SetIonSignalScalingFactor(const double scale) { m_scaleIonSignal = scale; }
32
33 bool DriftElectron(const double& x0, const double& y0, const double& z0,
34 const double& t0);
35 bool DriftHole(const double& x0, const double& y0, const double& z0,
36 const double& t0);
37 bool DriftIon(const double& x0, const double& y0, const double& z0,
38 const double& t0);
39
40 void GetEndPoint(double& x, double& y, double& z, double& t, int& st) const;
41 unsigned int GetNumberOfDriftLinePoints() const { return m_path.size(); }
42 void GetDriftLinePoint(const unsigned int i, double& x, double& y, double& z, double& t) const;
43
44 double GetArrivalTimeSpread();
45 double GetGain();
46 double GetDriftTime() const;
47
48 void EnableDebugging() { m_debug = true; }
49 void DisableDebugging() { m_debug = false; }
50
51 void EnableVerbose() { m_verbose = true; }
52 void DisableVerbose() { m_verbose = false; }
53
54 private:
55 static const unsigned int ParticleTypeElectron = 0;
56 static const unsigned int ParticleTypeIon = 1;
57 static const unsigned int ParticleTypeHole = 2;
58
59 std::string m_className;
60
61 Sensor* m_sensor;
62 Medium* m_medium;
63
64 unsigned int m_particleType;
65 double m_maxStepSize;
66 double m_accuracy;
67 unsigned int m_maxSteps;
68
69 bool m_usePlotting;
70 ViewDrift* m_view;
71
72 struct step {
73 // Position (initial and final)
74 double xi, xf;
75 double yi, yf;
76 double zi, zf;
77 // Time (initial and final)
78 double ti, tf;
79 // Integrated Townsend coefficient
80 double alphaint;
81 // Status flag
82 int status;
83 };
84 std::vector<step> m_path;
85
86 double m_scaleElectronSignal;
87 double m_scaleHoleSignal;
88 double m_scaleIonSignal;
89
90 bool m_debug;
91 bool m_verbose;
92
93 // Calculate a drift line starting at a given position.
94 bool DriftLine(const double& x0, const double& y0, const double& z0,
95 const double& t0);
96 // Calculate transport parameters for the respective particle type.
97 bool GetVelocity(const double& ex, const double& ey, const double& ez,
98 const double& bx, const double& by, const double& bz,
99 double& vx, double& vy, double& vz) const;
100 bool GetDiffusion(const double& ex, const double& ey, const double& ez,
101 const double& bx, const double& by, const double& bz,
102 double& dl, double& dt) const;
103 bool GetTownsend(const double& ex, const double& ey, const double& ez,
104 const double& bx, const double& by, const double& bz,
105 double& alpha) const;
106 // Terminate a drift line at the edge of a boundary.
107 bool EndDriftLine();
108 // Drift a particle to a wire
109 bool DriftToWire(double x0, double y0, double z0, const double& xw,
110 const double& yw, const double& rw);
111 // Determine the longitudinal diffusion over the drift line.
112 double IntegrateDiffusion(const double& x, const double& y, const double& z,
113 const double& xe, const double& ye,
114 const double& ze);
115 // Determine the effective gain over the drift line.
116 double IntegrateTownsend(const double& x, const double& y, const double& z,
117 const double& xe, const double& ye, const double& ze,
118 const double& tol);
119 // Calculate the signal for the current drift line.
120 void ComputeSignal() const;
121};
122}
123
124#endif
void SetIonSignalScalingFactor(const double scale)
Definition: DriftLineRKF.hh:31
bool DriftElectron(const double &x0, const double &y0, const double &z0, const double &t0)
Definition: DriftLineRKF.cc:75
void SetIntegrationAccuracy(const double a)
Definition: DriftLineRKF.cc:38
void SetMaxSteps(const unsigned int &m)
Definition: DriftLineRKF.hh:27
void SetSensor(Sensor *s)
Definition: DriftLineRKF.cc:28
bool DriftHole(const double &x0, const double &y0, const double &z0, const double &t0)
Definition: DriftLineRKF.cc:85
unsigned int GetNumberOfDriftLinePoints() const
Definition: DriftLineRKF.hh:41
bool DriftIon(const double &x0, const double &y0, const double &z0, const double &t0)
Definition: DriftLineRKF.cc:94
void GetDriftLinePoint(const unsigned int i, double &x, double &y, double &z, double &t) const
void EnablePlotting(ViewDrift *view)
Definition: DriftLineRKF.cc:58
double GetDriftTime() const
void GetEndPoint(double &x, double &y, double &z, double &t, int &st) const
void SetHoleSignalScalingFactor(const double scale)
Definition: DriftLineRKF.hh:30
void SetMaximumStepSize(const double ms)
Definition: DriftLineRKF.cc:48
void SetElectronSignalScalingFactor(const double scale)
Definition: DriftLineRKF.hh:29