#include <GeometrySimple.hh>
|
| GeometrySimple () |
|
virtual | ~GeometrySimple () |
|
void | AddSolid (Solid *s, Medium *m) |
|
Solid * | GetSolid (const double x, const double y, const double z) const |
|
Medium * | GetMedium (const double x, const double y, const double z) const |
|
unsigned int | GetNumberOfSolids () const |
|
unsigned int | GetNumberOfMedia () const |
|
Solid * | GetSolid (const unsigned int i) const |
|
virtual Medium * | GetMedium (const unsigned int i) const |
|
void | Clear () |
|
void | PrintSolids () |
|
bool | IsInside (const double x, const double y, const double z) const |
|
bool | IsInBoundingBox (const double x, const double y, const double z) const |
|
bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) |
|
void | EnableDebugging () |
|
void | DisableDebugging () |
|
| GeometryBase () |
|
virtual | ~GeometryBase () |
|
virtual Medium * | GetMedium (const double x, const double y, const double z) const =0 |
|
virtual bool | IsInside (const double x, const double y, const double z) const =0 |
|
virtual bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)=0 |
|
Definition at line 13 of file GeometrySimple.hh.
◆ GeometrySimple()
Garfield::GeometrySimple::GeometrySimple |
( |
| ) |
|
Definition at line 6 of file GeometrySimple.cc.
9
11
14}
std::vector< medium > m_media
std::vector< solid > m_solids
◆ ~GeometrySimple()
virtual Garfield::GeometrySimple::~GeometrySimple |
( |
| ) |
|
|
inlinevirtual |
◆ AddSolid()
void Garfield::GeometrySimple::AddSolid |
( |
Solid * |
s, |
|
|
Medium * |
m |
|
) |
| |
Definition at line 16 of file GeometrySimple.cc.
16 {
17
18
19 if (!s) {
21 std::cerr << " Solid pointer is null.\n";
22 return;
23 }
24
25 if (!m) {
27 std::cerr << " Medium pointer is null.\n";
28 return;
29 }
30
31 int n = -1;
32 int id = m->GetId();
33
34 for (
unsigned int i = 0; i <
m_nMedia; ++i) {
36 n = i;
37 break;
38 }
39 }
40
41 if (n < 0) {
43 newMedium.medium = m;
47 }
48
49
50 double xmin, ymin, zmin;
51 double xmax, ymax, zmax;
52 if (!s->GetBoundingBox(xmin, ymin, zmin, xmax, ymax, zmax)) {
54 std::cerr << " Solid has no bounding box.\n";
55 return;
56 }
57
65 } else {
73 }
74
75
76 solid newSolid;
77 newSolid.solid = s;
78 newSolid.medium = n;
81}
Referenced by GarfieldPhysics::CreateGeometry().
◆ Clear()
void Garfield::GeometrySimple::Clear |
( |
| ) |
|
◆ DisableDebugging()
void Garfield::GeometrySimple::DisableDebugging |
( |
| ) |
|
|
inline |
◆ EnableDebugging()
void Garfield::GeometrySimple::EnableDebugging |
( |
| ) |
|
|
inline |
◆ GetBoundingBox()
bool Garfield::GeometrySimple::GetBoundingBox |
( |
double & |
xmin, |
|
|
double & |
ymin, |
|
|
double & |
zmin, |
|
|
double & |
xmax, |
|
|
double & |
ymax, |
|
|
double & |
zmax |
|
) |
| |
|
inlinevirtual |
◆ GetMedium() [1/2]
Medium * Garfield::GeometrySimple::GetMedium |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| const |
|
virtual |
◆ GetMedium() [2/2]
Medium * Garfield::GeometrySimple::GetMedium |
( |
const unsigned int |
i | ) |
const |
|
virtual |
Definition at line 116 of file GeometrySimple.cc.
116 {
117
120 std::cerr << " Requested medium " << i << " does not exist.\n";
121 return NULL;
122 }
123
125}
◆ GetNumberOfMedia()
unsigned int Garfield::GeometrySimple::GetNumberOfMedia |
( |
| ) |
const |
|
inline |
◆ GetNumberOfSolids()
unsigned int Garfield::GeometrySimple::GetNumberOfSolids |
( |
| ) |
const |
|
inline |
◆ GetSolid() [1/2]
Solid * Garfield::GeometrySimple::GetSolid |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| const |
◆ GetSolid() [2/2]
Solid * Garfield::GeometrySimple::GetSolid |
( |
const unsigned int |
i | ) |
const |
Definition at line 105 of file GeometrySimple.cc.
105 {
106
109 std::cerr << " Requested solid " << i << " does not exist.\n";
110 return NULL;
111 }
112
114}
◆ IsInBoundingBox()
bool Garfield::GeometrySimple::IsInBoundingBox |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| const |
Definition at line 169 of file GeometrySimple.cc.
170 {
171
174 std::cerr <<
m_className <<
"::IsInBoundingBox:\n";
175 std::cerr << " Bounding box is not defined.\n";
176 }
177 return true;
178 }
179
183 return true;
184 return false;
185}
Referenced by IsInside().
◆ IsInside()
bool Garfield::GeometrySimple::IsInside |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| const |
|
virtual |
Implements Garfield::GeometryBase.
Definition at line 158 of file GeometrySimple.cc.
159 {
160
162
163 for (
unsigned int i = 0; i <
m_nSolids; ++i) {
164 if (
m_solids[i].solid->IsInside(x, y, z))
return true;
165 }
166 return false;
167}
bool IsInBoundingBox(const double x, const double y, const double z) const
◆ PrintSolids()
void Garfield::GeometrySimple::PrintSolids |
( |
| ) |
|
Definition at line 135 of file GeometrySimple.cc.
135 {
136
139 std::cout << " 1 solid\n";
140 } else {
141 std::cout <<
" " <<
m_nSolids <<
" solids\n";
142 }
144 std::cout << " Index Type Medium\n";
145 for (
unsigned int i = 0; i <
m_nSolids; ++i) {
146 std::cout << " " << i << " ";
148 std::cout << "box ";
149 }
else if (
m_solids[i].solid->IsTube()) {
150 std::cout << "tube ";
151 } else {
152 std::cout << "unknown ";
153 }
155 }
156}
◆ m_debug
bool Garfield::GeometrySimple::m_debug |
|
protected |
◆ m_hasBoundingBox
bool Garfield::GeometrySimple::m_hasBoundingBox |
|
protected |
◆ m_media
std::vector<medium> Garfield::GeometrySimple::m_media |
|
protected |
◆ m_nMedia
unsigned int Garfield::GeometrySimple::m_nMedia |
|
protected |
◆ m_nSolids
unsigned int Garfield::GeometrySimple::m_nSolids |
|
protected |
◆ m_solids
std::vector<solid> Garfield::GeometrySimple::m_solids |
|
protected |
◆ m_xMaxBoundingBox
double Garfield::GeometrySimple::m_xMaxBoundingBox |
|
protected |
◆ m_xMinBoundingBox
double Garfield::GeometrySimple::m_xMinBoundingBox |
|
protected |
◆ m_yMaxBoundingBox
double Garfield::GeometrySimple::m_yMaxBoundingBox |
|
protected |
◆ m_yMinBoundingBox
double Garfield::GeometrySimple::m_yMinBoundingBox |
|
protected |
◆ m_zMaxBoundingBox
double Garfield::GeometrySimple::m_zMaxBoundingBox |
|
protected |
◆ m_zMinBoundingBox
double Garfield::GeometrySimple::m_zMinBoundingBox |
|
protected |
The documentation for this class was generated from the following files: