From 669740b2eeaf7ddfb2599c8ad95cfed6bd943d95 Mon Sep 17 00:00:00 2001
From: Susumu Oda <susumu.oda@cern.ch>
Date: Fri, 19 Jun 2020 11:06:01 +0000
Subject: [PATCH] Add ATLAS_CHECK_THREAD_SAFETY to three InnerDetector packages

---
 .../TRT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY     |  1 +
 .../TRT_ConditionsData/ExpandedIdentifier.h          |  7 ++++---
 .../TRT_ConditionsData/TRT_ConditionsData/HWMap.h    | 12 ++++++------
 .../TRT_ConditionsData/NestedContainer.h             |  3 ++-
 .../FastSiDigitization/ATLAS_CHECK_THREAD_SAFETY     |  1 +
 .../FastSiDigitization/PixelFastDigitizationTool.h   |  2 --
 .../FastSiDigitization/SiSmearedDigitizationTool.h   |  6 +++---
 .../src/PixelFastDigitizationTool.cxx                |  2 --
 .../src/SiSmearedDigitizationTool.cxx                |  4 ++--
 .../TRTMonitoringRun3/ATLAS_CHECK_THREAD_SAFETY      |  1 +
 .../src/TRTMonitoringRun3ESD_Alg.cxx                 |  9 +--------
 11 files changed, 21 insertions(+), 27 deletions(-)
 create mode 100644 InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 InnerDetector/InDetMonitoring/TRTMonitoringRun3/TRTMonitoringRun3/ATLAS_CHECK_THREAD_SAFETY

diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..3c71a096029
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetConditions/TRT_ConditionsData
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h
index a4c66f6fb99..59e9aa01f8c 100755
--- a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRTConditionsData_TRTCondIdentifier_h
 #define TRTConditionsData_TRTCondIdentifier_h
 
 #include <iostream>
+#include <string>
 
 namespace TRTCond
 {
@@ -63,8 +64,8 @@ namespace TRTCond
     size_t level() const { return m_level ; }
     
     /** returns level name */
-    static const char* name(size_t l) { 
-      static const char* names[] = {"detector","barrelec","layer_or_wheel","module","straw_layer","straw"} ;
+    const std::string name(size_t l) const { 
+      static const std::string names[] = {"detector","barrelec","layer_or_wheel","module","straw_layer","straw"} ;
       return names[l] ;
     }
     
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/HWMap.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/HWMap.h
index e35a7ceb070..b53778d1b15 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/HWMap.h
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/HWMap.h
@@ -26,12 +26,12 @@ namespace TRTCond{
 
   virtual ~HWMap() {}
 
-  std::vector<std::string>* get_Barrel_HV_Names() const {return m_Barrel_HV_CoolChanNames; } 
-  std::vector<std::string>* get_EndcapA_HV_Names() const {return m_EndcapA_HV_CoolChanNames; } 
-  std::vector<std::string>* get_EndcapC_HV_Names() const {return m_EndcapC_HV_CoolChanNames; } 
-  std::vector<int>* get_Barrel_HV_Nums() const {return m_Barrel_HV_CoolChanNums; }
-  std::vector<int>* get_EndcapA_HV_Nums() const {return m_EndcapA_HV_CoolChanNums; }
-  std::vector<int>* get_EndcapC_HV_Nums() const {return m_EndcapC_HV_CoolChanNums; }
+  const std::vector<std::string>* get_Barrel_HV_Names() const {return m_Barrel_HV_CoolChanNames; } 
+  const std::vector<std::string>* get_EndcapA_HV_Names() const {return m_EndcapA_HV_CoolChanNames; } 
+  const std::vector<std::string>* get_EndcapC_HV_Names() const {return m_EndcapC_HV_CoolChanNames; } 
+  const std::vector<int>* get_Barrel_HV_Nums() const {return m_Barrel_HV_CoolChanNums; }
+  const std::vector<int>* get_EndcapA_HV_Nums() const {return m_EndcapA_HV_CoolChanNums; }
+  const std::vector<int>* get_EndcapC_HV_Nums() const {return m_EndcapC_HV_CoolChanNums; }
  
   void setBarrelName(int i, const std::string & name) {
     m_Barrel_HV_CoolChanNames->at(i)=name;
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/NestedContainer.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/NestedContainer.h
index 559102e2016..cdca38a253d 100755
--- a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/NestedContainer.h
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/NestedContainer.h
@@ -333,7 +333,8 @@ namespace TRTCond
     }
     void print() const {
       printindent() ;
-      std::cout << "level = " << ExpandedIdentifier::name(NestingLevel) << " (" << NestingLevel << ")"  << std::endl ;
+      ExpandedIdentifier id;
+      std::cout << "level = " << id.name(NestingLevel) << " (" << NestingLevel << ")"  << std::endl ;
       for(unsigned int i=0; i< m_daughters.size(); ++i) {
 	printindent() ;
 	std::cout << "daughter " << i << std::endl ;
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..4301ca91b98
--- /dev/null
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetDigitization/FastSiDigitization
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h
index d96b8a98dc7..63214264860 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h
@@ -122,8 +122,6 @@ private:
   bool                                  m_pixEmulateSurfaceCharge;  //!< emulate the surface charge
   double                                m_pixSmearPathLength;       //!< the 2. model parameter: smear the path
   bool                                  m_pixSmearLandau;           //!< if true : landau else: gauss
-  mutable int                           m_siDeltaPhiCut;
-  mutable int                           m_siDeltaEtaCut;
   double                                m_pixMinimalPathCut;        //!< the 1. model parameter: minimal 3D path in pixel
   double                                m_pixPathLengthTotConv;     //!< from path length to tot
   bool                                  m_pixModuleDistortion;       //!< simulationn of module bowing
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h
index de8b59c63c5..995d8006de5 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h
@@ -127,8 +127,8 @@ public:
   CLHEP::HepRandomEngine*           m_randomEngine;
   std::string                m_randomEngineName;         //!< Name of the random number stream
 
-  mutable float m_pitch_X;
-  mutable float m_pitch_Y;
+  float m_pitch_X;
+  float m_pitch_Y;
 
   bool m_merge;
   double m_nSigma;
@@ -215,7 +215,7 @@ public:
   double           m_Err_y_SCT;
 
   ServiceHandle<Trk::ITrackingGeometrySvc>     m_trackingGeometrySvc;        //!< Service handle for retrieving the TrackingGeometry
-  mutable const Trk::TrackingGeometry*              m_trackingGeometry;           //!< The TrackingGeometry to be retrieved
+  const Trk::TrackingGeometry*              m_trackingGeometry;           //!< The TrackingGeometry to be retrieved
   std::string                                  m_trackingGeometryName;       //!< The Name of the TrackingGeometry
 
   bool m_useCustomGeometry;
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx
index 972379c352b..108651dbdb1 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx
@@ -93,8 +93,6 @@ PixelFastDigitizationTool::PixelFastDigitizationTool(const std::string &type, co
   m_pixEmulateSurfaceCharge(true),
   m_pixSmearPathLength(0.01),
   m_pixSmearLandau(true),
-  m_siDeltaPhiCut(0),
-  m_siDeltaEtaCut(0),
   m_pixMinimalPathCut(0.06),// Optimized choice of threshold (old 0.02)
   m_pixPathLengthTotConv(125.),
   m_pixModuleDistortion(true), // default: false
diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx
index c2de5e19527..703d09ab7ac 100644
--- a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx
+++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx
@@ -1448,9 +1448,9 @@ StatusCode SiSmearedDigitizationTool::digitize(const EventContext& ctx)
 
         if (!m_useCustomGeometry) {
           // Pixel Design needed -------------------------------------------------------------
-          InDetDD::SCT_ModuleSideDesign* design_sct;
+          const InDetDD::SCT_ModuleSideDesign* design_sct;
 
-          design_sct = (InDetDD::SCT_ModuleSideDesign*)&hitSiDetElement->design();
+          design_sct = dynamic_cast<const InDetDD::SCT_ModuleSideDesign*>(&hitSiDetElement->design());
 
           if (!design_sct) {
             ATH_MSG_INFO ( "Could not get design"<< design_sct) ;
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/TRTMonitoringRun3/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/TRTMonitoringRun3/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 00000000000..7f595a2ceff
--- /dev/null
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/TRTMonitoringRun3/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+InnerDetector/InDetMonitoring/TRTMonitoringRun3
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx
index efb53011b17..fa2b8a9121f 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TRTMonitoringRun3/TRTMonitoringRun3ESD_Alg.h"
@@ -1115,7 +1115,6 @@ for (; p_trk != trackCollection.end(); ++p_trk) {
 }
 
 
-int maxtimestamp = 0.;
 //----------------------------------------------------------------------------------//
 StatusCode TRTMonitoringRun3ESD_Alg::fillTRTHighThreshold(const xAOD::TrackParticleContainer& trackCollection,
                                                      const xAOD::EventInfo& eventInfo) const {
@@ -1131,12 +1130,6 @@ StatusCode TRTMonitoringRun3ESD_Alg::fillTRTHighThreshold(const xAOD::TrackParti
     const Trk::Perigee *perigee = NULL;
     const DataVector<const Trk::TrackParameters> *AllTrkPar(0);
     DataVector<const Trk::TrackParameters>::const_iterator p_trkpariter;
-    int timeStamp;
-    timeStamp = eventInfo.timeStamp();
-
-    if (timeStamp > maxtimestamp) {
-        maxtimestamp = timeStamp;
-    }
 
     int runNumber;
     runNumber = eventInfo.runNumber();
-- 
GitLab