Skip to content
Snippets Groups Projects
Commit 5582a6bf authored by Nicolas Köhler's avatar Nicolas Köhler
Browse files

fix some thread-safety warnings

parent ac6c952e
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
namespace MuonGM { namespace MuonGM {
class ATLAS_NOT_THREAD_SAFE DetectorElement { class DetectorElement {
public: public:
std::string name; std::string name;
std::string logVolName; std::string logVolName;
...@@ -37,7 +37,7 @@ namespace MuonGM { ...@@ -37,7 +37,7 @@ namespace MuonGM {
log << MSG::INFO << "generic detector element" << endmsg; log << MSG::INFO << "generic detector element" << endmsg;
} }
virtual ~DetectorElement() {} virtual ~DetectorElement()=default;
// Static // Static
...@@ -49,7 +49,7 @@ namespace MuonGM { ...@@ -49,7 +49,7 @@ namespace MuonGM {
s_matManager = &matMan; s_matManager = &matMan;
} }
static const AbsMaterialManager * getMaterialManager() { const AbsMaterialManager * getMaterialManager() const {
return s_matManager; return s_matManager;
} }
......
...@@ -34,7 +34,10 @@ public: ...@@ -34,7 +34,10 @@ public:
// Creates the raw geometry tree: required, // Creates the raw geometry tree: required,
virtual void create (GeoPhysVol* world); 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; virtual MuonDetectorManager* getDetectorManager() const;
inline void setDBAtlasVersion(std::string v); inline void setDBAtlasVersion(std::string v);
......
...@@ -199,49 +199,43 @@ namespace MuonGM { ...@@ -199,49 +199,43 @@ namespace MuonGM {
StatusCode sc = StatusCode::SUCCESS; StatusCode sc = StatusCode::SUCCESS;
const DataHandle<MdtIdHelper> mdtidh; const MdtIdHelper* mdtidh=nullptr;
sc = m_pDetStore->retrieve(mdtidh,"MDTIDHELPER"); sc = m_pDetStore->retrieve(mdtidh,"MDTIDHELPER");
if ( sc.isFailure()) log << MSG::ERROR << " not found MDT " << endmsg; if ( sc.isFailure()) log << MSG::ERROR << " not found MDT " << endmsg;
else log << MSG::INFO << "MDTIDHELPER retrieved from DetStore" << endmsg; else log << MSG::INFO << "MDTIDHELPER retrieved from DetStore" << endmsg;
m_manager->set_mdtIdHelper(mdtidh); m_manager->set_mdtIdHelper(mdtidh);
const DataHandle<RpcIdHelper> rpcidh;
const RpcIdHelper* rpcidh=nullptr;
sc = m_pDetStore->retrieve(rpcidh,"RPCIDHELPER"); sc = m_pDetStore->retrieve(rpcidh,"RPCIDHELPER");
if ( sc.isFailure() ) log << MSG::ERROR << " not found RPC " << endmsg; if ( sc.isFailure() ) log << MSG::ERROR << " not found RPC " << endmsg;
else log << MSG::INFO << "RPCIDHELPER retrieved from DetStore" << endmsg; else log << MSG::INFO << "RPCIDHELPER retrieved from DetStore" << endmsg;
m_manager->set_rpcIdHelper(rpcidh); m_manager->set_rpcIdHelper(rpcidh);
const DataHandle<TgcIdHelper> tgcidh;
const TgcIdHelper* tgcidh=nullptr;
sc = m_pDetStore->retrieve(tgcidh,"TGCIDHELPER"); sc = m_pDetStore->retrieve(tgcidh,"TGCIDHELPER");
if ( sc.isFailure() ) log << MSG::ERROR << " not found TGC " << endmsg; if ( sc.isFailure() ) log << MSG::ERROR << " not found TGC " << endmsg;
else log << MSG::INFO << "TGCIDHELPER retrieved from DetStore" << endmsg; else log << MSG::INFO << "TGCIDHELPER retrieved from DetStore" << endmsg;
m_manager->set_tgcIdHelper(tgcidh); m_manager->set_tgcIdHelper(tgcidh);
if (m_hasCSC) { if (m_hasCSC) {
const DataHandle<CscIdHelper> cscidh; const CscIdHelper* cscidh=nullptr;
sc = m_pDetStore->retrieve(cscidh,"CSCIDHELPER"); sc = m_pDetStore->retrieve(cscidh,"CSCIDHELPER");
if ( sc.isFailure() ) log << MSG::ERROR << " not found CSC " << endmsg; if ( sc.isFailure() ) log << MSG::ERROR << " not found CSC " << endmsg;
else log << MSG::INFO << "CSCIDHELPER retrieved from DetStore" << endmsg; else log << MSG::INFO << "CSCIDHELPER retrieved from DetStore" << endmsg;
m_manager->set_cscIdHelper(cscidh); m_manager->set_cscIdHelper(cscidh);
} }
if (m_hasSTgc) { if (m_hasSTgc) {
const DataHandle<sTgcIdHelper> stgcidh; const sTgcIdHelper* stgcidh=nullptr;
sc = m_pDetStore->retrieve(stgcidh,"STGCIDHELPER"); sc = m_pDetStore->retrieve(stgcidh,"STGCIDHELPER");
if ( sc.isFailure() ) log << MSG::ERROR << " not found sTGC " << endmsg; if ( sc.isFailure() ) log << MSG::ERROR << " not found sTGC " << endmsg;
else log << MSG::INFO << "STGCIDHELPER retrieved from DetStore" << endmsg; else log << MSG::INFO << "STGCIDHELPER retrieved from DetStore" << endmsg;
m_manager->set_stgcIdHelper(stgcidh); m_manager->set_stgcIdHelper(stgcidh);
} }
if (m_hasMM) { if (m_hasMM) {
const DataHandle<MmIdHelper> mmidh; const MmIdHelper* mmidh=nullptr;
sc = m_pDetStore->retrieve(mmidh,"MMIDHELPER"); sc = m_pDetStore->retrieve(mmidh,"MMIDHELPER");
if ( sc.isFailure() ) log << MSG::ERROR << " not found MicroMegas " << endmsg; if ( sc.isFailure() ) log << MSG::ERROR << " not found MicroMegas " << endmsg;
else log << MSG::INFO << "MMIDHELPER retrieved from DetStore" << endmsg; else log << MSG::INFO << "MMIDHELPER retrieved from DetStore" << endmsg;
m_manager->set_mmIdHelper(mmidh); 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