11 const double rmin,
const double rmax)
13 m_cX(cx), m_cY(cy), m_cZ(cz),
14 m_rMin(rmin), m_rMax(rmax) {}
17 const double z)
const {
20 const double dx = x - m_cX;
21 const double dy = y - m_cY;
22 const double dz = z - m_cZ;
24 if (fabs(dx) > m_rMax || fabs(dy) > m_rMax || fabs(dz) > m_rMax) {
26 std::cout <<
"SolidSphere::IsInside:\n";
27 std::cout <<
" (" << x <<
", " << y <<
", " << z <<
")"
33 const double r = sqrt(dx * dx + dy * dy + dz * dz);
34 if (r >= m_rMin && r <= m_rMax) {
36 std::cout <<
"SolidSphere::IsInside:\n";
37 std::cout <<
" (" << x <<
", " << y <<
", " << z <<
")"
44 std::cout <<
"SolidSphere::IsInside:\n";
45 std::cout <<
" (" << x <<
", " << y <<
", " << z <<
") "
52 double& xmax,
double& ymax,
double& zmax)
const {
92 std::cerr <<
"SolidSphere::SetInnerRadius:\n";
93 std::cerr <<
" Radius must be > 0.\n";
97 std::cerr <<
"SolidSphere::SetInnerRadius:\n";
98 std::cerr <<
" Inner radius must be smaller than outer radius.\n";
107 std::cerr <<
"SolidSphere::SetOuterRadius:\n";
108 std::cerr <<
" Radius must be > 0.\n";
111 if (rmax <= m_rMin) {
112 std::cerr <<
"SolidSphere::SetOuterRadius:\n";
113 std::cerr <<
" Outer radius must be greater than inner radius.\n";
virtual bool GetCenter(double &x, double &y, double &z) const
SolidSphere(const double cx, const double cy, const double cz, const double rmin, const double rmax)
Constructor.
void SetOuterRadius(const double rmax)
virtual bool IsInside(const double x, const double y, const double z) const
Check whether a given point is inside the solid.
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
Return the bounding box of the solid.
virtual bool GetOrientation(double &ctheta, double &stheta, double &cphi, double &sphi) const
virtual bool GetDimensions(double &l1, double &l2, double &l3) const
void SetInnerRadius(const double rmin)
Abstract base class for solids.