File indexing completed on 2026-01-04 09:10:15
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Detector/detail/IndexedGridFiller.hpp"
0013 #include "Acts/Navigation/InternalNavigation.hpp"
0014 #include "Acts/Utilities/Enumerate.hpp"
0015
0016 #include <algorithm>
0017 #include <array>
0018 #include <memory>
0019
0020 namespace Acts::detail::IndexedSurfacesGenerator {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 template <template <typename> class indexed_updator, typename surface_container,
0033 typename reference_generator>
0034 Experimental::InternalNavigationDelegate createInternalNavigation(
0035 const GeometryContext& gctx, const surface_container& surfaces,
0036 const reference_generator& rGenerator, const DirectedProtoAxis& pAxis,
0037 std::size_t pFillExpansion, const std::vector<std::size_t> assignToAll = {},
0038 const Transform3 transform = Transform3::Identity()) {
0039
0040 return pAxis.getAxis().visit([&]<typename AxisTypeA>(const AxisTypeA& axis) {
0041 Grid<std::vector<std::size_t>, AxisTypeA> grid(axis);
0042
0043
0044 std::array<AxisDirection, 1u> axisDirs = {pAxis.getAxisDirection()};
0045 indexed_updator<decltype(grid)> indexedSurfaces(std::move(grid), axisDirs,
0046 transform);
0047
0048
0049 Experimental::InternalNavigationDelegate nStateUpdater;
0050
0051 std::vector<std::size_t> fillExpansion = {pFillExpansion};
0052 Experimental::detail::IndexedGridFiller filler{fillExpansion};
0053 filler.fill(gctx, indexedSurfaces, surfaces, rGenerator, assignToAll);
0054
0055
0056 Experimental::AllPortalsNavigation allPortals;
0057
0058
0059 using DelegateType =
0060 Experimental::IndexedSurfacesAllPortalsNavigation<decltype(grid),
0061 indexed_updator>;
0062 auto indexedSurfacesAllPortals = std::make_unique<const DelegateType>(
0063 std::tie(allPortals, indexedSurfaces));
0064
0065
0066 nStateUpdater.connect<&DelegateType::update>(
0067 std::move(indexedSurfacesAllPortals));
0068
0069 return nStateUpdater;
0070 });
0071 }
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086 template <template <typename> class indexed_updator, typename surface_container,
0087 typename reference_generator>
0088 Experimental::InternalNavigationDelegate createInternalNavigation(
0089 const GeometryContext& gctx, const surface_container& surfaces,
0090 const reference_generator& rGenerator, const DirectedProtoAxis& pAxisA,
0091 std::size_t fillExpansionA, const DirectedProtoAxis& pAxisB,
0092 std::size_t fillExpansionB, const std::vector<std::size_t> assignToAll = {},
0093 const Transform3 transform = Transform3::Identity()) {
0094
0095 return pAxisA.getAxis().visit([&]<typename AxisTypeA>(
0096 const AxisTypeA& axisA) {
0097 return pAxisB.getAxis().visit([&]<typename AxisTypeB>(
0098 const AxisTypeB& axisB) {
0099 Grid<std::vector<std::size_t>, AxisTypeA, AxisTypeB> grid(axisA, axisB);
0100 Experimental::InternalNavigationDelegate nStateUpdater;
0101
0102
0103 std::array<AxisDirection, 2u> axisDirs = {pAxisA.getAxisDirection(),
0104 pAxisB.getAxisDirection()};
0105 indexed_updator<decltype(grid)> indexedSurfaces(std::move(grid), axisDirs,
0106 transform);
0107
0108 std::vector<std::size_t> fillExpansion = {fillExpansionA, fillExpansionB};
0109
0110 Experimental::detail::IndexedGridFiller filler{fillExpansion};
0111 filler.fill(gctx, indexedSurfaces, surfaces, rGenerator, assignToAll);
0112
0113
0114 Experimental::AllPortalsNavigation allPortals;
0115
0116
0117 using DelegateType =
0118 Experimental::IndexedSurfacesAllPortalsNavigation<decltype(grid),
0119 indexed_updator>;
0120 auto indexedSurfacesAllPortals = std::make_unique<const DelegateType>(
0121 std::tie(allPortals, indexedSurfaces));
0122
0123
0124 nStateUpdater.connect<&DelegateType::update>(
0125 std::move(indexedSurfacesAllPortals));
0126
0127 return nStateUpdater;
0128 });
0129 });
0130 }
0131
0132 }