Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Acts/Propagator/VoidNavigator.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2018-2023 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 namespace Acts {
0012 
0013 class Surface;
0014 
0015 /// @brief The void navigator struct as a default navigator
0016 ///
0017 /// It does not provide any navigation action, the compiler
0018 /// should eventually optimise that the function call is not done
0019 ///
0020 struct VoidNavigator {
0021   /// @brief Nested State struct, minimal requirement
0022   struct State {
0023     /// Navigation state - external state: the start surface
0024     const Surface* startSurface = nullptr;
0025 
0026     /// Navigation state - external state: the current surface
0027     const Surface* currentSurface = nullptr;
0028 
0029     /// Navigation state - external state: the target surface
0030     const Surface* targetSurface = nullptr;
0031 
0032     /// Indicator if the target is reached
0033     bool targetReached = false;
0034 
0035     /// Navigation state : a break has been detected
0036     bool navigationBreak = false;
0037   };
0038 
0039   /// Unique typedef to publish to the Propagator
0040   using state_type = State;
0041 
0042   State makeState(const Surface* startSurface,
0043                   const Surface* targetSurface) const {
0044     State result;
0045     result.startSurface = startSurface;
0046     result.targetSurface = targetSurface;
0047     return result;
0048   }
0049 
0050   const Surface* currentSurface(const State& state) const {
0051     return state.currentSurface;
0052   }
0053 
0054   const Surface* startSurface(const State& state) const {
0055     return state.startSurface;
0056   }
0057 
0058   const Surface* targetSurface(const State& state) const {
0059     return state.targetSurface;
0060   }
0061 
0062   bool targetReached(const State& state) const { return state.targetReached; }
0063 
0064   bool navigationBreak(const State& state) const {
0065     return state.navigationBreak;
0066   }
0067 
0068   void currentSurface(State& state, const Surface* surface) const {
0069     state.currentSurface = surface;
0070   }
0071 
0072   void targetReached(State& state, bool targetReached) const {
0073     state.targetReached = targetReached;
0074   }
0075 
0076   void navigationBreak(State& state, bool navigationBreak) const {
0077     state.navigationBreak = navigationBreak;
0078   }
0079 
0080   /// Navigation call - void
0081   ///
0082   /// @tparam propagator_state_t is the type of Propagatgor state
0083   /// @tparam stepper_t Type of the Stepper
0084   ///
0085   /// Empty call, compiler should optimise that
0086   template <typename propagator_state_t, typename stepper_t>
0087   void initialize(propagator_state_t& /*state*/,
0088                   const stepper_t& /*stepper*/) const {}
0089 
0090   /// Navigation call - void
0091   ///
0092   /// @tparam propagator_state_t is the type of Propagatgor state
0093   /// @tparam stepper_t Type of the Stepper
0094   ///
0095   /// Empty call, compiler should optimise that
0096   template <typename propagator_state_t, typename stepper_t>
0097   void preStep(propagator_state_t& /*state*/,
0098                const stepper_t& /*stepper*/) const {}
0099 
0100   /// Navigation call - void
0101   ///
0102   /// @tparam propagator_state_t is the type of Propagatgor state
0103   /// @tparam stepper_t Type of the Stepper
0104   ///
0105   /// Empty call, compiler should optimise that
0106   template <typename propagator_state_t, typename stepper_t>
0107   void postStep(propagator_state_t& /*state*/,
0108                 const stepper_t& /*stepper*/) const {}
0109 };
0110 
0111 }  // namespace Acts