Skip to content

Commit

Permalink
computeGx2fDeltaParams
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger committed Dec 5, 2024
1 parent 9794715 commit d08d08d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,15 @@ std::size_t countMaterialStates(
return nMaterialSurfaces;
}

/// @brief Solve the gx2f system to get the delta parameters for the update
///
/// This function computes the delta parameters for the GX2F Actor fitting
/// process by solving the linear equation system [a] * delta = b. It uses the
/// column-pivoting Householder QR decomposition for numerical stability.
///
/// @param extendedSystem All parameters of the current equation system
Eigen::VectorXd computeGx2fDeltaParams(const Gx2fSystem& extendedSystem);

/// @brief Update parameters (and scattering angles if applicable)
///
/// @param params Parameters to be updated
Expand Down Expand Up @@ -1334,10 +1343,8 @@ class Gx2Fitter {
return Experimental::GlobalChiSquareFitterError::NotEnoughMeasurements;
}

// calculate delta params [a] * delta = b
Eigen::VectorXd deltaParamsExtended =
extendedSystem.aMatrix().colPivHouseholderQr().solve(
extendedSystem.bVector());
computeGx2fDeltaParams(extendedSystem);

ACTS_VERBOSE("aMatrix:\n"
<< extendedSystem.aMatrix() << "\n"
Expand Down Expand Up @@ -1501,10 +1508,8 @@ class Gx2Fitter {
return Experimental::GlobalChiSquareFitterError::NotEnoughMeasurements;
}

// calculate delta params [a] * delta = b
Eigen::VectorXd deltaParamsExtended =
extendedSystem.aMatrix().colPivHouseholderQr().solve(
extendedSystem.bVector());
computeGx2fDeltaParams(extendedSystem);

ACTS_VERBOSE("aMatrix:\n"
<< extendedSystem.aMatrix() << "\n"
Expand Down
6 changes: 6 additions & 0 deletions Core/src/TrackFitting/GlobalChiSquareFitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,9 @@ void Acts::Experimental::addMeasurementToGx2fSumsBackend(
<< " safeInvCovMeasurement:\n"
<< (*safeInvCovMeasurement));
}

Eigen::VectorXd Acts::Experimental::computeGx2fDeltaParams(
const Acts::Experimental::Gx2fSystem& extendedSystem) {
return extendedSystem.aMatrix().colPivHouseholderQr().solve(
extendedSystem.bVector());
}

0 comments on commit d08d08d

Please sign in to comment.