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