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

#include <ComponentUserMapBase.hh>

+ Inheritance diagram for Garfield::ComponentUserMapBase:

Public Member Functions

 ComponentUserMapBase ()
 
virtual ~ComponentUserMapBase ()
 
MediumGetMedium (const double &x, const double &y, const double &z)
 
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 &vmin, double &vmax)
 
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)
 
virtual void MapCoordinates (double &p1, double &p2, double &p3, double &u1x, double &u2x, double &u3x, double &u1y, double &u2y, double &u3y, double &u1z, double &u2z, double &u3z, ComponentBase *&pComponent)=0
 
virtual void MapCoordinates (double &p1, double &p2, double &p3, double &u1x, double &u2x, double &u3x, double &u1y, double &u2y, double &u3y, double &u1z, double &u2z, double &u3z, ComponentBase *&pComponent, std::string &label)
 
- Public Member Functions inherited from Garfield::ComponentBase
 ComponentBase ()
 
virtual ~ComponentBase ()
 
virtual void SetGeometry (GeometryBase *geo)
 
virtual void Clear ()
 
virtual MediumGetMedium (const double &x, const double &y, const double &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
 
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)
 
virtual bool IsReady ()
 
virtual bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
 
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 (double x0, double y0, double z0, double &xw, double &yw, double &rw)
 
void EnablePeriodicityX ()
 
void DisablePeriodicityX ()
 
void EnablePeriodicityY ()
 
void DisablePeriodicityY ()
 
void EnablePeriodicityZ ()
 
void DisablePeriodicityZ ()
 
void EnableMirrorPeriodicityX ()
 
void DisableMirrorPeriodicityX ()
 
void EnableMirrorPeriodicityY ()
 
void DisableMirrorPeriodicityY ()
 
void EnableMirrorPeriodicityZ ()
 
void DisableMirrorPeriodicityZ ()
 
void EnableAxialPeriodicityX ()
 
void DisableAxialPeriodicityX ()
 
void EnableAxialPeriodicityY ()
 
void DisableAxialPeriodicityY ()
 
void EnableAxialPeriodicityZ ()
 
void DisableAxialPeriodicityZ ()
 
void EnableRotationSymmetryX ()
 
void DisableRotationSymmetryX ()
 
void EnableRotationSymmetryY ()
 
void DisableRotationSymmetryY ()
 
void EnableRotationSymmetryZ ()
 
void DisableRotationSymmetryZ ()
 
void EnableDebugging ()
 
void DisableDebugging ()
 

Protected Member Functions

void Reset ()
 
void UpdatePeriodicity ()
 
void UnmapField (const double e1, const double e2, const double e3, const double u1x, const double u2x, const double u3x, const double u1y, const double u2y, const double u3y, const double u1z, const double u2z, const double u3z, double &ex, double &ey, double &ez) const
 
virtual void Reset ()=0
 
virtual void UpdatePeriodicity ()=0
 

Additional Inherited Members

- Protected Attributes inherited from Garfield::ComponentBase
std::string m_className
 
GeometryBasetheGeometry
 
bool ready
 
bool xPeriodic
 
bool yPeriodic
 
bool zPeriodic
 
bool xMirrorPeriodic
 
bool yMirrorPeriodic
 
bool zMirrorPeriodic
 
bool xAxiallyPeriodic
 
bool yAxiallyPeriodic
 
bool zAxiallyPeriodic
 
bool xRotationSymmetry
 
bool yRotationSymmetry
 
bool zRotationSymmetry
 
double bx0
 
double by0
 
double bz0
 
bool debug
 

Detailed Description

Definition at line 10 of file ComponentUserMapBase.hh.

Constructor & Destructor Documentation

◆ ComponentUserMapBase()

Garfield::ComponentUserMapBase::ComponentUserMapBase ( )

Definition at line 6 of file ComponentUserMapBase.cc.

6 {
7 m_className = "ComponentUserMapBase";
8}

◆ ~ComponentUserMapBase()

Garfield::ComponentUserMapBase::~ComponentUserMapBase ( )
virtual

Definition at line 10 of file ComponentUserMapBase.cc.

10{}

Member Function Documentation

◆ ElectricField() [1/2]

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

Implements Garfield::ComponentBase.

Definition at line 52 of file ComponentUserMapBase.cc.

55 {
56 double p1 = x , p2 = y , p3 = z ;
57 double u1x = 1., u2x = 0., u3x = 0.;
58 double u1y = 0., u2y = 1., u3y = 0.;
59 double u1z = 0., u2z = 0., u3z = 1.;
60 double e1 = 0., e2 = 0., e3 = 0.;
61 ComponentBase* pComponent = NULL;
62
63 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
64 pComponent);
65
66 if(!pComponent){
67 if(debug){
68 std::cerr << m_className << "::ElectricField:\n";
69 std::cerr << " ComponentBase pointer is NULL for point (" << x << ", "
70 << y << "," << z << ")\n";
71 }
72 status = -6;
73 m = NULL;
74 return;
75 }
76
77 if(debug){
78 std::cerr << m_className << "::ElectricField:\n";
79 std::cerr << " Coordinates: \n";
80 std::cerr << " Global: (" << x << ", " << y << ", " << z << ")\n";
81 std::cerr << " Local: (" << p1 << ", " << p2 << ", " << p3 << ")\n";
82 std::cerr << " Local base vectors: \n";
83 std::cerr << " u1: (" << u1x << ", " << u1y << ", " << u1z << ")\n";
84 std::cerr << " u2: (" << u2x << ", " << u2y << ", " << u2z << ")\n";
85 std::cerr << " u3: (" << u3x << ", " << u3y << ", " << u3z << ")\n";
86 }
87
88 pComponent->ElectricField(p1, p2, p3, e1, e2, e3, v, m, status);
89 UnmapField(e1, e2, e3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z, ex, ey,
90 ez);
91}
void UnmapField(const double e1, const double e2, const double e3, const double u1x, const double u2x, const double u3x, const double u1y, const double u2y, const double u3y, const double u1z, const double u2z, const double u3z, double &ex, double &ey, double &ez) const
virtual void MapCoordinates(double &p1, double &p2, double &p3, double &u1x, double &u2x, double &u3x, double &u1y, double &u2y, double &u3y, double &u1z, double &u2z, double &u3z, ComponentBase *&pComponent)=0

◆ ElectricField() [2/2]

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

Implements Garfield::ComponentBase.

Definition at line 45 of file ComponentUserMapBase.cc.

47 {
48 double v;
49 ElectricField(x, y, z, ex, ey, ez, v, m, status);
50}
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)

Referenced by ElectricField().

◆ GetMedium()

Medium * Garfield::ComponentUserMapBase::GetMedium ( const double &  x,
const double &  y,
const double &  z 
)
virtual

Reimplemented from Garfield::ComponentBase.

Definition at line 12 of file ComponentUserMapBase.cc.

13 {
14 double p1 = x , p2 = y , p3 = z ;
15 double u1x = 1., u2x = 0., u3x = 0.;
16 double u1y = 0., u2y = 1., u3y = 0.;
17 double u1z = 0., u2z = 0., u3z = 1.;
18 ComponentBase* pComponent = NULL;
19 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
20 pComponent);
21
22 if(!pComponent){
23 if(debug){
24 std::cerr << m_className << "::GetMedium:\n";
25 std::cerr << " ComponentBase pointer is NULL for point (" << x << ", "
26 << y << "," << z << ")\n";
27 }
28 return NULL;
29 }
30
31 if(debug){
32 std::cerr << m_className << "::GetMedium:\n";
33 std::cerr << " Coordinates: \n";
34 std::cerr << " Global: (" << x << ", " << y << ", " << z << ")\n";
35 std::cerr << " Local: (" << p1 << ", " << p2 << ", " << p3 << ")\n";
36 std::cerr << " Local base vectors: \n";
37 std::cerr << " u1: (" << u1x << ", " << u1y << ", " << u1z << ")\n";
38 std::cerr << " u2: (" << u2x << ", " << u2y << ", " << u2z << ")\n";
39 std::cerr << " u3: (" << u3x << ", " << u3y << ", " << u3z << ")\n";
40 }
41
42 return pComponent->GetMedium(p1, p2, p3);
43}

◆ GetVoltageRange()

bool Garfield::ComponentUserMapBase::GetVoltageRange ( double &  vmin,
double &  vmax 
)
inlinevirtual

Implements Garfield::ComponentBase.

Definition at line 23 of file ComponentUserMapBase.hh.

23{ vmin = vmax = 0.; return false; }

◆ MapCoordinates() [1/2]

virtual void Garfield::ComponentUserMapBase::MapCoordinates ( double &  p1,
double &  p2,
double &  p3,
double &  u1x,
double &  u2x,
double &  u3x,
double &  u1y,
double &  u2y,
double &  u3y,
double &  u1z,
double &  u2z,
double &  u3z,
ComponentBase *&  pComponent 
)
pure virtual

◆ MapCoordinates() [2/2]

virtual void Garfield::ComponentUserMapBase::MapCoordinates ( double &  p1,
double &  p2,
double &  p3,
double &  u1x,
double &  u2x,
double &  u3x,
double &  u1y,
double &  u2y,
double &  u3y,
double &  u1z,
double &  u2z,
double &  u3z,
ComponentBase *&  pComponent,
std::string &  label 
)
inlinevirtual

Definition at line 48 of file ComponentUserMapBase.hh.

53 {
54 (void)label; // Suppress compiler warning
55 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
56 pComponent);
57 }

◆ Reset()

void Garfield::ComponentUserMapBase::Reset ( )
inlineprotectedvirtual

Implements Garfield::ComponentBase.

Definition at line 61 of file ComponentUserMapBase.hh.

61{}

◆ UnmapField()

void Garfield::ComponentUserMapBase::UnmapField ( const double  e1,
const double  e2,
const double  e3,
const double  u1x,
const double  u2x,
const double  u3x,
const double  u1y,
const double  u2y,
const double  u3y,
const double  u1z,
const double  u2z,
const double  u3z,
double &  ex,
double &  ey,
double &  ez 
) const
inlineprotected

Definition at line 64 of file ComponentUserMapBase.hh.

69 {
70 ex = u1x*e1 + u2x*e2 + u3x*e3;
71 ey = u1y*e1 + u2y*e2 + u3y*e3;
72 ez = u1z*e1 + u2z*e2 + u3z*e3;
73 }

Referenced by ElectricField(), and WeightingField().

◆ UpdatePeriodicity()

void Garfield::ComponentUserMapBase::UpdatePeriodicity ( )
protectedvirtual

Implements Garfield::ComponentBase.

Definition at line 169 of file ComponentUserMapBase.cc.

169 {
170 if(debug){
171 std::cerr << m_className << "::UpdatePeriodicity:\n";
172 std::cerr << " Periodicities should be implemented by overloading the "
173 << "MapCoordinates function.\n";
174 }
175}

◆ WeightingField()

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

Reimplemented from Garfield::ComponentBase.

Definition at line 93 of file ComponentUserMapBase.cc.

96 {
97 double p1 = x , p2 = y , p3 = z ;
98 double u1x = 1., u2x = 0., u3x = 0.;
99 double u1y = 0., u2y = 1., u3y = 0.;
100 double u1z = 0., u2z = 0., u3z = 1.;
101 double w1 = 0., w2 = 0., w3 = 0.;
102 ComponentBase* pComponent = NULL;
103 std::string label_ = label;
104
105 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
106 pComponent, label_);
107
108 if(!pComponent){
109 if(debug){
110 std::cerr << m_className << "::WeightingField:\n";
111 std::cerr << " ComponentBase pointer is NULL for point (" << x << ", "
112 << y << "," << z << ")\n";
113 }
114 wx = wy = wz = 0.;
115 return;
116 }
117
118 if(debug){
119 std::cerr << m_className << "::WeightingField:\n";
120 std::cerr << " Coordinates: \n";
121 std::cerr << " Global: (" << x << ", " << y << ", " << z << ")\n";
122 std::cerr << " Local: (" << p1 << ", " << p2 << ", " << p3 << ")\n";
123 std::cerr << " Local base vectors: \n";
124 std::cerr << " u1: (" << u1x << ", " << u1y << ", " << u1z << ")\n";
125 std::cerr << " u2: (" << u2x << ", " << u2y << ", " << u2z << ")\n";
126 std::cerr << " u3: (" << u3x << ", " << u3y << ", " << u3z << ")\n";
127 }
128
129 pComponent->WeightingField(p1, p2, p3, w1, w2, w3, label_);
130 UnmapField(w1, w2, w3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z, wx, wy,
131 wz);
132}

◆ WeightingPotential()

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

Reimplemented from Garfield::ComponentBase.

Definition at line 134 of file ComponentUserMapBase.cc.

136 {
137 double p1 = x , p2 = y , p3 = z ;
138 double u1x = 1., u2x = 0., u3x = 0.;
139 double u1y = 0., u2y = 1., u3y = 0.;
140 double u1z = 0., u2z = 0., u3z = 1.;
141 ComponentBase* pComponent = NULL;
142 std::string label_ = label;
143 MapCoordinates(p1, p2, p3, u1x, u2x, u3x, u1y, u2y, u3y, u1z, u2z, u3z,
144 pComponent, label_);
145
146 if(!pComponent){
147 if(debug){
148 std::cerr << m_className << "::WeightingPotential:\n";
149 std::cerr << " ComponentBase pointer is NULL for point (" << x << ", "
150 << y << "," << z << ")\n";
151 }
152 return 0.;
153 }
154
155 if(debug){
156 std::cerr << m_className << "::WeightingPotential:\n";
157 std::cerr << " Coordinates: \n";
158 std::cerr << " Global: (" << x << ", " << y << ", " << z << ")\n";
159 std::cerr << " Local: (" << p1 << ", " << p2 << ", " << p3 << ")\n";
160 std::cerr << " Local base vectors: \n";
161 std::cerr << " u1: (" << u1x << ", " << u1y << ", " << u1z << ")\n";
162 std::cerr << " u2: (" << u2x << ", " << u2y << ", " << u2z << ")\n";
163 std::cerr << " u3: (" << u3x << ", " << u3y << ", " << u3z << ")\n";
164 }
165
166 return pComponent->WeightingPotential(p1, p2, p3, label_);
167}

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