Garfield++ v2r0
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
12 public:
13 /// Constructor from centre and half-widths.
14 SolidBox(const double cx, const double cy, const double cz,
15 const double lx, const double ly, const double lz);
16 /// Constructor from centre, half-widths, and orientation.
17 SolidBox(const double cx, const double cy, const double cz,
18 const double lx, const double ly, const double lz,
19 const double dx, const double dy, const double dz);
20 /// Destructor
22
23 virtual bool IsInside(const double x, const double y, const double z) const;
24 virtual bool GetBoundingBox(double& xmin, double& ymin, double& zmin,
25 double& xmax, double& ymax, double& zmax) const;
26 virtual bool IsBox() const { return true; }
27
28 virtual bool GetCenter(double& x, double& y, double& z) const;
29 virtual bool GetDimensions(double& l1, double& l2, double& l3) const;
30 virtual bool GetOrientation(double& ctheta, double& stheta, double& cphi,
31 double& sphi) const;
32
33 void SetHalfLengthX(const double lx);
34 void SetHalfLengthY(const double ly);
35 void SetHalfLengthZ(const double lz);
36
37 private:
38 // Center of the box
39 double m_cX, m_cY, m_cZ;
40 // Half lengths
41 double m_lX, m_lY, m_lZ;
42 // Direction
43 double m_dX, m_dY, m_dZ;
44 double m_cPhi, m_sPhi;
45 double m_cTheta, m_sTheta;
46};
47}
48
49#endif
void SetHalfLengthX(const double lx)
Definition: SolidBox.cc:141
~SolidBox()
Destructor.
Definition: SolidBox.hh:21
virtual bool GetOrientation(double &ctheta, double &stheta, double &cphi, double &sphi) const
Definition: SolidBox.cc:131
void SetHalfLengthZ(const double lz)
Definition: SolidBox.cc:161
virtual bool GetDimensions(double &l1, double &l2, double &l3) const
Definition: SolidBox.cc:123
virtual bool IsInside(const double x, const double y, const double z) const
Check whether a given point is inside the solid.
Definition: SolidBox.cc:62
virtual bool GetCenter(double &x, double &y, double &z) const
Definition: SolidBox.cc:115
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
Return the bounding box of the solid.
Definition: SolidBox.cc:92
virtual bool IsBox() const
Return true if the solid is a box.
Definition: SolidBox.hh:26
void SetHalfLengthY(const double ly)
Definition: SolidBox.cc:151
Abstract base class for solids.
Definition: Solid.hh:8