11 const double& rmin,
const double& rmax)
13 m_cX(cx), m_cY(cy), m_cZ(cz),
14 m_rMin(rmin), m_rMax(rmax) {}
19 const double dx = x - m_cX;
20 const double dy = y - m_cY;
21 const double dz = z - m_cZ;
23 if (
fabs(dx) > m_rMax ||
fabs(dy) > m_rMax ||
fabs(dz) > m_rMax) {
25 std::cout <<
"SolidSphere::IsInside:\n";
26 std::cout <<
" (" << x <<
", " << y <<
", " << z <<
")"
32 const double r =
sqrt(dx * dx + dy * dy + dz * dz);
33 if (r >= m_rMin && r <= m_rMax) {
35 std::cout <<
"SolidSphere::IsInside:\n";
36 std::cout <<
" (" << x <<
", " << y <<
", " << z <<
")"
43 std::cout <<
"SolidSphere::IsInside:\n";
44 std::cout <<
" (" << x <<
", " << y <<
", " << z <<
") "
51 double& xmax,
double& ymax,
double& zmax)
const {
91 std::cerr <<
"SolidSphere::SetInnerRadius:\n";
92 std::cerr <<
" Radius must be > 0.\n";
96 std::cerr <<
"SolidSphere::SetInnerRadius:\n";
97 std::cerr <<
" Inner radius must be smaller than outer radius.\n";
106 std::cerr <<
"SolidSphere::SetOuterRadius:\n";
107 std::cerr <<
" Radius must be > 0.\n";
110 if (rmax <= m_rMin) {
111 std::cerr <<
"SolidSphere::SetOuterRadius:\n";
112 std::cerr <<
" Outer radius must be greater than inner radius.\n";
DoubleAc sqrt(const DoubleAc &f)
DoubleAc fabs(const DoubleAc &f)
virtual bool GetCenter(double &x, double &y, double &z) const
virtual bool IsInside(const double &x, const double &y, const double &z) const
void SetInnerRadius(const double &rmin)
void SetOuterRadius(const double &rmax)
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
virtual bool GetOrientation(double &ctheta, double &stheta, double &cphi, double &sphi) const
SolidSphere(const double &cx, const double &cy, const double &cz, const double &rmin, const double &rmax)
virtual bool GetDimensions(double &l1, double &l2, double &l3) const