14 template <
typename input_track_t>
23 if (linTrack.covarianceAtPCA.determinant() == 0.) {
31 const ActsVector<5> trkParams = linTrack.parametersAtPCA.head<5>();
34 linTrack.covarianceAtPCA.block<5, 5>(0, 0).inverse();
38 (momJac.transpose() * (trkParamWeight * momJac)).inverse();
40 const ActsVector<5> residual = linTrack.constantTerm.head<5>();
43 Vector3 newTrkMomentum = sMat * momJac.transpose() * trkParamWeight *
44 (trkParams - residual - posJac * vtxPos);
50 const auto correctedPhiTheta =
62 -vtxCov * posJac.transpose() * trkParamWeight * momJac * sMat;
67 KalmanVertexUpdater::updatePosition<input_track_t>(
78 trkParams - (residual + posJac * vtx.fullPosition().template head<3>() +
79 momJac * newTrkMomentum);
82 double chi2 = posDiff.dot(reducedVtxWeight * posDiff) +
83 smParams.dot(trkParamWeight * smParams);
88 newFullTrkCov.block<3, 3>(0, 0) = newTrkCov;
91 vtxFullWeight.block<3, 3>(0, 0) = vtxWeight;
94 vtxFullCov.block<3, 3>(0, 0) = vtxCov;
97 sMat, newFullTrkCov, vtxFullWeight, vtxFullCov, newTrkParams);
100 std::shared_ptr<PerigeeSurface> perigeeSurface =
101 Surface::makeShared<PerigeeSurface>(vtx.position());
104 perigeeSurface, newTrkParams,
std::move(fullPerTrackCov),
122 sMat + (newTrkCov.block<3, 3>(0, 0)).transpose() *
123 (vtxWeight.block<3, 3>(0, 0) * newTrkCov.block<3, 3>(0, 0));
129 fullTrkCov.block<3, 3>(0, 0) = vtxCov.block<3, 3>(0, 0);
130 fullTrkCov.block<3, 3>(0, 3) = newTrkCov.block<3, 3>(0, 0);
131 fullTrkCov.block<3, 3>(3, 0) = (newTrkCov.block<3, 3>(0, 0)).transpose();
132 fullTrkCov.block<3, 3>(3, 3) = momCov;
138 trkJac(0, 0) = -std::sin(newTrkParams[2]);
139 trkJac(0, 1) = std::cos(newTrkParams[2]);
141 double tanTheta = std::tan(newTrkParams[3]);
144 trkJac(1, 0) = -trkJac(0, 1) / tanTheta;
145 trkJac(1, 1) = trkJac(0, 0) / tanTheta;
150 BoundMatrix fullPerTrackCov(BoundMatrix::Identity());
151 fullPerTrackCov.block<5, 5>(0, 0) =
152 (trkJac * (fullTrkCov * trkJac.transpose()));
154 return fullPerTrackCov;