From d9acc9ce9dba13fb144c4bcbf3a6387d930ec27a Mon Sep 17 00:00:00 2001 From: scott snyder <scott.snyder@cern.ch> Date: Wed, 28 Nov 2018 16:26:39 +0100 Subject: [PATCH] MuonGeoModel: Avoid use of non-bound DataHandle. Deprecating use of non-bound DataHandle, especially non-const. Also adding const for materials. Former-commit-id: 44a9502c386603d0229814565ab0b4c8a77c8dc6 --- .../MuonGeoModel/MuonGeoModel/DBReader.h | 59 +------------------ .../MuonGeoModel/RDBReaderAtlas.h | 3 +- .../src/MuonDetectorFactory001.cxx | 14 ++--- .../MuonGeoModel/src/MuonDetectorTool.cxx | 11 +--- 4 files changed, 11 insertions(+), 76 deletions(-) diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h index ce8564808f3..67d960ac1f4 100755 --- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h +++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -537,63 +537,6 @@ namespace MuonGM { } } -// static void ProcessCSC(const DataHandle<CtbhgeotbWcsc> dhwcsc, const CtbhgeotbWcsc::WCSC * wcsc, -// std::string s) -// { -// MsgStream log(Athena::getMessageSvc(), "MuGM:ProcessCSC"); -// Technology* t=NULL; -// t = MYSQL::GetPointer()->GetTechnology(s); -// if ( t != NULL ) return; - - -// CSC *csc=new CSC(s); -// ncsc++; -// std::cerr << " TECH. A new CSC named " <<s<<" ncsc = "<<ncsc<<std::endl; -// if (ncsc >1) -// { -// log<<MSG::FATAL<<" More than 1 CSC technology in the TB layout ? EXIT"; -// return; -// } - -// csc->numOfLayers=wcsc->laycsc; -// csc->totalThickness=wcsc->ttotal*CLHEP::cm; -// csc->thickness=csc->totalThickness; -// csc->honeycombthick=wcsc->tnomex*CLHEP::cm; -// csc->g10thick=wcsc->tlag10*CLHEP::cm; //csc->g10thick=0.0820*CLHEP::cm; - -// // wire spacing -// csc->wirespacing =wcsc->wispa*CLHEP::cm; -// // anode-cathode distance -// csc->anocathodist=wcsc->dancat*CLHEP::cm; -// // gapbetwcathstrips -// csc->gapbetwcathstrips=wcsc->gstrip*CLHEP::cm; - -// // precision (Radial) strip pitch -// csc->cathreadoutpitch=wcsc->pcatr*CLHEP::cm; // it was not used before but set by hand in CscReadoutEl. -// // Azimuthal strip pitch -// csc->phireadoutpitch =wcsc->pcata*CLHEP::cm; -// // number of strips -// csc->nEtastrips = 192; -// csc->nPhistrips = 48; - -// // precision (Radial) strip width -// csc->readoutstripswidth = wcsc->wrestr*CLHEP::cm; -// // Azimuthal strip width -// csc->phistripwidth = wcsc->wflstr*CLHEP::cm; // CTB and layout Q interpretation -// // -// // dead materials -// csc->rectwasherthick=wcsc->trrwas*CLHEP::cm; -// csc->roxacellwith = 54.96*CLHEP::mm; // CTB and layout Q: must be computed - -// csc->roxwirebargap=wcsc->groxwi*CLHEP::cm; -// csc->fullgasgapwirewidth=wcsc->wgasba*CLHEP::cm; -// csc->fullwirefixbarwidth=wcsc->wfixwi*CLHEP::cm; -// csc->wirebarposx=wcsc->pba1wi*CLHEP::cm; -// csc->wirebarposy=wcsc->pba2wi*CLHEP::cm; -// csc->wirebarposz=wcsc->pba3wi*CLHEP::cm; - -// } - template <class TYPEdhwspa, class TYPEwspa> static void ProcessSPA(const TYPEdhwspa dhwspa, const TYPEwspa * wspa, std::string s) diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h index 985a9a813cc..4ba2f191e5d 100755 --- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h +++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef RDBReaderAtlas_H @@ -11,7 +11,6 @@ #include <vector> #include "MuonGeoModel/DBReader.h" -#include "StoreGate/DataHandle.h" #include "MuonGMdbObjects/DblQ00IAcsc.h" #include "MuonGMdbObjects/DblQ00Xtomo.h" diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx index 539f81744e9..eef65f7fbcb 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorFactory001.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -195,35 +195,35 @@ namespace MuonGM { // if (m_idhfromconverters != 0) // { - 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); - 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); //for nSW - 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); - 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; diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx index b5b0fc81171..d071df39ecb 100755 --- a/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx +++ b/MuonSpectrometer/MuonGeoModel/src/MuonDetectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "MuonGeoModel/MuonDetectorTool.h" @@ -237,7 +237,7 @@ MuonDetectorTool::create() // // Locate the top level experiment node // - DataHandle<GeoModelExperiment> theExpt; + GeoModelExperiment* theExpt = nullptr; ATH_CHECK( detStore()->retrieve( theExpt, "ATLAS" ) ); if (!m_useCscIntAlines) m_controlCscIntAlines = 0; @@ -281,12 +281,6 @@ MuonDetectorTool::create() } } - // - // Locate the material manager: - // - DataHandle<StoredMaterialManager> theMaterialManager; - ATH_CHECK( detStore()->retrieve(theMaterialManager, "MATERIALS") ); - if (m_dumpMemoryBreakDown) { umem = GeoPerfUtils::getMem(); @@ -340,7 +334,6 @@ MuonDetectorTool::create() // GeoPhysVol *world=&*theExpt->getPhysVol(); theFactory.create(world); - // ATH_MSG_INFO("CREATING MuonDetectorNode; MM=" << &*theMaterialManager ); } catch (const std::bad_alloc&) { ATH_MSG_FATAL("Could not create new MuonDetectorNode!" ); return StatusCode::FAILURE; -- GitLab