File indexing completed on 2025-01-18 09:11:27
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Navigation/TryAllNavigationPolicy.hpp"
0010
0011 #include "Acts/Geometry/TrackingVolume.hpp"
0012 #include "Acts/Navigation/NavigationStream.hpp"
0013
0014 namespace Acts {
0015
0016 TryAllNavigationPolicy::TryAllNavigationPolicy(const GeometryContext& ,
0017 const TrackingVolume& volume,
0018 const Logger& logger,
0019 const Config& config)
0020 : m_cfg{config}, m_volume(&volume) {
0021 assert(m_volume != nullptr);
0022 ACTS_VERBOSE("TryAllNavigationPolicy created for volume "
0023 << m_volume->volumeName());
0024 }
0025
0026 TryAllNavigationPolicy::TryAllNavigationPolicy(const GeometryContext& gctx,
0027 const TrackingVolume& volume,
0028 const Logger& logger)
0029 : TryAllNavigationPolicy(gctx, volume, logger, {}) {}
0030
0031 void TryAllNavigationPolicy::initializeCandidates(
0032 const NavigationArguments& args, AppendOnlyNavigationStream& stream,
0033 const Logger& logger) const {
0034 ACTS_VERBOSE("TryAllNavigationPolicy");
0035 assert(m_volume != nullptr);
0036
0037 if (m_cfg.portals) {
0038 for (const auto& portal : m_volume->portals()) {
0039 stream.addPortalCandidate(portal);
0040 }
0041 }
0042
0043 if (m_cfg.sensitives) {
0044 for (const auto& surface : m_volume->surfaces()) {
0045 stream.addSurfaceCandidate(surface, args.tolerance);
0046 };
0047 }
0048 }
0049
0050 void TryAllNavigationPolicy::connect(NavigationDelegate& delegate) const {
0051 connectDefault<TryAllNavigationPolicy>(delegate);
0052 }
0053
0054 }