Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:55

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