diff --git a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py index 25a58d6bf827f20e2980221d731873ccac049eff..113b5e96b76162711aacdbeb8ec0d5e8ac3588b3 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonRIO_OnTrackCreatorConfig.py @@ -23,29 +23,25 @@ def CscClusterOnTrackCreatorCfg(flags,name="CscClusterOnTrackCreator", **kwargs) result=ComponentAccumulator() acc = QratCscClusterFitterCfg(flags) - qrat = acc.getPrimary() - result.addPublicTool(qrat) + qrat = acc.popPrivateTools() result.merge(acc) kwargs.setdefault("CscClusterFitter", qrat ) acc = CalibCscStripFitterCfg(flags) - strip_fitter = acc.getPrimary() - result.addPublicTool(strip_fitter) + strip_fitter = acc.popPrivateTools() result.merge(acc) kwargs.setdefault("CscStripFitter", strip_fitter) acc = CscClusterUtilToolCfg(flags) - cluster_util_tool = acc.getPrimary() + cluster_util_tool = acc.popPrivateTools() kwargs.setdefault("CscClusterUtilTool", cluster_util_tool ) - result.addPublicTool(cluster_util_tool) result.merge(acc) if not flags.Input.isMC: # collisions real data or simulated first data # scale CSC and hit errors kwargs.setdefault("ErrorScalerBeta", 0.070 ) - csc_cluster_creator = Muon__CscClusterOnTrackCreator(name,**kwargs) - result.addPublicTool(csc_cluster_creator, primary=True) + result.setPrivateTools(Muon__CscClusterOnTrackCreator(name,**kwargs)) return result diff --git a/MuonSpectrometer/MuonConfig/python/MuonRecToolsConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRecToolsConfig.py index 91b1acbbb08a2c641e7e6ba27d2443cf2854f899..3c50d1228efb4848a51e876c667a9fecba263d3d 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonRecToolsConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonRecToolsConfig.py @@ -388,7 +388,7 @@ def MuPatHitToolCfg(flags, name="MuPatHitTool",**kwargs): kwargs.setdefault("MdtRotCreator", mdt_creator) acc = CscClusterOnTrackCreatorCfg(flags) - csc_cluster_creator = acc.getPrimary() + csc_cluster_creator = acc.popPrivateTools() result.merge(acc) kwargs.setdefault("CscRotCreator", csc_cluster_creator) diff --git a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py index 7477882d7cfdfe1592cf362c4de52ca67907cc28..2fc6e0e8b371f23793318955fc6aa2a1731c62ab 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py @@ -400,7 +400,6 @@ def QratCscClusterFitterCfg(flags, **kwargs): kwargs.setdefault("qratcor_csl_eta",qratcor_csl_eta) kwargs.setdefault("qratcor_css_eta",qratcor_css_eta) csc_align_tool = CscAlignmentTool(flags) - result.addPublicTool(csc_align_tool) # TODO remove once private kwargs.setdefault("CscAlignmentTool", csc_align_tool ) result.setPrivateTools(QratCscClusterFitter(**kwargs)) @@ -431,7 +430,7 @@ def CscSegmentUtilToolCfg(flags, name='CscSegmentUtilTool', **kwargs): from MuonConfig.MuonRIO_OnTrackCreatorConfig import CscClusterOnTrackCreatorCfg result=CscClusterOnTrackCreatorCfg(flags) - csc_cluster_creator = result.getPrimary() + csc_cluster_creator = result.popPrivateTools() kwargs.setdefault("rot_creator", csc_cluster_creator ) result.setPrivateTools(CscSegmentUtilTool( name=name, **kwargs)) diff --git a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py index 588177ef1d4c19405d33f343eb67e599ea90efff..f17bd640d7cc22fce47973e2c36734798bdb52c8 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py @@ -325,7 +325,7 @@ def MuPatCandidateToolCfg(flags, name="MuPatCandidateTool", **kwargs): kwargs.setdefault("MdtRotCreator", mdt_dcot_creator) acc = CscClusterOnTrackCreatorCfg(flags) - csc_cluster_creator = acc.getPrimary() + csc_cluster_creator = acc.popPrivateTools() result.merge(acc) kwargs.setdefault("CscRotCreator", csc_cluster_creator) @@ -344,7 +344,7 @@ def MuonChamberHoleRecoveryToolCfg(flags, name="MuonChamberHoleRecoveryTool", ** if flags.Muon.enableErrorTuning or not flags.Input.isMC: extrakwargs["ErrorScalerBeta"] = 0.200 acc = CscClusterOnTrackCreatorCfg(flags, **extrakwargs) - csc_cluster_creator = acc.getPrimary() + csc_cluster_creator = acc.popPrivateTools() result.merge(acc) kwargs.setdefault("CscRotCreator", csc_cluster_creator) else: diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.cxx index 7e21a13e33a16ad092993ec6c7a8357ab4c9e6e4..fc58507c470af59390850bd6189dbca4e616eddd 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.cxx @@ -16,7 +16,6 @@ #include "MuonRIO_OnTrack/CscClusterOnTrack.h" #include "MuonRIO_OnTrack/MdtDriftCircleOnTrack.h" #include "MuonRecToolInterfaces/IMuonClusterOnTrackCreator.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" #include "TrkEventPrimitives/FitQuality.h" #include "MuonSegment/MuonSegment.h" @@ -25,7 +24,6 @@ #include "TrkSegment/Segment.h" #include "TrkRoad/TrackRoad.h" -#include "MuonRecHelperTools/MuonEDMPrinterTool.h" #include "MuonCondInterface/ICSCConditionsSvc.h" @@ -74,19 +72,9 @@ std::string chamber(int istation, int zsec, int phi) { Csc2dSegmentMaker:: Csc2dSegmentMaker(const std::string& type, const std::string& aname, const IInterface* parent) - : AthAlgTool(type, aname, parent), - m_segmentTool("CscSegmentUtilTool/CscSegmentUtilTool", this), - m_cscClusterOnTrackCreator("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator", this), - m_idHelper("Muon::MuonIdHelperTool/MuonIdHelperTool"), - m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool") - //m_cscCoolStrSvc("MuonCalib::CscCoolStrSvc", aname) - //m_cscCondSvc("CSCCondSummarySvc",name()) + : AthAlgTool(type, aname, parent) { declareInterface<ICscSegmentFinder>(this); - declareProperty("segmentTool", m_segmentTool); - declareProperty("cscRotCreator", m_cscClusterOnTrackCreator); - declareProperty("IdHelper", m_idHelper); - declareProperty("cscdig_sg_inkey", m_cscdig_sg_inkey = "CSC_Measurements"); } //****************************************************************************** @@ -116,9 +104,14 @@ StatusCode Csc2dSegmentMaker::initialize(){ return StatusCode::FAILURE; } if ( m_idHelper.retrieve().isFailure() ) { - ATH_MSG_ERROR ( "Unable to retrieve CscSegmentUtilTool " << m_idHelper ); + ATH_MSG_ERROR ( "Unable to retrieve MuonIdHelperTool " << m_idHelper ); return StatusCode::FAILURE; } + if ( m_printer.retrieve().isFailure() ) { + ATH_MSG_ERROR ( "Unable to retrieve " << m_printer ); + return StatusCode::FAILURE; + } + /* if ( m_cscCoolStrSvc.retrieve().isFailure() ) { ATH_MSG_FATAL ( "Unable to retrieve pointer to the CSC COLL Conditions Service" ); diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.h index 3eaae8e34293d8fb2762885a0f65cd7326094287..1c583602b75c9a64a9d686a6dbd5b9bc9f0fcb14 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.h +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/Csc2dSegmentMaker.h @@ -19,6 +19,8 @@ #include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "Identifier/Identifier.h" #include "CscSegmentMakers/ICscSegmentFinder.h" +#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonRecHelperTools/MuonEDMPrinterTool.h" //#include "MuonCondInterface/CscICoolStrSvc.h" // MuonSegmentCombination(Collection).h included // and "MuonPrepRawData/CscPrepDataContainer.h" @@ -72,12 +74,12 @@ private: // data // MuonSegmentCombinationCollection* m_psegs; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; - std::string m_cscdig_sg_inkey; + Gaudi::Property<std::string> m_cscdig_sg_inkey{this, "scdig_sg_inkey", "CSC_Measurements"}; - ToolHandle<ICscSegmentUtilTool> m_segmentTool; - ToolHandle<Muon::IMuonClusterOnTrackCreator> m_cscClusterOnTrackCreator; - ToolHandle<Muon::MuonIdHelperTool> m_idHelper; - ToolHandle<Muon::MuonEDMPrinterTool> m_printer; + ToolHandle<ICscSegmentUtilTool> m_segmentTool{this, "segmentTool", "CscSegmentUtilTool/CscSegmentUtilTool"}; + ToolHandle<Muon::IMuonClusterOnTrackCreator> m_cscClusterOnTrackCreator{this, "cscRotCreator", "Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator"}; + ToolHandle<Muon::MuonIdHelperTool> m_idHelper{this, "IdHelper", "Muon::MuonIdHelperTool/MuonIdHelperTool"}; + ToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}; //ServiceHandle<MuonCalib::CscICoolStrSvc> m_cscCoolStrSvc; //ServiceHandle<ICSCConditionsSvc> m_cscCondSvc; //CSC conditions diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.cxx index b08921b545d57e415814220fc48ee719e16f1b70..7728fc3468e0051ecadc057f9339801ae85e6a9c 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.cxx @@ -93,8 +93,7 @@ namespace { // Constructor. CscSegmentUtilTool::CscSegmentUtilTool (const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool(type,name,parent), - m_rotCreator("Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator") + : AthAlgTool(type,name,parent) { declareInterface<ICscSegmentUtilTool>(this); declareProperty("max_chisquare_tight", m_max_chisquare_tight = 16.); // 16 for outlier removal... @@ -114,7 +113,6 @@ CscSegmentUtilTool::CscSegmentUtilTool declareProperty("IPconstraint", m_IPconstraint = true); declareProperty("IPerror", m_IPerror = 250.); declareProperty("allEtaPhiMatches", m_allEtaPhiMatches = true); - declareProperty("rot_creator", m_rotCreator); declareProperty("TightenChi2", m_TightenChi2 = true); declareProperty("Remove4Overlap", m_remove4Overlap = true); declareProperty("Remove3Overlap", m_remove3Overlap = true); diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.h index ba6ec5c13323735cdc652c59c0a1a70648d89c39..40f24ac6748fd00f4fbc80da9f2eebc40fe9c9bc 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/src/CscSegmentUtilTool.h @@ -110,7 +110,7 @@ private: // data bool m_remove3Overlap; int m_nunspoil; - ToolHandle<Muon::ICscClusterOnTrackCreator> m_rotCreator; + ToolHandle<Muon::ICscClusterOnTrackCreator> m_rotCreator{this, "rot_creator", "Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; SG::ReadCondHandleKey<CscCondDbData> m_readKey{this, "ReadKey", "CscCondDbData", "Key of CscCondDbData"};