Skip to content

Commit

Permalink
Replaced isnan, isinf with edm::isNotFinite in MTD vertex validation
Browse files Browse the repository at this point in the history
  • Loading branch information
noepalm committed Feb 12, 2024
1 parent 7d5cb36 commit 88f9847
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Validation/MtdValidation/plugins/Primary4DVertexValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/isFinite.h"

#include "DataFormats/Math/interface/LorentzVector.h"
#include "DataFormats/Math/interface/Point3D.h"
Expand Down Expand Up @@ -1323,7 +1324,7 @@ void Primary4DVertexValidation::analyze(const edm::Event& iEvent, const edm::Eve
unsigned int noPIDtype = 0;
if (probPi[*iTrack] == -1) {
noPIDtype = 1;
} else if (std::isnan(probPi[*iTrack])) {
} else if (edm::isNotFinite(probPi[*iTrack])) {
noPIDtype = 2;
} else if (probPi[*iTrack] == 1 && probK[*iTrack] == 0 && probP[*iTrack] == 0) {
noPIDtype = 3;
Expand Down Expand Up @@ -1602,7 +1603,7 @@ 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))) {
if (edm::isNotFinite(1. / puLineDensity(simpv.at(is).z))) {
continue;
}
meSimPVZ_->Fill(simpv.at(is).z, 1. / puLineDensity(simpv.at(is).z));
Expand Down

0 comments on commit 88f9847

Please sign in to comment.