Commit a89ab5eb authored by Susumu Oda's avatar Susumu Oda Committed by Frank Winklmeier
Browse files

Remove ATLAS_NO_CHECK_FILE_THREAD_SAFETY from SiHitIdHelper.h/cxx and...

Remove ATLAS_NO_CHECK_FILE_THREAD_SAFETY from SiHitIdHelper.h/cxx and TRTHitIdHelper.h/.cxx. Add const to static Si/TRTHitIdHelper helper. Add const to return type of Si/TRTHelper::GetHelper.
parent 13e227a5
/*
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());
......
/*
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;
......
/*
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
......
/*
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
......
/*
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() {
......
/*
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;
}
......
/*
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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment