diff --git a/Reconstruction/eflowRec/python/PFCfg.py b/Reconstruction/eflowRec/python/PFCfg.py index d6b51aa0f3caf3c64be717d421d1244f226444c0..38fa939422b5da85575fed32b5722c7347e738d2 100644 --- a/Reconstruction/eflowRec/python/PFCfg.py +++ b/Reconstruction/eflowRec/python/PFCfg.py @@ -1,14 +1,14 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentFactory import CompFactory -def getPFTrackSelectorAlgorithm(inputFlags,algName,useCaching=True): +def PFTrackSelectorAlgCfg(inputFlags,algName,useCaching=True): PFTrackSelector=CompFactory.PFTrackSelector PFTrackSelector=PFTrackSelector(algName) from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg Trk__ParticleCaloExtensionTool=CompFactory.Trk.ParticleCaloExtensionTool - extrapCfg = AtlasExtrapolatorCfg(inputFlags) - pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = extrapCfg.popPrivateTools()) + result = AtlasExtrapolatorCfg(inputFlags) + pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = result.popPrivateTools()) eflowTrackCaloExtensionTool=CompFactory.eflowTrackCaloExtensionTool TrackCaloExtensionTool=eflowTrackCaloExtensionTool(TrackCaloExtensionTool=pcExtensionTool) @@ -25,7 +25,9 @@ def getPFTrackSelectorAlgorithm(inputFlags,algName,useCaching=True): PFTrackSelector.trackSelectionTool = TrackSelectionTool - return PFTrackSelector + result.addEventAlgo (PFTrackSelector) + + return result def getPFClusterSelectorTool(clustersin,calclustersin,algName): diff --git a/Reconstruction/eflowRec/python/PFHLTConfig.py b/Reconstruction/eflowRec/python/PFHLTConfig.py index 82920efa765d190c9c5c83fdd6bc872f75f903c1..517b50e5eb78f056da131f4b2c148fb918adcc94 100644 --- a/Reconstruction/eflowRec/python/PFHLTConfig.py +++ b/Reconstruction/eflowRec/python/PFHLTConfig.py @@ -41,16 +41,17 @@ def CaloGeoAndNoiseCfg(inputFlags): #---------------------------------------------------------------------------------# # PFlow track selection -def getHLTPFTrackSelector(inputFlags,tracksin,verticesin): +def HLTPFTrackSelectorCfg(inputFlags,tracksin,verticesin): - from eflowRec.PFCfg import getPFTrackSelectorAlgorithm - PFTrackSelector = getPFTrackSelectorAlgorithm(inputFlags,"PFTrackSelector_HLT",False) + from eflowRec.PFCfg import PFTrackSelectorAlgCfg + result = getPFTrackSelectorAlgCfg(inputFlags,"PFTrackSelector_HLT",False) + PFTrackSelector = result.getEventAlgo ("PFTrackSelector_HLT") PFTrackSelector.electronsName = "" PFTrackSelector.muonsName = "" PFTrackSelector.tracksName = tracksin PFTrackSelector.VertexContainer = verticesin - return PFTrackSelector + return result def getHLTPFMomentCalculatorTool(inputFlags): @@ -98,16 +99,17 @@ def PFCfg(inputFlags): calogeocfg = CaloGeoAndNoiseCfg(inputFlags) result.merge(calogeocfg) - PFTrackSelector = getHLTPFTrackSelector(inputFlags, - inputFlags.eflowRec.TrackColl, - inputFlags.eflowRec.VertexColl) + selcfg = HLTPFTrackSelectorCfg(inputFlags, + inputFlags.eflowRec.TrackColl, + inputFlags.eflowRec.VertexColl) + PFTrackSelector = selcfg.getEventAlgo ("PFTrackSelector_HLT") # Add monitoring tool from eflowRec import PFOnlineMon monTool = PFOnlineMon.getMonTool_PFTrackSelector() PFTrackSelector.MonTool = monTool - result.addEventAlgo( PFTrackSelector ) + result.merge( selcfg ) #---------------------------------------------------------------------------------# # PFlowAlgorithm -- subtraction steps diff --git a/Reconstruction/eflowRec/python/PFRun3Config.py b/Reconstruction/eflowRec/python/PFRun3Config.py index 9fb7badeea76b09239850a324d00ae3a109ba4df..3c08b024c15095975982d2e711c322a0bf99abca 100644 --- a/Reconstruction/eflowRec/python/PFRun3Config.py +++ b/Reconstruction/eflowRec/python/PFRun3Config.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 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -112,15 +112,15 @@ def PFCfg(inputFlags,**kwargs): result.merge(CaloNoiseCondAlgCfg(inputFlags,"electronicNoise")) #Cache the track extrapolations - from TrackToCalo.CaloExtensionBuilderAlgCfg import getCaloExtenstionBuilderAlgorithm - result.addEventAlgo(getCaloExtenstionBuilderAlgorithm(inputFlags)) + from TrackToCalo.CaloExtensionBuilderAlgCfg import CaloExtensionBuilderAlgCfg + result.merge(CaloExtensionBuilderAlgCfg(inputFlags)) #Configure the pflow algorithms PFLeptonSelector=CompFactory.PFLeptonSelector result.addEventAlgo(PFLeptonSelector("PFLeptonSelector")) - from eflowRec.PFCfg import getPFTrackSelectorAlgorithm - result.addEventAlgo(getPFTrackSelectorAlgorithm(inputFlags,"PFTrackSelector")) + from eflowRec.PFCfg import PFTrackSelectorAlgCfg + result.merge(PFTrackSelectorAlgCfg(inputFlags,"PFTrackSelector")) result.addEventAlgo(getOfflinePFAlgorithm(inputFlags))