Garfield++ v2r0
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
12 public:
13 /// Constructor
15 /// Destructor
17
18 void ElectricField(const double x, const double y, const double z, double& ex,
19 double& ey, double& ez, Medium*& m, int& status);
20 void ElectricField(const double x, const double y, const double z, double& ex,
21 double& ey, double& ez, double& v, Medium*& m,
22 int& status);
23 bool GetVoltageRange(double& vmin, double& vmax);
24 void MagneticField(const double x, const double y, const double z,
25 double& bx, double& by, double& bz, int& status);
26 void WeightingField(const double x, const double y, const double z,
27 double& wx, double& wy, double& wz,
28 const std::string& label);
29 double WeightingPotential(const double x, const double y, const double z,
30 const std::string& label);
31
32 /// Set the function to be called for calculating the electric field.
33 void SetElectricField(void (*f)(const double, const double, const double,
34 double&, double&, double&));
35 /// Set the function to be called for calculating the potential.
36 void SetPotential(void (*f)(const double, const double, const double,
37 double&));
38 /// Set the function to be called for calculating the weighting field.
39 void SetWeightingField(void (*f)(const double, const double, const double,
40 double&, double&, double&,
41 const std::string));
42 /// Set the function to be called for calculating the weighting potential.
43 void SetWeightingPotential(void (*f)(const double, const double, const double,
44 double&, const std::string));
45 /// Set the function to be called for calculating the magnetic field.
46 void SetMagneticField(void (*f)(const double, const double, const double,
47 double&, double&, double&));
48
49 private:
50 /// Electric field function
51 void (*m_efield)(const double, const double, const double, double&, double&,
52 double&);
53
54 /// Potential function
55 void (*m_potential)(const double, const double, const double, double&);
56
57 /// Weighting field function
58 void (*m_wfield)(const double, const double, const double, double&, double&,
59 double&, const std::string);
60
61 /// Weighting potential function
62 void (*m_wpot)(const double, const double, const double, double&,
63 const std::string);
64
65 /// Magnetic field function
66 void (*m_bfield)(const double, const double, const double, double&, double&,
67 double&);
68
69 /// Reset the component
70 void Reset();
71 // Verify periodicities
72 void UpdatePeriodicity();
73};
74}
75#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 SetMagneticField(void(*f)(const double, const double, const double, double &, double &, double &))
Set the function to be called for calculating the magnetic field.
bool GetVoltageRange(double &vmin, double &vmax)
Calculate the voltage range [V].
void MagneticField(const double x, const double y, const double z, double &bx, double &by, double &bz, int &status)
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 WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
ComponentUser()
Constructor.
Definition: ComponentUser.cc:7
double WeightingPotential(const double x, const double y, const double z, const std::string &label)
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)
void SetPotential(void(*f)(const double, const double, const double, double &))
Set the function to be called for calculating the potential.
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:11