Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:09:41

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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 #include "Acts/TrackFitting/GlobalChiSquareFitter.hpp"
0010 
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 
0013 namespace Acts::Experimental {
0014 
0015 BoundVector calculateDeltaParams(bool zeroField, const BoundMatrix& aMatrix,
0016                                  const BoundVector& bVector) {
0017   BoundVector deltaParams = BoundVector::Zero();
0018   if (zeroField) {
0019     constexpr std::size_t reducedMatrixSize = 4;
0020     deltaParams.topLeftCorner<reducedMatrixSize, 1>() =
0021         aMatrix.topLeftCorner<reducedMatrixSize, reducedMatrixSize>()
0022             .colPivHouseholderQr()
0023             .solve(bVector.topLeftCorner<reducedMatrixSize, 1>());
0024   } else {
0025     constexpr std::size_t reducedMatrixSize = 5;
0026     deltaParams.topLeftCorner<reducedMatrixSize, 1>() =
0027         aMatrix.topLeftCorner<reducedMatrixSize, reducedMatrixSize>()
0028             .colPivHouseholderQr()
0029             .solve(bVector.topLeftCorner<reducedMatrixSize, 1>());
0030   }
0031 
0032   return deltaParams;
0033 }
0034 }  // namespace Acts::Experimental