diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigCondBase.cxx b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigCondBase.cxx index fd2809d1307b8d9cc79c41c9d40d3b09dffdfac5..cea5fd2dc4037152d0f901751274edeefa027bf4 100644 --- a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigCondBase.cxx +++ b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigCondBase.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 "TRTDigCondBase.h" @@ -69,7 +69,7 @@ void TRTDigCondBase::initialize(CLHEP::HepRandomEngine* rndmEngine) { ATH_MSG_INFO ( "TRTDigCondBase::initialize()" ); //id helpers: - TRTHitIdHelper *hitid_helper(TRTHitIdHelper::GetHelper()); + const TRTHitIdHelper *hitid_helper(TRTHitIdHelper::GetHelper()); //We loop through all of the detector elements registered in the manager InDetDD::TRT_DetElementCollection::const_iterator it(m_detmgr->getDetectorElementBegin()); diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTNoise.cxx b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTNoise.cxx index 79f118a697ef2db283222119840bb3cce2342e03..1d26891dac31e50abfaada82cdbd27ae9dd49b09 100644 --- a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTNoise.cxx +++ b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTNoise.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 "TRTNoise.h" @@ -376,7 +376,7 @@ void TRTNoise::appendCrossTalkNoiseToProperDigits(std::vector<TRTDigit>& digitVe CLHEP::HepRandomEngine* noiseRndmEngine) { //id helper: - TRTHitIdHelper* hitid_helper = TRTHitIdHelper::GetHelper(); + const TRTHitIdHelper* hitid_helper = TRTHitIdHelper::GetHelper(); std::vector<Identifier> IdsFromChip; std::vector<Identifier> CrossTalkIds; diff --git a/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h b/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h index 1e93a436c453cbe1f183679cbc2ab30c80283e24..54d086700800c33bf8b74aebb7a2144ad7f8cea5 100755 --- a/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h +++ b/InnerDetector/InDetSimEvent/InDetSimEvent/SiHitIdHelper.h @@ -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 */ #ifndef INDETSIMEVENT_SIHITIDHELPER @@ -21,15 +21,12 @@ // Base Class #include "HitManagement/HitIdHelper.h" -// This class is singleton and static method and variable are used. -#include "CxxUtils/checker_macros.h" -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; class SiHitIdHelper : HitIdHelper { public: // // Access to the helper - static SiHitIdHelper* GetHelper(); + static const SiHitIdHelper* GetHelper(); // // Info retrieval: // Pixel or SCT diff --git a/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h b/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h index 18f3c381c724a04a86e1fca1c310b2ca666bc997..5144eb3d99e5d3c853e5c56043b2094b77b9415f 100755 --- a/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h +++ b/InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h @@ -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 */ #ifndef INDETSIMEVENT_TRTHITIDHELPER @@ -21,16 +21,12 @@ // Base Class #include "HitManagement/HitIdHelper.h" -// This class is singleton and static method and variable are used. -#include "CxxUtils/checker_macros.h" -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - class TRTHitIdHelper : HitIdHelper { public: // // Access to the helper - static TRTHitIdHelper* GetHelper(); + static const TRTHitIdHelper* GetHelper(); // // Info retrieval: // Barrel or Endcap diff --git a/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx b/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx index 5836be31e74a97709956c225c990d96975b17aee..5add7978d975784aa443f0069615253d449afd0c 100755 --- a/InnerDetector/InDetSimEvent/src/SiHitIdHelper.cxx +++ b/InnerDetector/InDetSimEvent/src/SiHitIdHelper.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 <mutex> @@ -16,25 +16,22 @@ static std::mutex sgMutex; -// This class is singleton and static method and variable are used. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - // // private constructor SiHitIdHelper::SiHitIdHelper() :HitIdHelper() { Initialize(); } -SiHitIdHelper* SiHitIdHelper::GetHelper() { -#ifdef G4MULTITHREADED +const SiHitIdHelper* SiHitIdHelper::GetHelper ATLAS_NOT_THREAD_SAFE () { // static variable helperPtr is used. + #ifdef G4MULTITHREADED // Context-specific singleton - static Gaudi::Hive::ContextSpecificPtr<SiHitIdHelper> helperPtr; - if(!helperPtr) helperPtr = new SiHitIdHelper(); + static Gaudi::Hive::ContextSpecificPtr<const SiHitIdHelper> helperPtr; + if (!helperPtr) helperPtr = new SiHitIdHelper(); return helperPtr.get(); -#else - static SiHitIdHelper helper; + #else + static const SiHitIdHelper helper; return &helper; -#endif + #endif } void SiHitIdHelper::Initialize() { diff --git a/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx b/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx index 4926b00e3b72a5bd8085626411d801a585348edb..385ff95e3608cd6dfc624264a57b8708536145f6 100755 --- a/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx +++ b/InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx @@ -1,20 +1,17 @@ /* - 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 "InDetSimEvent/TRTHitIdHelper.h" -// This class is singleton and static method and variable are used. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - // // private constructor TRTHitIdHelper::TRTHitIdHelper() :HitIdHelper() { Initialize(); } -TRTHitIdHelper* TRTHitIdHelper::GetHelper() { - static TRTHitIdHelper helper; +const TRTHitIdHelper* TRTHitIdHelper::GetHelper() { + static const TRTHitIdHelper helper; return &helper; } diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/src/HitCreatorTRT.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/src/HitCreatorTRT.cxx index cee72e2a68fab875e108bac5370e316bd3d5d536..1e1ab847b0a72eb8f71d13b421b79646059c5e03 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/src/HitCreatorTRT.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/src/HitCreatorTRT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -210,7 +210,7 @@ void iFatras::HitCreatorTRT::createSimHit(const ISF::ISFParticle& isp, const Trk int layer = m_trtIdHelper->straw_layer(hitId); int istraw = m_trtIdHelper->straw(hitId); - TRTHitIdHelper* hitid_helper = TRTHitIdHelper::GetHelper(); + const TRTHitIdHelper* hitid_helper = TRTHitIdHelper::GetHelper(); int hitID = hitid_helper->buildHitId( barrel_endcap, ispos, ringwheel, phisector,layer,istraw); TRTUncompressedHit