diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DetectorElement.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DetectorElement.h index dfd677390fc1071260ede0e94e298bdf2babad9a..0b0ad8ad9cb8ad059f6991f47b0558831e59d8f1 100755 --- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DetectorElement.h +++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DetectorElement.h @@ -17,7 +17,7 @@ namespace MuonGM { - class ATLAS_NOT_THREAD_SAFE DetectorElement { + class DetectorElement { public: std::string name; std::string logVolName; @@ -37,7 +37,7 @@ namespace MuonGM { log << MSG::INFO << "generic detector element" << endmsg; } - virtual ~DetectorElement() {} + virtual ~DetectorElement()=default; // Static @@ -49,7 +49,7 @@ namespace MuonGM { s_matManager = &matMan; } - static const AbsMaterialManager * getMaterialManager() { + const AbsMaterialManager * getMaterialManager() const { return s_matManager; } diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h index 42c9d5169443a7fc4fd5b776240e19de42ddedb7..cbe058fd86000a982f957626148801e6c2f32de2 100755 --- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h +++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonDetectorFactory001.h @@ -34,7 +34,10 @@ public: // Creates the raw geometry tree: required, virtual void create (GeoPhysVol* world); - // Get the manager. + // this function is inherited from GeoVDetectorFactory where it is declared const. + // However, the MuonDetectorManager cannot be const since it holds the pointers to the readout elements, + // and those can change with alignment. Thus, this const method will create a thread-safety warning since + // the returned object is *not* const virtual MuonDetectorManager* getDetectorManager() const; inline void setDBAtlasVersion(std::string v); diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx index 12b0f35fea8810373e486026ab8e88c2dbbf3fb7..779ee8afbe08980b7b5edba4ef2865f1646b3d34 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx @@ -199,49 +199,43 @@ namespace MuonGM { StatusCode sc = StatusCode::SUCCESS; - const DataHandle<MdtIdHelper> mdtidh; + const MdtIdHelper* mdtidh=nullptr; sc = m_pDetStore->retrieve(mdtidh,"MDTIDHELPER"); if ( sc.isFailure()) log << MSG::ERROR << " not found MDT " << endmsg; else log << MSG::INFO << "MDTIDHELPER retrieved from DetStore" << endmsg; - m_manager->set_mdtIdHelper(mdtidh); - const DataHandle<RpcIdHelper> rpcidh; + + const RpcIdHelper* rpcidh=nullptr; sc = m_pDetStore->retrieve(rpcidh,"RPCIDHELPER"); if ( sc.isFailure() ) log << MSG::ERROR << " not found RPC " << endmsg; else log << MSG::INFO << "RPCIDHELPER retrieved from DetStore" << endmsg; - m_manager->set_rpcIdHelper(rpcidh); - const DataHandle<TgcIdHelper> tgcidh; + + const TgcIdHelper* tgcidh=nullptr; sc = m_pDetStore->retrieve(tgcidh,"TGCIDHELPER"); if ( sc.isFailure() ) log << MSG::ERROR << " not found TGC " << endmsg; else log << MSG::INFO << "TGCIDHELPER retrieved from DetStore" << endmsg; - m_manager->set_tgcIdHelper(tgcidh); + if (m_hasCSC) { - const DataHandle<CscIdHelper> cscidh; + const CscIdHelper* cscidh=nullptr; sc = m_pDetStore->retrieve(cscidh,"CSCIDHELPER"); - if ( sc.isFailure() ) log << MSG::ERROR << " not found CSC " << endmsg; else log << MSG::INFO << "CSCIDHELPER retrieved from DetStore" << endmsg; - m_manager->set_cscIdHelper(cscidh); } if (m_hasSTgc) { - const DataHandle<sTgcIdHelper> stgcidh; + const sTgcIdHelper* stgcidh=nullptr; sc = m_pDetStore->retrieve(stgcidh,"STGCIDHELPER"); - if ( sc.isFailure() ) log << MSG::ERROR << " not found sTGC " << endmsg; else log << MSG::INFO << "STGCIDHELPER retrieved from DetStore" << endmsg; - m_manager->set_stgcIdHelper(stgcidh); } if (m_hasMM) { - const DataHandle<MmIdHelper> mmidh; + const MmIdHelper* mmidh=nullptr; sc = m_pDetStore->retrieve(mmidh,"MMIDHELPER"); - if ( sc.isFailure() ) log << MSG::ERROR << " not found MicroMegas " << endmsg; else log << MSG::INFO << "MMIDHELPER retrieved from DetStore" << endmsg; - m_manager->set_mmIdHelper(mmidh); }