|
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef MUONPATTERNHELPERS_MDTSEGMENTFITTER_H
5 #define MUONPATTERNHELPERS_MDTSEGMENTFITTER_H
14 #include <GaudiKernel/SystemOfUnits.h>
18 class ISpacePointCalibrator;
23 using HitType = std::unique_ptr<CalibratedSpacePoint>;
56 static constexpr
unsigned nPars{4};
111 LineWithPartials&
line);
120 ResidualWithPartials&
residual)
const;
130 ResidualWithPartials&
residual)
const;
140 const LineWithPartials&
line,
178 template <
unsigned int nDim>
185 template <
unsigned int nDim>
Amg::Vector3D residual
Vector carrying the residual.
void updateDriftSigns(const Amg::Vector3D &segPos, const Amg::Vector3D &segDir, SegmentFitResult &fitRes) const
Update the signs of the measurement.
ParamDefs
This file defines the parameter enums in the Trk namespace.
void blockCovariance(const AmgSymMatrix(5)&hessian, SegmentFit::Covariance &covariance) const
bool updateHitSummary(SegmentFitResult &fitResult) const
Brief updates the hit summary from the contributing hits.
void calculateStripResiduals(const LineWithPartials &line, const CalibratedSpacePoint &spacePoint, ResidualWithPartials &residual) const
Calculates the residual together with hte correspdonding derivatives for strip measurements.
static constexpr unsigned nPars
Free parameters of the line (x0,y0,theta,phi)
AmgVector(toInt(ParamDefs::nPars)) Parameters
Helper struct carrying the residual with its derivatives.
SegmentFit::Parameters Parameters
Amg::Vector3D dir
Segment direction
SpacePointPerLayerSorter::HitVec HitVec
std::array< Amg::Vector3D, nPars > gradient
First order derivatives.
unsigned int noMoveIter
How many iterations with changes below tolerance.
SegmentFitResult fitSegment(const EventContext &ctx, HitVec &&calibHits, const Parameters &startPars, const Amg::Transform3D &localToGlobal) const
const ISpacePointCalibrator * calibrator
Pointer to the calibrator tool.
std::array< Amg::Vector3D, nPars > gradient
First order derivatives.
constexpr unsigned int sumUp(unsigned k)
Calculates the sum of 1 + 2 +3 +4 +...
bool evalPhiPars
Flag whether the the residuals w.r.t phi shall be evaluated.
static constexpr unsigned nPars
Number of parameters.
CalibratedSpacePoint::Covariance_t MeasCov_t
Updates the chi2, its Gradient & Hessian from the measurement residual.
std::array< Amg::Vector3D, sumUp(nPars)> hessian
Second order derivatives.
std::unique_ptr< CalibratedSpacePoint > HitType
Eigen::Affine3d Transform3D
double chi2(TH1 *h0, TH1 *h1)
bool useSecOrderDeriv
Switch toggling whether the second order derivative shall be included.
Class to provide easy MsgStream access and capabilities.
unsigned int nParsOutOfBounds
Abort the fit as soon as more than n parameters leave the fit range.
void calculateWireResiduals(const LineWithPartials &line, const CalibratedSpacePoint &spacePoint, ResidualWithPartials &residual) const
Calculates the residuals together with the corresponding derivatives for a drift-circle measurement.
void updateDerivatives(const ResidualWithPartials &fitMeas, const MeasCov_t &measCovariance, AmgVector(5)&gradient, AmgSymMatrix(5)&hessian, double &chi2, int startPar) const
MdtSegmentFitter(const std::string &name, Config &&config)
Standard constructor.
unsigned int nMaxCalls
How many calls shall be executed.
constexpr int toInt(const ParamDefs p)
bool reCalibrate
Switch toggling whether the calibrator shall be called at each iteration.
Interface class to refine the space point calibration with an external seed.
Eigen::Matrix< double, 3, 1 > Vector3D
Store the partial derivative of the line w.r.t.
This header ties the generic definitions in this package.
std::array< std::array< double, 2 >, SegmentFit::toInt(ParamDefs::nPars)> RangeArray
Allowed parameter ranges.
AmgSymMatrix(toInt(ParamDefs::nPars)) Covariance
bool doTimeFit
Switch toggling whether the T0 shall be fitted or not.
std::vector< HitType > HitVec
The calibrated Space point is created during the calibration process.
Amg::Vector3D pos
segment position
static Amg::Vector3D partialPlaneIntersect(const Amg::Vector3D &normal, const double offset, const LineWithPartials &line, const ParamDefs fitPar)
Calculates the partial derivative of the intersection point between the segment line and the measurem...
static RangeArray defaultRanges()
Function that returns a set of predefined ranges for testing.
const AmgSymMatrix(2) &SpacePoint
bool recalibrate(const EventContext &ctx, SegmentFitResult &fitResult) const
Recalibrate the measurements participating in the fit & shift them into the centre-of gravity frame.
UpdateStatus updateParameters(Parameters ¤tPars, Parameters &previousPars, Parameters &currGrad, Parameters &prevGrad, const AmgSymMatrix(5)&hessian) const
Update step of the segment parameters using the Hessian and the gradient.
std::array< Amg::Vector3D, sumUp(nPars)> hessian
Second order derivatives.
std::variant< AmgSymMatrix(2), AmgSymMatrix(3)> Covariance_t
The spatial covariance matrix of the calibrated space point.
static void updateLinePartials(const Parameters &fitPars, LineWithPartials &line)
Updates the line parameters together with its first & second order partial derivatives.