9 #include <boost/test/unit_test.hpp>
40 using namespace Acts::Test;
41 using namespace Acts::Experimental;
42 using namespace Acts::Experimental::detail;
61 auto indexedRing = irSurfaces(
tContext, aGenerator, rGenerator);
63 using GridType = decltype(aGenerator)::grid_type<std::vector<std::size_t>>;
67 const auto* instance = indexedRing.instance();
68 auto castedDelegate =
dynamic_cast<const DelegateType*
>(instance);
70 BOOST_CHECK(castedDelegate !=
nullptr);
72 const auto& chainedUpdators = castedDelegate->updators;
73 const auto& indexedSurfaces =
74 std::get<IndexedSurfacesImpl<GridType>>(chainedUpdators);
75 const auto&
grid = indexedSurfaces.grid;
78 std::vector<size_t> reference = {10, 11, 12};
79 GridType::point_t
p = {0.05};
81 BOOST_CHECK(grid.atPosition(p) == reference);
84 reference = {0, 1, 21};
86 BOOST_CHECK(grid.atPosition(p) == reference);
95 auto rBounds = std::make_shared<RadialBounds>(20., 20.);
96 auto dSurface = Surface::makeShared<DiscSurface>(Transform3::Identity(),
98 rSurfaces.push_back(dSurface.get());
101 rSurfaces, {rSurfaces.size() - 1
u}, {
binPhi}};
106 auto indexedRing = irSurfaces(
tContext, aGenerator, rGenerator);
108 using GridType = decltype(aGenerator)::grid_type<std::vector<std::size_t>>;
113 const auto* instance = indexedRing.instance();
114 auto castedDelegate =
dynamic_cast<const DelegateType*
>(instance);
116 BOOST_CHECK(castedDelegate !=
nullptr);
118 const auto& chainedUpdators = castedDelegate->updators;
119 const auto& indexedSurfaces =
120 std::get<IndexedSurfacesImpl<GridType>>(chainedUpdators);
121 const auto&
grid = indexedSurfaces.grid;
125 std::vector<size_t> reference = {10, 11, 12, 22};
126 GridType::point_t
p = {0.05};
127 BOOST_CHECK(grid.atPosition(p) == reference);
130 reference = {0, 1, 21, 22};
132 BOOST_CHECK(grid.atPosition(p) == reference);
144 decltype(rSurfacesR0) rSurfaces = rSurfacesR0;
145 rSurfaces.insert(rSurfaces.end(), rSurfacesR1.begin(), rSurfacesR1.end());
151 {24., 74., 110.}, {-M_PI, M_PI}, 44
u};
154 auto indexedRing = irSurfaces(
tContext, aGenerator, rGenerator);
156 using GridType = decltype(aGenerator)::grid_type<std::vector<std::size_t>>;
161 const auto* instance = indexedRing.instance();
162 auto castedDelegate =
dynamic_cast<const DelegateType*
>(instance);
164 BOOST_CHECK(castedDelegate !=
nullptr);
166 const auto& chainedUpdators = castedDelegate->updators;
167 const auto& indexedSurfaces =
168 std::get<IndexedSurfacesImpl<GridType>>(chainedUpdators);
169 const auto&
grid = indexedSurfaces.grid;
172 std::vector<size_t> reference = {16, 17, 38, 39};
173 GridType::point_t
p = {65., M_PI * 0.49};
174 BOOST_CHECK(grid.atPosition(p) == reference);
189 decltype(rSurfacesR0) rSurfaces = rSurfacesR0;
190 rSurfaces.insert(rSurfaces.end(), rSurfacesR1.begin(), rSurfacesR1.end());
191 rSurfaces.insert(rSurfaces.end(), rSurfacesR2.begin(), rSurfacesR2.end());
197 {24., 152}, 8
u, {-M_PI, M_PI}, 88
u};
201 auto indexedRing = irSurfaces(
tContext, aGenerator, rGenerator);
203 using GridType = decltype(aGenerator)::grid_type<std::vector<std::size_t>>;
208 const auto* instance = indexedRing.instance();
209 auto castedDelegate =
dynamic_cast<const DelegateType*
>(instance);
211 BOOST_CHECK(castedDelegate !=
nullptr);
213 const auto& chainedUpdators = castedDelegate->updators;
214 const auto& indexedSurfaces =
215 std::get<IndexedSurfacesImpl<GridType>>(chainedUpdators);
216 const auto&
grid = indexedSurfaces.grid;
219 std::vector<size_t> reference = {38, 39};
220 GridType::point_t
p = {80., M_PI * 0.49};
221 BOOST_CHECK(grid.atPosition(p) == reference);
236 decltype(rSurfacesR0) rSurfaces = rSurfacesR0;
237 rSurfaces.insert(rSurfaces.end(), rSurfacesR1.begin(), rSurfacesR1.end());
238 rSurfaces.insert(rSurfaces.end(), rSurfacesR2.begin(), rSurfacesR2.end());
244 {24., 152}, 8
u, {-M_PI, M_PI}, 88
u};
247 auto indexedRing = irSurfaces(
tContext, aGenerator, rGenerator);
249 using GridType = decltype(aGenerator)::grid_type<std::vector<std::size_t>>;
253 const auto* instance = indexedRing.instance();
254 auto castedDelegate =
dynamic_cast<const DelegateType*
>(instance);
256 BOOST_CHECK(castedDelegate !=
nullptr);
258 const auto& chainedUpdators = castedDelegate->updators;
259 const auto& indexedSurfaces =
260 std::get<IndexedSurfacesImpl<GridType>>(chainedUpdators);
261 const auto&
grid = indexedSurfaces.grid;
264 std::vector<size_t> reference = {38, 39};
265 GridType::point_t
p = {80., M_PI * 0.49};
266 BOOST_CHECK(grid.atPosition(p).size() > 2
u);
272 116., 3., 2., {52, 14});
278 {-500., 500}, 28, {-M_PI, M_PI}, 52
u};
281 auto indexedCylinder = icSurfaces(
tContext, aGenerator, rGenerator);
283 using GridType = decltype(aGenerator)::grid_type<std::vector<std::size_t>>;
287 const auto* instance = indexedCylinder.instance();
288 auto castedDelegate =
dynamic_cast<const DelegateType*
>(instance);
290 BOOST_CHECK(castedDelegate !=
nullptr);
292 const auto& chainedUpdators = castedDelegate->updators;
293 const auto& indexedSurfaces =
294 std::get<IndexedSurfacesImpl<GridType>>(chainedUpdators);
295 const auto&
grid = indexedSurfaces.grid;
298 std::vector<size_t> reference = {676, 677, 725, 726, 727};
299 GridType::point_t
p = {490., M_PI * 0.99};
300 BOOST_CHECK(grid.atPosition(p) == reference);
303 BOOST_AUTO_TEST_SUITE_END()