14#include "GaudiKernel/SystemOfUnits.h"
15#include "GaudiKernel/ThreadLocalContext.h"
23 const std::string& name,
24 const IInterface* parent)
26 declareInterface<IGlobalTrackFitter>(
this);
42 auto [refittedTrack, fitState] =
43 fitWithState(Gaudi::Hive::currentContext(), trk, runOutlier, matEffects);
50 return refittedTrack.release();
60 int numberParameters = 5;
62 numberParameters = fitState.
parameters->numberParameters();
67 if (!m->isPositionMeasurement()) {
70 rows += m->numberDoF();
73 if (!numberParameters || !rows) {
78 <<
" measurement objects giving " << rows
79 <<
" rows and " << numberParameters
80 <<
" columns (parameters)");
82 auto derivativeMatrix =
83 std::make_unique<Amg::MatrixX>(rows, numberParameters);
86 if (!m->numberDoF() || !m->isPositionMeasurement()) {
90 if (m->weight() > 0.) {
91 norm = 1. / m->weight();
94 for (
int col = 0; col < numberParameters; ++col) {
95 (*derivativeMatrix)(row, col) = norm * m->derivative(col);
99 (*derivativeMatrix)(row, 4) *= Gaudi::Units::TeV;
100 if (fitState.
parameters->fitEnergyDeposit()) {
101 (*derivativeMatrix)(row, 5) *= Gaudi::Units::TeV;
104 if (m->numberDoF() < 2) {
110 if (m->weight2() > 0.)
111 norm = 1. / m->weight2();
112 for (
int col = 0; col < numberParameters; ++col) {
113 (*derivativeMatrix)(row, col) = norm * m->derivative2(col);
115 (*derivativeMatrix)(row, 4) *= Gaudi::Units::TeV;
116 if (fitState.
parameters->fitEnergyDeposit()) {
117 (*derivativeMatrix)(row, 5) *= Gaudi::Units::TeV;
123 ATH_MSG_WARNING(
"iPatGlobalFitter: inconsistent #rows in deriv matrix ");
126 return derivativeMatrix;
131 int numberParameters = 5;
134 numberParameters = fitState.
parameters->numberParameters();
140 0, 0, numberParameters, numberParameters));
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
static Amg::MatrixX * fullCovariance()
bool hasMeasurements() const
std::vector< FitMeasurement * > & getMeasurements()
std::unique_ptr< FitParameters > parameters
iPatFitter(const std::string &type, const std::string &name, const IInterface *parent, bool isGlobalFit=false)
std::pair< std::unique_ptr< Track >, std::unique_ptr< FitState > > fitWithState(const EventContext &ctx, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis particleHypothesis=Trk::nonInteracting) const
std::unique_ptr< FitProcedure > m_fitProcedure
std::unique_ptr< Amg::MatrixX > derivMatrix(const FitState &fitState) const
GlobalTrackFitter methods: access to the matrix of derivatives used during the latest track fit.
static int iterationsOfLastFit(const FitState &fitState)
access to the number of iterations taken by the latest track fit
void setMinIterations(int minIterations)
set method for the minimum number of iterations for (alignment) friend
Track * alignmentFit(AlignmentCache &, const Track &, const RunOutlierRemoval runOutlier=false, const ParticleHypothesis matEffects=Trk::nonInteracting) const
RE-FIT A TRACK FOR ALIGNMENT.
std::unique_ptr< Amg::MatrixX > fullCovarianceMatrix(const FitState &fitState) const
access to the global fitter's full covariance matrix
iPatGlobalFitter(const std::string &type, const std::string &name, const IInterface *parent)
Ensure that the ATLAS eigen extensions are properly loaded.
bool RunOutlierRemoval
switch to toggle quality processing after fit
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
std::unique_ptr< Amg::MatrixX > m_fullCovarianceMatrix
access to the global fitter's full covariance matrix.
int m_iterationsOfLastFit
returns the number of iterations used by the last fit (count starts at 1 for a single-iteration fit)
std::unique_ptr< Amg::MatrixX > m_derivMatrix
access to the matrix of derivatives used during the latest global-chi2 track fit.