23 #include <type_traits>
31 throw(std::invalid_argument(
32 "CylinderVolumeBounds: invalid extrusion thickness."));
36 m_values[eHalfLengthZ] = cBounds.get(CylinderBounds::eHalfLengthZ);
37 m_values[eHalfPhiSector] = cBounds.get(CylinderBounds::eHalfPhiSector);
38 m_values[eAveragePhi] = cBounds.get(CylinderBounds::eAveragePhi);
39 m_values[eBevelMinZ] = cBounds.get(CylinderBounds::eBevelMinZ);
40 m_values[eBevelMaxZ] = cBounds.get(CylinderBounds::eBevelMaxZ);
48 throw(std::invalid_argument(
49 "CylinderVolumeBounds: invalid extrusion thickness."));
51 m_values[eMinR] =
rBounds.get(RadialBounds::eMinR);
52 m_values[eMaxR] =
rBounds.get(RadialBounds::eMaxR);
54 m_values[eHalfPhiSector] =
rBounds.get(RadialBounds::eHalfPhiSector);
55 m_values[eAveragePhi] =
rBounds.get(RadialBounds::eAveragePhi);
56 m_values[eBevelMinZ] = (
double)0.;
57 m_values[eBevelMaxZ] = (
double)0.;
72 if (bevelMinZ != 0.) {
73 double sy = 1 - 1 / std::cos(bevelMinZ);
74 transMinZ = transform * vMinZ *
75 Eigen::AngleAxisd(-bevelMinZ, Eigen::Vector3d(1., 0., 0.)) *
76 Eigen::Scaling(1., 1. + sy, 1.);
78 transMinZ = transform * vMinZ;
80 if (bevelMaxZ != 0.) {
81 double sy = 1 - 1 / std::cos(bevelMaxZ);
82 transMaxZ = transform * vMaxZ *
83 Eigen::AngleAxisd(bevelMaxZ, Eigen::Vector3d(1., 0., 0.)) *
84 Eigen::Scaling(1., 1. + sy, 1.);
86 transMaxZ = transform * vMaxZ;
89 auto dSurface = Surface::makeShared<DiscSurface>(transMinZ,
m_discBounds);
93 dSurface = Surface::makeShared<DiscSurface>(transMaxZ,
m_discBounds);
141 m_innerCylinderBounds = std::make_shared<const CylinderBounds>(
142 get(eMinR),
get(eHalfLengthZ),
get(eHalfPhiSector),
get(eAveragePhi),
143 get(eBevelMinZ),
get(eBevelMaxZ));
145 m_outerCylinderBounds = std::make_shared<const CylinderBounds>(
146 get(eMaxR),
get(eHalfLengthZ),
get(eHalfPhiSector),
get(eAveragePhi),
147 get(eBevelMinZ),
get(eBevelMaxZ));
148 m_discBounds = std::make_shared<const RadialBounds>(
149 get(eMinR),
get(eMaxR),
get(eHalfPhiSector),
get(eAveragePhi));
151 if (std::abs(
get(eHalfPhiSector) - M_PI) >
s_epsilon) {
152 m_sectorPlaneBounds = std::make_shared<const RectangleBounds>(
153 0.5 * (
get(eMaxR) -
get(eMinR)),
get(eHalfLengthZ));
158 return dumpT<std::ostream>(sl);
163 const Volume* entity)
const {
167 if (
get(eHalfPhiSector) > M_PI / 2.) {
171 xmin = xmax * std::cos(
get(eHalfPhiSector));
174 ymax =
get(eMaxR) * std::sin(
get(eHalfPhiSector));
177 xmin =
get(eMinR) * std::cos(
get(eHalfPhiSector));
185 return trf ==
nullptr ?
box :
box.transformed(*trf);