9 #include <boost/test/unit_test.hpp>
39 template <
typename referenced_type>
41 return rt.getSharedPtr();
46 BOOST_AUTO_TEST_SUITE(Detector)
59 std::make_unique<Acts::CylinderVolumeBounds>(
r0,
r1,
zHalfL);
62 std::make_unique<Acts::CylinderVolumeBounds>(
r0,
r1,
zHalfL);
65 std::make_unique<Acts::CylinderVolumeBounds>(
r1,
r2,
zHalfL);
68 std::make_unique<Acts::CylinderVolumeBounds>(
r2,
r3,
zHalfL);
77 portalGenerator, tContext,
"Cyl0", nominal,
std::move(cyl0BoundsCopy),
81 portalGenerator, tContext,
"Cyl1", nominal,
std::move(cyl1Bounds),
85 portalGenerator, tContext,
"Cyl2", nominal,
std::move(cyl2Bounds),
88 std::vector<std::shared_ptr<Acts::Experimental::DetectorVolume>>
volumes012 =
94 BOOST_CHECK(
det012->name() ==
"Det012");
95 BOOST_CHECK(
det012->volumes().size() == 3
u);
96 BOOST_CHECK(
det012->volumePtrs().size() == 3
u);
99 BOOST_CHECK(
det012 == unpackToShared<Acts::Experimental::Detector>(*
det012));
101 unpackToShared<const Acts::Experimental::Detector>(*
det012));
107 det012->updateDetectorVolume(tContext, nState);
111 BOOST_CHECK(find1 ==
cyl1.get());
115 BOOST_CHECK(find2 ==
cyl2.get());
119 BOOST_CHECK(findNull ==
nullptr);
122 auto find0 =
det012->findDetectorVolume(
"Cyl0");
123 BOOST_CHECK(find0 ==
cyl0.get());
125 findNull =
det012->findDetectorVolume(
"Null");
126 BOOST_CHECK(findNull ==
nullptr);
133 std::invalid_argument);
136 std::vector<std::shared_ptr<Acts::Experimental::DetectorVolume>> volumes002 =
139 "Det002_name_duplicate", volumes002,
141 std::invalid_argument);
147 std::vector<std::unique_ptr<Acts::Test::DetectorElementStub>> detStore;
148 std::vector<Acts::ActsScalar> radii = {100, 102, 104, 106, 108, 110};
149 auto cylinderVoumeBounds =
150 std::make_unique<Acts::CylinderVolumeBounds>(80, 130, 200);
151 std::vector<std::shared_ptr<Acts::Surface>> surfaces = {};
153 auto detElement = std::make_unique<Acts::Test::DetectorElementStub>(
154 Acts::Transform3::Identity(),
155 std::make_shared<Acts::CylinderBounds>(
r, 190.), 0.1);
156 auto surface = detElement->surface().getSharedPtr();
159 detStore.push_back(
std::move(detElement));
163 portalGenerator, tContext,
"CylinderVolume", Acts::Transform3::Identity(),
164 std::move(cylinderVoumeBounds), surfaces, {},
171 const auto& sensitiveHierarchyMap = det->sensitiveHierarchyMap();
172 BOOST_CHECK(sensitiveHierarchyMap.size() == 6
u);
175 BOOST_AUTO_TEST_SUITE_END()