-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Factorize GX2F delta param calculation (#2774)
This allows compiling the fairly expensive `colPivHouseholderQr` expression to be compiled in a separate translation unit.
- Loading branch information
1 parent
a8a0576
commit 12de1e2
Showing
3 changed files
with
41 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ target_sources( | |
GsfUtils.cpp | ||
BetheHeitlerApprox.cpp | ||
GsfMixtureReduction.cpp | ||
GlobalChiSquareFitter.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This file is part of the Acts project. | ||
// | ||
// Copyright (C) 2023 CERN for the benefit of the Acts project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#include "Acts/TrackFitting/GlobalChiSquareFitter.hpp" | ||
|
||
#include "Acts/Definitions/TrackParametrization.hpp" | ||
|
||
namespace Acts::Experimental { | ||
|
||
BoundVector calculateDeltaParams(bool zeroField, const BoundMatrix& aMatrix, | ||
const BoundVector& bVector) { | ||
BoundVector deltaParams = BoundVector::Zero(); | ||
if (zeroField) { | ||
constexpr std::size_t reducedMatrixSize = 4; | ||
deltaParams.topLeftCorner<reducedMatrixSize, 1>() = | ||
aMatrix.topLeftCorner<reducedMatrixSize, reducedMatrixSize>() | ||
.colPivHouseholderQr() | ||
.solve(bVector.topLeftCorner<reducedMatrixSize, 1>()); | ||
} else { | ||
constexpr std::size_t reducedMatrixSize = 5; | ||
deltaParams.topLeftCorner<reducedMatrixSize, 1>() = | ||
aMatrix.topLeftCorner<reducedMatrixSize, reducedMatrixSize>() | ||
.colPivHouseholderQr() | ||
.solve(bVector.topLeftCorner<reducedMatrixSize, 1>()); | ||
} | ||
|
||
return deltaParams; | ||
} | ||
} // namespace Acts::Experimental |