Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 08:18:59

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Navigation/INavigationPolicy.hpp"
0012 #include "Acts/Navigation/NavigationStream.hpp"
0013 
0014 namespace Acts {
0015 
0016 class TrackingVolume;
0017 class GeometryContext;
0018 class Logger;
0019 
0020 /// Policy which adds **all** candidates of the configured type to the
0021 /// stream
0022 class TryAllNavigationPolicy final : public INavigationPolicy {
0023  public:
0024   /// Configuration for the try-all navigation policy
0025   struct Config {
0026     /// Whether to include portal surfaces
0027     bool portals = true;
0028     /// Whether to include sensitive surfaces
0029     bool sensitives = true;
0030     /// Whether to include passive surfaces
0031     bool passives = true;
0032   };
0033 
0034   /// Constructor from a volume
0035   /// @param gctx is the geometry context
0036   /// @param volume is the volume to navigate
0037   /// @param logger is the logger
0038   /// @param config The configuration for the policy
0039   TryAllNavigationPolicy(const GeometryContext& gctx,
0040                          const TrackingVolume& volume, const Logger& logger,
0041                          const Config& config);
0042 
0043   /// Constructor from a volume
0044   /// @param gctx is the geometry context
0045   /// @param volume is the volume to navigate
0046   /// @param logger is the logger
0047   TryAllNavigationPolicy(const GeometryContext& gctx,
0048                          const TrackingVolume& volume, const Logger& logger);
0049 
0050   /// Add all candidates to the stream
0051   /// @param gctx is the geometry context
0052   /// @param args are the navigation arguments
0053   /// @param state is the navigation policy state
0054   /// @param stream is the navigation stream to update
0055   /// @param logger is the logger
0056   void initializeCandidates(const GeometryContext& gctx,
0057                             const NavigationArguments& args,
0058                             NavigationPolicyState& state,
0059                             AppendOnlyNavigationStream& stream,
0060                             const Logger& logger) const;
0061 
0062   /// Connect the policy to a navigation delegate
0063   /// @param delegate is the navigation delegate
0064   void connect(NavigationDelegate& delegate) const override;
0065 
0066   /// Constant access to config
0067   /// @return config
0068   const Config& config() const;
0069 
0070  private:
0071   Config m_cfg;
0072   const TrackingVolume* m_volume;
0073 };
0074 
0075 static_assert(NavigationPolicyConcept<TryAllNavigationPolicy>);
0076 
0077 }  // namespace Acts