File indexing completed on 2025-07-05 08:11:33
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Propagator/StraightLineStepper.hpp"
0010
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 #include "Acts/EventData/TransformationHelpers.hpp"
0013 #include "Acts/Propagator/detail/CovarianceEngine.hpp"
0014
0015 namespace Acts {
0016
0017 StraightLineStepper::State StraightLineStepper::makeState(
0018 const Options& options) const {
0019 State state{options};
0020 return state;
0021 }
0022
0023 void StraightLineStepper::initialize(State& state,
0024 const BoundTrackParameters& par) const {
0025 initialize(state, par.parameters(), par.covariance(),
0026 par.particleHypothesis(), par.referenceSurface());
0027 }
0028
0029 void StraightLineStepper::initialize(State& state,
0030 const BoundVector& boundParams,
0031 const std::optional<BoundMatrix>& cov,
0032 ParticleHypothesis particleHypothesis,
0033 const Surface& surface) const {
0034 FreeVector freeParams = transformBoundToFreeParameters(
0035 surface, state.options.geoContext, boundParams);
0036
0037 state.particleHypothesis = particleHypothesis;
0038
0039 state.pathAccumulated = 0;
0040 state.nSteps = 0;
0041 state.nStepTrials = 0;
0042 state.stepSize = ConstrainedStep();
0043 state.stepSize.setAccuracy(state.options.initialStepSize);
0044 state.stepSize.setUser(state.options.maxStepSize);
0045 state.previousStepSize = 0;
0046 state.statistics = StepperStatistics();
0047
0048 state.pars = freeParams;
0049
0050
0051 state.covTransport = cov.has_value();
0052 if (state.covTransport) {
0053 state.cov = *cov;
0054 state.jacToGlobal = surface.boundToFreeJacobian(
0055 state.options.geoContext, freeParams.segment<3>(eFreePos0),
0056 freeParams.segment<3>(eFreeDir0));
0057 state.jacobian = BoundMatrix::Identity();
0058 state.jacTransport = FreeMatrix::Identity();
0059 state.derivative = FreeVector::Zero();
0060 }
0061 }
0062
0063 Result<std::tuple<BoundTrackParameters, BoundMatrix, double>>
0064 StraightLineStepper::boundState(
0065 State& state, const Surface& surface, bool transportCov,
0066 const FreeToBoundCorrection& freeToBoundCorrection) const {
0067 return detail::boundState(
0068 state.options.geoContext, surface, state.cov, state.jacobian,
0069 state.jacTransport, state.derivative, state.jacToGlobal, state.pars,
0070 state.particleHypothesis, state.covTransport && transportCov,
0071 state.pathAccumulated, freeToBoundCorrection);
0072 }
0073
0074 std::tuple<BoundTrackParameters, BoundMatrix, double>
0075 StraightLineStepper::curvilinearState(State& state, bool transportCov) const {
0076 return detail::curvilinearState(
0077 state.cov, state.jacobian, state.jacTransport, state.derivative,
0078 state.jacToGlobal, state.pars, state.particleHypothesis,
0079 state.covTransport && transportCov, state.pathAccumulated);
0080 }
0081
0082 void StraightLineStepper::update(State& state, const FreeVector& freeParams,
0083 const BoundVector& ,
0084 const Covariance& covariance,
0085 const Surface& surface) const {
0086 state.pars = freeParams;
0087 state.cov = covariance;
0088 state.jacToGlobal = surface.boundToFreeJacobian(
0089 state.options.geoContext, freeParams.template segment<3>(eFreePos0),
0090 freeParams.template segment<3>(eFreeDir0));
0091 }
0092
0093 void StraightLineStepper::update(State& state, const Vector3& uposition,
0094 const Vector3& udirection, double qop,
0095 double time) const {
0096 state.pars.template segment<3>(eFreePos0) = uposition;
0097 state.pars.template segment<3>(eFreeDir0) = udirection;
0098 state.pars[eFreeTime] = time;
0099 state.pars[eFreeQOverP] = qop;
0100 }
0101
0102 void StraightLineStepper::transportCovarianceToCurvilinear(State& state) const {
0103 detail::transportCovarianceToCurvilinear(
0104 state.cov, state.jacobian, state.jacTransport, state.derivative,
0105 state.jacToGlobal, state.pars.template segment<3>(eFreeDir0));
0106 }
0107
0108 void StraightLineStepper::transportCovarianceToBound(
0109 State& state, const Surface& surface,
0110 const FreeToBoundCorrection& freeToBoundCorrection) const {
0111 detail::transportCovarianceToBound(
0112 state.options.geoContext, surface, state.cov, state.jacobian,
0113 state.jacTransport, state.derivative, state.jacToGlobal, state.pars,
0114 freeToBoundCorrection);
0115 }
0116
0117 }