Skip to content

Commit

Permalink
Merge pull request #45935 from 24LopezR/141X_VertexExceptionPatch
Browse files Browse the repository at this point in the history
[141X] Patch in MuonBeamspotConstraintValueMapProducer for VertexException
  • Loading branch information
cmsbuild authored Sep 9, 2024
2 parents ba9a2b1 + 25f13ac commit 70e4527
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,19 @@ 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 70e4527

Please sign in to comment.