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

Triangular prism (Toblerone bar). More...

#include <SolidRidge.hh>

+ Inheritance diagram for Garfield::SolidRidge:

Public Member Functions

 SolidRidge (const double cx, const double cy, const double cz, const double lx, const double ly, const double hz, const double offsetx)
 Constructor from centre, half-lengths, height and x-offset.
 
 SolidRidge (const double cx, const double cy, const double cz, const double lx, const double ly, const double hz, const double offsetx, const double dx, const double dy, const double dz)
 Constructor from centre, half-lengths, height, x-offset and orientation.
 
 ~SolidRidge ()
 Destructor.
 
bool IsInside (const double x, const double y, const double z, const bool tesselated) const override
 
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const override
 Return the bounding box of the solid.
 
bool IsRidge () const override
 Return true if the solid is a ridge.
 
void SetHalfLengthX (const double lx)
 Set the half-length along x.
 
void SetHalfLengthY (const double ly)
 Set the half-length along y.
 
void SetRidgeHeight (const double hz)
 Set the height of the ridge.
 
void SetRidgeOffset (const double dx)
 Set the x-offset of the ridge.
 
double GetHalfLengthX () const override
 Return the half-length along x.
 
double GetHalfLengthY () const override
 Return the half-length along y.
 
double GetRidgeHeight () const override
 Return the height of a ridge.
 
double GetRidgeOffset () const override
 Return the x-offset of a ridge.
 
bool SolidPanels (std::vector< Panel > &panels) override
 Retrieve the surface panels of the solid.
 
void SetDiscretisationLevel (const double dis) override
 Set the discretisation level (for all panels).
 
double GetDiscretisationLevel (const Panel &panel) override
 Retrieve the discretisation level of a panel.
 
void Cut (const double x0, const double y0, const double z0, const double xn, const double yn, const double zn, std::vector< Panel > &panels) override
 
- Public Member Functions inherited from Garfield::Solid
 Solid ()=delete
 Default constructor.
 
 Solid (const double cx, const double cy, const double cz, const std::string &name)
 Constructor.
 
virtual ~Solid ()
 Destructor.
 
virtual bool IsInside (const double x, const double y, const double z, const bool tesselated=false) const =0
 
virtual bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const =0
 Return the bounding box of the solid.
 
virtual bool IsBox () const
 Return true if the solid is a box.
 
virtual bool IsTube () const
 Return true if the solid is a tube.
 
virtual bool IsSphere () const
 Return true if the solid is a sphere.
 
virtual bool IsHole () const
 Return true if the solid is a hole.
 
virtual bool IsRidge () const
 Return true if the solid is a ridge.
 
virtual bool IsExtrusion () const
 Return true if the solid is an extrusion.
 
virtual bool IsWire () const
 Return true if the solid is a wire.
 
void SetLabel (const std::string &label)
 Set a label.
 
std::string GetLabel () const
 Return the label.
 
bool GetCentre (double &x, double &y, double &z) const
 Retrieve the centre point of the solid.
 
bool GetDirection (double &dx, double &dy, double &dz) const
 Retrieve the direction vector.
 
bool GetOrientation (double &ctheta, double &stheta, double &cphi, double &sphi) const
 Retrieve the orientation (azimuthal and polar angles) of the solid.
 
virtual double GetHalfLengthX () const
 Return the half-length along x.
 
virtual double GetHalfLengthY () const
 Return the half-length along y.
 
virtual double GetHalfLengthZ () const
 Return the half-length along z.
 
virtual double GetInnerRadius () const
 Return the inner radius.
 
virtual double GetOuterRadius () const
 Return the outer radius.
 
virtual double GetRadius () const
 Return the radius.
 
virtual double GetLowerRadius () const
 Return the lower radius (of a hole).
 
virtual double GetUpperRadius () const
 Return the upper radius (of a hole).
 
virtual double GetRidgeOffset () const
 Return the x-offset of a ridge.
 
virtual double GetRidgeHeight () const
 Return the height of a ridge.
 
virtual bool GetProfile (std::vector< double > &xv, std::vector< double > &yv) const
 Get the vertices defining an extrusion.
 
unsigned int GetId () const
 Get the ID of the solid.
 
virtual bool SolidPanels (std::vector< Panel > &panels)=0
 Retrieve the surface panels of the solid.
 
virtual void SetDiscretisationLevel (const double dis)=0
 Set the discretisation level (for all panels).
 
virtual double GetDiscretisationLevel (const Panel &panel)=0
 Retrieve the discretisation level of a panel.
 
virtual void Cut (const double x0, const double y0, const double z0, const double xn, const double yn, const double zn, std::vector< Panel > &panels)=0
 
void SetBoundaryPotential (const double v)
 Apply Dirichlet boundary conditions (fixed voltage).
 
void SetBoundaryChargeDensity (const double q)
 Apply fixed-charge boundary conditions.
 
void SetBoundaryFloat ()
 Make the potential at the surface of the solid floating.
 
void SetBoundaryDielectric ()
 Make the surfaces of the solid dielectric-dielectric interfaces.
 
void SetBoundaryParallelField ()
 
void SetBoundaryPerpendicularField ()
 
BoundaryCondition GetBoundaryConditionType () const
 Retrieve the type of boundary condition.
 
double GetBoundaryPotential () const
 Retrieve the potential.
 
double GetBoundaryChargeDensity () const
 Retrieve the surface charge density.
 
void EnableDebugging (const bool on=true)
 Switch debugging messages on/off.
 
void SetColour (const int col)
 Set the colour of the solid.
 
int GetColour () const
 Get the colour of the solid.
 

Additional Inherited Members

- Public Types inherited from Garfield::Solid
enum  BoundaryCondition {
  Unknown = 0 , Voltage , Charge , Float ,
  Dielectric , DielectricCharge , ParallelField , PerpendicularField
}
 
- Static Public Member Functions inherited from Garfield::Solid
static bool Intersect (const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x0, const double y0, const double z0, const double a, const double b, const double c, double &xc, double &yc, double &zc)
 
- Protected Member Functions inherited from Garfield::Solid
void ToLocal (const double x, const double y, const double z, double &u, double &v, double &w) const
 
void ToGlobal (const double u, const double v, const double w, double &x, double &y, double &z) const
 
void VectorToLocal (const double x, const double y, const double z, double &u, double &v, double &w)
 Transform a vector from global to local coordinates.
 
void SetDirection (const double dx, const double dy, const double dz)
 
- Protected Attributes inherited from Garfield::Solid
double m_cX = 0.
 Centre of the solid.
 
double m_cY = 0.
 
double m_cZ = 0.
 
double m_dX = 0.
 Direction vector.
 
double m_dY = 0.
 
double m_dZ = 1.
 
double m_cPhi = 1.
 Azimuthal angle.
 
double m_sPhi = 0.
 
double m_cTheta = 1.
 Polar angle.
 
double m_sTheta = 0.
 
std::string m_className = "Solid"
 Class name.
 
std::string m_label = ""
 Label.
 
bool m_debug = false
 Debug flag.
 
BoundaryCondition m_bctype = Unknown
 Type of boundary condition.
 
double m_volt = 0.
 Potential at the surface.
 
double m_charge = 0.
 Surface charge density.
 
double m_eps = 0.
 Dielectric constant.
 
int m_colour = -1
 Colour.
 

Detailed Description

Triangular prism (Toblerone bar).

Definition at line 10 of file SolidRidge.hh.

Constructor & Destructor Documentation

◆ SolidRidge() [1/2]

Garfield::SolidRidge::SolidRidge ( const double  cx,
const double  cy,
const double  cz,
const double  lx,
const double  ly,
const double  hz,
const double  offsetx 
)

Constructor from centre, half-lengths, height and x-offset.

Definition at line 10 of file SolidRidge.cc.

13 : Solid(cx, cy, cz, "SolidRidge"),
14 m_lX(lx),
15 m_lY(ly),
16 m_hz(hz),
17 m_hx(hx) {}
Solid()=delete
Default constructor.

◆ SolidRidge() [2/2]

Garfield::SolidRidge::SolidRidge ( const double  cx,
const double  cy,
const double  cz,
const double  lx,
const double  ly,
const double  hz,
const double  offsetx,
const double  dx,
const double  dy,
const double  dz 
)

Constructor from centre, half-lengths, height, x-offset and orientation.

Definition at line 19 of file SolidRidge.cc.

23 : SolidRidge(cx, cy, cz, lx, ly, hz, hx) {
24 SetDirection(dx, dy, dz);
25}
SolidRidge(const double cx, const double cy, const double cz, const double lx, const double ly, const double hz, const double offsetx)
Constructor from centre, half-lengths, height and x-offset.
Definition: SolidRidge.cc:10
void SetDirection(const double dx, const double dy, const double dz)
Definition: Solid.cc:12

◆ ~SolidRidge()

Garfield::SolidRidge::~SolidRidge ( )
inline

Destructor.

Definition at line 22 of file SolidRidge.hh.

22{}

Member Function Documentation

◆ Cut()

void Garfield::SolidRidge::Cut ( const double  x0,
const double  y0,
const double  z0,
const double  xn,
const double  yn,
const double  zn,
std::vector< Panel > &  panels 
)
overridevirtual

Implements Garfield::Solid.

Definition at line 195 of file SolidRidge.cc.

197 {
198
199 //-----------------------------------------------------------------------
200 // PLATBC - Cuts ridge with a plane.
201 //-----------------------------------------------------------------------
202
203 std::vector<double> xv;
204 std::vector<double> yv;
205 std::vector<double> zv;
206 // Draw all 9 lines and cut.
207 // The line (xmin,ymin,0) to (xmax,ymin,0).
208 double x1, y1, z1;
209 ToGlobal(-m_lX, -m_lY, 0., x1, y1, z1);
210 double x2, y2, z2;
211 ToGlobal(+m_lX, -m_lY, 0., x2, y2, z2);
212 double xc, yc, zc;
213 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
214 xv.push_back(xc);
215 yv.push_back(yc);
216 zv.push_back(zc);
217 }
218 // ... to (xmin,ymax,0).
219 ToGlobal(-m_lX, +m_lY, 0., x2, y2, z2);
220 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
221 xv.push_back(xc);
222 yv.push_back(yc);
223 zv.push_back(zc);
224 }
225 // ... to (xh,ymin,zh).
226 ToGlobal(m_hx, -m_lY, m_hz, x2, y2, z2);
227 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
228 xv.push_back(xc);
229 yv.push_back(yc);
230 zv.push_back(zc);
231 }
232
233 // The line (xmax,ymax,0) to (xmin,ymax,0).
234 ToGlobal(+m_lX, +m_lY, 0., x1, y1, z1);
235 ToGlobal(-m_lX, +m_lY, 0., x2, y2, z2);
236 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
237 xv.push_back(xc);
238 yv.push_back(yc);
239 zv.push_back(zc);
240 }
241
242 // ... to (xmax,ymin,0).
243 ToGlobal(+m_lX, -m_lY, 0., x2, y2, z2);
244 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
245 xv.push_back(xc);
246 yv.push_back(yc);
247 zv.push_back(zc);
248 }
249
250 // ... to (xh,ymax,zh).
251 ToGlobal(m_hx, +m_lY, m_hz, x2, y2, z2);
252 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
253 xv.push_back(xc);
254 yv.push_back(yc);
255 zv.push_back(zc);
256 }
257
258 // The line (xmin,ymax,0) to (xh,ymax,zh).
259 ToGlobal(-m_lX, +m_lY, 0., x1, y1, z1);
260 ToGlobal(m_hx, +m_lY, m_hz, x2, y2, z2);
261 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
262 xv.push_back(xc);
263 yv.push_back(yc);
264 zv.push_back(zc);
265 }
266
267 // The line (xh,ymax,zh) to (xh,ymin,zh)
268 ToGlobal(m_hx, +m_lY, m_hz, x1, y1, z1);
269 ToGlobal(m_hx, -m_lY, m_hz, x2, y2, z2);
270 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
271 xv.push_back(xc);
272 yv.push_back(yc);
273 zv.push_back(zc);
274 }
275
276 // The line (xh,ymin,zh) to (xmax,ymin,0)
277 ToGlobal(m_hx, -m_lY, m_hz, x1, y1, z1);
278 ToGlobal(+m_lX, -m_lY, 0., x2, y2, z2);
279 if (Intersect(x1, y1, z1, x2, y2, z2, x0, y0, z0, xn, yn, zn, xc, yc, zc)) {
280 xv.push_back(xc);
281 yv.push_back(yc);
282 zv.push_back(zc);
283 }
284
285 // Get rid of butterflies.
287 if (xv.size() >= 3) {
288 Panel panel;
289 panel.a = xn;
290 panel.b = yn;
291 panel.c = zn;
292 panel.xv = xv;
293 panel.yv = yv;
294 panel.zv = zv;
295 panel.colour = m_colour;
296 panel.volume = GetId();
297 panels.push_back(std::move(panel));
298 }
299
300}
static bool Intersect(const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x0, const double y0, const double z0, const double a, const double b, const double c, double &xc, double &yc, double &zc)
Definition: Solid.cc:52
unsigned int GetId() const
Get the ID of the solid.
Definition: Solid.hh:137
int m_colour
Colour.
Definition: Solid.hh:230
void ToGlobal(const double u, const double v, const double w, double &x, double &y, double &z) const
Definition: Solid.hh:246
void EliminateButterflies(std::vector< double > &xp, std::vector< double > &yp, std::vector< double > &zp)
Definition: Polygon.cc:355

◆ GetBoundingBox()

bool Garfield::SolidRidge::GetBoundingBox ( double &  xmin,
double &  ymin,
double &  zmin,
double &  xmax,
double &  ymax,
double &  zmax 
) const
overridevirtual

Return the bounding box of the solid.

Implements Garfield::Solid.

Definition at line 44 of file SolidRidge.cc.

45 {
46 if (m_cTheta == 1. && m_cPhi == 1.) {
47 xmin = m_cX - m_lX;
48 xmax = m_cX + m_lX;
49 ymin = m_cY - m_lY;
50 ymax = m_cY + m_lY;
51 zmin = m_cZ;
52 zmax = m_cZ + m_hz;
53 return true;
54 }
55
56 const double dd = sqrt(m_lX * m_lX + m_lY * m_lY + m_hz * m_hz);
57 xmin = m_cX - dd;
58 xmax = m_cX + dd;
59 ymin = m_cY - dd;
60 ymax = m_cY + dd;
61 zmin = m_cZ - dd;
62 zmax = m_cZ + dd;
63 return true;
64}
double m_cZ
Definition: Solid.hh:202
double m_cTheta
Polar angle.
Definition: Solid.hh:209
double m_cY
Definition: Solid.hh:202
double m_cX
Centre of the solid.
Definition: Solid.hh:202
double m_cPhi
Azimuthal angle.
Definition: Solid.hh:207
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314

◆ GetDiscretisationLevel()

double Garfield::SolidRidge::GetDiscretisationLevel ( const Panel panel)
overridevirtual

Retrieve the discretisation level of a panel.

Implements Garfield::Solid.

Definition at line 171 of file SolidRidge.cc.

171 {
172
173 // Transform the normal vector to local coordinates.
174 double u = 0., v = 0., w = 0.;
175 VectorToLocal(panel.a, panel.b, panel.c, u, v, w);
176 // Identify the vector.
177 if (v > std::max(std::abs(u), std::abs(w))) {
178 return m_dis[2];
179 } else if (v < -std::max(std::abs(u), std::abs(w))) {
180 return m_dis[3];
181 } else if (w < -std::max(std::abs(u), std::abs(v))) {
182 return m_dis[4];
183 } else if (u > 0) {
184 return m_dis[0];
185 } else if (u < 0) {
186 return m_dis[1];
187 }
188 if (m_debug) {
189 std::cout << m_className << "::GetDiscretisationLevel:\n"
190 << " Found no match for the panel; return first value.\n";
191 }
192 return m_dis[0];
193}
void VectorToLocal(const double x, const double y, const double z, double &u, double &v, double &w)
Transform a vector from global to local coordinates.
Definition: Solid.hh:253
bool m_debug
Debug flag.
Definition: Solid.hh:218
std::string m_className
Class name.
Definition: Solid.hh:212

◆ GetHalfLengthX()

double Garfield::SolidRidge::GetHalfLengthX ( ) const
inlineoverridevirtual

Return the half-length along x.

Reimplemented from Garfield::Solid.

Definition at line 39 of file SolidRidge.hh.

39{ return m_lX; }

◆ GetHalfLengthY()

double Garfield::SolidRidge::GetHalfLengthY ( ) const
inlineoverridevirtual

Return the half-length along y.

Reimplemented from Garfield::Solid.

Definition at line 40 of file SolidRidge.hh.

40{ return m_lY; }

◆ GetRidgeHeight()

double Garfield::SolidRidge::GetRidgeHeight ( ) const
inlineoverridevirtual

Return the height of a ridge.

Reimplemented from Garfield::Solid.

Definition at line 41 of file SolidRidge.hh.

41{ return m_hz; }

◆ GetRidgeOffset()

double Garfield::SolidRidge::GetRidgeOffset ( ) const
inlineoverridevirtual

Return the x-offset of a ridge.

Reimplemented from Garfield::Solid.

Definition at line 42 of file SolidRidge.hh.

42{ return m_hx; }

◆ IsInside()

bool Garfield::SolidRidge::IsInside ( const double  x,
const double  y,
const double  z,
const bool  tesselated 
) const
overridevirtual

Check whether a given point is inside the solid. If requested, use the tesselated approximation of the solid (if applicable).

Implements Garfield::Solid.

Definition at line 27 of file SolidRidge.cc.

28 {
29 // Transform the point to local coordinates.
30 double u = x, v = y, w = z;
31 ToLocal(x, y, z, u, v, w);
32
33 bool inside = true;
34 if (fabs(u) > m_lX || fabs(v) > m_lY || w < 0. || w > m_hz) {
35 inside = false;
36 } else if (u >= m_hx && m_hz * u + (m_lX - m_hx) * v > m_hz * m_lX) {
37 inside = false;
38 } else if (u <= m_hx && -m_hz * u + (m_lX + m_hx) * v > m_hz * m_lX) {
39 inside = false;
40 }
41 return inside;
42}
void ToLocal(const double x, const double y, const double z, double &u, double &v, double &w) const
Definition: Solid.hh:234
DoubleAc fabs(const DoubleAc &f)
Definition: DoubleAc.h:615

◆ IsRidge()

bool Garfield::SolidRidge::IsRidge ( ) const
inlineoverridevirtual

Return true if the solid is a ridge.

Reimplemented from Garfield::Solid.

Definition at line 28 of file SolidRidge.hh.

28{ return true; }

◆ SetDiscretisationLevel()

void Garfield::SolidRidge::SetDiscretisationLevel ( const double  dis)
inlineoverridevirtual

Set the discretisation level (for all panels).

Implements Garfield::Solid.

Definition at line 45 of file SolidRidge.hh.

45 {
46 m_dis.fill(dis);
47 }

◆ SetHalfLengthX()

void Garfield::SolidRidge::SetHalfLengthX ( const double  lx)

Set the half-length along x.

Definition at line 66 of file SolidRidge.cc.

66 {
67 if (lx <= 0.) {
68 std::cerr << "SolidRidge::SetHalfLengthX: Half-length must be > 0.\n";
69 return;
70 }
71 m_lX = lx;
72}

◆ SetHalfLengthY()

void Garfield::SolidRidge::SetHalfLengthY ( const double  ly)

Set the half-length along y.

Definition at line 74 of file SolidRidge.cc.

74 {
75 if (ly <= 0.) {
76 std::cerr << "SolidRidge::SetHalfLengthY: Half-length must be > 0.\n";
77 return;
78 }
79 m_lY = ly;
80}

◆ SetRidgeHeight()

void Garfield::SolidRidge::SetRidgeHeight ( const double  hz)

Set the height of the ridge.

Definition at line 82 of file SolidRidge.cc.

82 {
83 if (hz <= 0.) {
84 std::cerr << "SolidRidge::SetRidgeHeight: Height must be > 0.\n";
85 return;
86 }
87 m_hz = hz;
88}

◆ SetRidgeOffset()

void Garfield::SolidRidge::SetRidgeOffset ( const double  dx)
inline

Set the x-offset of the ridge.

Definition at line 37 of file SolidRidge.hh.

37{ m_hx = dx; }

◆ SolidPanels()

bool Garfield::SolidRidge::SolidPanels ( std::vector< Panel > &  panels)
overridevirtual

Retrieve the surface panels of the solid.

Implements Garfield::Solid.

Definition at line 90 of file SolidRidge.cc.

90 {
91 const auto id = GetId();
92 const unsigned int nPanels = panels.size();
93 // Direction vector.
94 const double fnorm = sqrt(m_dX * m_dX + m_dY * m_dY + m_dZ * m_dZ);
95 if (fnorm <= 0) {
96 std::cerr << "SolidRidge::SolidPanels:\n"
97 << " Zero norm direction vector; no panels generated.\n";
98 return false;
99 }
100 double xv0, yv0, zv0;
101 double xv1, yv1, zv1;
102 double xv2, yv2, zv2;
103 double xv3, yv3, zv3;
104
105 // Draw the 5 sides of the ridge, start with the floor.
106 ToGlobal(-m_lX, -m_lY, 0, xv0, yv0, zv0);
107 ToGlobal(-m_lX, +m_lY, 0, xv1, yv1, zv1);
108 ToGlobal(+m_lX, +m_lY, 0, xv2, yv2, zv2);
109 ToGlobal(+m_lX, -m_lY, 0, xv3, yv3, zv3);
110
111 Panel base;
112 base.a = -m_cPhi * m_sTheta;
113 base.b = -m_sPhi * m_sTheta;
114 base.c = -m_cTheta;
115 base.xv = {xv0, xv1, xv2, xv3};
116 base.yv = {yv0, yv1, yv2, yv3};
117 base.zv = {zv0, zv1, zv2, zv3};
118 base.colour = m_colour;
119 base.volume = id;
120 panels.push_back(std::move(base));
121
122 // Side triangles at y=ymin and y=ymax.
123 for (unsigned int i = 0; i < 2; ++i) {
124 const double y = i == 0 ? -m_lY : +m_lY;
125 ToGlobal(-m_lX, y, 0, xv0, yv0, zv0);
126 ToGlobal(+m_lX, y, 0, xv1, yv1, zv1);
127 ToGlobal(m_hx, y, m_hz, xv2, yv2, zv2);
128
129 const double a = i == 0 ? +m_sPhi : -m_sPhi;
130 const double b = i == 0 ? -m_cPhi : +m_cPhi;
131 Panel side;
132 side.a = a;
133 side.b = b;
134 side.c = 0.;
135 side.xv = {xv0, xv1, xv2};
136 side.yv = {yv0, yv1, yv2};
137 side.zv = {zv0, zv1, zv2};
138 side.colour = m_colour;
139 side.volume = id;
140 panels.push_back(std::move(side));
141 }
142
143 // The roof, parts at +x and -x.
144 for (unsigned int i = 0; i < 2; ++i) {
145 const double x = i == 0 ? +m_lX : -m_lX;
146 ToGlobal(x, -m_lY, 0, xv0, yv0, zv0);
147 ToGlobal(x, +m_lY, 0, xv1, yv1, zv1);
148 ToGlobal(m_hx, +m_lY, m_hz, xv2, yv2, zv2);
149 ToGlobal(m_hx, -m_lY, m_hz, xv3, yv3, zv3);
150 const double dx = i == 0 ? m_lX - m_hx : m_lX + m_hx;
151 const double s = sqrt(m_hz * m_hz + dx * dx);
152 const double xroof = i == 0 ? m_hz / s : -m_hz / s;
153 const double zroof = dx / s;
154
155 Panel roof;
156 roof.a = m_cPhi * m_cTheta * xroof + m_cPhi * m_sTheta * zroof;
157 roof.b = m_sPhi * m_cTheta * xroof + m_sPhi * m_sTheta * zroof;
158 roof.c = -m_sTheta * xroof + m_cTheta * zroof;
159 roof.xv = {xv0, xv1, xv2, xv3};
160 roof.yv = {yv0, yv1, yv2, yv3};
161 roof.zv = {zv0, zv1, zv2, zv3};
162 roof.colour = m_colour;
163 roof.volume = id;
164 panels.push_back(std::move(roof));
165 }
166 std::cout << "SolidRidge::SolidPanels: " << panels.size() - nPanels
167 << " panels.\n";
168 return true;
169}
double m_dZ
Definition: Solid.hh:205
double m_dX
Direction vector.
Definition: Solid.hh:205
double m_sPhi
Definition: Solid.hh:207
double m_sTheta
Definition: Solid.hh:209
double m_dY
Definition: Solid.hh:205

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