24 declareInterface<IMuonCombinedTagTool>(
this);
32 return StatusCode::SUCCESS;
37 const EventContext& ctx)
const {
47 std::unique_ptr<const Trk::Perigee> bestPerigee;
49 double bestChi2{FLT_MAX};
54 if (idTP->isSiliconAssociated())
continue;
57 if (!idTP->indetTrackParticle().perigeeParameters().covariance())
continue;
63 const Trk::Perigee* idPer = &idTP->indetTrackParticle().perigeeParameters();
65 std::unique_ptr<const Trk::TrackParameters> exPars;
71 ATH_MSG_DEBUG(
"The ID and MS candidates are not expressed at the same surface: id r "
72 << idTP->indetTrackParticle().perigeeParameters().associatedSurface().center().perp() <<
" z "
73 << idTP->indetTrackParticle().perigeeParameters().associatedSurface().center().z() <<
" ms r "
76 <<
" and extrapolation failed");
86 std::unique_ptr<const Trk::Perigee> perigee =
theCombIdMu(*idPer, *msPer,
chi2);
91 if (
chi2 < bestChi2) {
93 bestPerigee = std::move(perigee);
98 const double outerMatchChi2 =
100 ATH_MSG_DEBUG(
"Combined Muon with ID " <<
m_printer->print(*bestPerigee) <<
" match chi2 " << bestChi2 <<
" outer match "
108 double&
chi2)
const {
110 if (!indetPerigee.covariance() || !extrPerigee.covariance()) {
115 const AmgSymMatrix(5)& covID = *indetPerigee.covariance();
117 if (weightID.determinant() == 0.) {
122 const AmgSymMatrix(5)& covMS = *extrPerigee.covariance();
124 if (weightMS.determinant() == 0.) {
131 if (weightCB.determinant() == 0) {
136 if (covCB.determinant() == 0) {
144 if (invCovSum.determinant() == 0) {
149 AmgVector(5) parsMS(extrPerigee.parameters());
151 AmgVector(5) diffPars = indetPerigee.parameters() - parsMS;
152 chi2 = (diffPars.transpose() * invCovSum * diffPars);
155 AmgVector(5) parsCB = (covCB) * (weightID * indetPerigee.parameters() + weightMS * parsMS);