From a4a0d1685ad4716ef65a472445fd755ea42e7a3d Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 6 Dec 2024 22:02:11 +0100 Subject: [PATCH] annotate SequentialPrimaryVertexFitterAdapter::fit exception --- .../interface/SequentialPrimaryVertexFitterAdapter.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h b/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h index 3c75fbab20037..b512aa61cf492 100644 --- a/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h +++ b/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h @@ -7,6 +7,8 @@ */ +#include + #include "RecoVertex/VertexPrimitives/interface/TransientVertex.h" #include "TrackingTools/TransientTrack/interface/TransientTrack.h" #include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexFitterBase.h" @@ -27,7 +29,15 @@ class SequentialPrimaryVertexFitterAdapter : public PrimaryVertexFitterBase { const std::vector& tracklist = cluster.originalTracks(); TransientVertex v; if (useBeamConstraint && (tracklist.size() > 1)) { - v = fitter->vertex(tracklist, beamspot); + try { + v = fitter->vertex(tracklist, beamspot); + } catch (VertexException& ex) { + std::ostringstream beamspotInfo; + beamspotInfo << "While processing SequentialPrimaryVertexFitterAdapter::fit() with BeamSpot parameters: \n" + << beamspot; + ex.addContext(beamspotInfo.str()); + throw; // rethrow the exception + } } else if (!(useBeamConstraint) && (tracklist.size() > 1)) { v = fitter->vertex(tracklist); } // else: no fit ==> v.isValid()=False