Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
ComponentUser.hh
Go to the documentation of this file.
1#ifndef G_COMPONENT_USER_H
2#define G_COMPONENT_USER_H
3
4#include "ComponentBase.hh"
5
6namespace Garfield {
7
8/// Simple component with electric field given by a user function.
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 MagneticField(const double x, const double y, const double z, double& bx,
24 double& by, double& bz, int& status) override;
25 void WeightingField(const double x, const double y, const double z,
26 double& wx, double& wy, double& wz,
27 const std::string& label) override;
28 double WeightingPotential(const double x, const double y, const double z,
29 const std::string& label) override;
30 void DelayedWeightingField(const double x, const double y, const double z,
31 const double t, double& wx, double& wy, double& wz,
32 const std::string& label) override;
33
34 /// Set the function to be called for calculating the electric field.
35 void SetElectricField(void (*f)(const double, const double, const double,
36 double&, double&, double&));
37 /// Set the function to be called for calculating the potential.
38 void SetPotential(void (*f)(const double, const double, const double,
39 double&));
40 /// Set the function to be called for calculating the weighting field.
41 void SetWeightingField(void (*f)(const double, const double, const double,
42 double&, double&, double&,
43 const std::string));
44 /// Set the function to be called for calculating the weighting potential.
45 void SetWeightingPotential(void (*f)(const double, const double, const double,
46 double&, const std::string));
47 /// Set the function to be called for calculating the delayed weighting field.
48 void SetDelayedWeightingField(void (*f)(const double, const double,
49 const double, const double,
50 double&, double&, double&,
51 const std::string));
52 /// Set the function to be called for calculating the magnetic field.
53 void SetMagneticField(void (*f)(const double, const double, const double,
54 double&, double&, double&));
55
56 private:
57 /// Electric field function
58 void (*m_efield)(const double, const double, const double, double&, double&,
59 double&) = nullptr;
60
61 /// Potential function
62 void (*m_potential)(const double, const double, const double,
63 double&) = nullptr;
64
65 /// Weighting field function
66 void (*m_wfield)(const double, const double, const double, double&, double&,
67 double&, const std::string) = nullptr;
68
69 /// Weighting potential function
70 void (*m_wpot)(const double, const double, const double, double&,
71 const std::string) = nullptr;
72
73 /// Delayed weighting field function
74 void (*m_dwfield)(const double, const double, const double, const double,
75 double&, double&, double&, const std::string) = nullptr;
76
77 /// Magnetic field function
78 void (*m_bfield)(const double, const double, const double, double&, double&,
79 double&) = nullptr;
80
81 /// Reset the component
82 void Reset() override;
83 // Verify periodicities
84 void UpdatePeriodicity() override;
85};
86}
87#endif
Abstract base class for components.
Simple component with electric field given by a user function.
void SetWeightingField(void(*f)(const double, const double, const double, double &, double &, double &, const std::string))
Set the function to be called for calculating the weighting field.
void DelayedWeightingField(const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label) override
void SetMagneticField(void(*f)(const double, const double, const double, double &, double &, double &))
Set the function to be called for calculating the magnetic field.
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
void SetElectricField(void(*f)(const double, const double, const double, double &, double &, double &))
Set the function to be called for calculating the electric field.
void SetDelayedWeightingField(void(*f)(const double, const double, const double, const double, double &, double &, double &, const std::string))
Set the function to be called for calculating the delayed weighting field.
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
ComponentUser()
Constructor.
Definition: ComponentUser.cc:7
void MagneticField(const double x, const double y, const double z, double &bx, double &by, double &bz, int &status) override
bool GetVoltageRange(double &vmin, double &vmax) override
Calculate the voltage range [V].
void SetPotential(void(*f)(const double, const double, const double, double &))
Set the function to be called for calculating the potential.
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
void SetWeightingPotential(void(*f)(const double, const double, const double, double &, const std::string))
Set the function to be called for calculating the weighting potential.
~ComponentUser()
Destructor.
Abstract base class for media.
Definition: Medium.hh:13