From 91eb27777e106f15ae87bd0d9e630ae0d6126c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= Date: Tue, 3 Mar 2020 18:47:23 +0100 Subject: [PATCH 1/5] add NSWCalibTool to NSWCalibToolsConfigDb and use it --- .../NSWCalib/NSWCalibTools/python/NSWCalibToolsConfig.py | 4 +++- .../NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py | 3 +++ .../MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx | 1 + .../MM_Digitization/python/MM_DigitizationConfig.py | 4 ++-- .../sTGC_Digitization/python/sTGC_DigitizationConfig.py | 4 ++-- .../MuonRecExample/python/MuonPrdProviderToolsConfig.py | 4 ++-- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfig.py b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfig.py index 1a39e95de53..b9f8d0ac95a 100644 --- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfig.py +++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # Import NSWCalibTools job properties # @@ -11,4 +11,6 @@ def STgcCalibSmearingTool(name="STgcCalibSmearingTool",extraFlags=None,**kwargs) return CfgMgr.Muon__NSWCalibSmearingTool(name,**kwargs) def NSWCalibTool(name="NSWCalibTool",extraFlags=None,**kwargs): + from MuonRecExample.MuonRecTools import MuonIdHelperTool + kwargs.setdefault("MuonIdHelperTool", MuonIdHelperTool()) return CfgMgr.Muon__NSWCalibTool(name,**kwargs) diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py index f7c601c3d11..d0cd9284221 100644 --- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py +++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py @@ -1,3 +1,6 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + from AthenaCommon.CfgGetter import addTool addTool("NSWCalibTools.NSWCalibToolsConfig.MMCalibSmearingTool","MMCalibSmearingTool") addTool("NSWCalibTools.NSWCalibToolsConfig.STgcCalibSmearingTool","STgcCalibSmearingTool") +addTool("NSWCalibTools.NSWCalibToolsConfig.NSWCalibTool","NSWCalibTool") diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx index eccaa712e8f..b61b4f74dc8 100644 --- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx +++ b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/src/NSWCalibTool.cxx @@ -17,6 +17,7 @@ Muon::NSWCalibTool::NSWCalibTool(const std::string& t, declareProperty("MagFieldSvc", m_magFieldSvc, "Magnetic Field Service"); declareProperty("DriftVelocity", m_vDrift = 47., "Drift Velocity"); declareProperty("TimeResolution", m_timeRes = 25., "Time Resolution"); + declareProperty("MuonIdHelperTool", m_idHelperTool); } diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.py b/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.py index afe19a1785b..103b7d919b9 100644 --- a/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.py +++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/python/MM_DigitizationConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # Import MM_Digitization job properties @@ -30,7 +30,7 @@ def MM_DigitizationTool(name="MM_DigitizationTool",**kwargs): kwargs.setdefault("InputObjectName", "MicromegasSensitiveDetector") kwargs.setdefault("OutputObjectName", "MM_DIGITS") kwargs.setdefault("OutputSDOName", "MM_SDO") - kwargs.setdefault("SmearingTool","Muon::NSWCalibSmearingTool/MMCalibSmearingTool") + kwargs.setdefault("SmearingTool","MMCalibSmearingTool") if 'NewMerge' in jobproperties.Digitization.experimentalDigi(): kwargs.setdefault("UseMcEventCollectionHelper",True) else: diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py index f53a66217fb..551f9fe4278 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/python/sTGC_DigitizationConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # # Import sTGC_Digitization job properties @@ -30,7 +30,7 @@ def sTgcDigitizationTool(name="sTgcDigitizationTool",**kwargs): kwargs.setdefault("OutputObjectName", "sTGC_DIGITS") kwargs.setdefault("OutputSDOName", "sTGC_SDO") kwargs.setdefault("doToFCorrection", True) - kwargs.setdefault("SmearingTool","Muon::NSWCalibSmearingTool/STgcCalibSmearingTool") + kwargs.setdefault("SmearingTool","STgcCalibSmearingTool") if 'NewMerge' in jobproperties.Digitization.experimentalDigi(): kwargs.setdefault("UseMcEventCollectionHelper",True) else: diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py index 18ef841502d..f0c2f053697 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Include import include @@ -109,7 +109,7 @@ def CscRdoToCscPrepData(name="CscRdoToCscPrepData", **kwargs): ############################################################################# def MM_PrepDataProviderTool(name="MM_PrepDataProviderTool", **kwargs): kwargs.setdefault("ClusterBuilderTool","SimpleMMClusterBuilderTool") - kwargs.setdefault("NSWCalibTool","Muon::NSWCalibTool/NSWCalibTool") + kwargs.setdefault("NSWCalibTool","NSWCalibTool") from MuonMM_CnvTools.MuonMM_CnvToolsConf import Muon__MmRdoToPrepDataTool return Muon__MmRdoToPrepDataTool(name,**kwargs) -- GitLab From a1e1b66efe7632275fd48d087bd48b3826ea8570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= Date: Wed, 4 Mar 2020 19:15:21 +0100 Subject: [PATCH 2/5] move MuonIdHelperTool import inside if block --- .../MuonRecExample/share/MuonRec_jobOptions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py index 792402dcf7a..786d40553a9 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRec_jobOptions.py @@ -1,3 +1,5 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# ## @file MuonRec_jobOptions.py # # @brief Main jobOptions to setup muon reconstruction. Main muon entry point for RecExCommon. @@ -24,7 +26,6 @@ from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags from RecExConfig.RecFlags import rec from RecExConfig.RecAlgsFlags import recAlgs from MuonRecExample.MuonAlignFlags import muonAlignFlags -from MuonRecExample.MuonRecTools import MuonIdHelperTool muonRecFlags.setDefaults() @@ -34,11 +35,11 @@ if muonRecFlags.doCSCs() and not MuonGeometryFlags.hasCSC(): muonRecFlags.doCSCs if muonRecFlags.dosTGCs() and not MuonGeometryFlags.hasSTGC(): muonRecFlags.dosTGCs = False if muonRecFlags.doMicromegas() and not MuonGeometryFlags.hasMM(): muonRecFlags.doMicromegas = False - # ESDtoAOD and AODtoTAG need a configured MuonIdHelperTool (e.g. for the RPC_ResidualPullCalculator) # Since it is not automatically created by the job configuration (as for RDOtoESD), # do it here manually (hope this will be fixed with the movement to the new configuration for release 22) if rec.readESD() or rec.readAOD(): + from MuonRecExample.MuonRecTools import MuonIdHelperTool MuonIdHelperTool() if muonRecFlags.doDigitization(): -- GitLab From 5612f9c65fa1ccbbfbe6a9293c93279c6ee4c313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= Date: Sat, 14 Mar 2020 14:14:19 +0100 Subject: [PATCH 3/5] remove NSWCalibTool from MuonRecExampleConfigDb, no idea how it then works --- .../MuonRecExample/python/MuonRecExampleConfigDb.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py index 271f1efead1..18aadf7fa93 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py @@ -13,14 +13,6 @@ from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags addNamesToSkipIfNotAvailable( "MuonIsolationTool" ) addTypesOnlyToSkip( "ICaloNoiseTool" ) -################################################################################ -# Tools from other packages -################################################################################ - -# put this here until it is set in the appropriate package -addTool("TrkExTools.AtlasExtrapolator.AtlasExtrapolator","AtlasExtrapolator") - - ################################################################################ # Tools from MuonRecExample.MuonRecTools ################################################################################ @@ -104,8 +96,6 @@ addTool( "Muon::MuonTruthSummaryTool","MuonTruthSummaryTool") addTool( "Muon::MuonClusterizationTool","MuonClusterizationTool" ) -addTool( "NSWCalibTools.NSWCalibToolsConfig.NSWCalibTool","NSWCalibTool" ) - # Set some Muon Properties in the global ResidualPullCalculator # Those values should be in the C++ defaults really addTool("Trk::ResidualPullCalculator","ResidualPullCalculator", -- GitLab From 79a1a11e5a267920f32fe319b98d625efe7b8f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= Date: Sat, 14 Mar 2020 20:37:45 +0100 Subject: [PATCH 4/5] add back AtlasExtrapolator --- .../MuonRecExample/python/MuonRecExampleConfigDb.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py index 18aadf7fa93..e40f18381f4 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py @@ -13,6 +13,13 @@ from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags addNamesToSkipIfNotAvailable( "MuonIsolationTool" ) addTypesOnlyToSkip( "ICaloNoiseTool" ) +################################################################################ +# Tools from other packages +################################################################################ + +# put this here until it is set in the appropriate package (needed for Trigger_topOptions_standalone.py", line 141) +addTool("TrkExTools.AtlasExtrapolator.AtlasExtrapolator","AtlasExtrapolator") + ################################################################################ # Tools from MuonRecExample.MuonRecTools ################################################################################ -- GitLab From a4e1c52fbb5ddb0756d193c025d867aa283cde3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= Date: Mon, 16 Mar 2020 10:16:34 +0100 Subject: [PATCH 5/5] move NSWCalibToolsConfigDb inside MuonRecExampleConfigDb --- .../NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py | 6 ------ .../MuonRecExample/python/MuonRecExampleConfigDb.py | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py diff --git a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py b/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py deleted file mode 100644 index d0cd9284221..00000000000 --- a/MuonSpectrometer/MuonCalib/NSWCalib/NSWCalibTools/python/NSWCalibToolsConfigDb.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.CfgGetter import addTool -addTool("NSWCalibTools.NSWCalibToolsConfig.MMCalibSmearingTool","MMCalibSmearingTool") -addTool("NSWCalibTools.NSWCalibToolsConfig.STgcCalibSmearingTool","STgcCalibSmearingTool") -addTool("NSWCalibTools.NSWCalibToolsConfig.NSWCalibTool","NSWCalibTool") diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py index e40f18381f4..84fe9b4c54e 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.CfgGetter import addTool, addToolClone, addService, addAlgorithm, \ addTypesToExcludeIfDefaultValue, addNamesToExcludeIfDefaultValue, addFullNamesToExcludeIfDefaultValue, \ @@ -229,6 +229,10 @@ addTool("MuonRecExample.NSWTools.ProjectionMMClusterBuilderTool","ProjectionMMCl addTool("MuonRecExample.NSWTools.ConstraintAngleMMClusterBuilderTool","ConstraintAngleMMClusterBuilderTool") addTool("MuonRecExample.NSWTools.SimpleSTgcClusterBuilderTool","SimpleSTgcClusterBuilderTool") +addTool("NSWCalibTools.NSWCalibToolsConfig.MMCalibSmearingTool","MMCalibSmearingTool") +addTool("NSWCalibTools.NSWCalibToolsConfig.STgcCalibSmearingTool","STgcCalibSmearingTool") +addTool("NSWCalibTools.NSWCalibToolsConfig.NSWCalibTool","NSWCalibTool") + ################################################################################ # Tools from MuonRecExample.MuPatTools ################################################################################ -- GitLab