14 template <
typename input_track_t>
23 if (linTrack.covarianceAtPCA.determinant() == 0.) {
31 const ActsVectorD<5> trkParams = linTrack.parametersAtPCA.head<5>();
33 linTrack.weightAtPCA.block<5, 5>(0, 0);
37 (momJac.transpose() * (trkParamWeight * momJac)).inverse();
42 Vector3D newTrkMomentum = sMat * momJac.transpose() * trkParamWeight *
43 (trkParams - residual - posJac * vtxPos);
49 auto correctedPhiTheta =
63 -vtxCov * posJac.transpose() * trkParamWeight * momJac * sMat;
68 KalmanVertexUpdater::updatePosition<input_track_t>(
79 trkParams - (residual + posJac * vtx.fullPosition().template head<3>() +
80 momJac * newTrkMomentum);
83 double chi2 = posDiff.dot(reducedVtxWeight * posDiff) +
84 smParams.dot(trkParamWeight * smParams);
89 newFullTrkCov.block<3, 3>(0, 0) = newTrkCov;
92 vtxFullWeight.block<3, 3>(0, 0) = vtxWeight;
95 vtxFullCov.block<3, 3>(0, 0) = vtxCov;
98 sMat, newFullTrkCov, vtxFullWeight, vtxFullCov, newTrkParams);
101 std::shared_ptr<PerigeeSurface> perigeeSurface =
102 Surface::makeShared<PerigeeSurface>(vtx.position());
105 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;