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()));
134 if (innerRadius() > s_numericalStable) {
142 if (std::abs(halfPhiSector() -
M_PI) > s_numericalStable) {
150 sectorPlaneBounds()));
158 sectorPlaneBounds()));
171 m_innerRadius > s_numericalStable &&
172 std::abs(m_halfPhiSector -
M_PI) < s_numericalStable) {
174 double posZ = gp.z();
175 double posR = gp.perp();
183 bool isOnFace =
false;
184 bool intersectionIndicator = (
deltaR > 0.);
185 bool choiceIndicator =
false;
190 std::abs(
posZ + m_halfZ) < s_numericalStable ||
194 std::abs(
posZ - m_halfZ) < s_numericalStable ||
199 std::abs(posR - m_innerRadius) < s_numericalStable ||
200 (posR < m_innerRadius && deltaR > 0.)) {
206 std::abs(posR - m_outerRadius) < s_numericalStable ||
207 (posR > m_outerRadius &&
deltaR < 0.)) {
217 if (intersectionIndicator) {
221 double zOfIntersect = intersectRmax.
yOfX;
223 if (std::abs(zOfIntersect) <= m_halfZ)
224 return {(choiceIndicator || zOfIntersect > 0.)
225 ? m_boundaryAccessors.tubeAccessor(
227 : m_boundaryAccessors.tubeAccessor(
231 (choiceIndicator || zOfIntersect > 0.)
233 : m_boundaryAccessors.tubeAccessor(
239 double zOfIntersect = intersectRmin.
yOfX;
241 if (std::abs(zOfIntersect) <= m_halfZ)
243 (choiceIndicator || zOfIntersect > 0.)
245 : m_boundaryAccessors.tubeAccessor(
249 (choiceIndicator || zOfIntersect > 0.)
258 if (posR < m_innerRadius &&
deltaR < 0.)
260 if (posR > m_outerRadius &&
deltaR > 0.)
273 double zOfIntersect = intersectRmax.
yOfX;
275 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
277 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
279 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect < 0.)
281 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
289 double zOfIntersect = intersectRmin.
yOfX;
291 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
293 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
295 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
302 m_innerRadius < s_numericalStable &&
303 std::abs(m_halfPhiSector -
M_PI) < s_numericalStable) {
306 double posZ = gp.z();
307 double posR = gp.perp();
310 bool isOnCylinder = (std::abs(posR - m_outerRadius) < s_numericalStable);
318 int radiusSign =
deltaR > 0. ? 1 : -1;
326 radiusSign * m_outerRadius);
329 double zOfIntersect = intersectR.
yOfX;
331 bool intersectsCylinder =
332 !isOnCylinder ? (zOfIntersect * zOfIntersect <= m_halfZ * m_halfZ)
336 if (intersectsCylinder && zOfIntersect > 0.)
338 if (intersectsCylinder && zOfIntersect <= 0.)
345 if (m_innerRadius != 0. && std::abs(m_halfPhiSector -
M_PI) > 10
e-3)
346 return {m_boundaryAccessors.sectoralCylinderAccessor(
367 return new Trk::DiscBounds(m_innerRadius, m_outerRadius, m_halfPhiSector);
374 0.5 * (m_outerRadius - m_innerRadius), m_halfZ);
382 std::stringstream temp_sl;
383 temp_sl << std::setiosflags(std::ios::fixed);
384 temp_sl << std::setprecision(2);
385 temp_sl <<
"Trk::CylinderVolumeBounds: (rMin, rMax, halfPhi, halfZ) = ";
386 temp_sl << m_innerRadius <<
", " << m_outerRadius <<
", " << m_halfPhiSector
395 std::stringstream temp_sl;
396 temp_sl << std::setiosflags(std::ios::fixed);
397 temp_sl << std::setprecision(2);
398 temp_sl <<
"Trk::CylinderVolumeBounds: (rMin, rMax, halfPhi, halfZ) = ";
399 temp_sl << m_innerRadius <<
", " << m_outerRadius <<
", " << m_halfPhiSector