Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:28

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 #include "Acts/Propagator/StraightLineStepper.hpp"
0010 
0011 #include "Acts/EventData/TransformationHelpers.hpp"
0012 #include "Acts/Propagator/detail/CovarianceEngine.hpp"
0013 
0014 namespace Acts {
0015 
0016 Result<std::tuple<BoundTrackParameters, BoundMatrix, double>>
0017 StraightLineStepper::boundState(
0018     State& state, const Surface& surface, bool transportCov,
0019     const FreeToBoundCorrection& freeToBoundCorrection) const {
0020   return detail::boundState(
0021       state.options.geoContext, surface, state.cov, state.jacobian,
0022       state.jacTransport, state.derivative, state.jacToGlobal, state.pars,
0023       state.particleHypothesis, state.covTransport && transportCov,
0024       state.pathAccumulated, freeToBoundCorrection);
0025 }
0026 
0027 std::tuple<CurvilinearTrackParameters, BoundMatrix, double>
0028 StraightLineStepper::curvilinearState(State& state, bool transportCov) const {
0029   return detail::curvilinearState(
0030       state.cov, state.jacobian, state.jacTransport, state.derivative,
0031       state.jacToGlobal, state.pars, state.particleHypothesis,
0032       state.covTransport && transportCov, state.pathAccumulated);
0033 }
0034 
0035 void StraightLineStepper::update(State& state, const FreeVector& freeParams,
0036                                  const BoundVector& /*boundParams*/,
0037                                  const Covariance& covariance,
0038                                  const Surface& surface) const {
0039   state.pars = freeParams;
0040   state.cov = covariance;
0041   state.jacToGlobal = surface.boundToFreeJacobian(
0042       state.options.geoContext, freeParams.template segment<3>(eFreePos0),
0043       freeParams.template segment<3>(eFreeDir0));
0044 }
0045 
0046 void StraightLineStepper::update(State& state, const Vector3& uposition,
0047                                  const Vector3& udirection, double qop,
0048                                  double time) const {
0049   state.pars.template segment<3>(eFreePos0) = uposition;
0050   state.pars.template segment<3>(eFreeDir0) = udirection;
0051   state.pars[eFreeTime] = time;
0052   state.pars[eFreeQOverP] = qop;
0053 }
0054 
0055 void StraightLineStepper::transportCovarianceToCurvilinear(State& state) const {
0056   detail::transportCovarianceToCurvilinear(
0057       state.cov, state.jacobian, state.jacTransport, state.derivative,
0058       state.jacToGlobal, state.pars.template segment<3>(eFreeDir0));
0059 }
0060 
0061 void StraightLineStepper::transportCovarianceToBound(
0062     State& state, const Surface& surface,
0063     const FreeToBoundCorrection& freeToBoundCorrection) const {
0064   detail::transportCovarianceToBound(
0065       state.options.geoContext, surface, state.cov, state.jacobian,
0066       state.jacTransport, state.derivative, state.jacToGlobal, state.pars,
0067       freeToBoundCorrection);
0068 }
0069 
0070 void StraightLineStepper::resetState(State& state,
0071                                      const BoundVector& boundParams,
0072                                      const BoundSquareMatrix& cov,
0073                                      const Surface& surface,
0074                                      const double stepSize) const {
0075   FreeVector freeParams = transformBoundToFreeParameters(
0076       surface, state.options.geoContext, boundParams);
0077 
0078   // Update the stepping state
0079   state.pars = freeParams;
0080   state.cov = cov;
0081   state.stepSize = ConstrainedStep(stepSize);
0082   state.pathAccumulated = 0.;
0083 
0084   // Reinitialize the stepping jacobian
0085   state.jacToGlobal = surface.boundToFreeJacobian(
0086       state.options.geoContext, freeParams.template segment<3>(eFreePos0),
0087       freeParams.template segment<3>(eFreeDir0));
0088   state.jacobian = BoundMatrix::Identity();
0089   state.jacTransport = FreeMatrix::Identity();
0090   state.derivative = FreeVector::Zero();
0091 }
0092 
0093 }  // namespace Acts