Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ComponentBase Class Referenceabstract

Abstract base class for components. More...

#include <ComponentBase.hh>

+ Inheritance diagram for Garfield::ComponentBase:

Public Member Functions

 ComponentBase ()
 Constructor.
 
virtual ~ComponentBase ()
 Destructor.
 
virtual void SetGeometry (GeometryBase *geo)
 Define the geometry.
 
virtual void Clear ()
 Reset.
 
virtual MediumGetMedium (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 $x$ direction.
 
void DisablePeriodicityX ()
 
void EnablePeriodicityY (const bool on=true)
 Enable simple periodicity in the $y$ direction.
 
void DisablePeriodicityY ()
 
void EnablePeriodicityZ (const bool on=true)
 Enable simple periodicity in the $z$ direction.
 
void DisablePeriodicityZ ()
 
void EnableMirrorPeriodicityX (const bool on=true)
 Enable mirror periodicity in the $x$ direction.
 
void DisableMirrorPeriodicityX ()
 
void EnableMirrorPeriodicityY (const bool on=true)
 Enable mirror periodicity in the $y$ direction.
 
void DisableMirrorPeriodicityY ()
 
void EnableMirrorPeriodicityZ (const bool on=true)
 Enable mirror periodicity in the $y$ direction.
 
void DisableMirrorPeriodicityZ ()
 
void EnableAxialPeriodicityX (const bool on=true)
 Enable axial periodicity in the $x$ direction.
 
void DisableAxialPeriodicityX ()
 
void EnableAxialPeriodicityY (const bool on=true)
 Enable axial periodicity in the $y$ direction.
 
void DisableAxialPeriodicityY ()
 
void EnableAxialPeriodicityZ (const bool on=true)
 Enable axial periodicity in the $z$ direction.
 
void DisableAxialPeriodicityZ ()
 
void EnableRotationSymmetryX (const bool on=true)
 Enable rotation symmetry around the $x$ axis.
 
void DisableRotationSymmetryX ()
 
void EnableRotationSymmetryY (const bool on=true)
 Enable rotation symmetry around the $y$ axis.
 
void DisableRotationSymmetryY ()
 
void EnableRotationSymmetryZ (const bool on=true)
 Enable rotation symmetry around the $z$ 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)
 

Protected Member Functions

virtual void Reset ()=0
 Geometry checks.
 
virtual void UpdatePeriodicity ()=0
 Verify periodicities.
 

Protected Attributes

std::string m_className
 Class name.
 
GeometryBasem_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.
 

Detailed Description

Abstract base class for components.

Definition at line 13 of file ComponentBase.hh.

Constructor & Destructor Documentation

◆ ComponentBase()

Garfield::ComponentBase::ComponentBase ( )

Constructor.

Definition at line 6 of file ComponentBase.cc.

7 : m_className("ComponentBase"),
8 m_geometry(NULL),
9 m_ready(false),
10 m_activeTraps(false),
11 m_xPeriodic(false),
12 m_yPeriodic(false),
13 m_zPeriodic(false),
14 m_xMirrorPeriodic(false),
15 m_yMirrorPeriodic(false),
16 m_zMirrorPeriodic(false),
17 m_xAxiallyPeriodic(false),
18 m_yAxiallyPeriodic(false),
19 m_zAxiallyPeriodic(false),
23 m_bx0(0.),
24 m_by0(0.),
25 m_bz0(0.),
26 m_debug(false) {}
bool m_zMirrorPeriodic
Mirror periodicity in z.
bool m_yAxiallyPeriodic
Axial periodicity in y.
GeometryBase * m_geometry
Pointer to the geometry.
bool m_activeTraps
Does the component have traps?
bool m_zRotationSymmetry
Rotation symmetry around z-axis.
bool m_yRotationSymmetry
Rotation symmetry around y-axis.
bool m_ready
Ready for use?
bool m_zAxiallyPeriodic
Axial periodicity in z.
bool m_xRotationSymmetry
Rotation symmetry around x-axis.
bool m_yPeriodic
Simple periodicity in y.
bool m_yMirrorPeriodic
Mirror periodicity in y.
bool m_xPeriodic
Simple periodicity in x.
bool m_zPeriodic
Simple periodicity in z.
std::string m_className
Class name.
bool m_xAxiallyPeriodic
Axial periodicity in x.
bool m_debug
Switch on/off debugging messages.
bool m_xMirrorPeriodic
Mirror periodicity in x.

◆ ~ComponentBase()

virtual Garfield::ComponentBase::~ComponentBase ( )
inlinevirtual

Destructor.

Definition at line 19 of file ComponentBase.hh.

19{}

Member Function Documentation

◆ ActivateTraps()

void Garfield::ComponentBase::ActivateTraps ( )
inline

Request trapping to be taken care of by the component (for TCAD).

Definition at line 185 of file ComponentBase.hh.

185{ m_activeTraps = true; }

◆ ActivateVelocityMap()

void Garfield::ComponentBase::ActivateVelocityMap ( )
inline

Request velocity to be taken care of by the component (for TCAD).

Definition at line 190 of file ComponentBase.hh.

190{ m_hasVelocityMap = true; }
bool m_hasVelocityMap
Does the component have velocity maps?

◆ Clear()

void Garfield::ComponentBase::Clear ( )
virtual

Reset.

Definition at line 47 of file ComponentBase.cc.

47 {
48
49 m_geometry = NULL;
50 Reset();
51}
virtual void Reset()=0
Geometry checks.

◆ DeactivateTraps()

void Garfield::ComponentBase::DeactivateTraps ( )
inline

Definition at line 186 of file ComponentBase.hh.

186{ m_activeTraps = false; }

◆ DectivateVelocityMap()

void Garfield::ComponentBase::DectivateVelocityMap ( )
inline

Definition at line 191 of file ComponentBase.hh.

191{ m_hasVelocityMap = false; }

◆ DisableAxialPeriodicityX()

void Garfield::ComponentBase::DisableAxialPeriodicityX ( )
inline

Definition at line 146 of file ComponentBase.hh.

146{ EnableAxialPeriodicityX(false); }
void EnableAxialPeriodicityX(const bool on=true)
Enable axial periodicity in the direction.

◆ DisableAxialPeriodicityY()

void Garfield::ComponentBase::DisableAxialPeriodicityY ( )
inline

Definition at line 152 of file ComponentBase.hh.

152{ EnableAxialPeriodicityY(false); }
void EnableAxialPeriodicityY(const bool on=true)
Enable axial periodicity in the direction.

◆ DisableAxialPeriodicityZ()

void Garfield::ComponentBase::DisableAxialPeriodicityZ ( )
inline

Definition at line 158 of file ComponentBase.hh.

158{ EnableAxialPeriodicityZ(false); }
void EnableAxialPeriodicityZ(const bool on=true)
Enable axial periodicity in the direction.

◆ DisableDebugging()

void Garfield::ComponentBase::DisableDebugging ( )
inline

Switch off debugging messages.

Definition at line 182 of file ComponentBase.hh.

182{ m_debug = false; }

◆ DisableMirrorPeriodicityX()

void Garfield::ComponentBase::DisableMirrorPeriodicityX ( )
inline

Definition at line 127 of file ComponentBase.hh.

127{ EnableMirrorPeriodicityX(false); }
void EnableMirrorPeriodicityX(const bool on=true)
Enable mirror periodicity in the direction.

◆ DisableMirrorPeriodicityY()

void Garfield::ComponentBase::DisableMirrorPeriodicityY ( )
inline

Definition at line 133 of file ComponentBase.hh.

133{ EnableMirrorPeriodicityY(false); }
void EnableMirrorPeriodicityY(const bool on=true)
Enable mirror periodicity in the direction.

◆ DisableMirrorPeriodicityZ()

void Garfield::ComponentBase::DisableMirrorPeriodicityZ ( )
inline

Definition at line 139 of file ComponentBase.hh.

139{ EnableMirrorPeriodicityZ(false); }
void EnableMirrorPeriodicityZ(const bool on=true)
Enable mirror periodicity in the direction.

◆ DisablePeriodicityX()

void Garfield::ComponentBase::DisablePeriodicityX ( )
inline

Definition at line 108 of file ComponentBase.hh.

108{ EnablePeriodicityX(false); }
void EnablePeriodicityX(const bool on=true)
Enable simple periodicity in the direction.

◆ DisablePeriodicityY()

void Garfield::ComponentBase::DisablePeriodicityY ( )
inline

Definition at line 114 of file ComponentBase.hh.

114{ EnablePeriodicityY(false); }
void EnablePeriodicityY(const bool on=true)
Enable simple periodicity in the direction.

◆ DisablePeriodicityZ()

void Garfield::ComponentBase::DisablePeriodicityZ ( )
inline

Definition at line 120 of file ComponentBase.hh.

120{ EnablePeriodicityZ(false); }
void EnablePeriodicityZ(const bool on=true)
Enable simple periodicity in the direction.

◆ DisableRotationSymmetryX()

void Garfield::ComponentBase::DisableRotationSymmetryX ( )
inline

Definition at line 165 of file ComponentBase.hh.

165{ EnableRotationSymmetryX(false); }
void EnableRotationSymmetryX(const bool on=true)
Enable rotation symmetry around the axis.

◆ DisableRotationSymmetryY()

void Garfield::ComponentBase::DisableRotationSymmetryY ( )
inline

Definition at line 171 of file ComponentBase.hh.

171{ EnableRotationSymmetryY(false); }
void EnableRotationSymmetryY(const bool on=true)
Enable rotation symmetry around the axis.

◆ DisableRotationSymmetryZ()

void Garfield::ComponentBase::DisableRotationSymmetryZ ( )
inline

Definition at line 177 of file ComponentBase.hh.

177{ EnableRotationSymmetryZ(false); }
void EnableRotationSymmetryZ(const bool on=true)
Enable rotation symmetry around the axis.

◆ ElectricField() [1/2]

virtual void Garfield::ComponentBase::ElectricField ( const double  x,
const double  y,
const double  z,
double &  ex,
double &  ey,
double &  ez,
double &  v,
Medium *&  m,
int &  status 
)
pure virtual

◆ ElectricField() [2/2]

virtual void Garfield::ComponentBase::ElectricField ( const double  x,
const double  y,
const double  z,
double &  ex,
double &  ey,
double &  ez,
Medium *&  m,
int &  status 
)
pure virtual

Calculate the drift field at given point.

Parameters
x,y,zcoordinates [cm].
ex,ey,ezcomponents of the electric field [V/cm].
mpointer to the medium at this location.
statusstatus 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)

Implemented in Garfield::ComponentAnalyticField, Garfield::ComponentAnsys121, Garfield::ComponentAnsys123, Garfield::ComponentComsol, Garfield::ComponentConstant, Garfield::ComponentCST, Garfield::ComponentElmer, Garfield::ComponentNeBem2d, Garfield::ComponentTcad2d, Garfield::ComponentTcad3d, Garfield::ComponentUser, Garfield::ComponentUserMapBase, Garfield::ComponentVoxel, and Garfield::ComponentFieldMap.

Referenced by Garfield::ComponentUserMapBase::ElectricField(), Garfield::ViewField::Evaluate2D(), and Garfield::ViewField::EvaluateProfile().

◆ ElectronAttachment()

virtual bool Garfield::ComponentBase::ElectronAttachment ( const double  ,
const double  ,
const double  ,
double &  eta 
)
inlinevirtual

Get the electron attachment coefficient.

Reimplemented in Garfield::ComponentTcad2d.

Definition at line 195 of file ComponentBase.hh.

196 {
197 eta = 0;
198 return false;
199 }

◆ ElectronVelocity()

virtual void Garfield::ComponentBase::ElectronVelocity ( const double  ,
const double  ,
const double  ,
double &  vx,
double &  vy,
double &  vz,
Medium *&  ,
int &  status 
)
inlinevirtual

Get the electron drift velocity.

Reimplemented in Garfield::ComponentTcad2d.

Definition at line 207 of file ComponentBase.hh.

209 {
210 vx = vy = vz = 0;
211 status = -100;
212 }

◆ EnableAxialPeriodicityX()

void Garfield::ComponentBase::EnableAxialPeriodicityX ( const bool  on = true)
inline

Enable axial periodicity in the $x$ direction.

Definition at line 142 of file ComponentBase.hh.

142 {
145 }
virtual void UpdatePeriodicity()=0
Verify periodicities.

Referenced by DisableAxialPeriodicityX().

◆ EnableAxialPeriodicityY()

void Garfield::ComponentBase::EnableAxialPeriodicityY ( const bool  on = true)
inline

Enable axial periodicity in the $y$ direction.

Definition at line 148 of file ComponentBase.hh.

148 {
151 }

Referenced by DisableAxialPeriodicityY().

◆ EnableAxialPeriodicityZ()

void Garfield::ComponentBase::EnableAxialPeriodicityZ ( const bool  on = true)
inline

Enable axial periodicity in the $z$ direction.

Definition at line 154 of file ComponentBase.hh.

154 {
157 }

Referenced by DisableAxialPeriodicityZ().

◆ EnableDebugging()

void Garfield::ComponentBase::EnableDebugging ( )
inline

Switch on debugging messages.

Definition at line 180 of file ComponentBase.hh.

180{ m_debug = true; }

◆ EnableMirrorPeriodicityX()

void Garfield::ComponentBase::EnableMirrorPeriodicityX ( const bool  on = true)
inline

Enable mirror periodicity in the $x$ direction.

Definition at line 123 of file ComponentBase.hh.

123 {
126 }

Referenced by DisableMirrorPeriodicityX().

◆ EnableMirrorPeriodicityY()

void Garfield::ComponentBase::EnableMirrorPeriodicityY ( const bool  on = true)
inline

Enable mirror periodicity in the $y$ direction.

Definition at line 129 of file ComponentBase.hh.

129 {
132 }

Referenced by DisableMirrorPeriodicityY().

◆ EnableMirrorPeriodicityZ()

void Garfield::ComponentBase::EnableMirrorPeriodicityZ ( const bool  on = true)
inline

Enable mirror periodicity in the $y$ direction.

Definition at line 135 of file ComponentBase.hh.

135 {
138 }

Referenced by DisableMirrorPeriodicityZ().

◆ EnablePeriodicityX()

void Garfield::ComponentBase::EnablePeriodicityX ( const bool  on = true)
inline

Enable simple periodicity in the $x$ direction.

Definition at line 104 of file ComponentBase.hh.

104 {
105 m_xPeriodic = on;
107 }

Referenced by DisablePeriodicityX().

◆ EnablePeriodicityY()

void Garfield::ComponentBase::EnablePeriodicityY ( const bool  on = true)
inline

Enable simple periodicity in the $y$ direction.

Definition at line 110 of file ComponentBase.hh.

110 {
111 m_yPeriodic = on;
113 }

Referenced by DisablePeriodicityY().

◆ EnablePeriodicityZ()

void Garfield::ComponentBase::EnablePeriodicityZ ( const bool  on = true)
inline

Enable simple periodicity in the $z$ direction.

Definition at line 116 of file ComponentBase.hh.

116 {
117 m_zPeriodic = on;
119 }

Referenced by DisablePeriodicityZ().

◆ EnableRotationSymmetryX()

void Garfield::ComponentBase::EnableRotationSymmetryX ( const bool  on = true)
inline

Enable rotation symmetry around the $x$ axis.

Definition at line 161 of file ComponentBase.hh.

161 {
164 }

Referenced by DisableRotationSymmetryX().

◆ EnableRotationSymmetryY()

void Garfield::ComponentBase::EnableRotationSymmetryY ( const bool  on = true)
inline

Enable rotation symmetry around the $y$ axis.

Definition at line 167 of file ComponentBase.hh.

167 {
170 }

Referenced by DisableRotationSymmetryY().

◆ EnableRotationSymmetryZ()

void Garfield::ComponentBase::EnableRotationSymmetryZ ( const bool  on = true)
inline

Enable rotation symmetry around the $z$ axis.

Definition at line 173 of file ComponentBase.hh.

173 {
176 }

Referenced by DisableRotationSymmetryZ().

◆ GetBoundingBox()

bool Garfield::ComponentBase::GetBoundingBox ( double &  xmin,
double &  ymin,
double &  zmin,
double &  xmax,
double &  ymax,
double &  zmax 
)
virtual

Get the bounding box coordinates.

Reimplemented in Garfield::ComponentAnalyticField, Garfield::ComponentFieldMap, Garfield::ComponentTcad2d, Garfield::ComponentTcad3d, and Garfield::ComponentVoxel.

Definition at line 100 of file ComponentBase.cc.

101 {
102
103 if (!m_geometry) return false;
104 return (m_geometry->GetBoundingBox(xmin, ymin, zmin, xmax, ymax, zmax));
105}
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)=0

Referenced by Garfield::ComponentConstant::GetVoltageRange().

◆ GetElectronLifetime()

virtual bool Garfield::ComponentBase::GetElectronLifetime ( const double  ,
const double  ,
const double  ,
double &  etau 
)
inlinevirtual

Reimplemented in Garfield::ComponentTcad2d.

Definition at line 220 of file ComponentBase.hh.

221 {
222 etau = -1;
223 return false;
224 }

◆ GetHoleLifetime()

virtual bool Garfield::ComponentBase::GetHoleLifetime ( const double  ,
const double  ,
const double  ,
double &  htau 
)
inlinevirtual

Reimplemented in Garfield::ComponentTcad2d.

Definition at line 225 of file ComponentBase.hh.

226 {
227 htau = -1;
228 return false;
229 }

◆ GetMedium()

◆ GetVoltageRange()

virtual bool Garfield::ComponentBase::GetVoltageRange ( double &  vmin,
double &  vmax 
)
pure virtual

◆ HoleAttachment()

virtual bool Garfield::ComponentBase::HoleAttachment ( const double  ,
const double  ,
const double  ,
double &  eta 
)
inlinevirtual

Get the hole attachment coefficient.

Reimplemented in Garfield::ComponentTcad2d.

Definition at line 201 of file ComponentBase.hh.

202 {
203 eta = 0;
204 return false;
205 }

◆ HoleVelocity()

virtual void Garfield::ComponentBase::HoleVelocity ( const double  ,
const double  ,
const double  ,
double &  vx,
double &  vy,
double &  vz,
Medium *&  ,
int &  status 
)
inlinevirtual

Get the hole drift velocity.

Reimplemented in Garfield::ComponentTcad2d.

Definition at line 214 of file ComponentBase.hh.

216 {
217 vx = vy = vz = 0;
218 status = -100;
219 }

◆ IsInTrapRadius()

bool Garfield::ComponentBase::IsInTrapRadius ( const double  q0,
const double  x0,
const double  y0,
const double  z0,
double &  xw,
double &  yw,
double &  rw 
)
virtual

Determine whether a particle is inside the trap radius of a wire.

Parameters
q0charge of the particle [in elementary charges].
x0,y0,z0position [cm] of the particle.
xw,ywcoordinates of the wire (if applicable).
rwradius of the wire (if applicable).

Reimplemented in Garfield::ComponentAnalyticField.

Definition at line 120 of file ComponentBase.cc.

122 {
123
124 xw = x0;
125 yw = y0;
126 rw = 0.;
127 return false;
128
129}

◆ IsReady()

virtual bool Garfield::ComponentBase::IsReady ( )
inlinevirtual

Ready for use?

Definition at line 79 of file ComponentBase.hh.

79{ return m_ready; }

◆ IsTrapActive()

bool Garfield::ComponentBase::IsTrapActive ( )
inline

Definition at line 187 of file ComponentBase.hh.

187{ return m_activeTraps; }

◆ IsVelocityActive()

bool Garfield::ComponentBase::IsVelocityActive ( )
inline

Definition at line 192 of file ComponentBase.hh.

192{ return m_hasVelocityMap; }

◆ IsWireCrossed()

bool Garfield::ComponentBase::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

Determine whether the line between two points crosses a wire.

Parameters
x0,y0,z0first point [cm].
x1,y1,z1second point [cm]
xc,yc,zcpoint [cm] where the line crosses the wire.

Reimplemented in Garfield::ComponentAnalyticField.

Definition at line 107 of file ComponentBase.cc.

111 {
112
113 xc = x0;
114 yc = y0;
115 zc = z0;
116 return false;
117
118}

◆ MagneticField()

void Garfield::ComponentBase::MagneticField ( const double  x,
const double  y,
const double  z,
double &  bx,
double &  by,
double &  bz,
int &  status 
)
virtual

Calculate the magnetic field at a given point.

Parameters
x,y,zcoordinates [cm].
bx,by,bzcomponents of the magnetic field [Tesla].
statusstatus flag.

Reimplemented in Garfield::ComponentUser, and Garfield::ComponentVoxel.

Definition at line 78 of file ComponentBase.cc.

80 {
81 bx = m_bx0;
82 by = m_by0;
83 bz = m_bz0;
84 if (m_debug) {
85 std::cout << m_className << "::MagneticField:\n";
86 std::cout << " Magnetic field at (" << x << ", " << y << ", " << z
87 << ") is (" << bx << ", " << by << ", " << bz << ")\n";
88 }
89 status = 0;
90}

Referenced by Garfield::ComponentVoxel::MagneticField().

◆ Reset()

virtual void Garfield::ComponentBase::Reset ( )
protectedpure virtual

Geometry checks.

Implemented in Garfield::ComponentFieldMap, and Garfield::ComponentUserMapBase.

Referenced by Clear().

◆ SetGeometry()

void Garfield::ComponentBase::SetGeometry ( GeometryBase geo)
virtual

Define the geometry.

Definition at line 28 of file ComponentBase.cc.

28 {
29
30 // Make sure the geometry is defined
31 if (!geo) {
32 std::cerr << "ComponentBase::SetGeometry:\n";
33 std::cerr << " Geometry pointer is null.\n";
34 return;
35 }
36
37 m_geometry = geo;
38}

Referenced by GarfieldPhysics::CreateGeometry().

◆ SetMagneticField()

void Garfield::ComponentBase::SetMagneticField ( const double  bx,
const double  by,
const double  bz 
)

Set a constant magnetic field.

Definition at line 92 of file ComponentBase.cc.

93 {
94
95 m_bx0 = bx;
96 m_by0 = by;
97 m_bz0 = bz;
98}

◆ UpdatePeriodicity()

◆ WeightingField()

void Garfield::ComponentBase::WeightingField ( const double  x,
const double  y,
const double  z,
double &  wx,
double &  wy,
double &  wz,
const std::string &  label 
)
virtual

Calculate the weighting field at a given point and for a given electrode.

Parameters
x,y,zcoordinates [cm].
wx,wy,wzcomponents of the weighting field [1/cm].
labelname of the electrode

Reimplemented in Garfield::ComponentAnalyticField, Garfield::ComponentAnsys121, Garfield::ComponentAnsys123, Garfield::ComponentComsol, Garfield::ComponentConstant, Garfield::ComponentCST, Garfield::ComponentElmer, Garfield::ComponentTcad2d, Garfield::ComponentUser, Garfield::ComponentUserMapBase, Garfield::ComponentVoxel, and Garfield::ComponentFieldMap.

Definition at line 53 of file ComponentBase.cc.

55 {
56 if (m_debug) {
57 std::cerr << m_className << "::WeightingField:\n";
58 std::cerr << " This function is not implemented.\n";
59 std::cerr << " Weighting field at (" << x << ", " << y << ", " << z
60 << ") for electrode " << label << " cannot be calculated.\n";
61 }
62 wx = wy = wz = 0.;
63}

Referenced by Garfield::ViewField::Evaluate2D(), Garfield::ViewField::EvaluateProfile(), and Garfield::ComponentUserMapBase::WeightingField().

◆ WeightingPotential()

double Garfield::ComponentBase::WeightingPotential ( const double  x,
const double  y,
const double  z,
const std::string &  label 
)
virtual

Reimplemented in Garfield::ComponentAnalyticField, Garfield::ComponentAnsys121, Garfield::ComponentAnsys123, Garfield::ComponentComsol, Garfield::ComponentConstant, Garfield::ComponentCST, Garfield::ComponentElmer, Garfield::ComponentUser, Garfield::ComponentUserMapBase, and Garfield::ComponentFieldMap.

Definition at line 65 of file ComponentBase.cc.

67 {
68
69 if (m_debug) {
70 std::cerr << m_className << "::WeightingPotential:\n";
71 std::cerr << " This function is not implemented.\n";
72 std::cerr << " Weighting potential at (" << x << ", " << y << ", " << z
73 << ") for electrode " << label << " cannot be calculated.\n";
74 }
75 return 0.;
76}

Referenced by Garfield::ViewField::Evaluate2D(), Garfield::ViewField::EvaluateProfile(), and Garfield::ComponentUserMapBase::WeightingPotential().

Member Data Documentation

◆ m_activeTraps

bool Garfield::ComponentBase::m_activeTraps
protected

Does the component have traps?

Definition at line 242 of file ComponentBase.hh.

Referenced by ActivateTraps(), DeactivateTraps(), and IsTrapActive().

◆ m_bx0

double Garfield::ComponentBase::m_bx0
protected

Definition at line 271 of file ComponentBase.hh.

Referenced by MagneticField(), and SetMagneticField().

◆ m_by0

double Garfield::ComponentBase::m_by0
protected

Definition at line 271 of file ComponentBase.hh.

Referenced by MagneticField(), and SetMagneticField().

◆ m_bz0

double Garfield::ComponentBase::m_bz0
protected

Definition at line 271 of file ComponentBase.hh.

Referenced by MagneticField(), and SetMagneticField().

◆ m_className

std::string Garfield::ComponentBase::m_className
protected

Class name.

Definition at line 233 of file ComponentBase.hh.

Referenced by Garfield::ComponentNeBem2d::AddPanel(), Garfield::ComponentAnalyticField::AddPixelOnPlaneX(), Garfield::ComponentAnalyticField::AddPixelOnPlaneY(), Garfield::ComponentAnalyticField::AddPlaneX(), Garfield::ComponentAnalyticField::AddPlaneY(), Garfield::ComponentAnalyticField::AddReadout(), Garfield::ComponentAnalyticField::AddStripOnPlaneX(), Garfield::ComponentAnalyticField::AddStripOnPlaneY(), Garfield::ComponentAnalyticField::AddTube(), Garfield::ComponentAnalyticField::AddWire(), Garfield::ComponentNeBem2d::AddWire(), Garfield::ComponentAnalyticField::ComponentAnalyticField(), Garfield::ComponentAnsys121::ComponentAnsys121(), Garfield::ComponentAnsys123::ComponentAnsys123(), Garfield::ComponentComsol::ComponentComsol(), Garfield::ComponentConstant::ComponentConstant(), Garfield::ComponentCST::ComponentCST(), Garfield::ComponentElmer::ComponentElmer(), Garfield::ComponentFieldMap::ComponentFieldMap(), Garfield::ComponentNeBem2d::ComponentNeBem2d(), Garfield::ComponentTcad2d::ComponentTcad2d(), Garfield::ComponentTcad3d::ComponentTcad3d(), Garfield::ComponentUser::ComponentUser(), Garfield::ComponentUserMapBase::ComponentUserMapBase(), Garfield::ComponentVoxel::ComponentVoxel(), Garfield::ComponentCST::Coordinate2Index(), Garfield::ComponentFieldMap::DriftMedium(), Garfield::ComponentAnsys121::ElectricField(), Garfield::ComponentAnsys123::ElectricField(), Garfield::ComponentComsol::ElectricField(), Garfield::ComponentElmer::ElectricField(), Garfield::ComponentNeBem2d::ElectricField(), Garfield::ComponentTcad2d::ElectricField(), Garfield::ComponentTcad3d::ElectricField(), Garfield::ComponentUserMapBase::ElectricField(), Garfield::ComponentVoxel::ElectricField(), Garfield::ComponentConstant::ElectricField(), Garfield::ComponentUser::ElectricField(), Garfield::ComponentTcad2d::ElectronAttachment(), Garfield::ComponentTcad2d::ElectronVelocity(), Garfield::ComponentFieldMap::FindElement13(), Garfield::ComponentFieldMap::FindElement5(), Garfield::ComponentFieldMap::FindElementCube(), Garfield::ComponentTcad2d::GetAcceptorOccupation(), Garfield::ComponentFieldMap::GetConductivity(), Garfield::ComponentTcad2d::GetDonorOccupation(), Garfield::ComponentVoxel::GetElectricFieldRange(), Garfield::ComponentTcad2d::GetElectronLifetime(), Garfield::ComponentVoxel::GetElement(), Garfield::ComponentFieldMap::GetElement(), Garfield::ComponentTcad2d::GetElement(), Garfield::ComponentTcad3d::GetElement(), Garfield::ComponentTcad2d::GetHoleLifetime(), Garfield::ComponentAnsys121::GetMedium(), Garfield::ComponentAnsys123::GetMedium(), Garfield::ComponentComsol::GetMedium(), Garfield::ComponentCST::GetMedium(), Garfield::ComponentElmer::GetMedium(), Garfield::ComponentTcad2d::GetMedium(), Garfield::ComponentTcad3d::GetMedium(), Garfield::ComponentUserMapBase::GetMedium(), Garfield::ComponentVoxel::GetMedium(), Garfield::ComponentFieldMap::GetMedium(), Garfield::ComponentTcad2d::GetMobility(), Garfield::ComponentTcad2d::GetNode(), Garfield::ComponentTcad3d::GetNode(), Garfield::ComponentFieldMap::GetPermittivity(), Garfield::ComponentAnalyticField::GetPlaneX(), Garfield::ComponentAnalyticField::GetPlaneY(), Garfield::ComponentTcad2d::GetRegion(), Garfield::ComponentTcad3d::GetRegion(), Garfield::ComponentAnalyticField::GetVoltageRange(), Garfield::ComponentConstant::GetVoltageRange(), Garfield::ComponentAnalyticField::GetWire(), Garfield::ComponentTcad2d::HoleAttachment(), Garfield::ComponentTcad2d::HoleVelocity(), Garfield::ComponentTcad2d::Initialise(), Garfield::ComponentTcad3d::Initialise(), Garfield::ComponentElmer::Initialise(), Garfield::ComponentCST::Initialise(), Garfield::ComponentAnsys121::Initialise(), Garfield::ComponentAnsys123::Initialise(), Garfield::ComponentComsol::Initialise(), Garfield::ComponentAnalyticField::IsInTrapRadius(), Garfield::ComponentAnalyticField::IsWireCrossed(), Garfield::ComponentVoxel::LoadElectricField(), Garfield::ComponentVoxel::LoadMagneticField(), MagneticField(), Garfield::ComponentFieldMap::NotDriftMedium(), Garfield::ComponentAnalyticField::PrintCharges(), Garfield::ComponentFieldMap::PrintElement(), Garfield::ComponentFieldMap::PrintMaterials(), Garfield::ComponentFieldMap::PrintNotReady(), Garfield::ComponentFieldMap::PrintRange(), Garfield::ComponentTcad3d::PrintRegions(), Garfield::ComponentTcad2d::PrintRegions(), Garfield::ComponentVoxel::PrintRegions(), Garfield::ComponentFieldMap::PrintWarning(), Garfield::ComponentTcad2d::SetAcceptor(), Garfield::ComponentTcad2d::SetDonor(), Garfield::ComponentTcad2d::SetDriftRegion(), Garfield::ComponentTcad3d::SetDriftRegion(), Garfield::ComponentConstant::SetElectricField(), Garfield::ComponentUser::SetElectricField(), Garfield::ComponentUser::SetMagneticField(), Garfield::ComponentNeBem2d::SetMaxNumberOfIterations(), Garfield::ComponentVoxel::SetMedium(), Garfield::ComponentFieldMap::SetMedium(), Garfield::ComponentTcad2d::SetMedium(), Garfield::ComponentTcad3d::SetMedium(), Garfield::ComponentVoxel::SetMesh(), Garfield::ComponentNeBem2d::SetMinimumElementSize(), Garfield::ComponentNeBem2d::SetNumberOfCollocationPoints(), Garfield::ComponentNeBem2d::SetNumberOfDivisions(), Garfield::ComponentAnalyticField::SetPeriodicityX(), Garfield::ComponentAnalyticField::SetPeriodicityY(), Garfield::ComponentUser::SetPotential(), Garfield::ComponentFieldMap::SetRange(), Garfield::ComponentAnsys121::SetRangeZ(), Garfield::ComponentCST::SetRangeZ(), Garfield::ComponentTcad2d::SetRangeZ(), Garfield::ComponentComsol::SetWeightingField(), Garfield::ComponentAnsys121::SetWeightingField(), Garfield::ComponentAnsys123::SetWeightingField(), Garfield::ComponentElmer::SetWeightingField(), Garfield::ComponentCST::SetWeightingField(), Garfield::ComponentUser::SetWeightingField(), Garfield::ComponentConstant::SetWeightingPotential(), Garfield::ComponentUser::SetWeightingPotential(), Garfield::ComponentCST::ShiftComponent(), Garfield::ComponentTcad2d::UnsetDriftRegion(), Garfield::ComponentTcad3d::UnsetDriftRegion(), Garfield::ComponentUserMapBase::UpdatePeriodicity(), Garfield::ComponentFieldMap::UpdatePeriodicity2d(), Garfield::ComponentFieldMap::UpdatePeriodicityCommon(), WeightingField(), Garfield::ComponentConstant::WeightingField(), Garfield::ComponentUserMapBase::WeightingField(), WeightingPotential(), Garfield::ComponentCST::WeightingPotential(), and Garfield::ComponentUserMapBase::WeightingPotential().

◆ m_debug

bool Garfield::ComponentBase::m_debug
protected

Switch on/off debugging messages.

Definition at line 274 of file ComponentBase.hh.

Referenced by Garfield::ComponentNeBem2d::AddPanel(), Garfield::ComponentNeBem2d::AddWire(), Garfield::ComponentCST::Coordinate2Index(), DisableDebugging(), Garfield::ComponentAnsys121::ElectricField(), Garfield::ComponentAnsys123::ElectricField(), Garfield::ComponentComsol::ElectricField(), Garfield::ComponentElmer::ElectricField(), Garfield::ComponentTcad2d::ElectricField(), Garfield::ComponentTcad3d::ElectricField(), Garfield::ComponentUserMapBase::ElectricField(), Garfield::ComponentConstant::ElectricField(), Garfield::ComponentUser::ElectricField(), Garfield::ComponentTcad2d::ElectronAttachment(), Garfield::ComponentTcad2d::ElectronVelocity(), EnableDebugging(), Garfield::ComponentFieldMap::FindElement13(), Garfield::ComponentFieldMap::FindElement5(), Garfield::ComponentFieldMap::FindElementCube(), Garfield::ComponentTcad2d::GetAcceptorOccupation(), Garfield::ComponentTcad2d::GetDonorOccupation(), Garfield::ComponentTcad2d::GetElectronLifetime(), Garfield::ComponentTcad2d::GetHoleLifetime(), Garfield::ComponentAnsys121::GetMedium(), Garfield::ComponentAnsys123::GetMedium(), Garfield::ComponentComsol::GetMedium(), Garfield::ComponentCST::GetMedium(), Garfield::ComponentElmer::GetMedium(), Garfield::ComponentUserMapBase::GetMedium(), Garfield::ComponentTcad2d::GetMobility(), Garfield::ComponentTcad2d::HoleAttachment(), Garfield::ComponentTcad2d::HoleVelocity(), Garfield::ComponentTcad3d::Initialise(), Garfield::ComponentElmer::Initialise(), Garfield::ComponentCST::Initialise(), Garfield::ComponentAnsys121::Initialise(), Garfield::ComponentAnsys123::Initialise(), Garfield::ComponentAnalyticField::IsInTrapRadius(), MagneticField(), Garfield::ComponentFieldMap::SetMedium(), Garfield::ComponentFieldMap::SetRange(), Garfield::ComponentCST::SetWeightingField(), Garfield::ComponentUserMapBase::UpdatePeriodicity(), Garfield::ComponentFieldMap::UpdatePeriodicityCommon(), Garfield::ComponentAnsys121::WeightingField(), Garfield::ComponentAnsys123::WeightingField(), WeightingField(), Garfield::ComponentComsol::WeightingField(), Garfield::ComponentConstant::WeightingField(), Garfield::ComponentElmer::WeightingField(), Garfield::ComponentUserMapBase::WeightingField(), Garfield::ComponentAnsys121::WeightingPotential(), Garfield::ComponentAnsys123::WeightingPotential(), WeightingPotential(), Garfield::ComponentComsol::WeightingPotential(), Garfield::ComponentCST::WeightingPotential(), Garfield::ComponentElmer::WeightingPotential(), and Garfield::ComponentUserMapBase::WeightingPotential().

◆ m_geometry

GeometryBase* Garfield::ComponentBase::m_geometry
protected

◆ m_hasVelocityMap

bool Garfield::ComponentBase::m_hasVelocityMap
protected

Does the component have velocity maps?

Definition at line 244 of file ComponentBase.hh.

Referenced by ActivateVelocityMap(), DectivateVelocityMap(), and IsVelocityActive().

◆ m_ready

bool Garfield::ComponentBase::m_ready
protected

Ready for use?

Definition at line 239 of file ComponentBase.hh.

Referenced by Garfield::ComponentNeBem2d::AddPanel(), Garfield::ComponentNeBem2d::AddWire(), Garfield::ComponentFieldMap::DriftMedium(), Garfield::ComponentAnsys121::ElectricField(), Garfield::ComponentAnsys123::ElectricField(), Garfield::ComponentComsol::ElectricField(), Garfield::ComponentElmer::ElectricField(), Garfield::ComponentNeBem2d::ElectricField(), Garfield::ComponentTcad2d::ElectricField(), Garfield::ComponentTcad3d::ElectricField(), Garfield::ComponentVoxel::ElectricField(), Garfield::ComponentTcad2d::ElectronVelocity(), Garfield::ComponentTcad2d::GetAcceptorOccupation(), Garfield::ComponentFieldMap::GetBoundingBox(), Garfield::ComponentTcad2d::GetBoundingBox(), Garfield::ComponentTcad3d::GetBoundingBox(), Garfield::ComponentVoxel::GetBoundingBox(), Garfield::ComponentTcad2d::GetDonorOccupation(), Garfield::ComponentVoxel::GetElectricFieldRange(), Garfield::ComponentTcad2d::GetElectronLifetime(), Garfield::ComponentVoxel::GetElement(), Garfield::ComponentTcad2d::GetHoleLifetime(), Garfield::ComponentAnsys121::GetMedium(), Garfield::ComponentAnsys123::GetMedium(), Garfield::ComponentComsol::GetMedium(), Garfield::ComponentElmer::GetMedium(), Garfield::ComponentTcad2d::GetMedium(), Garfield::ComponentTcad3d::GetMedium(), Garfield::ComponentVoxel::GetMedium(), Garfield::ComponentTcad2d::GetMobility(), Garfield::ComponentTcad2d::GetVoltageRange(), Garfield::ComponentTcad3d::GetVoltageRange(), Garfield::ComponentVoxel::GetVoltageRange(), Garfield::ComponentTcad2d::HoleVelocity(), Garfield::ComponentTcad2d::Initialise(), Garfield::ComponentTcad3d::Initialise(), Garfield::ComponentElmer::Initialise(), Garfield::ComponentCST::Initialise(), Garfield::ComponentAnsys121::Initialise(), Garfield::ComponentAnsys123::Initialise(), Garfield::ComponentComsol::Initialise(), IsReady(), Garfield::ComponentVoxel::LoadElectricField(), Garfield::ComponentFieldMap::NotDriftMedium(), Garfield::ComponentFieldMap::PrintMaterials(), Garfield::ComponentTcad3d::PrintRegions(), Garfield::ComponentTcad2d::PrintRegions(), Garfield::ComponentVoxel::PrintRegions(), Garfield::ComponentConstant::SetElectricField(), Garfield::ComponentUser::SetElectricField(), Garfield::ComponentNeBem2d::SetMinimumElementSize(), Garfield::ComponentNeBem2d::SetNumberOfCollocationPoints(), Garfield::ComponentNeBem2d::SetNumberOfDivisions(), Garfield::ComponentFieldMap::SetRange(), Garfield::ComponentComsol::SetWeightingField(), Garfield::ComponentAnsys121::SetWeightingField(), Garfield::ComponentAnsys123::SetWeightingField(), Garfield::ComponentElmer::SetWeightingField(), Garfield::ComponentCST::SetWeightingField(), Garfield::ComponentFieldMap::UpdatePeriodicity2d(), Garfield::ComponentFieldMap::UpdatePeriodicityCommon(), Garfield::ComponentAnsys121::WeightingField(), Garfield::ComponentAnsys123::WeightingField(), Garfield::ComponentComsol::WeightingField(), Garfield::ComponentCST::WeightingField(), Garfield::ComponentElmer::WeightingField(), Garfield::ComponentAnsys121::WeightingPotential(), Garfield::ComponentAnsys123::WeightingPotential(), Garfield::ComponentComsol::WeightingPotential(), Garfield::ComponentCST::WeightingPotential(), and Garfield::ComponentElmer::WeightingPotential().

◆ m_xAxiallyPeriodic

◆ m_xMirrorPeriodic

◆ m_xPeriodic

◆ m_xRotationSymmetry

bool Garfield::ComponentBase::m_xRotationSymmetry
protected

◆ m_yAxiallyPeriodic

◆ m_yMirrorPeriodic

◆ m_yPeriodic

◆ m_yRotationSymmetry

bool Garfield::ComponentBase::m_yRotationSymmetry
protected

◆ m_zAxiallyPeriodic

◆ m_zMirrorPeriodic

◆ m_zPeriodic

◆ m_zRotationSymmetry

bool Garfield::ComponentBase::m_zRotationSymmetry
protected

The documentation for this class was generated from the following files: