9 #include <boost/test/unit_test.hpp>
28 #include "../Surfaces/SurfaceStub.hpp"
35 namespace Experimental {
40 class DetectorVolume {
43 std::vector<const Surface*>
sfs = {};
44 std::vector<const Portal*>
prts = {};
45 const std::vector<const Surface*>
surfaces()
const {
return sfs; }
46 const std::vector<const Portal*>
portals()
const {
return prts; }
53 std::vector<const DetectorVolume*>
vs = {};
54 const std::vector<const DetectorVolume*>
volumes()
const {
return vs; }
58 struct AllPortalsExtractor {
64 inline static const std::vector<const Portal*>
extract(
67 [[maybe_unused]]
const std::vector<size_t>& indices = {}) {
73 struct AllSurfacesExtractor {
79 inline static const std::vector<const Surface*>
extract(
82 [[maybe_unused]]
const std::vector<size_t>& indices = {}) {
88 struct IndexedSurfacesExtractor {
94 inline static const std::vector<const Surface*>
extract(
100 std::vector<const Surface*> eSurfaces;
101 eSurfaces.reserve(indices.size());
102 std::for_each(indices.begin(), indices.end(),
103 [&](
const auto&
i) { eSurfaces.push_back(surfaces[
i]); });
117 return detail::AxisBoundaryType::Closed;
120 std::vector<ActsScalar>
getBinEdges() const final {
return {-1, 1}; }
131 static constexpr
size_t DIM = 1
u;
134 const std::array<ActsScalar, 1u>& )
const {
138 std::array<const IAxis*, DIM>
axes()
const {
return {&
ta}; }
142 std::vector<size_t>
e = {0
u, 1
u};
147 static constexpr
size_t DIM = 2
u;
150 const std::array<ActsScalar, 2u>& )
const {
154 std::array<const IAxis*, DIM>
axes()
const {
return {&
ta, &
ta}; };
158 std::vector<size_t>
e = {1
u};
173 auto surfaceA = Acts::Surface::makeShared<Acts::SurfaceStub>();
174 auto surfaceB = Acts::Surface::makeShared<Acts::SurfaceStub>();
175 auto surfaceC = Acts::Surface::makeShared<Acts::SurfaceStub>();
177 auto pSurfaceA = Acts::Surface::makeShared<Acts::SurfaceStub>();
178 auto pSurfaceB = Acts::Surface::makeShared<Acts::SurfaceStub>();
182 BOOST_AUTO_TEST_SUITE(Experimental)
188 auto sVolume = std::make_shared<Acts::Experimental::DetectorVolume>();
192 sVolumeUpdator.
update(tContext, nState);
198 auto dVolume = std::make_shared<Acts::Experimental::DetectorVolume>();
206 allSurfaces.
update(tContext, nState);
212 auto dVolume = std::make_shared<Acts::Experimental::DetectorVolume>();
220 allPortals.
update(tContext, nState);
226 auto dVolume = std::make_shared<Acts::Experimental::DetectorVolume>();
236 auto allPortalsAllSurfaces =
239 std::tie(allPortals, allSurfaces));
241 allPortalsAllSurfaces.
update(tContext, nState);
247 auto dVolume = std::make_shared<Acts::Experimental::DetectorVolume>();
262 auto allPortalsGrid1DSurfaces =
264 Grid1DSurfacesProvider>(
265 std::tie(allPortals, grid1DSurfaces));
267 allPortalsGrid1DSurfaces.update(tContext, nState);
273 auto dVolume = std::make_shared<Acts::Experimental::DetectorVolume>();
286 auto grid2DSurfaces =
289 auto allPortalsGrid2DSurfaces =
291 Grid2DSurfacesProvider>(
292 std::tie(allPortals, grid2DSurfaces));
294 allPortalsGrid2DSurfaces.update(tContext, nState);
298 BOOST_AUTO_TEST_SUITE_END()