|
14 | 14 | #include "TrackingTools/TransientTrack/interface/TransientTrack.h" |
15 | 15 | #include "RecoVertex/KalmanVertexFit/interface/SingleTrackVertexConstraint.h" |
16 | 16 | #include "DataFormats/VertexReco/interface/Vertex.h" |
| 17 | +#include "RecoVertex/VertexPrimitives/interface/VertexException.h" |
17 | 18 |
|
18 | 19 | class MuonBeamspotConstraintValueMapProducer : public edm::global::EDProducer<> { |
19 | 20 | public: |
@@ -86,13 +87,17 @@ class MuonBeamspotConstraintValueMapProducer : public edm::global::EDProducer<> |
86 | 87 | auto pv = pvHandle->at(0); |
87 | 88 | VertexState pvs = VertexState(GlobalPoint(Basic3DVector<float>(pv.position())), GlobalError(pv.covariance())); |
88 | 89 |
|
89 | | - SingleTrackVertexConstraint::BTFtuple btft = stvc.constrain(ttkb->build(muon.muonBestTrack()), pvs); |
90 | | - if (std::get<0>(btft)) { |
91 | | - const reco::Track& trkBS = std::get<1>(btft).track(); |
92 | | - pts.push_back(trkBS.pt()); |
93 | | - ptErrs.push_back(trkBS.ptError()); |
94 | | - chi2s.push_back(std::get<2>(btft)); |
95 | | - tbd = false; |
| 90 | + try { |
| 91 | + SingleTrackVertexConstraint::BTFtuple btft = stvc.constrain(ttkb->build(muon.muonBestTrack()), pvs); |
| 92 | + if (std::get<0>(btft)) { |
| 93 | + const reco::Track& trkBS = std::get<1>(btft).track(); |
| 94 | + pts.push_back(trkBS.pt()); |
| 95 | + ptErrs.push_back(trkBS.ptError()); |
| 96 | + chi2s.push_back(std::get<2>(btft)); |
| 97 | + tbd = false; |
| 98 | + } |
| 99 | + } catch (const VertexException& exc) { |
| 100 | + // Update failed; give up. |
96 | 101 | } |
97 | 102 | } |
98 | 103 | } |
|
0 commit comments