34 namespace Experimental {
51 template <Acts::detail::AxisBoundaryType aType>
54 std::vector<std::shared_ptr<Acts::Surface>> lSurfaces,
55 std::vector<size_t> assignToAll,
67 if (binning.
axisType == Acts::detail::AxisType::Equidistant) {
71 sfCandidates = isg(gctx, aGenerator, rGenerator);
76 sfCandidates = isg(gctx, aGenerator, rGenerator);
97 const std::vector<std::shared_ptr<Acts::Surface>>& lSurfaces,
98 const std::vector<size_t>& assignToAll,
112 if (aBinning.
axisType == Acts::detail::AxisType::Equidistant and
113 bBinning.
axisType == Acts::detail::AxisType::Equidistant) {
116 aGenerator{{aBinning.
edges.front(), aBinning.
edges.back()},
118 {bBinning.
edges.front(), bBinning.
edges.back()},
120 sfCandidates = isg(gctx, aGenerator, rGenerator);
121 }
else if (bBinning.
axisType == Acts::detail::AxisType::Equidistant) {
124 aGenerator{aBinning.
edges,
125 {bBinning.
edges.front(), bBinning.
edges.back()},
127 sfCandidates = isg(gctx, aGenerator, rGenerator);
128 }
else if (aBinning.
axisType == Acts::detail::AxisType::Equidistant) {
131 aGenerator{{aBinning.
edges.front(), aBinning.
edges.back()},
134 sfCandidates = isg(gctx, aGenerator, rGenerator);
139 sfCandidates = isg(gctx, aGenerator, rGenerator);
149 std::unique_ptr<const Acts::Logger>
logger)
152 throw std::invalid_argument(
153 "LayerStructureBuilder: surfaces provider is nullptr.");
161 std::vector<std::shared_ptr<DetectorVolume>> internalVolumes = {};
165 if (not
m_cfg.auxiliary.empty()) {
172 auto internalSurfaces =
m_cfg.surfacesProvider->surfaces(gctx);
173 ACTS_DEBUG(
"Building internal layer structure from "
174 << internalSurfaces.size() <<
" provided surfaces.");
178 std::vector<size_t> assignToAll = {};
179 if (not
m_cfg.supports.empty()) {
180 ACTS_DEBUG(
"Adding " <<
m_cfg.supports.size() <<
" support structures.")
182 for (
const auto& support :
m_cfg.supports) {
184 if (support.surface !=
nullptr) {
185 ACTS_VERBOSE(
"- Use provided support surface directly.");
186 if (support.assignToAll) {
187 assignToAll.push_back(internalSurfaces.size());
188 ACTS_VERBOSE(
" Support surface is assigned to all bins.");
190 internalSurfaces.push_back(support.surface);
195 if (support.type == Surface::SurfaceType::Other) {
196 throw std::invalid_argument(
197 "LayerStructureBuilder: support surface type not specified.");
201 if (support.splits > 1
u) {
202 ACTS_VERBOSE(
" Support surface is modelled with " << support.splits
207 for (
const auto&
s : internalSurfaces) {
208 auto sPolyhedron =
s->polyhedronRepresentation(gctx,
m_cfg.nSegments);
209 internalExtent.
extend(sPolyhedron.extent(), support.constraints);
213 internalSurfaces, assignToAll, internalExtent, support.type,
214 support.values, support.transform, support.splits);
217 if (
m_cfg.binnings.empty()) {
219 "No surface binning provided, navigation will be 'tryAll' (potentially "
221 }
else if (
m_cfg.binnings.size() == 1
u) {
222 ACTS_DEBUG(
"- 1-dimensional surface binning detected.");
224 auto binning =
m_cfg.binnings[0
u];
225 if (binning.
boundaryType == Acts::detail::AxisBoundaryType::Closed) {
227 internalCandidatesUpdator =
228 createUpdator<Acts::detail::AxisBoundaryType::Closed>(
229 gctx, internalSurfaces, assignToAll, binning);
232 internalCandidatesUpdator =
233 createUpdator<Acts::detail::AxisBoundaryType::Bound>(
234 gctx, internalSurfaces, assignToAll, binning);
236 }
else if (
m_cfg.binnings.size() == 2
u) {
237 ACTS_DEBUG(
"- 2-dimensional surface binning detected.");
239 const auto& binning0 =
m_cfg.binnings[0
u];
240 const auto& binning1 =
m_cfg.binnings[1
u];
242 if (binning0.boundaryType == Acts::detail::AxisBoundaryType::Closed) {
244 internalCandidatesUpdator =
245 createUpdator<Acts::detail::AxisBoundaryType::Closed,
246 Acts::detail::AxisBoundaryType::Bound>(
247 gctx, internalSurfaces, assignToAll, binning0, binning1);
248 }
else if (binning1.boundaryType ==
249 Acts::detail::AxisBoundaryType::Closed) {
251 internalCandidatesUpdator =
252 createUpdator<Acts::detail::AxisBoundaryType::Bound,
253 Acts::detail::AxisBoundaryType::Closed>(
254 gctx, internalSurfaces, assignToAll, binning0, binning1);
257 internalCandidatesUpdator =
258 createUpdator<Acts::detail::AxisBoundaryType::Bound,
259 Acts::detail::AxisBoundaryType::Bound>(
260 gctx, internalSurfaces, assignToAll, binning0, binning1);
264 if (not internalCandidatesUpdator.connected()) {
265 throw std::runtime_error(
266 "LayerStructureBuilder: could not connect surface candidate updator.");