Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-05 08:29:36

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