Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-14 07:59:58

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/Geometry/GeometryContext.hpp"
0013 #include "Acts/Propagator/PropagatorStatistics.hpp"
0014 #include "Acts/Utilities/detail/Extendable.hpp"
0015 
0016 #include <functional>
0017 
0018 namespace Acts {
0019 
0020 /// @brief Different stages during propagation
0021 enum class PropagatorStage {
0022   invalid,          ///< Invalid stage
0023   prePropagation,   ///< Before the propagation
0024   postPropagation,  ///< After the propagation
0025   preStep,          ///< Before a step
0026   postStep,         ///< After a step
0027 };
0028 
0029 /// @brief private Propagator state for navigation and debugging
0030 ///
0031 /// @tparam propagator_options_t Type of the Objections object
0032 ///
0033 /// This struct holds the common state information for propagating
0034 /// which is independent of the actual stepper implementation.
0035 template <typename propagator_options_t, typename stepper_state_t,
0036           typename navigator_state_t, typename... extension_state_t>
0037 struct PropagatorState : private detail::Extendable<extension_state_t...> {
0038   /// Type alias for propagator options
0039   using options_type = propagator_options_t;
0040   /// Type alias for stepper state
0041   using stepper_state_type = stepper_state_t;
0042   /// Type alias for navigator state
0043   using navigator_state_type = navigator_state_t;
0044 
0045   /// Create the propagator state from the options
0046   ///
0047   /// @tparam propagator_options_t the type of the propagator options
0048   ///
0049   /// @param topts The options handed over by the propagate call
0050   /// @param steppingIn Stepper state instance to begin with
0051   /// @param navigationIn Navigator state instance to begin with
0052   PropagatorState(const propagator_options_t& topts, stepper_state_t steppingIn,
0053                   navigator_state_t navigationIn)
0054       : geoContext(topts.geoContext),
0055         options(topts),
0056         stepping{std::move(steppingIn)},
0057         navigation{std::move(navigationIn)} {}
0058 
0059   using detail::Extendable<extension_state_t...>::get;
0060   using detail::Extendable<extension_state_t...>::tuple;
0061 
0062   /// Context object for the geometry
0063   std::reference_wrapper<const GeometryContext> geoContext;
0064 
0065   /// These are the options - provided for each propagation step
0066   propagator_options_t options;
0067 
0068   /// Propagation stage
0069   PropagatorStage stage = PropagatorStage::invalid;
0070 
0071   /// The position of the propagation
0072   Vector3 position = Vector3::Zero();
0073 
0074   /// The direction of the propagation
0075   Vector3 direction = Vector3::Zero();
0076 
0077   /// Stepper state - internal state of the Stepper
0078   stepper_state_t stepping;
0079 
0080   /// Navigation state - internal state of the Navigator
0081   navigator_state_t navigation;
0082 
0083   /// Number of propagation steps that were carried out
0084   std::size_t steps = 0;
0085 
0086   /// Signed distance over which the parameters were propagated
0087   double pathLength = 0.;
0088 
0089   /// Statistics of the propagation
0090   PropagatorStatistics statistics;
0091 };
0092 
0093 }  // namespace Acts