Skip to content

Commit

Permalink
Merge pull request #45873 from 24LopezR/142X_VertexExceptionPatch
Browse files Browse the repository at this point in the history
Patch in MuonBeamspotConstraintValueMapProducer for VertexException
  • Loading branch information
cmsbuild committed Sep 8, 2024
2 parents 6d38593 + 21d3103 commit 265975f
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,18 @@ class MuonBeamspotConstraintValueMapProducer : public edm::global::EDProducer<>
// SingleTrackVertexConstraint uses the width for the constraint,
// not the error)
if ((BeamWidthXError / BeamWidthX < 0.3) && (BeamWidthYError / BeamWidthY < 0.3)) {
SingleTrackVertexConstraint::BTFtuple btft =
stvc.constrain(ttkb->build(muon.muonBestTrack()), *beamSpotHandle);
if (std::get<0>(btft)) {
const reco::Track& trkBS = std::get<1>(btft).track();
pts.push_back(trkBS.pt());
ptErrs.push_back(trkBS.ptError());
chi2s.push_back(std::get<2>(btft));
tbd = false;
try {
SingleTrackVertexConstraint::BTFtuple btft =
stvc.constrain(ttkb->build(muon.muonBestTrack()), *beamSpotHandle);
if (std::get<0>(btft)) {
const reco::Track& trkBS = std::get<1>(btft).track();
pts.push_back(trkBS.pt());
ptErrs.push_back(trkBS.ptError());
chi2s.push_back(std::get<2>(btft));
tbd = false;
}
} catch (const VertexException& exc) {
// Update failed; give up.
}
}
}
Expand Down

0 comments on commit 265975f

Please sign in to comment.