![]() |
Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
|
Component for parallel-plate geometries. More...
#include <ComponentParallelPlate.hh>
Classes | |
| struct | Electrode |
| Structure that captures the information of the electrodes under study. More... | |
Public Member Functions | |
| ComponentParallelPlate () | |
| Constructor. | |
| ~ComponentParallelPlate () | |
| Destructor. | |
| void | Setup (const unsigned int N, std::vector< double > eps, std::vector< double > d, const double V, std::vector< int > sigmaIndex={}) |
| Define the geometry. | |
| void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override |
| Calculate the drift field at given point. | |
| void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override |
| Calculate the drift field [V/cm] and potential [V] at (x, y, z). | |
| double | WeightingPotential (const double x, const double y, const double z, const std::string &label) override |
| Calculate the weighting potential at a given point. | |
| bool | GetVoltageRange (double &vmin, double &vmax) override |
| Calculate the voltage range [V]. | |
| void | AddPixel (double x, double z, double lx, double lz, const std::string &label, bool fromAnode=true) |
| Add a pixel electrode. | |
| void | AddStrip (double z, double lz, const std::string &label, bool fromAnode=true) |
| Add strip electrode. | |
| void | AddPlane (const std::string &label, bool fromAnode=true) |
| Add plane electrode, if you want to read the signal from the cathode set the second argument to false. | |
| void | SetMedium (Medium *medium) |
| Setting the medium. | |
| void | SetWeightingPotentialGrid (const double xmin, const double xmax, const double xsteps, const double ymin, const double ymax, const double ysteps, const double zmin, const double zmax, const double zsteps, const std::string &label) |
| Calculate time-dependent weighting potential on a grid. | |
| void | SetWeightingPotentialGrids (const double xmin, const double xmax, const double xsteps, const double ymin, const double ymax, const double ysteps, const double zmin, const double zmax, const double zsteps) |
| This will calculate all electrodes time-dependent weighting potential on the specified grid. | |
| void | LoadWeightingPotentialGrid (const std::string &label) |
| This will load a previously calculated grid of time-dependent weighting potential values. | |
| Medium * | GetMedium (const double x, const double y, const double z) override |
| Get the medium at a given location (x, y, z). | |
| bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override |
| Get the bounding box coordinates. | |
| bool | getLayer (const double y, int &m, double &epsM) |
| void | getPermittivityFromLayer (int m, double &eps) |
| void | getZBoundFromLayer (int m, double &zbottom, double &ztop) |
| int | NumberOfLayers () |
| void | IndexOfGasGaps (std::vector< int > &indexGasGap) |
| void | SetIntegrationPrecision (const double eps) |
| void | SetIntegrationUpperbound (const double p) |
| void | DisablePotentialCalculationOutsideGasGap () |
| std::array< double, 3 > | ElectricField (const double x, const double y, const double z) |
| Calculate the drift field [V/cm] at (x, y, z). | |
| Public Member Functions inherited from Garfield::Component | |
| Component ()=delete | |
| Default constructor. | |
| Component (const std::string &name) | |
| Constructor. | |
| virtual | ~Component ()=default |
| Destructor. | |
| virtual void | SetGeometry (Geometry *geo) |
| Define the geometry. | |
| virtual void | Clear () |
| Reset. | |
| std::array< double, 3 > | ElectricField (const double x, const double y, const double z) |
| Calculate the drift field [V/cm] at (x, y, z). | |
| virtual double | ElectricPotential (const double x, const double y, const double z) |
| Calculate the (drift) electrostatic potential [V] at (x, y, z). | |
| virtual void | WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) |
| Calculate the weighting field at a given point and for a given electrode. | |
| virtual const std::vector< double > & | DelayedSignalTimes (const std::string &) |
| Return the time steps at which the delayed weighting potential/field are stored/evaluated. | |
| virtual void | DelayedWeightingField (const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label) |
| Calculate the delayed weighting field at a given point and time and for a given electrode. | |
| virtual double | DelayedWeightingPotential (const double x, const double y, const double z, const double t, const std::string &label) |
| Calculate the delayed weighting potential at a given point and time and for a given electrode. | |
| virtual void | DelayedWeightingPotentials (const double x, const double y, const double z, const std::string &label, std::vector< double > &dwp) |
| Calculate the delayed weighting potentials at a given point and for a given electrode, for a set of pre-defined times. | |
| virtual void | MagneticField (const double x, const double y, const double z, double &bx, double &by, double &bz, int &status) |
| Calculate the magnetic field at a given point. | |
| void | SetMagneticField (const double bx, const double by, const double bz) |
| Set a constant magnetic field. | |
| virtual bool | IsReady () |
| Ready for use? | |
| virtual bool | Is3d () |
| Does the component have a 3D field (map)? | |
| virtual bool | GetElementaryCell (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) |
| Get the coordinates of the elementary cell. | |
| double | CellSizeX () |
| double | CellSizeY () |
| double | CellSizeZ () |
| virtual size_t | GetNumberOfElements () const |
| Return the number of mesh elements. | |
| virtual bool | GetElementNodes (const size_t, std::vector< size_t > &) const |
| Get the indices of the nodes constituting a given element. | |
| virtual bool | GetElementRegion (const size_t, size_t &, bool &) const |
| Get the region/material of a mesh element and a flag whether it is associated to an active medium. | |
| virtual size_t | GetNumberOfNodes () const |
| Return the number of mesh nodes. | |
| virtual bool | GetNode (const size_t i, double &x, double &y, double &z) const |
| Get the coordinates of a mesh node. | |
| double | IntegrateFluxCircle (const double xc, const double yc, const double r, const unsigned int nI=50) |
| Integrate the normal component of the electric field over a circle. | |
| double | IntegrateFluxSphere (const double xc, const double yc, const double zc, const double r, const unsigned int nI=20) |
| Integrate the normal component of the electric field over a sphere. | |
| double | IntegrateFluxParallelogram (const double x0, const double y0, const double z0, const double dx1, const double dy1, const double dz1, const double dx2, const double dy2, const double dz2, const unsigned int nU=20, const unsigned int nV=20) |
| Integrate the normal component of the electric field over a parallelogram. | |
| double | IntegrateWeightingFluxParallelogram (const std::string &label, const double x0, const double y0, const double z0, const double dx1, const double dy1, const double dz1, const double dx2, const double dy2, const double dz2, const unsigned int nU=20, const unsigned int nV=20) |
| Integrate the normal component of the weighting field over a parallelogram. | |
| double | IntegrateFluxLine (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const double xp, const double yp, const double zp, const unsigned int nI, const int isign=0) |
| Integrate the electric field flux through a line from (x0,y0,z0) to (x1,y1,z1) along a direction (xp,yp,zp). | |
| virtual bool | CrossedWire (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc, const bool centre, double &rc) |
| Determine whether the line between two points crosses a wire. | |
| virtual bool | InTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yw, double &rw) |
| Determine whether a particle is inside the trap radius of a wire. | |
| virtual bool | CrossedPlane (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc) |
| Determine whether the line between two points crosses a plane. | |
| void | EnablePeriodicityX (const bool on=true) |
| Enable simple periodicity in the | |
| void | EnablePeriodicityY (const bool on=true) |
| Enable simple periodicity in the | |
| void | EnablePeriodicityZ (const bool on=true) |
| Enable simple periodicity in the | |
| void | IsPeriodic (bool &perx, bool &pery, bool &perz) |
| Return periodicity flags. | |
| void | EnableMirrorPeriodicityX (const bool on=true) |
| Enable mirror periodicity in the | |
| void | EnableMirrorPeriodicityY (const bool on=true) |
| Enable mirror periodicity in the | |
| void | EnableMirrorPeriodicityZ (const bool on=true) |
| Enable mirror periodicity in the | |
| void | IsMirrorPeriodic (bool &perx, bool &pery, bool &perz) |
| Return mirror periodicity flags. | |
| void | EnableAxialPeriodicityX (const bool on=true) |
| Enable axial periodicity in the | |
| void | EnableAxialPeriodicityY (const bool on=true) |
| Enable axial periodicity in the | |
| void | EnableAxialPeriodicityZ (const bool on=true) |
| Enable axial periodicity in the | |
| void | IsAxiallyPeriodic (bool &perx, bool &pery, bool &perz) |
| Return axial periodicity flags. | |
| void | EnableRotationSymmetryX (const bool on=true) |
| Enable rotation symmetry around the | |
| void | EnableRotationSymmetryY (const bool on=true) |
| Enable rotation symmetry around the | |
| void | EnableRotationSymmetryZ (const bool on=true) |
| Enable rotation symmetry around the | |
| void | IsRotationSymmetric (bool &rotx, bool &roty, bool &rotz) |
| Return rotation symmetry flags. | |
| void | EnableTriangleSymmetricXY (const bool on=true, const bool oct=2) |
| Enable triangular periodicity in the | |
| void | EnableTriangleSymmetricXZ (const bool on=true, const bool oct=2) |
| Enable triangular periodicity in the | |
| void | EnableTriangleSymmetricYZ (const bool on=true, const bool oct=2) |
| Enable triangular periodicity in the | |
| void | EnableDebugging (const bool on=true) |
| Switch on debugging messages. | |
| void | DisableDebugging () |
| Switch off debugging messages. | |
| virtual bool | HasMagneticField () const |
| Does the component have a non-zero magnetic field? | |
| virtual bool | HasTownsendMap () const |
| Does the component have maps of the Townsend coefficient? | |
| virtual bool | HasAttachmentMap () const |
| Does the component have maps of the attachment coefficient? | |
| virtual bool | HasMobilityMap () const |
| Does the component have maps of the low-field mobility? | |
| virtual bool | HasVelocityMap () const |
| Does the component have velocity maps? | |
| virtual bool | ElectronAttachment (const double, const double, const double, double &eta) |
| Get the electron attachment coefficient. | |
| virtual bool | HoleAttachment (const double, const double, const double, double &eta) |
| Get the hole attachment coefficient. | |
| virtual bool | ElectronMobility (const double, const double, const double, double &mu) |
| virtual bool | HoleMobility (const double, const double, const double, double &mu) |
| Get the hole Mobility coefficient. | |
| virtual bool | ElectronTownsend (const double, const double, const double, double &alpha) |
| Get the electron Townsend coefficient. | |
| virtual bool | HoleTownsend (const double, const double, const double, double &alpha) |
| Get the hole Townsend coefficient. | |
| virtual bool | ElectronVelocity (const double, const double, const double, double &vx, double &vy, double &vz) |
| Get the electron drift velocity. | |
| virtual bool | HoleVelocity (const double, const double, const double, double &vx, double &vy, double &vz) |
| Get the hole drift velocity. | |
| virtual double | StepSizeHint () |
| virtual double | CreateGPUTransferObject (ComponentGPU *&comp_gpu) |
| Create and initialise GPU Transfer class. | |
Private Types | |
| enum | structureelectrode { NotSet = -1 , Plane , Strip , Pixel } |
| Possible readout groups. More... | |
Private Member Functions | |
| double | IntegratePromptPotential (const Electrode &el, const double x, const double y, const double z) |
| void | CalculateDynamicalWeightingPotential (const Electrode &el) |
| double | FindWeightingPotentialInGrid (Electrode &el, const double x, const double y, const double z) |
| bool | Nsigma (int N, std::vector< std::vector< int > > &sigmaMatrix) |
| bool | Ntheta (int N, std::vector< std::vector< int > > &thetaMatrix, std::vector< std::vector< int > > &sigmaMatrix) |
| void | constructGeometryMatrices (const int N) |
| void | constructGeometryFunction (const int N, const std::vector< double > &d) |
| void | setHIntegrand () |
| void | setwpPixelIntegrand () |
| void | setwpStripIntegrand () |
| double | constWEFieldLayer (const int indexLayer) |
| double | wpPlane (const double z) |
| double | constEFieldLayer (const int indexLayer) |
| bool | decToBinary (int n, std::vector< int > &binaryNum) |
| void | LayerUpdate (const double z, const int im, const double epsM) |
| void | UpdatePeriodicity () override |
| Verify periodicities. | |
| void | Reset () override |
| Reset the component. | |
Private Attributes | |
| double | m_precision = 1.e-12 |
| double | m_V = 0. |
| Voltage difference between the parallel plates. | |
| bool | m_getPotentialInPlate = true |
| int | m_N = 0 |
| Number of layers. | |
| double | m_upperBoundIntegration = 30 |
| std::vector< double > | m_eps |
| relative permittivity of each layer | |
| std::vector< double > | m_epsHolder |
| std::vector< double > | m_d |
| thickness of each layer | |
| std::vector< double > | m_z |
| std::vector< bool > | m_conductive |
| Flag whether a layer is conductive. | |
| TF2 | m_hIntegrand |
| TF1 | m_wpStripIntegral |
| Weighting potential integrand for strips. | |
| TF2 | m_wpPixelIntegral |
| Weighting potential integrand for pixels. | |
| std::vector< std::vector< std::vector< int > > > | m_sigmaMatrix |
| std::vector< std::vector< std::vector< int > > > | m_thetaMatrix |
| std::vector< std::vector< double > > | m_cMatrix |
| c-matrixl. | |
| std::vector< std::vector< double > > | m_vMatrix |
| v-matrixl. | |
| std::vector< std::vector< double > > | m_gMatrix |
| g-matrixl. | |
| std::vector< std::vector< double > > | m_wMatrix |
| w-matrixl. | |
| int | m_currentLayer = 0 |
| Index of the current layer. | |
| double | m_currentPosition = -1 |
| Medium * | m_medium = nullptr |
| std::vector< std::string > | m_readout |
| std::vector< Electrode > | m_readout_p |
Static Private Attributes | |
| static constexpr double | m_Vw = 1. |
Additional Inherited Members | |
| Protected Attributes inherited from Garfield::Component | |
| std::string | m_className {"Component"} |
| Class name. | |
| Geometry * | m_geometry {nullptr} |
| Pointer to the geometry. | |
| std::array< double, 3 > | m_b0 = {{0., 0., 0.}} |
| Constant magnetic field. | |
| bool | m_ready {false} |
| Ready for use? | |
| bool | m_debug {false} |
| Switch on/off debugging messages. | |
| std::array< bool, 3 > | m_periodic = {{false, false, false}} |
| Simple periodicity in x, y, z. | |
| std::array< bool, 3 > | m_mirrorPeriodic = {{false, false, false}} |
| Mirror periodicity in x, y, z. | |
| std::array< bool, 3 > | m_axiallyPeriodic = {{false, false, false}} |
| Axial periodicity in x, y, z. | |
| std::array< bool, 3 > | m_rotationSymmetric = {{false, false, false}} |
| Rotation symmetry around x-axis, y-axis, z-axis. | |
| std::array< bool, 3 > | m_triangleSymmetric = {{false, false, false}} |
| Triangle symmetric in the xy, xz, and yz plane. | |
| int | m_triangleSymmetricOct = 0 |
| Triangle symmetric octant of imported map (0 < phi < Pi/4 --> octant 1). | |
| const std::array< int, 4 > | m_triangleOctRules = {1, 4, 5, 8} |
| Octants where |x| >= |y|. | |
| bool | m_outsideCone = false |
| std::vector< double > | m_wdtimes |
| Time steps at which the delayed weighting potentials/fields are stored. | |
Component for parallel-plate geometries.
Definition at line 19 of file ComponentParallelPlate.hh.
|
private |
Possible readout groups.
| Enumerator | |
|---|---|
| NotSet | |
| Plane | |
| Strip | |
| Pixel | |
Definition at line 214 of file ComponentParallelPlate.hh.
| Garfield::ComponentParallelPlate::ComponentParallelPlate | ( | ) |
Constructor.
|
inline |
| void Garfield::ComponentParallelPlate::AddPixel | ( | double | x, |
| double | z, | ||
| double | lx, | ||
| double | lz, | ||
| const std::string & | label, | ||
| bool | fromAnode = true ) |
Add a pixel electrode.
| x,z | position of the center of the electrode in the xz-plane. |
| lx | width in the along |
| lz | width in the along |
| label | give name using a string. |
| fromAnode | is |
| void Garfield::ComponentParallelPlate::AddPlane | ( | const std::string & | label, |
| bool | fromAnode = true ) |
Add plane electrode, if you want to read the signal from the cathode set the second argument to false.
| void Garfield::ComponentParallelPlate::AddStrip | ( | double | z, |
| double | lz, | ||
| const std::string & | label, | ||
| bool | fromAnode = true ) |
Add strip electrode.
|
private |
|
inlineprivate |
Definition at line 278 of file ComponentParallelPlate.hh.
|
private |
|
private |
|
inlineprivate |
Definition at line 256 of file ComponentParallelPlate.hh.
|
private |
|
inline |
Definition at line 155 of file ComponentParallelPlate.hh.
| std::array< double, 3 > Garfield::Component::ElectricField | ( | const double | x, |
| const double | y, | ||
| const double | z ) |
Calculate the drift field [V/cm] at (x, y, z).
|
overridevirtual |
Calculate the drift field [V/cm] and potential [V] at (x, y, z).
Implements Garfield::Component.
|
overridevirtual |
Calculate the drift field at given point.
| x,y,z | coordinates [cm]. |
| ex,ey,ez | components of the electric field [V/cm]. |
| m | pointer to the medium at this location. |
| status | status flag |
Status flags:
0: Inside an active medium
> 0: Inside a wire of type X
-4 ... -1: On the side of a plane where no wires are
-5: Inside the mesh but not in an active medium
-6: Outside the mesh
-10: Unknown potential type (should not occur)
other: Other cases (should not occur)
Implements Garfield::Component.
|
private |
|
overridevirtual |
Get the bounding box coordinates.
Reimplemented from Garfield::Component.
|
inline |
Definition at line 119 of file ComponentParallelPlate.hh.
|
overridevirtual |
Get the medium at a given location (x, y, z).
Reimplemented from Garfield::Component.
|
inline |
Definition at line 133 of file ComponentParallelPlate.hh.
|
overridevirtual |
Calculate the voltage range [V].
Implements Garfield::Component.
|
inline |
Definition at line 137 of file ComponentParallelPlate.hh.
|
inline |
Definition at line 144 of file ComponentParallelPlate.hh.
|
private |
|
inlineprivate |
Definition at line 293 of file ComponentParallelPlate.hh.
|
inline |
This will load a previously calculated grid of time-dependent weighting potential values.
Definition at line 97 of file ComponentParallelPlate.hh.
|
private |
|
private |
|
inline |
Definition at line 142 of file ComponentParallelPlate.hh.
|
overrideprivatevirtual |
Reset the component.
Implements Garfield::Component.
|
private |
|
inline |
Definition at line 151 of file ComponentParallelPlate.hh.
|
inline |
Definition at line 153 of file ComponentParallelPlate.hh.
|
inline |
Setting the medium.
Definition at line 72 of file ComponentParallelPlate.hh.
| void Garfield::ComponentParallelPlate::Setup | ( | const unsigned int | N, |
| std::vector< double > | eps, | ||
| std::vector< double > | d, | ||
| const double | V, | ||
| std::vector< int > | sigmaIndex = {} ) |
Define the geometry.
| N | amount of layers in the geometry, this includes the gas gaps |
| d | thickness of the layers starting from the bottom to the top layer along |
| eps | relative permittivities of the layers starting from the bottom to the top layer along |
| sigmaIndex | Indices of the resistive layers (optional). |
| V | applied potential difference between the parallel plates. |
| void Garfield::ComponentParallelPlate::SetWeightingPotentialGrid | ( | const double | xmin, |
| const double | xmax, | ||
| const double | xsteps, | ||
| const double | ymin, | ||
| const double | ymax, | ||
| const double | ysteps, | ||
| const double | zmin, | ||
| const double | zmax, | ||
| const double | zsteps, | ||
| const std::string & | label ) |
Calculate time-dependent weighting potential on a grid.
| xmin,ymin,zmin | minimum value of the interval in the |
| xmax,ymax,zmax | maximum value of the interval in the |
| xsteps,ysteps,zsteps | mumber of grid nodes in the |
| label | give name using a string. |
| void Garfield::ComponentParallelPlate::SetWeightingPotentialGrids | ( | const double | xmin, |
| const double | xmax, | ||
| const double | xsteps, | ||
| const double | ymin, | ||
| const double | ymax, | ||
| const double | ysteps, | ||
| const double | zmin, | ||
| const double | zmax, | ||
| const double | zsteps ) |
This will calculate all electrodes time-dependent weighting potential on the specified grid.
|
private |
|
private |
|
overrideprivatevirtual |
Verify periodicities.
Implements Garfield::Component.
|
overridevirtual |
Calculate the weighting potential at a given point.
| x,y,z | coordinates [cm]. |
| label | name of the electrode. |
Reimplemented from Garfield::Component.
|
inlineprivate |
Definition at line 265 of file ComponentParallelPlate.hh.
|
private |
c-matrixl.
Definition at line 191 of file ComponentParallelPlate.hh.
|
private |
Flag whether a layer is conductive.
Definition at line 177 of file ComponentParallelPlate.hh.
|
private |
Index of the current layer.
Definition at line 196 of file ComponentParallelPlate.hh.
|
private |
Definition at line 197 of file ComponentParallelPlate.hh.
|
private |
thickness of each layer
Definition at line 173 of file ComponentParallelPlate.hh.
|
private |
relative permittivity of each layer
Definition at line 171 of file ComponentParallelPlate.hh.
|
private |
Definition at line 172 of file ComponentParallelPlate.hh.
|
private |
Definition at line 165 of file ComponentParallelPlate.hh.
|
private |
g-matrixl.
Definition at line 193 of file ComponentParallelPlate.hh.
|
private |
Definition at line 179 of file ComponentParallelPlate.hh.
|
private |
Definition at line 199 of file ComponentParallelPlate.hh.
|
private |
Number of layers.
Definition at line 167 of file ComponentParallelPlate.hh.
|
private |
Definition at line 160 of file ComponentParallelPlate.hh.
|
private |
Definition at line 217 of file ComponentParallelPlate.hh.
|
private |
Definition at line 218 of file ComponentParallelPlate.hh.
|
private |
Definition at line 184 of file ComponentParallelPlate.hh.
|
private |
Definition at line 187 of file ComponentParallelPlate.hh.
|
private |
Definition at line 169 of file ComponentParallelPlate.hh.
|
private |
Voltage difference between the parallel plates.
Definition at line 163 of file ComponentParallelPlate.hh.
|
private |
v-matrixl.
Definition at line 192 of file ComponentParallelPlate.hh.
|
staticconstexprprivate |
Definition at line 161 of file ComponentParallelPlate.hh.
|
private |
w-matrixl.
Definition at line 194 of file ComponentParallelPlate.hh.
|
private |
Weighting potential integrand for pixels.
Definition at line 182 of file ComponentParallelPlate.hh.
|
private |
Weighting potential integrand for strips.
Definition at line 181 of file ComponentParallelPlate.hh.
|
private |
Definition at line 174 of file ComponentParallelPlate.hh.