Skip to content

Commit 265975f

Browse files
authored
Merge pull request #45873 from 24LopezR/142X_VertexExceptionPatch
Patch in MuonBeamspotConstraintValueMapProducer for VertexException
2 parents 6d38593 + 21d3103 commit 265975f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

RecoMuon/GlobalTrackingTools/plugins/MuonBeamspotConstraintValueMapProducer.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,18 @@ class MuonBeamspotConstraintValueMapProducer : public edm::global::EDProducer<>
6666
// SingleTrackVertexConstraint uses the width for the constraint,
6767
// not the error)
6868
if ((BeamWidthXError / BeamWidthX < 0.3) && (BeamWidthYError / BeamWidthY < 0.3)) {
69-
SingleTrackVertexConstraint::BTFtuple btft =
70-
stvc.constrain(ttkb->build(muon.muonBestTrack()), *beamSpotHandle);
71-
if (std::get<0>(btft)) {
72-
const reco::Track& trkBS = std::get<1>(btft).track();
73-
pts.push_back(trkBS.pt());
74-
ptErrs.push_back(trkBS.ptError());
75-
chi2s.push_back(std::get<2>(btft));
76-
tbd = false;
69+
try {
70+
SingleTrackVertexConstraint::BTFtuple btft =
71+
stvc.constrain(ttkb->build(muon.muonBestTrack()), *beamSpotHandle);
72+
if (std::get<0>(btft)) {
73+
const reco::Track& trkBS = std::get<1>(btft).track();
74+
pts.push_back(trkBS.pt());
75+
ptErrs.push_back(trkBS.ptError());
76+
chi2s.push_back(std::get<2>(btft));
77+
tbd = false;
78+
}
79+
} catch (const VertexException& exc) {
80+
// Update failed; give up.
7781
}
7882
}
7983
}

0 commit comments

Comments
 (0)