Skip to content

Commit 692e29a

Browse files
authored
More fixes for isnan (#6877)
1 parent ad00338 commit 692e29a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,7 @@ void BookParticleCutsHistograms()
20802080
if (pc.fUseParticleCuts[ePtDependentDCAxyParameterization]) {
20812081
pc.fPtDependentDCAxyFormula = new TFormula("fPtDependentDCAxyFormula", pc.fsParticleCuts[ePtDependentDCAxyParameterization].Data());
20822082
// As a quick insanity check, try immediately to evaluate something from this formula:
2083-
if (isnan(pc.fPtDependentDCAxyFormula->Eval(1.44))) {
2083+
if (std::isnan(pc.fPtDependentDCAxyFormula->Eval(1.44))) {
20842084
LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__);
20852085
}
20862086
} // if(pc.fUseParticleCuts[ePtDependentDCAxyParameterization]) {
@@ -4303,10 +4303,10 @@ bool ValidTrack(T const& track)
43034303
// c) Additional validity checks for all tracks (in Run 3, 2 and 1), use only during debugging:
43044304
if (tc.fInsanityCheckForEachParticle) {
43054305

4306-
// *) isnan() check (remember that 'nan' is 0./0., inf-inf, etc. However 'inf' itself is NOT a 'nan', therefore isnan(1./0.) is false, isnan(0./0.) is true, etc.):
4307-
if (isnan(track.phi()) || isnan(track.pt()) || isnan(track.eta())) {
4306+
// *) std::isnan() check (remember that 'nan' is 0./0., inf-inf, etc. However 'inf' itself is NOT a 'nan', therefore std::isnan(1./0.) is false, std::isnan(0./0.) is true, etc.):
4307+
if (std::isnan(track.phi()) || std::isnan(track.pt()) || std::isnan(track.eta())) {
43084308
if (tc.fVerboseForEachParticle) {
4309-
LOGF(info, "\033[1;31m%s isnan(track.phi()) || isnan(track.pt()) || isnan(track.eta())\033[0m", __FUNCTION__);
4309+
LOGF(info, "\033[1;31m%s std::isnan(track.phi()) || std::isnan(track.pt()) || std::isnan(track.eta())\033[0m", __FUNCTION__);
43104310
LOGF(error, "track.phi() = %f\ntrack.pt() = %f\ntrack.eta() = %f", track.phi(), track.pt(), track.eta());
43114311
}
43124312
return kFALSE;

PWGJE/Core/JetFindingUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ template <typename T>
163163
bool analyseCandidate(std::vector<fastjet::PseudoJet>& inputParticles, T const& candidate, float candPtMin, float candPtMax, float candYMin, float candYMax)
164164
{
165165
auto candMass = jetcandidateutilities::getCandidatePDGMass(candidate);
166-
if (isnan(candidate.y())) {
166+
if (std::isnan(candidate.y())) {
167167
return false;
168168
}
169169
if (candidate.y() < candYMin || candidate.y() > candYMax) {
@@ -227,7 +227,7 @@ bool analyseV0s(std::vector<fastjet::PseudoJet>& inputParticles, T const& v0s, f
227227
}
228228
v0Y = v0.rapidity(v0Index);
229229
}
230-
if (isnan(v0Y)) {
230+
if (std::isnan(v0Y)) {
231231
continue;
232232
}
233233
if (v0Y < v0YMin || v0Y > v0YMax) {

0 commit comments

Comments
 (0)