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/detail/SympyJacobianEngine.hpp"
0010 
0011 #include "Acts/Surfaces/CurvilinearSurface.hpp"
0012 #include "Acts/Surfaces/Surface.hpp"
0013 
0014 #include "codegen/sympy_jac_math.hpp"
0015 
0016 namespace Acts::detail {
0017 
0018 void sympy::boundToBoundTransportJacobian(
0019     const GeometryContext& geoContext, const Surface& surface,
0020     const FreeVector& freeParameters,
0021     const BoundToFreeMatrix& boundToFreeJacobian,
0022     const FreeMatrix& freeTransportJacobian,
0023     const FreeVector& freeToPathDerivatives,
0024     BoundMatrix& fullTransportJacobian) {
0025   const Vector3 position = freeParameters.segment<3>(eFreePos0);
0026   const Vector3 direction = freeParameters.segment<3>(eFreeDir0);
0027   // Calculate the derivative of path length at the final surface or the
0028   // point-of-closest approach w.r.t. free parameters
0029   const FreeToPathMatrix freeToPath =
0030       surface.freeToPathDerivative(geoContext, position, direction);
0031   // Calculate the jacobian from free to bound at the final surface
0032   FreeToBoundMatrix freeToBoundJacobian =
0033       surface.freeToBoundJacobian(geoContext, position, direction);
0034   // https://acts.readthedocs.io/en/latest/white_papers/correction-for-transport-jacobian.html
0035   // Calculate the full jacobian from the local/bound parameters at the start
0036   // surface to local/bound parameters at the final surface
0037   // @note jac(locA->locB) = jac(gloB->locB)*(1+
0038   // pathCorrectionFactor(gloB))*jacTransport(gloA->gloB) *jac(locA->gloA)
0039 
0040   boundToBoundTransportJacobianImpl(
0041       freeToBoundJacobian.data(), freeTransportJacobian.data(),
0042       boundToFreeJacobian.data(), freeToPathDerivatives.data(),
0043       freeToPath.data(), fullTransportJacobian.data());
0044 }
0045 
0046 void sympy::boundToCurvilinearTransportJacobian(
0047     const Vector3& direction, const BoundToFreeMatrix& boundToFreeJacobian,
0048     const FreeMatrix& freeTransportJacobian,
0049     const FreeVector& freeToPathDerivatives,
0050     BoundMatrix& fullTransportJacobian) {
0051   // Calculate the jacobian from global to local at the curvilinear surface
0052   FreeToBoundMatrix freeToBoundJacobian =
0053       CurvilinearSurface(direction).freeToBoundJacobian();
0054 
0055   // Calculate the full jocobian from the local parameters at the start surface
0056   // to curvilinear parameters
0057   // @note jac(locA->locB) = jac(gloB->locB)*(1+
0058   // pathCorrectionFactor(gloB))*jacTransport(gloA->gloB) *jac(locA->gloA)
0059 
0060   boundToCurvilinearTransportJacobianImpl(
0061       freeToBoundJacobian.data(), freeTransportJacobian.data(),
0062       boundToFreeJacobian.data(), freeToPathDerivatives.data(),
0063       direction.data(), fullTransportJacobian.data());
0064 }
0065 
0066 }  // namespace Acts::detail