Verified Commit b9b2659f authored by Tadej Novak's avatar Tadej Novak
Browse files

Cleanup extrapolator configuration for ITk

parent 2c3b2d28
Pipeline #3269782 failed with stage
in 0 seconds
......@@ -53,8 +53,7 @@ def InDetConversionTrackSelectorToolCfg(flags, name="TrackSelector"):
acc = ComponentAccumulator()
kwargs = {}
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
kwargs["Extrapolator"] = acc.getPrimaryAndMerge(
AtlasExtrapolatorCfg(flags))
kwargs["Extrapolator"] = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
kwargs["RatioCut1"] = flags.InDet.SecVertex.TrkSel.RatioCut1
kwargs["RatioCut2"] = flags.InDet.SecVertex.TrkSel.RatioCut2
kwargs["RatioCut3"] = flags.InDet.SecVertex.TrkSel.RatioCut3
......@@ -79,8 +78,7 @@ def TrkVKalVrtFitterCfg(flags, name="TrkVKalVrtFitter"):
acc = ComponentAccumulator()
kwargs = {}
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
kwargs["Extrapolator"] = acc.getPrimaryAndMerge(
AtlasExtrapolatorCfg(flags))
kwargs["Extrapolator"] = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
kwargs["FirstMeasuredPoint"] = flags.InDet.SecVertex.Fitter.FirstMeasuredPoint
kwargs["FirstMeasuredPointLimit"] = flags.InDet.SecVertex.Fitter.FirstMeasuredPointLimit
kwargs["InputParticleMasses"] = flags.InDet.SecVertex.Fitter.InputParticleMasses
......@@ -114,7 +112,7 @@ def ConversionFinderCfg(flags, name="ConversionFinderTool"):
acc = ComponentAccumulator()
kwargs = {}
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
kwargs["Extrapolator"] = acc.getPrimaryAndMerge(
kwargs["Extrapolator"] = acc.popToolsAndMerge(
AtlasExtrapolatorCfg(flags))
kwargs["PostSelector"] = acc.getPrimaryAndMerge(
ConversionPostSelectorCfg(flags))
......
......@@ -88,8 +88,10 @@ def ITkBoundaryCheckToolCfg(flags, name='ITkBoundaryCheckTool', **kwargs):
def ITkTrackHoleSearchToolCfg(flags, name='ITkHoleSearchTool', **kwargs):
result = ComponentAccumulator()
if 'Extrapolator' not in kwargs:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
kwargs.setdefault("Extrapolator", result.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags)))
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = result.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
result.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("Extrapolator", extrapolator)
if 'BoundaryCheckTool' not in kwargs:
kwargs.setdefault('BoundaryCheckTool', result.popToolsAndMerge(ITkBoundaryCheckToolCfg(flags)))
......@@ -110,9 +112,10 @@ def ITkTestPixelLayerToolCfg(flags, name = "ITkTestPixelLayerTool", **kwargs):
kwargs.setdefault("PixelSummaryTool", result.popToolsAndMerge(ITkPixelConditionsSummaryCfg(flags)))
if 'Extrapolator' not in kwargs :
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = result.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
kwargs.setdefault("Extrapolator", Extrapolator)
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = result.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
result.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("Extrapolator", extrapolator)
kwargs.setdefault("CheckActiveAreas", flags.ITk.checkDeadElementsOnTrack)
kwargs.setdefault("CheckDeadRegions", flags.ITk.checkDeadElementsOnTrack)
......
......@@ -132,22 +132,11 @@ def ITkClusterMakerToolCfg(flags, name="ITkClusterMakerTool", **kwargs) :
return acc
def ITkTrackToVertexCfg(flags, name="ITkTrackToVertex", **kwargs):
result = ComponentAccumulator()
if "Extrapolator" not in kwargs:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = result.popToolsAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
kwargs["Extrapolator"] = Extrapolator
from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
result.merge(BeamSpotCondAlgCfg(flags))
result.setPrivateTools(CompFactory.Reco.TrackToVertex(name, **kwargs))
return result
def ITkTrackParticleCreatorToolCfg(flags, name="ITkTrackParticleCreatorTool", **kwargs):
result = ComponentAccumulator()
if "TrackToVertex" not in kwargs:
kwargs["TrackToVertex"] = result.popToolsAndMerge(ITkTrackToVertexCfg(flags))
from InDetConfig.TrackRecoConfig import TrackToVertexCfg
kwargs["TrackToVertex"] = result.popToolsAndMerge(TrackToVertexCfg(flags))
if "TrackSummaryTool" not in kwargs:
from InDetConfig.ITkTrackingCommonConfig import ITkTrackSummaryToolSharedHitsCfg
TrackSummaryTool = result.getPrimaryAndMerge(ITkTrackSummaryToolSharedHitsCfg(flags))
......
......@@ -341,8 +341,10 @@ def ITkKalmanTrackFitterBaseCfg(flags, name='ITkKalmanTrackFitterBase',**kwargs)
if len(pix_cluster_on_track_args)>0 and len(nameSuffix)>0 :
pix_cluster_on_track_args['nameSuffix']=nameSuffix
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
kwargs.setdefault("ExtrapolatorHandle", acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags)))
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
acc.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("ExtrapolatorHandle", extrapolator)
if 'RIO_OnTrackCreatorHandle' not in kwargs :
ITkRefitRotCreator = acc.popToolsAndMerge(ITkRotCreatorCfg(flags,
......@@ -397,9 +399,10 @@ def ITkKalmanCompetingPixelClustersToolCfg(flags, name='ITkKalmanCompetingPixelC
kwargs.setdefault('WeightCutValueEndCap',5.5)
if 'Extrapolator' not in kwargs:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
kwargs.setdefault("Extrapolator", Extrapolator)
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
acc.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("Extrapolator", extrapolator)
acc.setPrivateTools(CompFactory.InDet.CompetingPixelClustersOnTrackTool(name=name, **kwargs))
return acc
......@@ -410,9 +413,10 @@ def ITkKalmanCompetingStripClustersToolCfg(flags, name='ITkKalmanCompetingStripC
kwargs.setdefault('WeightCutValueEndCap',5.5)
if 'Extrapolator' not in kwargs:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
kwargs.setdefault("Extrapolator", Extrapolator)
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
acc.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("Extrapolator", extrapolator)
acc.setPrivateTools(CompFactory.InDet.CompetingSCT_ClustersOnTrackTool(name=name,**kwargs))
return acc
......@@ -538,8 +542,8 @@ def ITkDistributedKalmanFilterCfg(flags, name="ITkDistributedKalmanFilter", **kw
pix_cluster_on_track_args = stripArgs(kwargs,['SplitClusterMapExtension','ClusterSplitProbabilityName','nameSuffix'])
if 'ExtrapolatorTool' not in kwargs:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
kwargs.setdefault('ExtrapolatorTool', acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags)))
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
kwargs.setdefault('ExtrapolatorTool', acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags)))
if 'ROTcreator' not in kwargs:
ITkRotCreator = acc.popToolsAndMerge(ITkRotCreatorCfg(flags, **pix_cluster_on_track_args))
......@@ -676,11 +680,11 @@ def ITkGlobalChi2FitterBaseCfg(flags, name='ITkGlobalChi2FitterBase', **kwargs)
# @TODO howto get the TrackingGeometryKey from the TrackingGeometryCondAlgCfg ?
kwargs.setdefault("TrackingGeometryReadKey", 'AtlasTrackingGeometry')
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
from TrkConfig.AtlasExtrapolatorToolsConfig import AtlasNavigatorCfg, ITkPropagatorCfg, ITkMaterialEffectsUpdatorCfg
from InDetConfig.ITkRecToolConfig import ITkUpdatorCfg
from InDetConfig.ITkRecToolConfig import ITkUpdatorCfg
Extrapolator = acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
Extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
Navigator = acc.getPrimaryAndMerge(AtlasNavigatorCfg(flags))
ITkPropagator = acc.getPrimaryAndMerge(ITkPropagatorCfg(flags))
ITkUpdator = acc.popToolsAndMerge(ITkUpdatorCfg(flags))
......@@ -813,8 +817,8 @@ def ITkROIInfoVecCondAlgCfg(flags, name='ITkROIInfoVecCondAlg', **kwargs) :
def ITkAmbiScoringToolBaseCfg(flags, name='ITkAmbiScoringTool', **kwargs) :
acc = ComponentAccumulator()
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
kwargs.setdefault("Extrapolator", acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags)))
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
kwargs.setdefault("Extrapolator", acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags)))
ITkTrackSummaryTool = acc.getPrimaryAndMerge(ITkTrackSummaryToolCfg(flags))
......@@ -885,8 +889,8 @@ def ITkNNScoringToolBaseCfg(flags, name='ITkNNScoringTool', **kwargs) :
alg = acc.popToolsAndMerge(ITkROIInfoVecCondAlgCfg(flags))
kwargs.setdefault("CaloROIInfoName", alg.WriteKey )
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
Extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
ITkTrackSummaryTool = acc.getPrimaryAndMerge(ITkTrackSummaryToolCfg(flags))
kwargs.setdefault("nnCutConfig", "dev/TrackingCP/LRTAmbiNetwork/20200727_225401/nn-config.json" )
......
......@@ -223,8 +223,13 @@ def ITkSiTrackMaker_xkCfg(flags, name="ITkSiTrackMaker", InputCollections = None
kwargs.setdefault("TrackPatternRecoInfo", 'SiSPSeededFinder')
if flags.ITk.doStoreTrackSeeds:
ITkSeedToTrackConversion = CompFactory.InDet.SeedToTrackConversionTool( name = "ITkSeedToTrackConversion",
OutputName = 'SiSPSeedSegments' + flags.ITk.Tracking.extension)
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
acc.addPublicTool(extrapolator) # TODO: migrate to private?
ITkSeedToTrackConversion = CompFactory.InDet.SeedToTrackConversionTool(name="ITkSeedToTrackConversion",
OutputName=f"SiSPSeedSegments{flags.ITk.Tracking.extension}",
Extrapolator=extrapolator)
acc.setPrivateTools(ITkSeedToTrackConversion)
kwargs.setdefault("SeedToTrackConversion", ITkSeedToTrackConversion)
kwargs.setdefault("SeedSegmentsWrite", True)
......@@ -482,8 +487,9 @@ def ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags, name = "ITkAmbiguityPro
ITkAmbiTrackSelectionTool = acc.popToolsAndMerge(ITkAmbiTrackSelectionToolCfg(flags))
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
acc.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("Fitter", fitter_list)
kwargs.setdefault("AssociationTool", ITkPRDtoTrackMapToolGangedPixels)
......@@ -491,7 +497,7 @@ def ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags, name = "ITkAmbiguityPro
kwargs.setdefault("TrackSummaryTool", ambi_track_summary_tool)
kwargs.setdefault("ScoringTool", ITkAmbiScoringTool)
kwargs.setdefault("SelectionTool", ITkAmbiTrackSelectionTool)
kwargs.setdefault("TrackExtrapolator", Extrapolator)
kwargs.setdefault("TrackExtrapolator", extrapolator)
kwargs.setdefault("InputClusterSplitProbabilityName", 'SplitProb'+flags.ITk.Tracking.extension)
kwargs.setdefault("OutputClusterSplitProbabilityName", 'ITkAmbiguityProcessorSplitProb'+flags.ITk.Tracking.extension)
kwargs.setdefault("SuppressHoleSearch", False)
......
......@@ -148,14 +148,10 @@ def InDetPhysValTruthDecoratorAlgCfg(flags, **kwargs):
'''
acc = ComponentAccumulator()
Extrapolator = None
if flags.Detector.GeometryITk:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
else:
from TrkConfig.AtlasExtrapolatorConfig import InDetExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(InDetExtrapolatorCfg(flags))
kwargs.setdefault("Extrapolator", Extrapolator)
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
acc.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("Extrapolator", extrapolator)
acc.merge(createExtendNameIfNotDefaultCfg(CompFactory.InDetPhysValTruthDecoratorAlg,
'TruthParticleContainerName', 'TruthParticles',
......
......@@ -35,14 +35,10 @@ def InDetRttTruthSelectionToolCfg(flags, name="InDetRttTruthSelectionTool", **kw
kwargs.setdefault("maxEta", 2.5)
kwargs.setdefault("minPt", 500.)
Extrapolator = None
if flags.Detector.GeometryITk:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(AtlasUpgradeExtrapolatorCfg(flags))
else:
from TrkConfig.AtlasExtrapolatorConfig import InDetExtrapolatorCfg
Extrapolator = acc.getPrimaryAndMerge(InDetExtrapolatorCfg(flags))
kwargs.setdefault("Extrapolator", Extrapolator)
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
acc.addPublicTool(extrapolator) # TODO: migrate to private?
kwargs.setdefault("Extrapolator", extrapolator)
tool = CompFactory.AthTruthSelectionTool(name = name, **kwargs)
acc.setPrivateTools(tool)
......
......@@ -209,12 +209,8 @@ def MooCandidateMatchingToolCfg(flags, name="MooCandidateMatchingTool", doSegmen
# Won't explicitly configure MuonEDMHelperSvc
kwargs.setdefault("MuonPrinterTool", MuonEDMPrinterTool(flags) )
kwargs.setdefault("Extrapolator", result.popToolsAndMerge(AtlasExtrapolatorCfg(flags)))
acc = AtlasExtrapolatorCfg(flags)
extrap = acc.getPrimary()
result.merge(acc)
kwargs.setdefault("Extrapolator", extrap)
acc = MuonSegmentMatchingToolCfg(flags, doPhiMatching = doSegmentPhiMatching)
muon_seg_matching = acc.getPrimary()
result.merge(acc)
......
......@@ -24,8 +24,7 @@ def BTagTrackAugmenterAlgCfg(ConfigFlags, TrackCollection = 'InDetTrackParticles
if 'TrackToVertexIPEstimator' not in options :
options.setdefault('TrackToVertexIPEstimator',acc.popToolsAndMerge(BTagTrackToVertexIPEstimatorCfg(ConfigFlags, 'TrkToVxIPEstimator') ))
if 'Extrapolator' not in options :
exrtrapolator_acc = AtlasExtrapolatorCfg(ConfigFlags)
options.setdefault('Extrapolator', acc.popToolsAndMerge(exrtrapolator_acc))
options.setdefault('Extrapolator', acc.popToolsAndMerge(AtlasExtrapolatorCfg(ConfigFlags)))
# -- create the track augmenter algorithm
acc.addEventAlgo(Analysis__BTagTrackAugmenterAlg(**options))
......
......@@ -55,7 +55,7 @@ def InDetImprovedJetFitterTrackSelectorToolCfg(flags, name, useBTagFlagsDefaults
options['name'] = name
acc = AtlasExtrapolatorCfg(flags)
options.setdefault("Extrapolator", acc.getPrimary() )
options.setdefault("Extrapolator", acc.popPrivateTools() )
# This presumably should be added, but causes config merge conflicts
# FIXME!
......
......@@ -25,38 +25,19 @@ def MCTruthClassifierCaloTruthMatchCfg(flags, **kwargs):
if "ParticleCaloExtensionTool" not in kwargs:
extAcc = None
if flags.Detector.GeometryITk:
from TrkConfig.AtlasUpgradeExtrapolatorConfig import (
MCTruthClassifierUpgradeExtrapolatorCfg)
extrapolator = acc.popToolsAndMerge(
MCTruthClassifierUpgradeExtrapolatorCfg(flags))
from TrackToCalo.ITkTrackToCaloConfig import (
ITkParticleCaloExtensionToolCfg)
extAcc = ITkParticleCaloExtensionToolCfg(
flags,
Extrapolator=extrapolator)
else:
from TrkConfig.AtlasExtrapolatorConfig import (
MCTruthClassifierExtrapolatorCfg)
extrapolator = acc.popToolsAndMerge(
MCTruthClassifierExtrapolatorCfg(flags))
from TrackToCalo.TrackToCaloConfig import (
ParticleCaloExtensionToolCfg)
extAcc = ParticleCaloExtensionToolCfg(
flags,
Extrapolator=extrapolator)
kwargs["ParticleCaloExtensionTool"] = acc.popToolsAndMerge(extAcc)
from TrkConfig.AtlasExtrapolatorConfig import MCTruthClassifierExtrapolatorCfg
extrapolator = acc.popToolsAndMerge(MCTruthClassifierExtrapolatorCfg(flags))
from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
extension = ParticleCaloExtensionToolCfg(flags, Extrapolator=extrapolator)
kwargs["ParticleCaloExtensionTool"] = acc.popToolsAndMerge(extension)
kwargs.setdefault("barcodeG4Shift", flags.Sim.SimBarcodeOffset + 1)
from AthenaConfiguration.ComponentFactory import CompFactory
MCTruthClassifier = CompFactory.MCTruthClassifier
acc.setPrivateTools(MCTruthClassifier(**kwargs))
acc.setPrivateTools(CompFactory.MCTruthClassifier(**kwargs))
return acc
##########################################################
# The function below are for the old style and should be
# condsidered deprecated
......
......@@ -272,7 +272,7 @@ def ExtrapolateMuonToIPToolCfg(flags, name="ExtrapolateMuonToIPTool", **kwargs):
from MuonConfig.MuonRecToolsConfig import MuonExtrapolatorCfg
result = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("Extrapolator", result.getPrimary() )
kwargs.setdefault("Extrapolator", result.popPrivateTools() )
kwargs.setdefault("MuonExtrapolator", result.popToolsAndMerge( MuonExtrapolatorCfg(flags) ) )
if flags.Muon.MuonTrigger:
......@@ -388,7 +388,7 @@ def MuonCombinedStacoTagToolCfg(flags, name="MuonCombinedStacoTagTool",**kwargs)
kwargs.setdefault("ParticleCaloExtensionTool", result.getPrimary() )
kwargs.setdefault("Printer", MuonEDMPrinterTool(flags) )
kwargs.setdefault("TagTool", result.popToolsAndMerge(CombinedMuonTagTestToolCfg(flags)))
kwargs.setdefault("Extrapolator", result.getPrimaryAndMerge(AtlasExtrapolatorCfg(flags)) )
kwargs.setdefault("Extrapolator", result.popToolsAndMerge(AtlasExtrapolatorCfg(flags)) )
tool = CompFactory.MuonCombined.MuonCombinedStacoTagTool(name,**kwargs)
result.setPrivateTools(tool)
......@@ -401,7 +401,7 @@ def MuidMaterialAllocatorCfg(flags, name='MuidMaterialAllocator', **kwargs):
kwargs.setdefault("AllowReordering",False)
result = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("Extrapolator", result.getPrimary() )
kwargs.setdefault("Extrapolator", result.popPrivateTools() )
from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg
result.merge( TrackingGeometryCondAlgCfg(flags) )
......@@ -643,9 +643,7 @@ def CombinedMuonTrackBuilderCfg(flags, name='CombinedMuonTrackBuilder', **kwargs
else:
kwargs.setdefault("CscRotCreator" , "")
acc = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("Extrapolator", acc.getPrimary() )
result.merge(acc)
kwargs.setdefault("Extrapolator", result.popToolsAndMerge(AtlasExtrapolatorCfg(flags)) )
acc = iPatFitterCfg(flags)
ipatFitter = acc.popPrivateTools() # possibly used again below
......@@ -776,7 +774,7 @@ def MuonMatchQualityCfg(flags, name='MuonMatchQuality', **kwargs ):
def MuidMuonRecoveryCfg(flags, name='MuidMuonRecovery',**kwargs):
result = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("Extrapolator", result.getPrimary() )
kwargs.setdefault("Extrapolator", result.popPrivateTools() )
acc = CombinedMuonTrackBuilderCfg(flags)
kwargs.setdefault("TrackBuilder", acc.popPrivateTools() )
result.merge(acc)
......@@ -789,7 +787,7 @@ def MuonCombinedTrackFitterCfg(flags, name="MuonCombinedTrackFitter", **kwargs )
from MuonConfig.MuonRIO_OnTrackCreatorConfig import MuonRotCreatorCfg
result = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("ExtrapolationTool", result.getPrimary() )
kwargs.setdefault("ExtrapolationTool", result.popPrivateTools() )
acc = MuonNavigatorCfg(flags)
kwargs.setdefault("NavigatorTool", acc.popPrivateTools())
......@@ -833,7 +831,7 @@ def MuonCombinedTrackFitterCfg(flags, name="MuonCombinedTrackFitter", **kwargs )
def CombinedMuonTagTestToolCfg(flags, name='CombinedMuonTagTestTool', **kwargs ):
result = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("ExtrapolatorTool",result.getPrimary() )
kwargs.setdefault("ExtrapolatorTool",result.popPrivateTools() )
kwargs.setdefault("Chi2Cut",50000.)
from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg
result.merge( TrackingGeometryCondAlgCfg(flags) )
......@@ -970,8 +968,7 @@ def MuonLayerSegmentFinderToolCfg(flags, name="MuonLayerSegmentFinderTool", **kw
def MuonLayerSegmentMatchingToolCfg(flags, name="MuonLayerSegmentMatchingTool", **kwargs):
result = AtlasExtrapolatorCfg(flags)
extrap = result.getPrimary()
kwargs.setdefault("Extrapolator", extrap)
kwargs.setdefault("Extrapolator", result.popPrivateTools())
from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuTagMatchingToolCfg
acc = MuTagMatchingToolCfg(flags)
......
......@@ -65,7 +65,7 @@ def MuTagMatchingToolCfg(flags, name='MuTagMatchingTool', **kwargs ):
kwargs.setdefault("CombinedPullCut", 3.0)
result = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("IExtrapolator", result.getPrimary())
kwargs.setdefault("IExtrapolator", result.popPrivateTools())
kwargs.setdefault("Propagator", result.getPrimaryAndMerge( AtlasRKPropagatorCfg(flags) ))
......@@ -183,11 +183,8 @@ def MuonCombinedInDetCandidateAlgCfg(flags, name="MuonCombinedInDetCandidateAlg"
acc = MuonCombinedInDetDetailedTrackSelectorToolCfg(flags, "MuonCombinedInDetDetailedForwardTrackSelectorTool", nHitSct=0)
kwargs.setdefault("InDetForwardTrackSelector", acc.getPrimary() )
result.merge(acc)
acc = AtlasExtrapolatorCfg(flags)
extrapolator = acc.getPrimary()
result.merge(acc)
extrapolator = result.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
muon_particle_extension_tool = CompFactory.Trk.ParticleCaloExtensionTool(Extrapolator=extrapolator)
muon_ext_tool = CompFactory.Muon.MuonSystemExtensionTool(ParticleCaloExtensionTool = muon_particle_extension_tool, Extrapolator = extrapolator)
......
......@@ -57,12 +57,8 @@ def RecoSteering(flags, tryConfiguringAll=False):
log.info("---------- Configured combined muon reconstruction")
# Caching of CaloExtension for downstream Combined Performance algorithms.
if flags.Detector.GeometryID:
from TrackToCalo.CaloExtensionBuilderAlgCfg import CaloExtensionBuilderAlgCfg
acc.merge(CaloExtensionBuilderAlgCfg(flags))
elif flags.Detector.GeometryITk:
from TrackToCalo.ITkCaloExtensionBuilderAlgCfg import ITkCaloExtensionBuilderAlgCfg
acc.merge(ITkCaloExtensionBuilderAlgCfg(flags))
from TrackToCalo.CaloExtensionBuilderAlgCfg import CaloExtensionBuilderAlgCfg
acc.merge(CaloExtensionBuilderAlgCfg(flags))
log.info("---------- Configured track calorimeter extension builder")
if flags.Reco.EnableEgamma:
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentFactory import CompFactory
def CaloExtensionBuilderAlgCfg(inputFlags):
def CaloExtensionBuilderAlgCfg(flags, **kwargs):
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
Trk__ParticleCaloExtensionTool = CompFactory.Trk.ParticleCaloExtensionTool
result = AtlasExtrapolatorCfg(inputFlags)
pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = result.popPrivateTools())
CaloExtensionBuilderAlg = CompFactory.Trk.CaloExtensionBuilderAlg
CaloExtensionBuilderAlg = CaloExtensionBuilderAlg(LastCaloExtentionTool = pcExtensionTool)
result.addEventAlgo (CaloExtensionBuilderAlg)
result = AtlasExtrapolatorCfg(flags)
kwargs.setdefault("LastCaloExtentionTool", CompFactory.Trk.ParticleCaloExtensionTool(Extrapolator=result.popPrivateTools()))
# P->T conversion extra dependencies
if flags.Detector.GeometryITk:
kwargs.setdefault("ExtraInputs", [
("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkPixelDetectorElementCollection"),
("InDetDD::SiDetectorElementCollection", "ConditionStore+ITkStripDetectorElementCollection"),
])
else:
kwargs.setdefault("ExtraInputs", [
("InDetDD::SiDetectorElementCollection", "ConditionStore+PixelDetectorElementCollection"),
("InDetDD::SiDetectorElementCollection", "ConditionStore+SCT_DetectorElementCollection"),
])
result.addEventAlgo(CompFactory.Trk.CaloExtensionBuilderAlg(**kwargs))
return result
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentFactory import CompFactory
def ITkCaloExtensionBuilderAlgCfg(inputFlags):
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
Trk__ParticleCaloExtensionTool = CompFactory.Trk.ParticleCaloExtensionTool
result = AtlasUpgradeExtrapolatorCfg(inputFlags)
pcExtensionTool = Trk__ParticleCaloExtensionTool(Extrapolator = result.popPrivateTools())
CaloExtensionBuilderAlg = CompFactory.Trk.CaloExtensionBuilderAlg
CaloExtensionBuilderAlg = CaloExtensionBuilderAlg(LastCaloExtentionTool = pcExtensionTool,
PixelDetEleCollKey="",
SCTDetEleCollKey="",
TRTDetEleContKey="")
result.addEventAlgo (CaloExtensionBuilderAlg)
return result
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Tool configuration for the track to calo tools."
#---------------------------------------
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from TrkConfig.AtlasUpgradeExtrapolatorConfig import AtlasUpgradeExtrapolatorCfg
def ITkParticleCaloExtensionToolCfg(flags, **kwargs):
acc=ComponentAccumulator()
if "Extrapolator" not in kwargs:
extrapAcc = AtlasUpgradeExtrapolatorCfg(flags)
kwargs["Extrapolator"] = acc.popToolsAndMerge(extrapAcc)
caloExtensionTool = CompFactory.Trk.ParticleCaloExtensionTool(**kwargs)
acc.setPrivateTools(caloExtensionTool)
return acc
def ITkParticleCaloCellAssociationToolCfg(flags, **kwargs):
acc=ComponentAccumulator()
if "ParticleCaloExtensionTool" not in kwargs:
pcExtrapToolAcc = ITkParticleCaloExtensionToolCfg(flags)
kwargs["ParticleCaloExtensionTool"] = acc.popToolsAndMerge(pcExtrapToolAcc)
# should this be a more global flag? It depends on whether you are in AOD
kwargs.setdefault("CaloCellContainer", flags.Egamma.Keys.Input.CaloCells)
cellAssocTool = CompFactory.Rec.ParticleCaloCellAssociationTool(**kwargs)
acc.setPrivateTools(cellAssocTool)
return acc
# Still to do, ParticleCaloClusterAssociationToolCfg and MuonCaloEnergyToolCfg
# They still have public tools
#---------------------------------------
......@@ -12,8 +12,7 @@ def ParticleCaloExtensionToolCfg(flags, **kwargs):
acc=ComponentAccumulator()
if "Extrapolator" not in kwargs:
extrapAcc = AtlasExtrapolatorCfg(flags)
kwargs["Extrapolator"] = acc.popToolsAndMerge(extrapAcc)
kwargs["Extrapolator"] = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))
caloExtensionTool = CompFactory.Trk.ParticleCaloExtensionTool(**kwargs)
......
......@@ -79,26 +79,6 @@ private:
"InDetTrackParticles",
"Container of tracks"
};
// For P->T converters of ID tracks with Pixel
SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection>
m_pixelDetEleCollKey{ this,
"PixelDetEleCollKey",
"PixelDetectorElementCollection",
"Key of SiDetectorElementCollection for Pixel" };
// For P->T converters of ID tracks with SCT
SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection>
m_SCTDetEleCollKey{ this,
"SCTDetEleCollKey",