25 #include "GaudiKernel/MsgStream.h"
26 #include "GaudiKernel/SystemOfUnits.h"
43 , m_boundaryAccessors()
44 , m_subtractedVolume(nullptr)
54 , m_innerRadius(std::abs(rinner))
55 , m_outerRadius(std::abs(router))
56 , m_halfPhiSector(haphi)
57 , m_halfZ(std::abs(halez))
61 , m_boundaryAccessors()
62 , m_subtractedVolume(nullptr)
68 , m_innerRadius(cylbo.m_innerRadius)
69 , m_outerRadius(cylbo.m_outerRadius)
70 , m_halfPhiSector(cylbo.m_halfPhiSector)
71 , m_halfZ(cylbo.m_halfZ)
72 , m_thetaMinus(cylbo.m_thetaMinus)
73 , m_thetaPlus(cylbo.m_thetaPlus)
75 , m_boundaryAccessors()
76 , m_subtractedVolume(nullptr)
93 m_subtractedVolume.store(
nullptr);
98 const std::vector<const Trk::Surface*>*
102 std::vector<const Trk::Surface*>* retsf =
103 new std::vector<const Trk::Surface*>;
111 if (
m_type > -1 && !m_subtractedVolume) {
112 m_subtractedVolume.set(std::unique_ptr<Trk::Volume>(subtractedVolume()));
122 cylCenter - (halflengthZ() - m_outerRadius *
tan(m_thetaMinus)) *
124 bottomEllipseBounds()));
126 if (m_subtractedVolume) {
150 (halflengthZ() - m_outerRadius *
tan(m_thetaPlus)) * discRot.col(2))),
151 topEllipseBounds()));
153 if (m_subtractedVolume) {
182 outerBevelledPlaneBounds()));
185 if (innerRadius() > s_numericalStable) {
200 innerBevelledPlaneBounds()));
203 if (std::abs(halfPhiSector() -
M_PI) > s_numericalStable) {
223 double ri = innerRadius();
224 double ro = outerRadius();
226 ri *= 1. /
cos(halfPhiSector());
228 ro *= 1. /
cos(halfPhiSector());
235 sectorPlaneBounds()));
243 sectorPlaneBounds()));
256 if (m_innerRadius != 0. && std::abs(m_halfPhiSector -
M_PI) < s_numericalStable) {
258 double posZ = gp.z();
259 double posR = gp.perp();
267 bool isOnFace =
false;
268 bool intersectionIndicator = (
deltaR > 0.);
269 bool choiceIndicator =
false;
274 std::abs(
posZ + m_halfZ) < s_numericalStable ||
278 std::abs(
posZ - m_halfZ) < s_numericalStable ||
283 std::abs(posR - m_innerRadius) < s_numericalStable ||
284 (posR < m_innerRadius && deltaR > 0.)) {
290 std::abs(posR - m_outerRadius) < s_numericalStable ||
291 (posR > m_outerRadius &&
deltaR < 0.)) {
301 if (intersectionIndicator) {
305 double zOfIntersect = intersectRmax.
yOfX;
307 if (std::abs(zOfIntersect) <= m_halfZ)
308 return {(choiceIndicator || zOfIntersect > 0.)
309 ? m_boundaryAccessors.bevelledtubeAccessor(
311 : m_boundaryAccessors.bevelledtubeAccessor(
314 return {(choiceIndicator || zOfIntersect > 0.)
315 ? m_boundaryAccessors.bevelledtubeAccessor(
317 : m_boundaryAccessors.bevelledtubeAccessor(
323 double zOfIntersect = intersectRmin.
yOfX;
325 if (std::abs(zOfIntersect) <= m_halfZ)
326 return {(choiceIndicator || zOfIntersect > 0.)
327 ? m_boundaryAccessors.bevelledtubeAccessor(
329 : m_boundaryAccessors.bevelledtubeAccessor(
332 return {(choiceIndicator || zOfIntersect > 0.)
333 ? m_boundaryAccessors.bevelledtubeAccessor(
335 : m_boundaryAccessors.bevelledtubeAccessor(
343 if (posR < m_innerRadius &&
deltaR < 0.)
344 return {m_boundaryAccessors.bevelledtubeAccessor(
346 if (posR > m_outerRadius &&
deltaR > 0.)
347 return {m_boundaryAccessors.bevelledtubeAccessor(
350 return {m_boundaryAccessors.bevelledtubeAccessor(
353 return {m_boundaryAccessors.bevelledtubeAccessor(
361 double zOfIntersect = intersectRmax.
yOfX;
363 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
364 return {m_boundaryAccessors.bevelledtubeAccessor(
366 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
367 return {m_boundaryAccessors.bevelledtubeAccessor(
369 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect < 0.)
370 return {m_boundaryAccessors.bevelledtubeAccessor(
372 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
373 return {m_boundaryAccessors.bevelledtubeAccessor(
380 double zOfIntersect = intersectRmin.
yOfX;
382 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
383 return {m_boundaryAccessors.bevelledtubeAccessor(
385 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
386 return {m_boundaryAccessors.bevelledtubeAccessor(
388 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
389 return {m_boundaryAccessors.bevelledtubeAccessor(
391 return {m_boundaryAccessors.bevelledtubeAccessor(
396 if (m_innerRadius == 0. && std::abs(m_halfPhiSector -
M_PI) < 10
e-3) {
398 double posZ = gp.z();
399 double posR = gp.perp();
410 double zOfIntersect = intersectR.
yOfX;
412 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
413 return {m_boundaryAccessors.bevelledcylinderAccessor(
415 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
416 return {m_boundaryAccessors.bevelledcylinderAccessor(
418 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
419 return {m_boundaryAccessors.bevelledcylinderAccessor(
421 return {m_boundaryAccessors.bevelledcylinderAccessor(
425 if (m_innerRadius != 0. && std::abs(m_halfPhiSector -
M_PI) > 10
e-3)
426 return {m_boundaryAccessors.sectoralBevelledCylinderAccessor(
429 return {m_boundaryAccessors.sectoralBevelledTubeAccessor(
454 m_outerRadius *
tan(m_halfPhiSector), m_halfZ);
461 m_innerRadius *
tan(m_halfPhiSector), m_halfZ);
469 m_innerRadius /
cos(m_thetaMinus),
471 m_outerRadius /
cos(m_thetaMinus),
481 m_innerRadius /
cos(m_thetaPlus),
483 m_outerRadius /
cos(m_thetaPlus),
505 (
m_type > 1) ? m_outerRadius /
cos(m_halfPhiSector) : m_outerRadius;
506 return new Trk::DiscBounds(m_innerRadius, outerRadius, m_halfPhiSector);
513 0.5 * (outerRadius() - innerRadius()), m_halfZ, m_thetaMinus, m_thetaPlus);
519 double ri = innerRadius();
520 double ro = outerRadius();
522 ri *= 1. /
cos(halfPhiSector());
524 ro *= 1. /
cos(halfPhiSector());
534 double tp =
tan(m_halfPhiSector);
541 m_innerRadius, m_innerRadius *
tp + 0.1, m_halfZ + 0.1));
544 double hz = m_outerRadius * (1. /
cos(m_halfPhiSector) - 1.);
564 std::stringstream sl_temp;
565 sl_temp << std::setiosflags(std::ios::fixed);
566 sl_temp << std::setprecision(7);
567 sl_temp <<
"Trk::BevelledCylinderVolumeBounds: (innerR, outerR, "
568 "halfPhiSector, halflengthInZ, thetaMinus, thetaPlus) = ";
569 sl_temp <<
"(" << m_innerRadius <<
", " << m_outerRadius <<
", "
570 << m_halfPhiSector <<
", " << m_halfZ <<
", " << m_thetaMinus <<
", "
571 << m_thetaPlus <<
")";
579 std::stringstream sl_temp;
580 sl_temp << std::setiosflags(std::ios::fixed);
581 sl_temp << std::setprecision(7);
582 sl_temp <<
"Trk::BevelledCylinderVolumeBounds: (innerR, outerR, "
583 "halfPhiSector, halflengthInZ, thetaMinus, thetaPlus) = ";
584 sl_temp <<
"(" << m_innerRadius <<
", " << m_outerRadius <<
", "
585 << m_halfPhiSector <<
", " << m_halfZ << m_thetaMinus <<
", "
586 << m_thetaPlus <<
")";