Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
SolidRidge.hh
Go to the documentation of this file.
1#ifndef G_SOLID_RIDGE_H
2#define G_SOLID_RIDGE_H
3
4#include "Solid.hh"
5
6namespace Garfield {
7
8/// Triangular prism (Toblerone bar).
9
10class SolidRidge : public Solid {
11 public:
12 /// Constructor from centre, half-lengths, height and x-offset.
13 SolidRidge(const double cx, const double cy, const double cz,
14 const double lx, const double ly, const double hz,
15 const double offsetx);
16 /// Constructor from centre, half-lengths, height, x-offset and orientation.
17 SolidRidge(const double cx, const double cy, const double cz,
18 const double lx, const double ly, const double hz,
19 const double offsetx,
20 const double dx, const double dy, const double dz);
21 /// Destructor
23
24 bool IsInside(const double x, const double y, const double z,
25 const bool tesselated) const override;
26 bool GetBoundingBox(double& xmin, double& ymin, double& zmin, double& xmax,
27 double& ymax, double& zmax) const override;
28 bool IsRidge() const override { return true; }
29
30 /// Set the half-length along x.
31 void SetHalfLengthX(const double lx);
32 /// Set the half-length along y.
33 void SetHalfLengthY(const double ly);
34 /// Set the height of the ridge.
35 void SetRidgeHeight(const double hz);
36 /// Set the x-offset of the ridge.
37 void SetRidgeOffset(const double dx) { m_hx = dx; }
38
39 double GetHalfLengthX() const override { return m_lX; }
40 double GetHalfLengthY() const override { return m_lY; }
41 double GetRidgeHeight() const override { return m_hz; }
42 double GetRidgeOffset() const override { return m_hx; }
43
44 bool SolidPanels(std::vector<Panel>& panels) override;
45 void SetDiscretisationLevel(const double dis) override {
46 m_dis.fill(dis);
47 }
48 double GetDiscretisationLevel(const Panel& panel) override;
49
50 void Cut(const double x0, const double y0, const double z0,
51 const double xn, const double yn, const double zn,
52 std::vector<Panel>& panels) override;
53
54 private:
55 /// Half-length in x.
56 double m_lX;
57 /// Half-length in y.
58 double m_lY;
59 /// Height of the ridge.
60 double m_hz;
61 /// Offset of the ridge in x.
62 double m_hx;
63
64 /// Discretisation levels.
65 std::array<double, 5> m_dis{{-1., -1., -1., -1., -1.}};
66};
67}
68
69#endif
Triangular prism (Toblerone bar).
Definition: SolidRidge.hh:10
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const override
Return the bounding box of the solid.
Definition: SolidRidge.cc:44
double GetHalfLengthY() const override
Return the half-length along y.
Definition: SolidRidge.hh:40
void SetDiscretisationLevel(const double dis) override
Set the discretisation level (for all panels).
Definition: SolidRidge.hh:45
void SetRidgeHeight(const double hz)
Set the height of the ridge.
Definition: SolidRidge.cc:82
double GetDiscretisationLevel(const Panel &panel) override
Retrieve the discretisation level of a panel.
Definition: SolidRidge.cc:171
bool IsInside(const double x, const double y, const double z, const bool tesselated) const override
Definition: SolidRidge.cc:27
~SolidRidge()
Destructor.
Definition: SolidRidge.hh:22
void SetRidgeOffset(const double dx)
Set the x-offset of the ridge.
Definition: SolidRidge.hh:37
double GetRidgeOffset() const override
Return the x-offset of a ridge.
Definition: SolidRidge.hh:42
void SetHalfLengthX(const double lx)
Set the half-length along x.
Definition: SolidRidge.cc:66
bool IsRidge() const override
Return true if the solid is a ridge.
Definition: SolidRidge.hh:28
bool SolidPanels(std::vector< Panel > &panels) override
Retrieve the surface panels of the solid.
Definition: SolidRidge.cc:90
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
Definition: SolidRidge.cc:195
void SetHalfLengthY(const double ly)
Set the half-length along y.
Definition: SolidRidge.cc:74
double GetHalfLengthX() const override
Return the half-length along x.
Definition: SolidRidge.hh:39
double GetRidgeHeight() const override
Return the height of a ridge.
Definition: SolidRidge.hh:41
Abstract base class for solids.
Definition: Solid.hh:28
Surface panel.
Definition: Solid.hh:11