14#include "GaudiKernel/SystemOfUnits.h"
15#include "GaudiKernel/ThreadLocalContext.h"
23 const std::string& name,
24 const IInterface* parent)
26 declareInterface<IGlobalTrackFitter>(
this);
49 auto [refittedTrack, fitState] =
50 fitWithState(Gaudi::Hive::currentContext(), trk, runOutlier, matEffects);
58 return refittedTrack.release();
68 int numberParameters = 5;
70 numberParameters = fitState.
parameters->numberParameters();
75 if (!m->isPositionMeasurement()) {
78 rows += m->numberDoF();
81 if (!numberParameters || !rows) {
86 <<
" measurement objects giving " << rows
87 <<
" rows and " << numberParameters
88 <<
" columns (parameters)");
90 auto derivativeMatrix =
91 std::make_unique<Amg::MatrixX>(rows, numberParameters);
94 if (!m->numberDoF() || !m->isPositionMeasurement()) {
98 if (m->weight() > 0.) {
99 norm = 1. / m->weight();
102 for (
int col = 0; col < numberParameters; ++col) {
103 (*derivativeMatrix)(row, col) = norm * m->derivative(col);
107 (*derivativeMatrix)(row, 4) *= Gaudi::Units::TeV;
108 if (fitState.
parameters->fitEnergyDeposit()) {
109 (*derivativeMatrix)(row, 5) *= Gaudi::Units::TeV;
112 if (m->numberDoF() < 2) {
118 if (m->weight2() > 0.)
119 norm = 1. / m->weight2();
120 for (
int col = 0; col < numberParameters; ++col) {
121 (*derivativeMatrix)(row, col) = norm * m->derivative2(col);
123 (*derivativeMatrix)(row, 4) *= Gaudi::Units::TeV;
124 if (fitState.
parameters->fitEnergyDeposit()) {
125 (*derivativeMatrix)(row, 5) *= Gaudi::Units::TeV;
131 ATH_MSG_WARNING(
"iPatGlobalFitter: inconsistent #rows in deriv matrix ");
134 return derivativeMatrix;
139 int numberParameters = 5;
142 numberParameters = fitState.
parameters->numberParameters();
148 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.
int m_iterationsOfLastFit
returns the number of iterations used by the last fit (count starts at 1 for a single-iteration fit)
Amg::MatrixX * m_derivMatrix
access to the matrix of derivatives used during the latest global-chi2 track fit.
Amg::MatrixX * m_fullCovarianceMatrix
access to the global fitter's full covariance matrix.