diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.cxx index 9a8951b2dd719cc9d72f826c7136d44e23559786..c6d8553fd6c3772b689d6fd70a736d83e338c4d0 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.cxx @@ -16,13 +16,12 @@ typedef ICscStripFitter::ChargeList ChargeList; //********************************************************************** CalibCscStripFitter::CalibCscStripFitter(std::string type, std::string aname, const IInterface* parent) - : AthAlgTool(type, aname, parent), m_noiseOption(rms), m_cscCalibTool("CscCalibTool/CscCalibTool", this) + : AthAlgTool(type, aname, parent), m_noiseOption(rms) { declareInterface<ICscStripFitter>(this); declareProperty("timeError", m_terr = 5.0); declareProperty("failTimeError", m_terr_fail = 50.0); declareProperty("chargeCalibrationError", m_qerrprop = 0.000); - declareProperty("cscCalibTool", m_cscCalibTool); declareProperty("noiseOption", m_noiseOptionStr = "f001"); declareProperty("doCorrection", m_doCorrection = true); declareProperty("chargeErrorScaler", m_chargeErrorScaler = 1.0); @@ -57,10 +56,7 @@ CalibCscStripFitter::initialize() // ATH_MSG_DEBUG ( " (failed) Charge error is noise(DB)*1.03588 = 4300 " << m_errorScaler ); /** CSC calibratin tool for the Condtiions Data base access */ - if (m_cscCalibTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Can't get handle on CSC calibration tools"); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_cscCalibTool.retrieve()); // Retrieve the detector descriptor. ATH_CHECK(m_idHelperSvc.retrieve()); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.h index 0ecab23df312ee2bdbd81f2bd111988eace4e646..e6d8d43ba96cac3dfd6eb63edb045c9b519393af 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CalibCscStripFitter.h @@ -61,7 +61,11 @@ class CalibCscStripFitter : virtual public ICscStripFitter, public AthAlgTool { "Muon::MuonIdHelperSvc/MuonIdHelperSvc", }; - ToolHandle<ICscCalibTool> m_cscCalibTool; + ToolHandle<ICscCalibTool> m_cscCalibTool{ + this, + "cscCalibTool", + "CscCalibTool/CscCalibTool", + }; }; #endif diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx index 13f69995e5c4f180ca0de570d2754df182e02227..d8ce1fb2dc60e94bb1494cf7d69c483742fa1883 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.cxx @@ -31,7 +31,6 @@ CscBipolarStripFitter::CscBipolarStripFitter(string type, string aname, const II : AthAlgTool(type, aname, parent), m_pmuon_detmgr(0), m_phelper(0), - m_cscCalibTool(""), m_n(0), m_n2(0), m_zmax(0), @@ -47,7 +46,6 @@ CscBipolarStripFitter::CscBipolarStripFitter(string type, string aname, const II declareProperty("failChargeError", m_qerr_fail = 5000.0); declareProperty("failTimeError", m_terr_fail = 50.0); declareProperty("chargeCalibrationError", m_qerrprop = 0.002); - declareProperty("cscCalibTool", m_cscCalibTool); } //********************************************************************** @@ -70,18 +68,13 @@ CscBipolarStripFitter::initialize() ATH_MSG_DEBUG(" Charge calibration error: " << m_qerrprop); /** CSC calibratin tool for the Condtiions Data base access */ - if (m_cscCalibTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Can't get handle on CSC calibration tools"); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_cscCalibTool.retrieve()); + // Retrieve the detector descriptor. - if (detStore()->retrieve(m_pmuon_detmgr).isFailure()) { - ATH_MSG_ERROR(" Cannot retrieve MuonGeoModel "); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(detStore()->retrieve(m_pmuon_detmgr)); ATH_MSG_DEBUG("Retrieved geometry."); - m_phelper = m_pmuon_detmgr->cscIdHelper(); + m_phelper = m_pmuon_detmgr->cscIdHelper(); m_n = m_cscCalibTool->getNumberOfIntegration(); // 12.; m_n2 = m_cscCalibTool->getNumberOfIntegration2(); // 11.66; diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h index 5e24b8c135adb5025ed1d84f1f08285fdd669ee2..0b2a1c2d1ffc80ddef61e28010500749e698a185 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscBipolarStripFitter.h @@ -60,7 +60,11 @@ class CscBipolarStripFitter : virtual public ICscStripFitter, public AthAlgTool const CscIdHelper * m_phelper; // Calibration tool. - ToolHandle<ICscCalibTool> m_cscCalibTool; + ToolHandle<ICscCalibTool> m_cscCalibTool{ + this, + "cscCalibTool", + "", + }; double FindInitValues(double *x, double *initValues, int *maxsample) const; double FindPow(double z) const; diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx index 571900b8c9038e3d2ae3e7e88e48dfeb88b15025..96a36efbb86a7d05a6f71cdbb0c55cd3660f98e1 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.cxx @@ -29,13 +29,9 @@ CscClusterUtilTool::CscClusterUtilTool(string type, string aname, const IInterfa : AthAlgTool(type, aname, parent), m_pmuon_detmgr(0), m_phelper(0), - m_stripFitter("CalibCscStripFitter/CalibCscStripFitter", this), - m_precClusterFitter("QratCscClusterFitter/QratCscClusterFitter", this), m_cscStripLocation("CSC_Measurements") { declareInterface<ICscClusterUtilTool>(this); - declareProperty("strip_fitter", m_stripFitter); - declareProperty("precision_fitter", m_precClusterFitter); declareProperty("CscStripPrepDataLocation", m_cscStripLocation); } @@ -55,28 +51,18 @@ CscClusterUtilTool::initialize() ATH_MSG_DEBUG(" CscStripPrepDataLocation is " << m_cscStripLocation.key()); // Retrieve the strip fitting tool. - if (m_stripFitter.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve strip fitting tool " << m_stripFitter); - return StatusCode::FAILURE; - } + ATH_CHECK(m_stripFitter.retrieve()); ATH_MSG_DEBUG("Retrieved strip fitting tool " << m_stripFitter); // Retrieve the precision cluster fitting tool. - if (m_precClusterFitter.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve CSC precision cluster fitting tool " << m_precClusterFitter->name()); - return StatusCode::FAILURE; - } + ATH_CHECK(m_precClusterFitter.retrieve()); ATH_MSG_DEBUG("Retrieved CSC precision cluster fitting tool"); // Retrieve the detector descriptor. - if (detStore()->retrieve(m_pmuon_detmgr).isFailure()) { - ATH_MSG_ERROR(" Cannot retrieve MuonGeoModel "); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(detStore()->retrieve(m_pmuon_detmgr)); ATH_MSG_DEBUG("Retrieved geometry."); m_phelper = m_pmuon_detmgr->cscIdHelper(); - return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h index 0eb7ff03730c4e1f596a2b2c8052afba799f647c..5df430ed5a18b7b384acc11a26f968b782a34b37 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscClusterUtilTool.h @@ -62,8 +62,17 @@ class CscClusterUtilTool : virtual public ICscClusterUtilTool, public AthAlgTool const CscIdHelper* m_phelper; // Strip fitter. - ToolHandle<ICscStripFitter> m_stripFitter; - ToolHandle<ICscClusterFitter> m_precClusterFitter; + ToolHandle<ICscStripFitter> m_stripFitter{ + this, + "strip_fitter", + "CalibCscStripFitter/CalibCscStripFitter", + }; + ToolHandle<ICscClusterFitter> m_precClusterFitter{ + this, + "precision_fitter", + "QratCscClusterFitter/QratCscClusterFitter", + }; + SG::ReadHandleKey<Muon::CscStripPrepDataContainer> m_cscStripLocation; }; diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx index 84313668cb5a1d917b25a5bba76d69a332ce9650..37d27d2bb9452e2d260fd3cd6e48af4917f8f33b 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.cxx @@ -74,10 +74,6 @@ CscPeakThresholdClusterBuilderTool::CscPeakThresholdClusterBuilderTool(const std : AthAlgTool(type, aname, parent), m_digit_key("CSC_Measurements"), m_cluster_handle("CSC_Clusters"), - m_pstrip_fitter("CalibCscStripFitter/CalibCscStripFitter"), - m_pfitter_def("SimpleCscClusterFitter/SimpleCscClusterFitter"), - m_pfitter_prec("QratCscClusterFitter/QratCscClusterFitter"), - m_pfitter_split("CscSplitClusterFitter/CscSplitClusterFitter"), m_fullEventDone(false) { @@ -89,10 +85,6 @@ CscPeakThresholdClusterBuilderTool::CscPeakThresholdClusterBuilderTool(const std declareProperty("q3sum_threshold_phi", m_q3sum_threshold_phi = 33000.0); declareProperty("digit_key", m_digit_key); declareProperty("cluster_key", m_cluster_handle); - declareProperty("strip_fitter", m_pstrip_fitter); - declareProperty("default_fitter", m_pfitter_def); - declareProperty("precision_fitter", m_pfitter_prec); - declareProperty("split_fitter", m_pfitter_split); } //****************************************************************************** @@ -120,31 +112,19 @@ CscPeakThresholdClusterBuilderTool::initialize() ATH_MSG_DEBUG(" Output cluster key is " << m_cluster_handle.key()); // Retrieve the strip fitting tool. - if (m_pstrip_fitter.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve strip fitting tool " << m_pstrip_fitter); - return StatusCode::FAILURE; - } + ATH_CHECK(m_pstrip_fitter.retrieve()); ATH_MSG_DEBUG("Retrieved strip fitting tool " << m_pstrip_fitter); // Retrieve the default cluster fitting tool. - if (m_pfitter_def.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve CSC default cluster fitting tool " << m_pfitter_def->name()); - return StatusCode::FAILURE; - } + ATH_CHECK(m_pfitter_def.retrieve()); ATH_MSG_DEBUG("Retrieved CSC default cluster fitting tool"); // Retrieve the precision cluster fitting tool. - if (m_pfitter_prec.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve CSC precision cluster fitting tool " << m_pfitter_prec->name()); - return StatusCode::FAILURE; - } + ATH_CHECK(m_pfitter_prec.retrieve()); ATH_MSG_DEBUG("Retrieved CSC precision cluster fitting tool"); // Retrieve the split cluster fitting tool. - if (m_pfitter_split.retrieve().isFailure()) { - ATH_MSG_FATAL("Unable to retrieve CSC split cluster fitting tool " << m_pfitter_split->name()); - return StatusCode::FAILURE; - } + ATH_CHECK(m_pfitter_split.retrieve()); ATH_MSG_DEBUG("Retrieved CSC split cluster fitting tool"); // retrieve MuonDetectorManager from the conditions store diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h index db7c77350abbd70ed997502077641785032ee952..89a41d35aa6ad074b460e442b5a705e3c512b612 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscPeakThresholdClusterBuilderTool.h @@ -55,13 +55,13 @@ // Algorithm to construct CSC clusters from digits. #include "AthenaBaseComps/AthAlgTool.h" -#include "CscClusterization/ICscClusterBuilder.h" #include "CscClusterization/ICscClusterFitter.h" #include "CscClusterization/ICscStripFitter.h" #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" +#include "CscClusterization/ICscClusterBuilder.h" namespace Muon { class CscPrepData; @@ -114,12 +114,28 @@ class CscPeakThresholdClusterBuilderTool : virtual public ICscClusterBuilder, pu SG::WriteHandle<Muon::CscPrepDataContainer> m_cluster_handle; // SG key for output clusters // Strip fitter. - ToolHandle<ICscStripFitter> m_pstrip_fitter; + ToolHandle<ICscStripFitter> m_pstrip_fitter{ + this, + "strip_fitter", + "CalibCscStripFitter/CalibCscStripFitter", + }; // Cluster fitters. - ToolHandle<ICscClusterFitter> m_pfitter_def; - ToolHandle<ICscClusterFitter> m_pfitter_prec; - ToolHandle<ICscClusterFitter> m_pfitter_split; + ToolHandle<ICscClusterFitter> m_pfitter_def{ + this, + "default_fitter", + "SimpleCscClusterFitter/SimpleCscClusterFitter", + }; + ToolHandle<ICscClusterFitter> m_pfitter_prec{ + this, + "precision_fitter", + "QratCscClusterFitter/QratCscClusterFitter", + }; + ToolHandle<ICscClusterFitter> m_pfitter_split{ + this, + "split_fitter", + "CscSplitClusterFitter/CscSplitClusterFitter", + }; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{ this, diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.cxx index 0395a5b015d4c1982f7521ab217587e0d5267cf5..2e1f0fdb9e3b75bfa065710978cbc6b065654fc1 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.cxx @@ -27,13 +27,9 @@ enum CscPlane { CSS_ETA, CSL_ETA, CSS_PHI, CSL_PHI, UNKNOWN_PLANE }; //****************************************************************************** CscSplitClusterFitter::CscSplitClusterFitter(std::string type, std::string aname, const IInterface* parent) - : AthAlgTool(type, aname, parent), - m_pfitter_def("SimpleCscClusterFitter/SimpleCscClusterFitter"), - m_pfitter_prec("QratCscClusterFitter/QratCscClusterFitter") + : AthAlgTool(type, aname, parent) { declareInterface<ICscClusterFitter>(this); - declareProperty("default_fitter", m_pfitter_def); - declareProperty("precision_fitter", m_pfitter_prec); declareProperty("min_dist", m_min_dist = 2); // Minimum distance between peaks and valley declareProperty("max_qratio", m_max_qratio = 0.15); // Maximum charge ratio between peak strip and valley strip } @@ -48,19 +44,13 @@ CscSplitClusterFitter::initialize() ATH_CHECK(m_idHelperSvc.retrieve()); // Retrieve the default cluster fitting tool. - if (m_pfitter_def.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve Csc default cluster fitting tool " - << name() << ": unable to retrieve cluster fitter " << m_pfitter_def); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_pfitter_def.retrieve()); + ATH_MSG_DEBUG("CscClusterization " << name() << ": retrieved " << m_pfitter_def); // Retrieve the precision cluster fitting tool. - if (m_pfitter_prec.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve Csc default cluster fitting tool " - << name() << ": unable to retrieve cluster fitter " << m_pfitter_prec); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_pfitter_prec.retrieve()); + ATH_MSG_DEBUG("CscClusterization " << name() << ": retrieved " << m_pfitter_prec); ATH_MSG_DEBUG("Properties for " << name() << ":"); @@ -76,7 +66,6 @@ CscSplitClusterFitter::initialize() Results CscSplitClusterFitter::fit(const StripFitList& sfits) const { - Results results; // Check input has at least three strips. unsigned int nstrip = sfits.size(); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.h index c0d4ebfa6cef28c75893e70b49b010e891be8d0d..3309177df31fb013442c4738104ce17c0a0a5fec 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscSplitClusterFitter.h @@ -49,8 +49,16 @@ class CscSplitClusterFitter : virtual public ICscClusterFitter, public AthAlgToo }; // Cluster fitters. - ToolHandle<ICscClusterFitter> m_pfitter_def; - ToolHandle<ICscClusterFitter> m_pfitter_prec; + ToolHandle<ICscClusterFitter> m_pfitter_def{ + this, + "default_fitter", + "SimpleCscClusterFitter/SimpleCscClusterFitter", + }; + ToolHandle<ICscClusterFitter> m_pfitter_prec{ + this, + "precision_fitter", + "QratCscClusterFitter/QratCscClusterFitter", + }; }; #endif diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.cxx index 1f89eb098565fb23137a400ad59e48a8a4c38b64..91834f31e07b19858338c7be252f3e9c8e9f8030 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.cxx @@ -15,11 +15,8 @@ using std::vector; //****************************************************************************** CscThresholdClusterBuilder::CscThresholdClusterBuilder(const std::string& aname, ISvcLocator* pSvcLocator) - : AthAlgorithm(aname, pSvcLocator), - m_cluster_builder("CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool") + : AthAlgorithm(aname, pSvcLocator) { - - declareProperty("cluster_builder", m_cluster_builder); } //****************************************************************************** @@ -37,10 +34,7 @@ CscThresholdClusterBuilder::initialize() ATH_MSG_DEBUG("Initializing " << name()); // Retrieve the strip fitting tool. - if (m_cluster_builder.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve strip fitting tool " << m_cluster_builder); - return StatusCode::FAILURE; - } + ATH_CHECK(m_cluster_builder.retrieve()); ATH_MSG_DEBUG("Retrieved strip fitting tool " << m_cluster_builder); return StatusCode::SUCCESS; diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.h index 454449db2b986a952862a180051286464e39a1bd..e24e0c45ccb886553674c99acd64d42fd0610ea6 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.h @@ -55,11 +55,11 @@ // Algorithm to construct CSC clusters from digits. #include "AthenaBaseComps/AthAlgorithm.h" -#include "CscClusterization/ICscClusterBuilder.h" #include "CscClusterization/ICscClusterFitter.h" #include "CscClusterization/ICscStripFitter.h" #include "GaudiKernel/ToolHandle.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" +#include "CscClusterization/ICscClusterBuilder.h" namespace MuonGM { class MuonDetectorManager; @@ -92,7 +92,11 @@ class CscThresholdClusterBuilder : public AthAlgorithm { private: // data // Strip fitter. - ToolHandle<ICscClusterBuilder> m_cluster_builder; + ToolHandle<ICscClusterBuilder> m_cluster_builder{ + this, + "cluster_builder", + "CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool", + }; }; #endif diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.cxx index 9766b053122dac1ac2e663df4864f1c6bc3fc3f1..ffd848acb639690710a12df6ca90facc871492c0 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.cxx @@ -78,14 +78,8 @@ CscThresholdClusterBuilderTool::CscThresholdClusterBuilderTool(const std::string m_noiseOption(rms), m_digit_key("CSC_Measurements"), m_pclusters("CSC_Clusters"), - m_cscCalibTool("CscCalibTool/CscCalibTool"), - m_pstrip_fitter("CalibCscStripFitter/CalibCscStripFitter"), - m_pfitter_def("SimpleCscClusterFitter/SimpleCscClusterFitter"), - m_pfitter_prec("QratCscClusterFitter/QratCscClusterFitter"), - m_pfitter_split("CscSplitClusterFitter/CscSplitClusterFitter"), m_fullEventDone(false) { - declareInterface<ICscClusterBuilder>(this); declareProperty("threshold", m_threshold = 20000.0); @@ -93,11 +87,6 @@ CscThresholdClusterBuilderTool::CscThresholdClusterBuilderTool(const std::string declareProperty("noiseOption", m_noiseOptionStr = "f001"); declareProperty("digit_key", m_digit_key); declareProperty("cluster_key", m_pclusters); - declareProperty("cscCalibTool", m_cscCalibTool); - declareProperty("strip_fitter", m_pstrip_fitter); - declareProperty("default_fitter", m_pfitter_def); - declareProperty("precision_fitter", m_pfitter_prec); - declareProperty("split_fitter", m_pfitter_split); declareProperty("makeNarrowClusterThreeStrips", m_makeNarrowClusterThreeStrips = true); } @@ -112,7 +101,6 @@ CscThresholdClusterBuilderTool::~CscThresholdClusterBuilderTool() {} StatusCode CscThresholdClusterBuilderTool::initialize() { - // Display algorithm properties. ATH_MSG_DEBUG("Properties for " << name() << ":"); ATH_MSG_DEBUG(" Strip threshold is Max( " << m_threshold << ", " << m_kFactor @@ -139,37 +127,22 @@ CscThresholdClusterBuilderTool::initialize() ATH_MSG_DEBUG(" Output cluster key is " << m_pclusters.key()); // CSC calibratin tool for the Condtiions Data base access // - if (m_cscCalibTool.retrieve().isFailure()) { - ATH_MSG_ERROR("Can't get handle on CSC calibration tools"); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_cscCalibTool.retrieve()); // Retrieve the strip fitting tool. - if (m_pstrip_fitter.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve strip fitting tool " << m_pstrip_fitter); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_pstrip_fitter.retrieve()); ATH_MSG_DEBUG("Retrieved strip fitting tool " << m_pstrip_fitter); // Retrieve the default cluster fitting tool. - if (m_pfitter_def.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve CSC default cluster fitting tool " << m_pfitter_def->name()); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_pfitter_def.retrieve()); ATH_MSG_DEBUG("Retrieved CSC default cluster fitting tool"); // Retrieve the precision cluster fitting tool. - if (m_pfitter_prec.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve CSC precision cluster fitting tool " << m_pfitter_prec->name()); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_pfitter_prec.retrieve()); ATH_MSG_DEBUG("Retrieved CSC precision cluster fitting tool"); // Retrieve the split cluster fitting tool. - if (m_pfitter_split.retrieve().isFailure()) { - ATH_MSG_ERROR("Unable to retrieve CSC split cluster fitting tool " << m_pfitter_split->name()); - return StatusCode::RECOVERABLE; - } + ATH_CHECK_RECOVERABLE(m_pfitter_split.retrieve()); ATH_MSG_DEBUG("Retrieved CSC split cluster fitting tool"); // retrieve MuonDetectorManager from the conditions store diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.h index 8a34695e763b516caea7de01f6e41031b03fa224..2e8ab9920ae397c66f7c60cd08564b754cb08e39 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.h @@ -55,13 +55,13 @@ // Algorithm to construct CSC clusters from digits. #include "AthenaBaseComps/AthAlgTool.h" -#include "CscClusterization/ICscClusterBuilder.h" #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonPrepRawData/CscPrepDataContainer.h" #include "MuonPrepRawData/CscStripPrepDataContainer.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" +#include "CscClusterization/ICscClusterBuilder.h" class ICscCalibTool; class ICscStripFitter; @@ -123,15 +123,35 @@ class CscThresholdClusterBuilderTool : virtual public ICscClusterBuilder, public SG::WriteHandleKey<Muon::CscPrepDataContainer> m_pclusters; // SG key for output clusters // Calibration tool. - ToolHandle<ICscCalibTool> m_cscCalibTool; + ToolHandle<ICscCalibTool> m_cscCalibTool{ + this, + "cscCalibTool", + "CscCalibTool/CscCalibTool", + }; // Strip fitter. - ToolHandle<ICscStripFitter> m_pstrip_fitter; + ToolHandle<ICscStripFitter> m_pstrip_fitter{ + this, + "strip_fitter", + "CalibCscStripFitter/CalibCscStripFitter", + }; // Cluster fitters. - ToolHandle<ICscClusterFitter> m_pfitter_def; - ToolHandle<ICscClusterFitter> m_pfitter_prec; - ToolHandle<ICscClusterFitter> m_pfitter_split; + ToolHandle<ICscClusterFitter> m_pfitter_def{ + this, + "default_fitter", + "SimpleCscClusterFitter/SimpleCscClusterFitter", + }; + ToolHandle<ICscClusterFitter> m_pfitter_prec{ + this, + "precision_fitter", + "QratCscClusterFitter/QratCscClusterFitter", + }; + ToolHandle<ICscClusterFitter> m_pfitter_split{ + this, + "split_fitter", + "CscSplitClusterFitter/CscSplitClusterFitter", + }; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{ this, diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.cxx index 3010bb8df9777e204ab9c4cfb9b2508f91a9ad99..ca448b9eb84f36f921a0d613c415d9fae00f431c 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.cxx @@ -226,7 +226,7 @@ qrat_atanh(const double a, const double b, double c, const double x0, double qra //**************************************************************************** QratCscClusterFitter::QratCscClusterFitter(std::string type, std::string aname, const IInterface* parent) - : AthAlgTool(type, aname, parent), m_alignmentTool("CscAlignmentTool/CscAlignmentTool", this) + : AthAlgTool(type, aname, parent) { declareInterface<ICscClusterFitter>(this); m_max_width.push_back(5); // CSS eta @@ -266,8 +266,6 @@ QratCscClusterFitter::QratCscClusterFitter(std::string type, std::string aname, declareProperty("atanh_x0_csl_eta", m_atanh_x0_csl_eta = 0.6615); declareProperty("dposmin", m_dposmin = 0.082); - - declareProperty("CscAlignmentTool", m_alignmentTool); } //********************************************************************** @@ -289,7 +287,6 @@ QratCscClusterFitter::initialize() ATH_MSG_DEBUG(name() << ": retrieved " << m_alignmentTool); } - ATH_MSG_DEBUG("Properties for " << name() << ":"); ATH_MSG_DEBUG(" Eta position option: " << m_posopt_eta); ATH_MSG_DEBUG(" Phi position option: " << m_posopt_phi); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.h index 14aaca0a6d18614467bc171b52b58279eb848553..01fd5118f3048fd5f48d740f24c405262ad41a7a 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/QratCscClusterFitter.h @@ -86,6 +86,10 @@ class QratCscClusterFitter : virtual public ICscClusterFitter, public AthAlgTool "Muon::MuonIdHelperSvc/MuonIdHelperSvc", }; - ToolHandle<ICscAlignmentTool> m_alignmentTool; + ToolHandle<ICscAlignmentTool> m_alignmentTool{ + this, + "CscAlignmentTool", + "CscAlignmentTool/CscAlignmentTool", + }; }; #endif diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx index f07311045537d6ca79368d956329fd2af8fe097c..09c175ef1a0791e35b6cdf23d7386161ca755b68 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx @@ -24,7 +24,7 @@ enum CscStation { UNKNOWN_STATION, CSS, CSL }; enum CscPlane { CSS_R, CSL_R, CSS_PHI, CSL_PHI, UNKNOWN_PLANE }; SimpleCscClusterFitter::SimpleCscClusterFitter(std::string type, std::string aname, const IInterface* parent) - : AthAlgTool(type, aname, parent), m_alignmentTool("CscAlignmentTool/CscAlignmentTool", this) + : AthAlgTool(type, aname, parent) { declareInterface<ICscClusterFitter>(this); declareProperty("position_option", m_option = "MEAN", "Cluster fitting option: MEAN, PEAK, CENTROID"); @@ -32,8 +32,6 @@ SimpleCscClusterFitter::SimpleCscClusterFitter(std::string type, std::string ana declareProperty("use_peakthreshold", m_use_peakthreshold = false); declareProperty("defaultErrorScaler_eta", m_defaultErrorScaler_eta = 1.0); declareProperty("defaultErrorScaler_phi", m_defaultErrorScaler_phi = 1.0); - - declareProperty("CscAlignmentTool", m_alignmentTool); } //********************************************************************** diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h index 7585a55257947a4b160ad1e62bfd0539fc8efd24..bcffb8c22a263122dc8c92f9ac19900fd27c0d83 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.h @@ -55,6 +55,10 @@ class SimpleCscClusterFitter : virtual public ICscClusterFitter, public AthAlgTo SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey{ this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; - ToolHandle<ICscAlignmentTool> m_alignmentTool; + ToolHandle<ICscAlignmentTool> m_alignmentTool{ + this, + "CscAlignmentTool", + "CscAlignmentTool/CscAlignmentTool", + }; }; #endif diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.cxx index f5d4bb07b196184f382f422b6834d75bb266068b..abbe64e4e6630ecffc0f6596f63f75a03718687d 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.cxx @@ -9,13 +9,12 @@ using namespace Muon; MuonClusterizationAlg::MuonClusterizationAlg(const std::string& name, ISvcLocator* pSvcLocator) - : AthAlgorithm(name, pSvcLocator), m_clusterTool("Muon::MuonClusterizationTool/MuonClusterizationTool") + : AthAlgorithm(name, pSvcLocator) { declareProperty("TgcPrepDataContainer", m_tgcPrdLocationInput = "TGC_Measurements"); declareProperty("TgcPrepDataContainerOutput", m_tgcPrdLocationOutput = "TGC_Clusters"); declareProperty("RpcPrepDataContainer", m_rpcPrdLocationInput = "RPC_Measurements"); declareProperty("RpcPrepDataContainerOutput", m_rpcPrdLocationOutput = "RPC_Clusters"); - declareProperty("ClusterTool", m_clusterTool); } StatusCode diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.h index b23e649d94cd90d4d459880b9fb8aa56b7ff4076..da2fbdf0f85750309691dc2f92ae7d6abc01f47e 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonClusterization/src/MuonClusterizationAlg.h @@ -28,7 +28,11 @@ class MuonClusterizationAlg : public AthAlgorithm { std::string m_rpcPrdLocationInput; //!< Location of input RpcPrepData std::string m_rpcPrdLocationOutput; //!< Location of output RpcPrepData - ToolHandle<Muon::IMuonClusterizationTool> m_clusterTool; //!< clustering Tool + ToolHandle<Muon::IMuonClusterizationTool> m_clusterTool{ + this, + "ClusterTool", + "Muon::MuonClusterizationTool/MuonClusterizationTool", + }; //!< clustering Tool }; #endif diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg.h index 7af26afb5d2e8ff709d3d9d67f8af7398574328c..a81ab5b69b83aff3359c62669e6c8517e3996118 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg/MuonTGMeasAssocAlg.h @@ -88,7 +88,16 @@ class MuonTGMeasAssocAlg : public AthAlgorithm { mutable const Trk::TrackingGeometry* m_trackingGeometry; std::string m_trackingGeometryName; - ToolHandle<Muon::IMuonTGMeasTool> m_muonTgTool; + ToolHandle<Muon::IMuonTGMeasTool> m_muonTgTool{ + this, + "MuonTGMeasurementTool", + "Muon::MuonTGMeasurementTool/MuonTGMeasurementTool", + }; + ToolHandle<Trk::IExtrapolator> m_extrapolator{ + this, + "Extrapolator", + "Trk::Extrapolator/Extrapolator", + }; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; @@ -112,7 +121,6 @@ class MuonTGMeasAssocAlg : public AthAlgorithm { mutable std::vector<PairOfLayerPrd*>* m_tgcHits; mutable MuonTGHits* m_allHits; mutable MuonTGSegments* m_allSegments; - ToolHandle<Trk::IExtrapolator> m_extrapolator; mutable std::map<Identifier, std::pair<const MuonGM::MuonStation*, const Trk::DetachedTrackingVolume*> > m_stationMap; mutable std::vector<std::pair<Identifier, Amg::Transform3D> > diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/src/MuonTGMeasAssocAlg.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/src/MuonTGMeasAssocAlg.cxx index 133a0f63fe21202aafb5b1a2fdf3e1b63a755db8..7ab0b681e417ef7d47e329bf793473bec842df2e 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/src/MuonTGMeasAssocAlg.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MuonTGMeasAssocAlg/src/MuonTGMeasAssocAlg.cxx @@ -42,7 +42,6 @@ Muon::MuonTGMeasAssocAlg::MuonTGMeasAssocAlg(const std::string& name, ISvcLocato m_allowGeomAssoc(true), m_trackingGeometry(0), m_trackingGeometryName("AtlasTrackingGeometry"), - m_muonTgTool("Muon::MuonTGMeasurementTool/MuonTGMeasurementTool"), m_inputSegmentCollectionMoore("MooreSegments"), m_inputSegmentCollectionMoMu("MuonSegments_MoMu"), m_inputSegmentCollectionMBoy("ConvertedMBoySegments"), @@ -56,11 +55,9 @@ Muon::MuonTGMeasAssocAlg::MuonTGMeasAssocAlg(const std::string& name, ISvcLocato m_cscHits(0), m_tgcHits(0), m_allHits(0), - m_allSegments(0), - m_extrapolator("Trk::Extrapolator/Extrapolator") + m_allSegments(0) { declareProperty("TrackingGeometry", m_trackingGeometryName); - declareProperty("Extrapolator", m_extrapolator); declareProperty("ProcessMdtHits", m_mdtIn); declareProperty("ProcessRpcHits", m_rpcIn); declareProperty("ProcessCscHits", m_cscIn);