Garfield++ 3.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) const override;
25 bool GetBoundingBox(double& xmin, double& ymin, double& zmin, double& xmax,
26 double& ymax, double& zmax) const override;
27 bool IsRidge() const override { return true; }
28
29 /// Set the half-length along x.
30 void SetHalfLengthX(const double lx);
31 /// Set the half-length along y.
32 void SetHalfLengthY(const double ly);
33 /// Set the height of the ridge.
34 void SetRidgeHeight(const double hz);
35 /// Set the x-offset of the ridge.
36 void SetRidgeOffset(const double dx) { m_hx = dx; }
37
38 double GetHalfLengthX() const override { return m_lX; }
39 double GetHalfLengthY() const override { return m_lY; }
40 double GetRidgeHeight() const override { return m_hz; }
41 double GetRidgeOffset() const override { return m_hx; }
42
43 bool SolidPanels(std::vector<Panel>& panels) override;
44 double GetDiscretisationLevel(const Panel& panel) override;
45
46 private:
47 /// Half-length in x.
48 double m_lX;
49 /// Half-length in y.
50 double m_lY;
51 /// Height of the ridge.
52 double m_hz;
53 /// Offset of the ridge in x.
54 double m_hx;
55
56 /// Discretisation levels.
57 std::array<double, 5> m_dis{{-1., -1., -1., -1., -1.}};
58};
59}
60
61#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:50
double GetHalfLengthY() const override
Return the half-length along y.
Definition: SolidRidge.hh:39
void SetRidgeHeight(const double hz)
Set the height of the ridge.
Definition: SolidRidge.cc:88
double GetDiscretisationLevel(const Panel &panel) override
Retrieve the discretization level of a panel.
Definition: SolidRidge.cc:177
~SolidRidge()
Destructor.
Definition: SolidRidge.hh:22
void SetRidgeOffset(const double dx)
Set the x-offset of the ridge.
Definition: SolidRidge.hh:36
double GetRidgeOffset() const override
Return the x-offset of a ridge.
Definition: SolidRidge.hh:41
void SetHalfLengthX(const double lx)
Set the half-length along x.
Definition: SolidRidge.cc:72
bool IsRidge() const override
Return true if the solid is a ridge.
Definition: SolidRidge.hh:27
bool SolidPanels(std::vector< Panel > &panels) override
Retrieve the surface panels of the solid.
Definition: SolidRidge.cc:96
bool IsInside(const double x, const double y, const double z) const override
Check whether a given point is inside the solid.
Definition: SolidRidge.cc:26
void SetHalfLengthY(const double ly)
Set the half-length along y.
Definition: SolidRidge.cc:80
double GetHalfLengthX() const override
Return the half-length along x.
Definition: SolidRidge.hh:38
double GetRidgeHeight() const override
Return the height of a ridge.
Definition: SolidRidge.hh:40
Abstract base class for solids.
Definition: Solid.hh:28
Surface panel.
Definition: Solid.hh:11