From 9db99bdfcb6aba774904a566b0d26252f11e7b30 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Fri, 23 Sep 2022 13:12:03 +0200 Subject: [PATCH] add protection against infinite weight in simpvz histogram --- Validation/MtdValidation/plugins/Primary4DVertexValidation.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Validation/MtdValidation/plugins/Primary4DVertexValidation.cc b/Validation/MtdValidation/plugins/Primary4DVertexValidation.cc index 21e466f23dbba..02c278ae3fbb2 100644 --- a/Validation/MtdValidation/plugins/Primary4DVertexValidation.cc +++ b/Validation/MtdValidation/plugins/Primary4DVertexValidation.cc @@ -1590,6 +1590,8 @@ void Primary4DVertexValidation::analyze(const edm::Event& iEvent, const edm::Eve //fill vertices histograms here in a new loop for (unsigned int is = 0; is < simpv.size(); is++) { + // protect against particle guns with very displaced vertices + if ( std::isinf(1. / puLineDensity(simpv.at(is).z)) ) { continue; } meSimPVZ_->Fill(simpv.at(is).z, 1. / puLineDensity(simpv.at(is).z)); if (is == 0 && optionalPlots_) { meSimPosInSimOrigCollection_->Fill(simpv.at(is).OriginalIndex);