diff --git a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx index 5f92e52f4dddd1caff106b61085949755a3245f4..ec1dde08a28333ed7594fc215c03ee8a7a78d0f4 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.cxx @@ -9,22 +9,14 @@ #include "MuonCombinedTimingTool.h" #include "TrkSpaceTimePoint/SpaceTimePoint.h" -#include "TrkToolInterfaces/ITrackTimingTool.h" + //================ Constructor ================================================= Rec::MuonCombinedTimingTool::MuonCombinedTimingTool(const std::string& t, const std::string& n, const IInterface* p) - : AthAlgTool(t, n, p), - m_trtTimingTool("InDet::TRT_TrackTimingTool/TRT_TrackTimingTool"), - m_caloTimingTool("Rec::TrackInCaloTimingTool/TrackInCaloTimingTool"), - m_mdtSegmentTimingTool("Muon::SegmentTimingTool/SegmentTimingTool"), - m_rpcTimingTool("") + : AthAlgTool(t, n, p) { declareInterface<IMuonCombinedTimingTool>(this); - declareProperty("InDetTimingTool", m_trtTimingTool); - declareProperty("CaloTimingTool", m_caloTimingTool); - declareProperty("MDT_TimingTool", m_mdtSegmentTimingTool); - declareProperty("RPC_TimingTool", m_rpcTimingTool); } //================ Destructor ================================================= @@ -42,32 +34,20 @@ Rec::MuonCombinedTimingTool::initialize() if (sc.isFailure()) return sc; if (!m_trtTimingTool.empty()) { - if (m_trtTimingTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Could not retrieve " << m_trtTimingTool.name()); - return StatusCode::FAILURE; - } else - ATH_MSG_DEBUG("Retrieved " << m_trtTimingTool.name()); + ATH_CHECK(m_trtTimingTool.retrieve()); + ATH_MSG_DEBUG("Retrieved " << m_trtTimingTool.name()); } if (!m_caloTimingTool.empty()) { - if (m_caloTimingTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Could not retrieve " << m_caloTimingTool.name()); - return StatusCode::FAILURE; - } else - ATH_MSG_DEBUG("Retrieved " << m_caloTimingTool.name()); + ATH_CHECK(m_caloTimingTool.retrieve()); + ATH_MSG_DEBUG("Retrieved " << m_caloTimingTool.name()); } if (!m_mdtSegmentTimingTool.empty()) { - if (m_mdtSegmentTimingTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Could not retrieve " << m_mdtSegmentTimingTool.name()); - return StatusCode::FAILURE; - } else - ATH_MSG_DEBUG("Retrieved " << m_mdtSegmentTimingTool.name()); + ATH_CHECK(m_mdtSegmentTimingTool.retrieve()); + ATH_MSG_DEBUG("Retrieved " << m_mdtSegmentTimingTool.name()); } if (!m_rpcTimingTool.empty()) { - if (m_rpcTimingTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Could not retrieve " << m_rpcTimingTool.name()); - return StatusCode::FAILURE; - } else - ATH_MSG_DEBUG("Retrieved " << m_rpcTimingTool.name()); + ATH_CHECK(m_rpcTimingTool.retrieve()); + ATH_MSG_DEBUG("Retrieved " << m_rpcTimingTool.name()); } /* diff --git a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h index fdddfa1860d9732f6c385e3c3de6e87ab54d7565..7ed265021db3d76450064a87a847a3ba2b7b9468 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h +++ b/Reconstruction/MuonIdentification/MuonCombinedTimingTools/src/MuonCombinedTimingTool.h @@ -13,6 +13,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonCombinedToolInterfaces/IMuonCombinedTimingTool.h" #include "TrkSegment/SegmentCollection.h" +#include "TrkToolInterfaces/ITrackTimingTool.h" #include "xAODMuon/Muon.h" namespace Trk { @@ -48,13 +49,29 @@ class MuonCombinedTimingTool : virtual public IMuonCombinedTimingTool, public At private: //! time calculation in subdetector responsibility: inner detector - ToolHandle<Trk::ITrackTimingTool> m_trtTimingTool; + ToolHandle<Trk::ITrackTimingTool> m_trtTimingTool{ + this, + "InDetTimingTool", + "InDet::TRT_TrackTimingTool/TRT_TrackTimingTool", + }; //! time calculation in subdetector responsibility: calorimeter - ToolHandle<Trk::ITrackTimingTool> m_caloTimingTool; + ToolHandle<Trk::ITrackTimingTool> m_caloTimingTool{ + this, + "CaloTimingTool", + "Rec::TrackInCaloTimingTool/TrackInCaloTimingTool", + }; //! time calculation in subdetector responsibility: muon spectrometer (T0 fit) for MDT and CSC - ToolHandle<Trk::ITrackTimingTool> m_mdtSegmentTimingTool; + ToolHandle<Trk::ITrackTimingTool> m_mdtSegmentTimingTool{ + this, + "MDT_TimingTool", + "Muon::SegmentTimingTool/SegmentTimingTool", + }; //! time calculation in subdetector responsibility: muon spectrometer (RPC timing) - ToolHandle<Trk::ITrackTimingTool> m_rpcTimingTool; + ToolHandle<Trk::ITrackTimingTool> m_rpcTimingTool{ + this, + "RPC_TimingTool", + "", + }; virtual const Trk::SegmentCollection* getSegmentContainer(const xAOD::Muon& muon) const; };