9 #include <boost/test/unit_test.hpp>
41 template <
typename referenced_type>
43 return rt.getSharedPtr();
46 using namespace Acts::Experimental;
59 auto fullCylinderBounds =
60 std::make_unique<Acts::CylinderVolumeBounds>(0., rOuter,
zHalfL);
67 "MisconfiguredFullCylinderVolume",
69 std::invalid_argument);
75 "MisconfiguredFullCylinderVolume",
77 std::invalid_argument);
81 portalGenerator,
tContext,
"FullCylinderVolume", nominal,
84 BOOST_CHECK(fullCylinderVolume ==
85 unpackToShared<DetectorVolume>(*fullCylinderVolume));
86 BOOST_CHECK(fullCylinderVolume ==
87 unpackToShared<const DetectorVolume>(*fullCylinderVolume));
89 BOOST_CHECK(fullCylinderVolume->surfaces().empty());
90 BOOST_CHECK(fullCylinderVolume->volumes().empty());
91 BOOST_CHECK(fullCylinderVolume->portals().size() == 3
u);
94 auto tubeCylinderBounds =
95 std::make_unique<Acts::CylinderVolumeBounds>(rInner, rOuter,
zHalfL);
98 portalGenerator,
tContext,
"TubeCylinderVolume", nominal,
101 BOOST_CHECK(tubeCylinderVolume->surfaces().empty());
102 BOOST_CHECK(tubeCylinderVolume->volumes().empty());
103 BOOST_CHECK(tubeCylinderVolume->portals().size() == 4
u);
112 auto volumeExtent = tubeCylinderVolume->extent(
tContext, 1);
122 auto fullCylinderBounds =
123 std::make_unique<Acts::CylinderVolumeBounds>(0., 10., 100.);
131 auto cylinderSurface =
132 Acts::Surface::makeShared<Acts::CylinderSurface>(
nominal, 10., 100.);
136 fullCylinderVolume->updatePortal(cylinderPortal, 2
u);
138 BOOST_CHECK(fullCylinderVolume->portals()[2
u] == cylinderPortal.get());
148 std::make_unique<Acts::CuboidVolumeBounds>(bigBox, bigBox, bigBox);
150 auto smallBoxBounds =
151 std::make_unique<Acts::CuboidVolumeBounds>(smallBox, smallBox, smallBox);
161 std::vector<std::shared_ptr<Acts::Surface>> surfaces = {};
162 std::vector<std::shared_ptr<Acts::Experimental::DetectorVolume>>
volumes = {
189 std::vector<Acts::ActsScalar> radii = {100, 102, 104, 106, 108, 110};
190 auto cylinderVoumeBounds =
191 std::make_unique<Acts::CylinderVolumeBounds>(80, 130, 200);
192 std::vector<std::shared_ptr<Acts::Surface>> surfaces = {};
193 for (
const auto&
r : radii) {
194 surfaces.push_back(Acts::Surface::makeShared<Acts::CylinderSurface>(
195 Acts::Transform3::Identity(),
196 std::make_shared<Acts::CylinderBounds>(
r, 190)));
212 BOOST_CHECK_THROW(allPortals.
extract(
tContext, nState), std::runtime_error);
213 BOOST_CHECK_THROW(allSurfaces.
extract(
tContext, nState), std::runtime_error);
222 BOOST_CHECK(eportals.size() == 4
u);
225 BOOST_CHECK(esurfaces.size() == 6
u);
228 BOOST_CHECK(esurfaces.size() == 2
u);
229 BOOST_CHECK(esurfaces[0
u] == surfaces[2
u].
get());
230 BOOST_CHECK(esurfaces[1
u] == surfaces[4
u].
get());
233 BOOST_AUTO_TEST_SUITE_END()