Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <ComponentAnalyticField.hh>
Public Types | |
enum | Cell { A00 , B1X , B1Y , B2X , B2Y , C10 , C2X , C2Y , C30 , D10 , D20 , D30 , D40 , Unknown } |
Public Member Functions | |
ComponentAnalyticField () | |
Constructor. | |
~ComponentAnalyticField () | |
Destructor. | |
void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) |
void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) |
bool | GetVoltageRange (double &pmin, double &pmax) |
Calculate the voltage range [V]. | |
void | WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) |
double | WeightingPotential (const double x, const double y, const double z, const std::string &label) |
bool | GetBoundingBox (double &x0, double &y0, double &z0, double &x1, double &y1, double &z1) |
Get the bounding box coordinates. | |
bool | IsWireCrossed (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc) |
bool | IsInTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yx, double &rw) |
void | AddWire (const double x, const double y, const double diameter, const double voltage, const std::string &label, const double length=100., const double tension=50., const double rho=19.3, const int ntrap=5) |
Add a wire at (x, y) . | |
void | AddTube (const double radius, const double voltage, const int nEdges, const std::string &label) |
Add a tube. | |
void | AddPlaneX (const double x, const double voltage, const std::string &label) |
Add a plane at constant x. | |
void | AddPlaneY (const double y, const double voltage, const std::string &label) |
Add a plane at constant y. | |
void | AddStripOnPlaneX (const char direction, const double x, const double smin, const double smax, const std::string &label, const double gap=-1.) |
void | AddStripOnPlaneY (const char direction, const double y, const double smin, const double smax, const std::string &label, const double gap=-1.) |
void | AddPixelOnPlaneX (const double x, const double ymin, const double ymax, const double zmin, const double zmax, const std::string &label, const double gap=-1.) |
void | AddPixelOnPlaneY (const double y, const double xmin, const double xmax, const double zmin, const double zmax, const std::string &label, const double gap=-1.) |
void | SetPeriodicityX (const double s) |
Set the periodic length [cm] in the x-direction. | |
void | SetPeriodicityY (const double s) |
Set the periodic length [cm] in the y-direction. | |
bool | GetPeriodicityX (double &s) |
bool | GetPeriodicityY (double &s) |
void | AddCharge (const double x, const double y, const double z, const double q) |
Add a point charge. | |
void | ClearCharges () |
void | PrintCharges () const |
std::string | GetCellType () |
void | AddReadout (const std::string &label) |
Setup the weighting field for a given group of wires or planes. | |
void | EnableChargeCheck (const bool on=true) |
void | DisableChargeCheck () |
unsigned int | GetNumberOfWires () const |
bool | GetWire (const unsigned int i, double &x, double &y, double &diameter, double &voltage, std::string &label, double &length, double &charge, int &ntrap) const |
unsigned int | GetNumberOfPlanesX () const |
unsigned int | GetNumberOfPlanesY () const |
bool | GetPlaneX (const unsigned int i, double &x, double &voltage, std::string &label) const |
bool | GetPlaneY (const unsigned int i, double &y, double &voltage, std::string &label) const |
bool | GetTube (double &r, double &voltage, int &nEdges, std::string &label) const |
Public Member Functions inherited from Garfield::ComponentBase | |
ComponentBase () | |
Constructor. | |
virtual | ~ComponentBase () |
Destructor. | |
virtual void | SetGeometry (GeometryBase *geo) |
Define the geometry. | |
virtual void | Clear () |
Reset. | |
virtual Medium * | GetMedium (const double x, const double y, const double z) |
Get the medium at a given location (x, y, z). | |
virtual void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)=0 |
virtual void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status)=0 |
virtual bool | GetVoltageRange (double &vmin, double &vmax)=0 |
Calculate the voltage range [V]. | |
virtual void | WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) |
virtual double | WeightingPotential (const double x, const double y, const double z, const std::string &label) |
virtual void | MagneticField (const double x, const double y, const double z, double &bx, double &by, double &bz, int &status) |
void | SetMagneticField (const double bx, const double by, const double bz) |
Set a constant magnetic field. | |
virtual bool | IsReady () |
Ready for use? | |
virtual bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) |
Get the bounding box coordinates. | |
virtual bool | IsWireCrossed (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc) |
virtual bool | IsInTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yw, double &rw) |
void | EnablePeriodicityX (const bool on=true) |
Enable simple periodicity in the direction. | |
void | DisablePeriodicityX () |
void | EnablePeriodicityY (const bool on=true) |
Enable simple periodicity in the direction. | |
void | DisablePeriodicityY () |
void | EnablePeriodicityZ (const bool on=true) |
Enable simple periodicity in the direction. | |
void | DisablePeriodicityZ () |
void | EnableMirrorPeriodicityX (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | DisableMirrorPeriodicityX () |
void | EnableMirrorPeriodicityY (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | DisableMirrorPeriodicityY () |
void | EnableMirrorPeriodicityZ (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | DisableMirrorPeriodicityZ () |
void | EnableAxialPeriodicityX (const bool on=true) |
Enable axial periodicity in the direction. | |
void | DisableAxialPeriodicityX () |
void | EnableAxialPeriodicityY (const bool on=true) |
Enable axial periodicity in the direction. | |
void | DisableAxialPeriodicityY () |
void | EnableAxialPeriodicityZ (const bool on=true) |
Enable axial periodicity in the direction. | |
void | DisableAxialPeriodicityZ () |
void | EnableRotationSymmetryX (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | DisableRotationSymmetryX () |
void | EnableRotationSymmetryY (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | DisableRotationSymmetryY () |
void | EnableRotationSymmetryZ (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | DisableRotationSymmetryZ () |
void | EnableDebugging () |
Switch on debugging messages. | |
void | DisableDebugging () |
Switch off debugging messages. | |
void | ActivateTraps () |
Request trapping to be taken care of by the component (for TCAD). | |
void | DeactivateTraps () |
bool | IsTrapActive () |
void | ActivateVelocityMap () |
Request velocity to be taken care of by the component (for TCAD). | |
void | DectivateVelocityMap () |
bool | IsVelocityActive () |
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 void | ElectronVelocity (const double, const double, const double, double &vx, double &vy, double &vz, Medium *&, int &status) |
Get the electron drift velocity. | |
virtual void | HoleVelocity (const double, const double, const double, double &vx, double &vy, double &vz, Medium *&, int &status) |
Get the hole drift velocity. | |
virtual bool | GetElectronLifetime (const double, const double, const double, double &etau) |
virtual bool | GetHoleLifetime (const double, const double, const double, double &htau) |
Additional Inherited Members | |
virtual void | Reset ()=0 |
Geometry checks. | |
virtual void | UpdatePeriodicity ()=0 |
Verify periodicities. | |
Protected Attributes inherited from Garfield::ComponentBase | |
std::string | m_className |
Class name. | |
GeometryBase * | m_geometry |
Pointer to the geometry. | |
bool | m_ready |
Ready for use? | |
bool | m_activeTraps |
Does the component have traps? | |
bool | m_hasVelocityMap |
Does the component have velocity maps? | |
bool | m_xPeriodic |
Simple periodicity in x. | |
bool | m_yPeriodic |
Simple periodicity in y. | |
bool | m_zPeriodic |
Simple periodicity in z. | |
bool | m_xMirrorPeriodic |
Mirror periodicity in x. | |
bool | m_yMirrorPeriodic |
Mirror periodicity in y. | |
bool | m_zMirrorPeriodic |
Mirror periodicity in z. | |
bool | m_xAxiallyPeriodic |
Axial periodicity in x. | |
bool | m_yAxiallyPeriodic |
Axial periodicity in y. | |
bool | m_zAxiallyPeriodic |
Axial periodicity in z. | |
bool | m_xRotationSymmetry |
Rotation symmetry around x-axis. | |
bool | m_yRotationSymmetry |
Rotation symmetry around y-axis. | |
bool | m_zRotationSymmetry |
Rotation symmetry around z-axis. | |
double | m_bx0 |
double | m_by0 |
double | m_bz0 |
bool | m_debug |
Switch on/off debugging messages. | |
Semi-analytic calculation of two-dimensional configurations consisting of wires, planes, and tubes.
Definition at line 15 of file ComponentAnalyticField.hh.
Garfield::ComponentAnalyticField::ComponentAnalyticField | ( | ) |
Constructor.
Definition at line 12 of file ComponentAnalyticField.cc.
|
inline |
void Garfield::ComponentAnalyticField::AddCharge | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | q | ||
) |
Add a point charge.
Definition at line 637 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddPixelOnPlaneX | ( | const double | x, |
const double | ymin, | ||
const double | ymax, | ||
const double | zmin, | ||
const double | zmax, | ||
const std::string & | label, | ||
const double | gap = -1. |
||
) |
Definition at line 454 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddPixelOnPlaneY | ( | const double | y, |
const double | xmin, | ||
const double | xmax, | ||
const double | zmin, | ||
const double | zmax, | ||
const std::string & | label, | ||
const double | gap = -1. |
||
) |
Definition at line 493 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddPlaneX | ( | const double | x, |
const double | voltage, | ||
const std::string & | label | ||
) |
Add a plane at constant x.
Definition at line 296 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddPlaneY | ( | const double | y, |
const double | voltage, | ||
const std::string & | label | ||
) |
Add a plane at constant y.
Definition at line 324 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddReadout | ( | const std::string & | label | ) |
Setup the weighting field for a given group of wires or planes.
Definition at line 1913 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddStripOnPlaneX | ( | const char | direction, |
const double | x, | ||
const double | smin, | ||
const double | smax, | ||
const std::string & | label, | ||
const double | gap = -1. |
||
) |
Definition at line 352 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddStripOnPlaneY | ( | const char | direction, |
const double | y, | ||
const double | smin, | ||
const double | smax, | ||
const std::string & | label, | ||
const double | gap = -1. |
||
) |
Definition at line 403 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::AddTube | ( | const double | radius, |
const double | voltage, | ||
const int | nEdges, | ||
const std::string & | label | ||
) |
Add a tube.
Definition at line 254 of file ComponentAnalyticField.cc.
Referenced by GarfieldPhysics::CreateGeometry().
void Garfield::ComponentAnalyticField::AddWire | ( | const double | x, |
const double | y, | ||
const double | diameter, | ||
const double | voltage, | ||
const std::string & | label, | ||
const double | length = 100. , |
||
const double | tension = 50. , |
||
const double | rho = 19.3 , |
||
const int | ntrap = 5 |
||
) |
Add a wire at (x, y) .
Definition at line 197 of file ComponentAnalyticField.cc.
Referenced by GarfieldPhysics::CreateGeometry().
void Garfield::ComponentAnalyticField::ClearCharges | ( | ) |
Definition at line 649 of file ComponentAnalyticField.cc.
|
inline |
Definition at line 158 of file ComponentAnalyticField.hh.
|
inlinevirtual |
Implements Garfield::ComponentBase.
Definition at line 41 of file ComponentAnalyticField.hh.
|
inlinevirtual |
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::ComponentBase.
Definition at line 23 of file ComponentAnalyticField.hh.
|
inline |
Definition at line 157 of file ComponentAnalyticField.hh.
Referenced by DisableChargeCheck().
|
virtual |
Get the bounding box coordinates.
Reimplemented from Garfield::ComponentBase.
Definition at line 35 of file ComponentAnalyticField.cc.
|
inline |
Return the cell type. Cells are classified according to the number and orientation of planes, the presence of periodicities and the location of the wires as one of the following types:
A non-periodic cells with at most 1 x- and 1 y-plane B1X x-periodic cells without x-planes and at most 1 y-plane B1Y y-periodic cells without y-planes and at most 1 x-plane B2X cells with 2 x-planes and at most 1 y-plane B2Y cells with 2 y-planes and at most 1 x-plane C1 doubly periodic cells without planes C2X doubly periodic cells with x-planes C2Y doubly periodic cells with y-planes C3 double periodic cells with x- and y-planes D1 round tubes without axial periodicity D2 round tubes with axial periodicity D3 polygonal tubes without axial periodicity
Definition at line 147 of file ComponentAnalyticField.hh.
unsigned int Garfield::ComponentAnalyticField::GetNumberOfPlanesX | ( | ) | const |
Definition at line 672 of file ComponentAnalyticField.cc.
unsigned int Garfield::ComponentAnalyticField::GetNumberOfPlanesY | ( | ) | const |
Definition at line 682 of file ComponentAnalyticField.cc.
|
inline |
Definition at line 160 of file ComponentAnalyticField.hh.
bool Garfield::ComponentAnalyticField::GetPeriodicityX | ( | double & | s | ) |
Definition at line 558 of file ComponentAnalyticField.cc.
bool Garfield::ComponentAnalyticField::GetPeriodicityY | ( | double & | s | ) |
Definition at line 569 of file ComponentAnalyticField.cc.
bool Garfield::ComponentAnalyticField::GetPlaneX | ( | const unsigned int | i, |
double & | x, | ||
double & | voltage, | ||
std::string & | label | ||
) | const |
Definition at line 714 of file ComponentAnalyticField.cc.
bool Garfield::ComponentAnalyticField::GetPlaneY | ( | const unsigned int | i, |
double & | y, | ||
double & | voltage, | ||
std::string & | label | ||
) | const |
Definition at line 730 of file ComponentAnalyticField.cc.
bool Garfield::ComponentAnalyticField::GetTube | ( | double & | r, |
double & | voltage, | ||
int & | nEdges, | ||
std::string & | label | ||
) | const |
Definition at line 746 of file ComponentAnalyticField.cc.
|
virtual |
Calculate the voltage range [V].
Implements Garfield::ComponentBase.
Definition at line 19 of file ComponentAnalyticField.cc.
bool Garfield::ComponentAnalyticField::GetWire | ( | const unsigned int | i, |
double & | x, | ||
double & | y, | ||
double & | diameter, | ||
double & | voltage, | ||
std::string & | label, | ||
double & | length, | ||
double & | charge, | ||
int & | ntrap | ||
) | const |
Definition at line 692 of file ComponentAnalyticField.cc.
|
virtual |
Determine whether a particle is inside the trap radius of a wire.
q0 | charge of the particle [in elementary charges]. |
x0,y0,z0 | position [cm] of the particle. |
xw,yw | coordinates of the wire (if applicable). |
rw | radius of the wire (if applicable). |
Reimplemented from Garfield::ComponentBase.
Definition at line 132 of file ComponentAnalyticField.cc.
|
virtual |
Determine whether the line between two points crosses a wire.
x0,y0,z0 | first point [cm]. |
x1,y1,z1 | second point [cm] |
xc,yc,zc | point [cm] where the line crosses the wire. |
Reimplemented from Garfield::ComponentBase.
Definition at line 54 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::PrintCharges | ( | ) | const |
Definition at line 656 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::SetPeriodicityX | ( | const double | s | ) |
Set the periodic length [cm] in the x-direction.
Definition at line 532 of file ComponentAnalyticField.cc.
void Garfield::ComponentAnalyticField::SetPeriodicityY | ( | const double | s | ) |
Set the periodic length [cm] in the y-direction.
Definition at line 545 of file ComponentAnalyticField.cc.
|
inlinevirtual |
Calculate the weighting field at a given point and for a given electrode.
x,y,z | coordinates [cm]. |
wx,wy,wz | components of the weighting field [1/cm]. |
label | name of the electrode |
Reimplemented from Garfield::ComponentBase.
Definition at line 60 of file ComponentAnalyticField.hh.
|
inlinevirtual |
Reimplemented from Garfield::ComponentBase.
Definition at line 68 of file ComponentAnalyticField.hh.