Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:42:11

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   struct Config {
0025     bool portals = true;
0026     bool sensitives = true;
0027     bool passives = true;
0028   };
0029 
0030   /// Constructor from a volume
0031   /// @param gctx is the geometry context
0032   /// @param volume is the volume to navigate
0033   /// @param logger is the logger
0034   /// @param config The configuration for the policy
0035   TryAllNavigationPolicy(const GeometryContext& gctx,
0036                          const TrackingVolume& volume, const Logger& logger,
0037                          const Config& config);
0038 
0039   /// Constructor from a volume
0040   /// @param gctx is the geometry context
0041   /// @param volume is the volume to navigate
0042   /// @param logger is the logger
0043   TryAllNavigationPolicy(const GeometryContext& gctx,
0044                          const TrackingVolume& volume, const Logger& logger);
0045 
0046   /// Add all candidates to the stream
0047   /// @param args are the navigation arguments
0048   /// @param stream is the navigation stream to update
0049   /// @param logger is the logger
0050   void initializeCandidates(const NavigationArguments& args,
0051                             AppendOnlyNavigationStream& stream,
0052                             const Logger& logger) const;
0053 
0054   /// Connect the policy to a navigation delegate
0055   /// @param delegate is the navigation delegate
0056   void connect(NavigationDelegate& delegate) const override;
0057 
0058  private:
0059   Config m_cfg;
0060   const TrackingVolume* m_volume;
0061 };
0062 
0063 static_assert(NavigationPolicyConcept<TryAllNavigationPolicy>);
0064 
0065 }  // namespace Acts