1 #ifndef TRACKBASE_RESIDUALOUTLIERFINDER_H
2 #define TRACKBASE_RESIDUALOUTLIERFINDER_H
25 double chi2 = std::numeric_limits<float>::max();
27 auto fullCalibrated = state
28 .template calibrated<Acts::MultiTrajectoryTraits::MeasurementSizeMax>().
data();
29 auto fullCalibratedCovariance = state
30 .template calibratedCovariance<Acts::MultiTrajectoryTraits::MeasurementSizeMax>().
data();
33 constexpr
size_t kMeasurementSize = decltype(
N)::
value;
38 calibratedCovariance{fullCalibratedCovariance};
41 const auto H = state.
projector().template topLeftCorner<kMeasurementSize, Acts::eBoundSize>().eval();
43 res = calibrated -
H * predicted;
44 chi2 = (res.transpose() * ((calibratedCovariance +
H * predictedCovariance *
H.transpose())).inverse() * res).eval()(0, 0);
52 constexpr
size_t kMeasurementSize = decltype(
N)::
value;
54 state.template calibrated<kMeasurementSize>() -
56 .template topLeftCorner<kMeasurementSize, Acts::eBoundSize>() *
58 auto cdistance = residuals.norm();
61 std::cout <<
"Measurement has distance, chi2 "
70 float chi2cut =
chi2Cuts.find(volume)->second;
78 std::cout <<
"Meas vol id and layer " << volume <<
", " <<
layer
80 << chi2cut <<
" so returning outlier : " << outlier