diff --git a/DataFormats/EgammaReco/interface/ElectronSeed.h b/DataFormats/EgammaReco/interface/ElectronSeed.h index 1507bae3ecce1..538c2f716702f 100644 --- a/DataFormats/EgammaReco/interface/ElectronSeed.h +++ b/DataFormats/EgammaReco/interface/ElectronSeed.h @@ -112,14 +112,14 @@ namespace reco { unsigned int hitsMask() const; void initTwoHitSeed(const unsigned char hitMask); - void setNegAttributes(const float dRZ2 = std::numeric_limits::infinity(), - const float dPhi2 = std::numeric_limits::infinity(), - const float dRZ1 = std::numeric_limits::infinity(), - const float dPhi1 = std::numeric_limits::infinity()); - void setPosAttributes(const float dRZ2 = std::numeric_limits::infinity(), - const float dPhi2 = std::numeric_limits::infinity(), - const float dRZ1 = std::numeric_limits::infinity(), - const float dPhi1 = std::numeric_limits::infinity()); + void setNegAttributes(const float dRZ2 = std::numeric_limits::max(), + const float dPhi2 = std::numeric_limits::max(), + const float dRZ1 = std::numeric_limits::max(), + const float dPhi1 = std::numeric_limits::max()); + void setPosAttributes(const float dRZ2 = std::numeric_limits::max(), + const float dPhi2 = std::numeric_limits::max(), + const float dRZ1 = std::numeric_limits::max(), + const float dPhi1 = std::numeric_limits::max()); //this is a backwards compatible function designed to //convert old format ElectronSeeds to the new format @@ -140,7 +140,7 @@ namespace reco { static float bestVal(float val1, float val2) { return std::abs(val1) < std::abs(val2) ? val1 : val2; } template T getVal(unsigned int hitNr, T PMVars::*val) const { - return hitNr < hitInfo_.size() ? hitInfo_[hitNr].*val : std::numeric_limits::infinity(); + return hitNr < hitInfo_.size() ? hitInfo_[hitNr].*val : std::numeric_limits::max(); } static std::vector hitNrsFromMask(unsigned int hitMask); diff --git a/DataFormats/Math/interface/approx_log.h b/DataFormats/Math/interface/approx_log.h index 3a9b4e957efab..75a233fe2d108 100644 --- a/DataFormats/Math/interface/approx_log.h +++ b/DataFormats/Math/interface/approx_log.h @@ -131,7 +131,7 @@ constexpr float approx_logf(float x) { //x = std::max(std::min(x,MAXNUMF),0.f); float res = unsafe_logf(x); - res = (x < MAXNUMF) ? res : std::numeric_limits::infinity(); + res = (x < MAXNUMF) ? res : std::numeric_limits::max(); return (x > 0) ? res : std::numeric_limits::quiet_NaN(); } diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc index dc5bbb190c32a..43d016ae278d8 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc @@ -64,13 +64,13 @@ namespace { if ((seed.caloCluster().key() == res.caloCluster().key()) && (seed.hitsMask() == res.hitsMask()) && equivalent(seed, res)) { if (positron) { - if (res.dRZPos(1) == std::numeric_limits::infinity() && - res.dRZNeg(1) != std::numeric_limits::infinity()) { + if (res.dRZPos(1) == std::numeric_limits::max() && + res.dRZNeg(1) != std::numeric_limits::max()) { res.setPosAttributes(info->dRz2, info->dPhi2, info->dRz1, info->dPhi1); seed.setNegAttributes(res.dRZNeg(1), res.dPhiNeg(1), res.dRZNeg(0), res.dPhiNeg(0)); break; } else { - if (res.dRZPos(1) != std::numeric_limits::infinity()) { + if (res.dRZPos(1) != std::numeric_limits::max()) { if (res.dRZPos(1) != seed.dRZPos(1)) { edm::LogWarning("ElectronSeedGenerator|BadValue") << "this similar old seed already has another dRz2Pos" @@ -82,13 +82,13 @@ namespace { } } } else { - if (res.dRZNeg(1) == std::numeric_limits::infinity() && - res.dRZPos(1) != std::numeric_limits::infinity()) { + if (res.dRZNeg(1) == std::numeric_limits::max() && + res.dRZPos(1) != std::numeric_limits::max()) { res.setNegAttributes(info->dRz2, info->dPhi2, info->dRz1, info->dPhi1); seed.setPosAttributes(res.dRZPos(1), res.dPhiPos(1), res.dRZPos(0), res.dPhiPos(0)); break; } else { - if (res.dRZNeg(1) != std::numeric_limits::infinity()) { + if (res.dRZNeg(1) != std::numeric_limits::max()) { if (res.dRZNeg(1) != seed.dRZNeg(1)) { edm::LogWarning("ElectronSeedGenerator|BadValue") << "this old seed already has another dRz2"