Skip to content

Commit

Permalink
annotate SequentialPrimaryVertexFitterAdapter::fit exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Dec 7, 2024
1 parent 567a8bc commit a4a0d16
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/

#include <sstream>

#include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
#include "TrackingTools/TransientTrack/interface/TransientTrack.h"
#include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexFitterBase.h"
Expand All @@ -27,7 +29,15 @@ class SequentialPrimaryVertexFitterAdapter : public PrimaryVertexFitterBase {
const std::vector<reco::TransientTrack>& 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
Expand Down

0 comments on commit a4a0d16

Please sign in to comment.