diff --git a/Core/src/Geometry/PortalShell.cpp b/Core/src/Geometry/PortalShell.cpp index 2e5627ea282..6bb433e7957 100644 --- a/Core/src/Geometry/PortalShell.cpp +++ b/Core/src/Geometry/PortalShell.cpp @@ -16,13 +16,14 @@ #include #include -#include namespace Acts { -SingleCylinderPortalShell::SingleCylinderPortalShell( - const GeometryContext& gctx, TrackingVolume& volume) { - assert(volume.volumeBounds().type() == VolumeBounds::BoundsType::eCylinder); +SingleCylinderPortalShell::SingleCylinderPortalShell(TrackingVolume& volume) { + if (volume.volumeBounds().type() != VolumeBounds::BoundsType::eCylinder) { + throw std::invalid_argument("Invalid volume bounds type"); + } + const auto& bounds = dynamic_cast(volume.volumeBounds()); @@ -164,8 +165,6 @@ CylinderStackPortalShell::CylinderStackPortalShell( } else { throw std::invalid_argument("Invalid direction"); } - - // @TODO: Handle portal fusing } std::size_t CylinderStackPortalShell::size() const { diff --git a/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp b/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp index fff355c5f7b..66200c17f9e 100644 --- a/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp +++ b/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp @@ -12,6 +12,7 @@ #include #include "Acts/Definitions/Units.hpp" +#include "Acts/Geometry/CuboidVolumeBounds.hpp" #include "Acts/Geometry/CylinderVolumeBounds.hpp" #include "Acts/Geometry/GridPortalLink.hpp" #include "Acts/Geometry/Portal.hpp" @@ -48,6 +49,13 @@ BOOST_AUTO_TEST_CASE(ConstructionFromVolume) { auto cyl3 = makeVolume(30_mm, 40_mm, 100_mm, 45_degree); auto cyl4 = makeVolume(0_mm, 40_mm, 100_mm, 45_degree); + TrackingVolume boxVolume( + Transform3::Identity(), + std::make_shared(10_mm, 10_mm, 10_mm)); + + BOOST_CHECK_THROW(SingleCylinderPortalShell{boxVolume}, + std::invalid_argument); + SingleCylinderPortalShell shell1{cyl1}; BOOST_CHECK_EQUAL(shell1.size(), 4);