Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-18 08:20:40

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/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Direction.hpp"
0013 #include "Acts/Propagator/NavigationTarget.hpp"
0014 #include "Acts/Propagator/NavigatorOptions.hpp"
0015 #include "Acts/Propagator/NavigatorStatistics.hpp"
0016 #include "Acts/Utilities/Result.hpp"
0017 
0018 namespace Acts {
0019 
0020 class TrackingVolume;
0021 class IVolumeMaterial;
0022 class Surface;
0023 
0024 /// @brief A navigator that does nothing
0025 ///
0026 /// It does not provide any navigation action
0027 ///
0028 class VoidNavigator {
0029  public:
0030   /// @brief Nested Config struct
0031   struct Config {};
0032 
0033   /// @brief Nested Options struct
0034   struct Options : public NavigatorPlainOptions {
0035     /// @brief Constructor for void navigator options
0036     /// @param gctx Geometry context (required but unused by void navigator)
0037     explicit Options(const GeometryContext& gctx)
0038         : NavigatorPlainOptions(gctx) {}
0039 
0040     /// @brief Sets the plain navigator options
0041     /// @param options The plain navigator options to copy (unused by void navigator)
0042     void setPlainOptions(const NavigatorPlainOptions& options) {
0043       static_cast<NavigatorPlainOptions&>(*this) = options;
0044     }
0045   };
0046 
0047   /// @brief Nested State struct
0048   struct State {
0049     /// @brief Constructor for void navigator state
0050     /// @param options_ The navigator options to store in state
0051     explicit State(const Options& options_) : options(options_) {}
0052 
0053     /// Configuration options for the navigator
0054     Options options;
0055 
0056     /// Navigation statistics
0057     NavigatorStatistics statistics;
0058   };
0059 
0060   /// @brief Creates a new navigator state for void navigation
0061   /// @param options The navigator options
0062   /// @return Initialized void navigator state
0063   State makeState(const Options& options) const {
0064     State state(options);
0065     return state;
0066   }
0067 
0068   /// @brief Returns the current surface (always nullptr for void navigator)
0069   /// @return Always nullptr since void navigator has no surfaces
0070   const Surface* currentSurface(const State& /*state*/) const {
0071     return nullptr;
0072   }
0073 
0074   /// @brief Returns the current tracking volume (always nullptr for void navigator)
0075   /// @return Always nullptr since void navigator has no volumes
0076   const TrackingVolume* currentVolume(const State& /*state*/) const {
0077     return nullptr;
0078   }
0079 
0080   /// @brief Returns the current volume material (always nullptr for void navigator)
0081   /// @return Always nullptr since void navigator has no material
0082   const IVolumeMaterial* currentVolumeMaterial(const State& /*state*/) const {
0083     return nullptr;
0084   }
0085 
0086   /// @brief Returns the start surface (always nullptr for void navigator)
0087   /// @return Always nullptr since void navigator has no surfaces
0088   const Surface* startSurface(const State& /*state*/) const { return nullptr; }
0089 
0090   /// @brief Returns the target surface (always nullptr for void navigator)
0091   /// @return Always nullptr since void navigator has no surfaces
0092   const Surface* targetSurface(const State& /*state*/) const { return nullptr; }
0093 
0094   /// @brief Checks if navigation should break (always true for void navigator)
0095   /// @return Always true to immediately stop navigation
0096   bool navigationBreak(const State& /*state*/) const { return true; }
0097 
0098   /// @brief Initializes the void navigator (always succeeds and does nothing)
0099   /// @return Always successful result since no initialization is needed
0100   [[nodiscard]] Result<void> initialize(
0101       State& /*state*/, const Vector3& /*position*/,
0102       const Vector3& /*direction*/, Direction /*propagationDirection*/) const {
0103     return Result<void>::success();
0104   }
0105 
0106   /// @brief Returns the next navigation target (always None for void navigator)
0107   /// @return NavigationTarget::None() since there are no targets in void space
0108   NavigationTarget nextTarget(State& /*state*/, const Vector3& /*position*/,
0109                               const Vector3& /*direction*/) const {
0110     return NavigationTarget::None();
0111   }
0112 
0113   /// @brief Checks if the current target is valid (always true for void navigator)
0114   /// @return Always true since there are no targets to invalidate
0115   bool checkTargetValid(const State& /*state*/, const Vector3& /*position*/,
0116                         const Vector3& /*direction*/) const {
0117     return true;
0118   }
0119 
0120   /// @brief Handles reaching a surface (does nothing for void navigator)
0121   void handleSurfaceReached(State& /*state*/, const Vector3& /*position*/,
0122                             const Vector3& /*direction*/,
0123                             const Surface& /*surface*/) const {
0124     return;
0125   }
0126 };
0127 
0128 }  // namespace Acts