diff --git a/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.cxx index 5231f616defc0c27387d47e7b6a63a3dd3dbe2d8..36724f80a97030c80f3fca6e18c9ab94dbb2e392 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.cxx @@ -26,14 +26,10 @@ using namespace MuonCombined; MuonTrackTagTestTool::MuonTrackTagTestTool(const std::string &type, const std::string &name, const IInterface *parent) - : AthAlgTool(type, name, parent), - m_extrapolator("Trk::Extrapolator/AtlasExtrapolator", this), - m_trackingGeometrySvc("AtlasTrackingGeometrySvc", name) + : AthAlgTool(type, name, parent), m_trackingGeometrySvc("AtlasTrackingGeometrySvc", name) { - declareInterface<IMuonTrackTagTool>(this); declareProperty("Chi2Cut", m_chi2cut = 50.); - declareProperty("ExtrapolatorTool", m_extrapolator); declareProperty("TrackingGeometrySvc", m_trackingGeometrySvc); #ifdef MUONCOMBDEBUG declareProperty("Truth", m_truth = false); @@ -46,18 +42,10 @@ MuonTrackTagTestTool::MuonTrackTagTestTool(const std::string &type, const std::s StatusCode MuonTrackTagTestTool::initialize() { - StatusCode sc = m_extrapolator.retrieve(); - if (sc == StatusCode::FAILURE) { - msg(MSG::FATAL) << "Could not retrieve extrapolator tool" << endmsg; - return sc; - } + ATH_CHECK(m_extrapolator.retrieve()); if (!m_trackingGeometrySvc.empty()) { - sc = m_trackingGeometrySvc.retrieve(); - if (sc.isFailure()) { - msg(MSG::ERROR) << " failed to retrieve geometry Svc " << m_trackingGeometrySvc << endmsg; - return StatusCode::FAILURE; - } + ATH_CHECK(m_trackingGeometrySvc.retrieve()); msg(MSG::INFO) << " geometry Svc " << m_trackingGeometrySvc << " retrieved " << endmsg; } diff --git a/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.h b/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.h index 1dedcb58e04ba5c32245dd831c5b3d52b27d513e..c80d624db14473f20824d5c1f9adc3ae0c65f7db 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.h +++ b/Reconstruction/MuonIdentification/MuonCombinedTestTools/src/MuonTrackTagTestTool.h @@ -37,7 +37,11 @@ class MuonTrackTagTestTool : public AthAlgTool, virtual public IMuonTrackTagTool double chi2(const Trk::Track& id, const Trk::Track& ms) const; private: - ToolHandle<Trk::IExtrapolator> m_extrapolator; + ToolHandle<Trk::IExtrapolator> m_extrapolator{ + this, + "ExtrapolatorTool", + "Trk::Extrapolator/AtlasExtrapolator", + }; mutable ServiceHandle<Trk::ITrackingGeometrySvc> m_trackingGeometrySvc ATLAS_THREAD_SAFE; // Services are assumed to be thread-safe mutable const Trk::TrackingGeometry* m_trackingGeometry