diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx b/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx index 3ff6dda14fb4f41948731ae12ac7f7ab921c997a..b3cf0d1c90ca13adde4b755b0e57965ceba42d36 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx @@ -31,8 +31,6 @@ /** Constructor */ DetDescrDBEnvelopeSvc::DetDescrDBEnvelopeSvc(const std::string& name, ISvcLocator* svc) : base_class(name,svc), - m_dbAccess(0), - m_geoModel(0), m_atlasNode("ATLAS"), m_atlasVersionTag("AUTO"), m_node(), @@ -96,14 +94,13 @@ StatusCode DetDescrDBEnvelopeSvc::initialize() ATH_MSG_INFO("Initializing ..."); // retrieve DataBase access service - ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap - if ( svcLocator->service("RDBAccessSvc", m_dbAccess).isFailure()) { + if ( m_dbAccess.retrieve().isFailure()) { ATH_MSG_ERROR("Could not locate RDBAccessSvc"); if ( !enableFallback()) return StatusCode::FAILURE; } // retrieve the GeoModelSvc - if ( !m_doFallback && svcLocator->service("GeoModelSvc", m_geoModel).isFailure()) { + if ( !m_doFallback && (m_geoModelSvc.retrieve().isFailure()) ) { ATH_MSG_ERROR("Could not locate GeoModelSvc"); if ( !enableFallback()) return StatusCode::FAILURE; } @@ -112,7 +109,7 @@ StatusCode DetDescrDBEnvelopeSvc::initialize() // (#) use the DB to retrieve the RZ values if ( !m_doFallback) { // geo model tag - m_atlasVersionTag = m_geoModel->atlasVersion(); + m_atlasVersionTag = m_geoModelSvc->atlasVersion(); if( m_atlasVersionTag == "AUTO") m_atlasVersionTag = "ATLAS-00"; // cache the volume definitions locally diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.h b/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.h index 8138e238d1fae0ab26210e0715e73d8d0cd10879..83545e9ca1c7040fde72e5fe3eb80b558aac6302 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.h +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.h @@ -19,9 +19,12 @@ // interface header file #include "SubDetectorEnvelopes/IEnvelopeDefSvc.h" -// forward declarations -class IRDBAccessSvc; -class IGeoModelSvc; +// Database includes +#include "RDBAccessSvc/IRDBAccessSvc.h" + +// GeoModel +#include "GeoModelInterfaces/IGeoModelSvc.h" + /** datatype used for fallback solution */ typedef std::vector< double > FallbackDoubleVector; @@ -71,10 +74,10 @@ class DetDescrDBEnvelopeSvc : public extends<AthService, IEnvelopeDefSvc> { bool enableFallback(); /** the DetectorDescription database access method */ - IRDBAccessSvc *m_dbAccess; + ServiceHandle<IRDBAccessSvc> m_dbAccess{this, "RDBAccessSvc", "RDBAccessSvc"}; /** ATLAS GeoModel */ - IGeoModelSvc *m_geoModel; + ServiceHandle<IGeoModelSvc> m_geoModelSvc{this, "GeoModelSvc", "GeoModelSvc"}; /** main DDDB node for the ATLAS detector */ std::string m_atlasNode;