From b5a8ece8b0c807a2a050041858bf1b81da9cf405 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Sat, 15 Aug 2020 20:16:32 +0200
Subject: [PATCH] Add ATLAS_CHECK_THREAD_SAFETY to CaloCalibHitRec

---
 .../CaloCalibHitRec/ATLAS_CHECK_THREAD_SAFETY               | 1 +
 .../CaloCalibHitRec/src/CaloCalibClusterMomentsMaker2.cxx   | 6 +-----
 2 files changed, 2 insertions(+), 5 deletions(-)
 create mode 100644 Calorimeter/CaloCalibHitRec/CaloCalibHitRec/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Calorimeter/CaloCalibHitRec/CaloCalibHitRec/ATLAS_CHECK_THREAD_SAFETY b/Calorimeter/CaloCalibHitRec/CaloCalibHitRec/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..75457a05b368
--- /dev/null
+++ b/Calorimeter/CaloCalibHitRec/CaloCalibHitRec/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Calorimeter/CaloCalibHitRec
diff --git a/Calorimeter/CaloCalibHitRec/src/CaloCalibClusterMomentsMaker2.cxx b/Calorimeter/CaloCalibHitRec/src/CaloCalibClusterMomentsMaker2.cxx
index bd66b91c6e29..a3355b4cae8b 100644
--- a/Calorimeter/CaloCalibHitRec/src/CaloCalibClusterMomentsMaker2.cxx
+++ b/Calorimeter/CaloCalibHitRec/src/CaloCalibClusterMomentsMaker2.cxx
@@ -820,7 +820,6 @@ Calculation of energy fraction caused by particles of different types
 void CaloCalibClusterMomentsMaker2::get_calib_frac(const std::map<unsigned int,int>& truthBarcodeToPdgCodeMap,
                                                    const MyClusInfo& clusInfo, std::vector<double> &engFrac) const
 {
-  static unsigned int nWarnings = 0;
   engFrac.assign(kCalibFracMax, 0.0);
   if(clusInfo.engCalibIn.engTot <= 0.0) return;
   // each MyClusInfo has a map of particle's barcode and particle calibration deposits in given cluster
@@ -829,10 +828,7 @@ void CaloCalibClusterMomentsMaker2::get_calib_frac(const std::map<unsigned int,i
     int pdg_id = 0;
     try { pdg_id = truthBarcodeToPdgCodeMap.at(barcode); }
     catch (const std::out_of_range& e){
-      if (nWarnings < 10 ){
-	ATH_MSG_WARNING("truthBarcodeToPdgCodeMap cannot find an entry with barcode " << barcode);
-	nWarnings++;
-      }
+      ATH_MSG_WARNING("truthBarcodeToPdgCodeMap cannot find an entry with barcode " << barcode);
       continue;
     }
 
-- 
GitLab