20 #include "GaudiKernel/MsgStream.h"
21 #include "GaudiKernel/SystemOfUnits.h"
36 , m_boundaryAccessors()
42 , m_outerRadius(std::abs(
radius))
43 , m_halfPhiSector(
M_PI)
44 , m_halfZ(std::abs(halez))
45 , m_boundaryAccessors()
53 , m_innerRadius(std::abs(rinner))
54 , m_outerRadius(std::abs(router))
55 , m_halfPhiSector(
M_PI)
56 , m_halfZ(std::abs(halez))
57 , m_boundaryAccessors()
66 , m_innerRadius(std::abs(rinner))
67 , m_outerRadius(std::abs(router))
68 , m_halfPhiSector(haphi)
69 , m_halfZ(std::abs(halez))
70 , m_boundaryAccessors()
76 , m_innerRadius(cylbo.m_innerRadius)
77 , m_outerRadius(cylbo.m_outerRadius)
78 , m_halfPhiSector(cylbo.m_halfPhiSector)
79 , m_halfZ(cylbo.m_halfZ)
80 , m_boundaryAccessors()
97 const std::vector<const Trk::Surface*>*
101 std::vector<const Trk::Surface*>* retsf =
102 new std::vector<const Trk::Surface*>;
107 bool isConcentric =
transform.isApprox(Amg::Transform3D::Identity());
114 bottomDiscRot.col(0) = discRot.col(1);
115 bottomDiscRot.col(1) = discRot.col(0);
116 bottomDiscRot.col(2) = -discRot.col(2);
121 bottomDiscBounds()));
135 if (innerRadius() > s_numericalStable) {
143 if (std::abs(halfPhiSector() -
M_PI) > s_numericalStable) {
151 sectorPlaneBounds()));
159 sectorPlaneBounds()));
172 m_innerRadius > s_numericalStable &&
173 std::abs(m_halfPhiSector -
M_PI) < s_numericalStable) {
175 double posZ = gp.z();
176 double posR = gp.perp();
184 bool isOnFace =
false;
185 bool intersectionIndicator = (
deltaR > 0.);
186 bool choiceIndicator =
false;
191 std::abs(
posZ + m_halfZ) < s_numericalStable ||
195 std::abs(
posZ - m_halfZ) < s_numericalStable ||
200 std::abs(posR - m_innerRadius) < s_numericalStable ||
201 (posR < m_innerRadius && deltaR > 0.)) {
207 std::abs(posR - m_outerRadius) < s_numericalStable ||
208 (posR > m_outerRadius &&
deltaR < 0.)) {
218 if (intersectionIndicator) {
222 double zOfIntersect = intersectRmax.
yOfX;
224 if (std::abs(zOfIntersect) <= m_halfZ)
225 return {(choiceIndicator || zOfIntersect > 0.)
226 ? m_boundaryAccessors.tubeAccessor(
228 : m_boundaryAccessors.tubeAccessor(
232 (choiceIndicator || zOfIntersect > 0.)
234 : m_boundaryAccessors.tubeAccessor(
240 double zOfIntersect = intersectRmin.
yOfX;
242 if (std::abs(zOfIntersect) <= m_halfZ)
244 (choiceIndicator || zOfIntersect > 0.)
246 : m_boundaryAccessors.tubeAccessor(
250 (choiceIndicator || zOfIntersect > 0.)
259 if (posR < m_innerRadius &&
deltaR < 0.)
261 if (posR > m_outerRadius &&
deltaR > 0.)
274 double zOfIntersect = intersectRmax.
yOfX;
276 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
278 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
280 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect < 0.)
282 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
290 double zOfIntersect = intersectRmin.
yOfX;
292 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
294 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
296 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
303 m_innerRadius < s_numericalStable &&
304 std::abs(m_halfPhiSector -
M_PI) < s_numericalStable) {
307 double posZ = gp.z();
308 double posR = gp.perp();
311 bool isOnCylinder = (std::abs(posR - m_outerRadius) < s_numericalStable);
319 int radiusSign =
deltaR > 0. ? 1 : -1;
327 radiusSign * m_outerRadius);
330 double zOfIntersect = intersectR.
yOfX;
332 bool intersectsCylinder =
333 !isOnCylinder ? (zOfIntersect * zOfIntersect <= m_halfZ * m_halfZ)
337 if (intersectsCylinder && zOfIntersect > 0.)
339 if (intersectsCylinder && zOfIntersect <= 0.)
346 if (m_innerRadius != 0. && std::abs(m_halfPhiSector -
M_PI) > 10
e-3)
347 return {m_boundaryAccessors.sectoralCylinderAccessor(
368 return new Trk::DiscBounds(m_innerRadius, m_outerRadius, m_halfPhiSector);
375 0.5 * (m_outerRadius - m_innerRadius), m_halfZ);
383 std::stringstream temp_sl;
384 temp_sl << std::setiosflags(std::ios::fixed);
385 temp_sl << std::setprecision(2);
386 temp_sl <<
"Trk::CylinderVolumeBounds: (rMin, rMax, halfPhi, halfZ) = ";
387 temp_sl << m_innerRadius <<
", " << m_outerRadius <<
", " << m_halfPhiSector
396 std::stringstream temp_sl;
397 temp_sl << std::setiosflags(std::ios::fixed);
398 temp_sl << std::setprecision(2);
399 temp_sl <<
"Trk::CylinderVolumeBounds: (rMin, rMax, halfPhi, halfZ) = ";
400 temp_sl << m_innerRadius <<
", " << m_outerRadius <<
", " << m_halfPhiSector