Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
SolidBox.hh
Go to the documentation of this file.
1#ifndef G_SOLID_BOX_H
2#define G_SOLID_BOX_H
3
4#include "Solid.hh"
5
6namespace Garfield {
7
8/// Box.
9
10class SolidBox : public Solid {
11 public:
12 /// Constructor from centre and half-widths.
13 SolidBox(const double cx, const double cy, const double cz, const double lx,
14 const double ly, const double lz);
15 /// Constructor from centre, half-widths, and orientation.
16 SolidBox(const double cx, const double cy, const double cz, const double lx,
17 const double ly, const double lz, const double dx, const double dy,
18 const double dz);
19 /// Destructor
21
22 bool IsInside(const double x, const double y, const double z) const override;
23 bool GetBoundingBox(double& xmin, double& ymin, double& zmin, double& xmax,
24 double& ymax, double& zmax) const override;
25 bool IsBox() const override { return true; }
26
27 double GetHalfLengthX() const override { return m_lX; }
28 double GetHalfLengthY() const override { return m_lY; }
29 double GetHalfLengthZ() const override { return m_lZ; }
30
31 void SetHalfLengthX(const double lx);
32 void SetHalfLengthY(const double ly);
33 void SetHalfLengthZ(const double lz);
34
35 bool SolidPanels(std::vector<Panel>& panels) override;
36 double GetDiscretisationLevel(const Panel& panel) override;
37
38 private:
39 /// Half lengths.
40 double m_lX = 0., m_lY = 0., m_lZ = 0.;
41 /// Discretisation levels.
42 std::array<double, 6> m_dis{{-1, -1, -1, -1, -1, -1}};
43};
44}
45
46#endif
double GetHalfLengthZ() const override
Return the half-length along z.
Definition: SolidBox.hh:29
void SetHalfLengthX(const double lx)
Definition: SolidBox.cc:65
bool IsBox() const override
Return true if the solid is a box.
Definition: SolidBox.hh:25
double GetHalfLengthY() const override
Return the half-length along y.
Definition: SolidBox.hh:28
bool SolidPanels(std::vector< Panel > &panels) override
Retrieve the surface panels of the solid.
Definition: SolidBox.cc:89
~SolidBox()
Destructor.
Definition: SolidBox.hh:20
void SetHalfLengthZ(const double lz)
Definition: SolidBox.cc:81
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const override
Return the bounding box of the solid.
Definition: SolidBox.cc:43
bool IsInside(const double x, const double y, const double z) const override
Check whether a given point is inside the solid.
Definition: SolidBox.cc:21
double GetHalfLengthX() const override
Return the half-length along x.
Definition: SolidBox.hh:27
double GetDiscretisationLevel(const Panel &panel) override
Retrieve the discretization level of a panel.
Definition: SolidBox.cc:205
void SetHalfLengthY(const double ly)
Definition: SolidBox.cc:73
Abstract base class for solids.
Definition: Solid.hh:28
Surface panel.
Definition: Solid.hh:11