Skip to content
Snippets Groups Projects
Commit 9cc0a631 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'MuonGeoModel' into 'master'

Fix some thread-safety warnings in MuonGeoModel

Closes ATLASRECTS-5255

See merge request atlas/athena!35098
parents d6478f40 5582a6bf
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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);
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment