From dc1d81cecc02b8dfd1a33e57dce8181537c7ddac Mon Sep 17 00:00:00 2001
From: "se.gorbunov" <se.gorbunov@gsi.de>
Date: Tue, 6 Sep 2022 12:56:24 +0000
Subject: [PATCH] L1: Florian's patch for Mac compilation

---
 reco/KF/CbmKFParticleFinder.cxx      | 14 +++++++-------
 reco/L1/L1Algo/L1CATrackFinder.cxx   |  4 ++--
 reco/L1/L1Algo/L1TrackPar.h          |  3 +++
 reco/L1/L1Algo/utils/L1AlgoPulls.cxx | 10 +++++-----
 4 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/reco/KF/CbmKFParticleFinder.cxx b/reco/KF/CbmKFParticleFinder.cxx
index 83718f4f26..bfa255572f 100644
--- a/reco/KF/CbmKFParticleFinder.cxx
+++ b/reco/KF/CbmKFParticleFinder.cxx
@@ -191,15 +191,15 @@ void CbmKFParticleFinder::Exec(Option_t* /*opt*/)
       if (stsTrack->GetNofHits() < 3) continue;
 
       bool ok = 1;
-      ok      = ok && finite(parameters->GetX());
-      ok      = ok && finite(parameters->GetY());
-      ok      = ok && finite(parameters->GetZ());
-      ok      = ok && finite(parameters->GetTx());
-      ok      = ok && finite(parameters->GetTy());
-      ok      = ok && finite(parameters->GetQp());
+      ok      = ok && std::isfinite(parameters->GetX());
+      ok      = ok && std::isfinite(parameters->GetY());
+      ok      = ok && std::isfinite(parameters->GetZ());
+      ok      = ok && std::isfinite(parameters->GetTx());
+      ok      = ok && std::isfinite(parameters->GetTy());
+      ok      = ok && std::isfinite(parameters->GetQp());
 
       for (unsigned short iC = 0; iC < 15; iC++)
-        ok = ok && finite(V[iC]);
+        ok = ok && std::isfinite(V[iC]);
       ok = ok && (V[0] < 1. && V[0] > 0.) && (V[2] < 1. && V[2] > 0.) && (V[5] < 1. && V[5] > 0.)
            && (V[9] < 1. && V[9] > 0.) && (V[14] < 1. && V[14] > 0.);
       ok = ok && stsTrack->GetChiSq() < 10 * stsTrack->GetNDF();
diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx
index 8cfb1912b1..6fde704c0b 100644
--- a/reco/L1/L1Algo/L1CATrackFinder.cxx
+++ b/reco/L1/L1Algo/L1CATrackFinder.cxx
@@ -1246,9 +1246,9 @@ inline void L1Algo::findTripletsStep3(  // input
     if (chi2 > fTripletChi2Cut) { continue; }
 #endif  // DO_NOT_SELECT_TRIPLETS
 
-    // assert(finite(chi2) && chi2 > 0);
+    // assert(std::isfinite(chi2) && chi2 > 0);
 
-    if (!finite(chi2) || chi2 < 0) { continue; }
+    if (!std::isfinite(chi2) || chi2 < 0) { continue; }
     //if (!T3.IsEntryConsistent(false, i3_4)) { continue; }
 
     fscal qp = T3.qp[i3_4];
diff --git a/reco/L1/L1Algo/L1TrackPar.h b/reco/L1/L1Algo/L1TrackPar.h
index 5c5a58395e..ed0666115d 100644
--- a/reco/L1/L1Algo/L1TrackPar.h
+++ b/reco/L1/L1Algo/L1TrackPar.h
@@ -5,6 +5,9 @@
 #ifndef L1TrackPar_h
 #define L1TrackPar_h 1
 
+#include <iomanip>
+#include <iostream>
+
 #include "L1Def.h"
 
 class L1TrackPar {
diff --git a/reco/L1/L1Algo/utils/L1AlgoPulls.cxx b/reco/L1/L1Algo/utils/L1AlgoPulls.cxx
index 269ad148cc..7a84778507 100644
--- a/reco/L1/L1Algo/utils/L1AlgoPulls.cxx
+++ b/reco/L1/L1Algo/utils/L1AlgoPulls.cxx
@@ -115,11 +115,11 @@ void L1AlgoPulls::AddOne(L1TrackPar& T_, int i, L1HitIndex_t ih)
   TL1TrackParameters err;
   const L1TrackPar& tr = T_;
 
-  if (!(finite(tr.C00[i]) && tr.C00[i] > 0)) return;
-  if (!(finite(tr.C11[i]) && tr.C11[i] > 0)) return;
-  if (!(finite(tr.C22[i]) && tr.C22[i] > 0)) return;
-  if (!(finite(tr.C33[i]) && tr.C33[i] > 0)) return;
-  if (!(finite(tr.C44[i]) && tr.C44[i] > 0)) return;
+  if (!(std::isfinite(tr.C00[i]) && tr.C00[i] > 0)) return;
+  if (!(std::isfinite(tr.C11[i]) && tr.C11[i] > 0)) return;
+  if (!(std::isfinite(tr.C22[i]) && tr.C22[i] > 0)) return;
+  if (!(std::isfinite(tr.C33[i]) && tr.C33[i] > 0)) return;
+  if (!(std::isfinite(tr.C44[i]) && tr.C44[i] > 0)) return;
   err.x  = sqrt(tr.C00[i]);
   err.y  = sqrt(tr.C11[i]);
   err.tx = sqrt(tr.C22[i]);
-- 
GitLab