Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
ComponentConstant.hh
Go to the documentation of this file.
1#ifndef G_COMPONENT_CONSTANT_H
2#define G_COMPONENT_CONSTANT_H
3
4#include "ComponentBase.hh"
5
6namespace Garfield {
7
8/// Component with constant electric field.
9
11 public:
12 /// Constructor
14 /// Destructor
16
17 void ElectricField(const double x, const double y, const double z, double& ex,
18 double& ey, double& ez, Medium*& m, int& status) override;
19 void ElectricField(const double x, const double y, const double z, double& ex,
20 double& ey, double& ez, double& v, Medium*& m,
21 int& status) override;
22 bool GetVoltageRange(double& vmin, double& vmax) override;
23 void WeightingField(const double x, const double y, const double z,
24 double& wx, double& wy, double& wz,
25 const std::string& label) override;
26 double WeightingPotential(const double x, const double y, const double z,
27 const std::string& label) override;
28
29 /// Set the components of the electric field [V / cm].
30 void SetElectricField(const double ex, const double ey, const double ez);
31 /// Specify the potential at a given point.
32 void SetPotential(const double x, const double y, const double z,
33 const double v = 0.);
34
35 /// Set the components of the weighting field [1 / cm].
36 void SetWeightingField(const double wx, const double wy, const double wz,
37 const std::string label);
38 /// Specify the weighting potential at a given point.
39 void SetWeightingPotential(const double x, const double y, const double z,
40 const double v = 0.);
41
42 private:
43 // Electric field
44 double m_fx = 0.;
45 double m_fy = 0.;
46 double m_fz = 0.;
47
48 // Potential
49 bool m_hasPotential = false;
50 // Point where potential was specified
51 double m_x0 = 0., m_y0 = 0., m_z0 = 0.;
52 // Potential at this point
53 double m_v0 = 0.;
54
55 // Weighting field
56 bool m_hasWeightingField = false;
57 std::string m_wfield = "";
58 double m_fwx = 0., m_fwy = 0., m_fwz = 0.;
59 bool m_hasWeightingPotential = false;
60 // Point where the weighting potential was specified
61 double m_wx0 = 0., m_wy0 = 0., m_wz0 = 0.;
62 // Weighting potential at this point
63 double m_w0 = 0.;
64
65 void Reset() override;
66 void UpdatePeriodicity() override;
67};
68}
69#endif
Abstract base class for components.
Component with constant electric field.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
bool GetVoltageRange(double &vmin, double &vmax) override
Calculate the voltage range [V].
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
void SetElectricField(const double ex, const double ey, const double ez)
Set the components of the electric field [V / cm].
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
void SetPotential(const double x, const double y, const double z, const double v=0.)
Specify the potential at a given point.
void SetWeightingPotential(const double x, const double y, const double z, const double v=0.)
Specify the weighting potential at a given point.
void SetWeightingField(const double wx, const double wy, const double wz, const std::string label)
Set the components of the weighting field [1 / cm].
Abstract base class for media.
Definition: Medium.hh:13