diff --git a/InnerDetector/InDetConfig/python/BackTrackingConfig.py b/InnerDetector/InDetConfig/python/BackTrackingConfig.py index 2f7f858ef4cf42537c21f9401e5e9c1b76e4f419..de9a30207cea2020f7c2fb5ea8fbea69cbfe7c33 100644 --- a/InnerDetector/InDetConfig/python/BackTrackingConfig.py +++ b/InnerDetector/InDetConfig/python/BackTrackingConfig.py @@ -1,310 +1,5 @@ # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaConfiguration.ComponentFactory import CompFactory -from AthenaConfiguration.Enums import BeamType -import InDetConfig.TrackingCommonConfig as TC - -def SiDetElementsRoadMaker_xkCfg(flags, name = 'InDetTRT_SeededSiRoad', **kwargs): - acc = ComponentAccumulator() - # - # Silicon det elements road maker tool - # - InDetPatternPropagator = acc.getPrimaryAndMerge(TC.InDetPatternPropagatorCfg()) - - kwargs.setdefault("PropagatorTool", InDetPatternPropagator) - kwargs.setdefault("usePixel", flags.InDet.Tracking.ActivePass.usePixel) - kwargs.setdefault("PixManagerLocation", 'Pixel') # InDetKeys.PixelManager() - kwargs.setdefault("useSCT", flags.InDet.Tracking.ActivePass.useSCT) - kwargs.setdefault("SCTManagerLocation", 'SCT') # InDetKeys.SCT_Manager() - kwargs.setdefault("RoadWidth", 35.) - kwargs.setdefault("MaxStep", 20.) - - if flags.Beam.Type is BeamType.Cosmics: - kwargs.setdefault("RoadWidth", 50) - # Condition algorithm for InDet__SiDetElementsRoadMaker_xk - if flags.InDet.Tracking.ActivePass.useSCT: - acc.addCondAlgo(CompFactory.InDet.SiDetElementsRoadCondAlg_xk(name = "InDet__SiDetElementsRoadCondAlg_xk")) - - InDetTRT_SeededSiRoadMaker = CompFactory.InDet.SiDetElementsRoadMaker_xk(name = name, **kwargs) - acc.setPrivateTools(InDetTRT_SeededSiRoadMaker) - return acc - -def SimpleTRT_SeededSpacePointFinder_ATLCfg(flags, name='InDetTRT_SeededSpFinder', InputCollections=[], **kwargs): - from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg - acc = MagneticFieldSvcCfg(flags) - - # - # --- decide if use the association tool - # - if len(InputCollections) > 0: - usePrdAssociationTool = True - prefix = 'InDetSegment' - suffix = '' - else: - prefix = '' - suffix = '' - usePrdAssociationTool = False - - kwargs.setdefault("SpacePointsSCTName", 'SCT_SpacePoints') - kwargs.setdefault("PRDtoTrackMap", prefix+'PRDtoTrackMap'+suffix if usePrdAssociationTool else "") - kwargs.setdefault("PerigeeCut", 1000.) - kwargs.setdefault("DirectionPhiCut", .3) - kwargs.setdefault("DirectionEtaCut", 1.) - kwargs.setdefault("MaxHoles", 2) - kwargs.setdefault("RestrictROI", True) - - InDetTRT_SeededSpacePointFinder = CompFactory.InDet.SimpleTRT_SeededSpacePointFinder_ATL(name = name, **kwargs) - acc.setPrivateTools(InDetTRT_SeededSpacePointFinder) - return acc - -def TRT_SeededSpacePointFinder_ATLCfg(flags, name='InDetTRT_SeededSpFinder', InputCollections=[], **kwargs): - acc = ComponentAccumulator() - # - # --- decide if use the association tool - # - if len(InputCollections) > 0: - usePrdAssociationTool = True - prefix = 'InDetSegment' - suffix = '' - else: - prefix = '' - suffix = '' - usePrdAssociationTool = False - # - # --- defaul space point finder - # - kwargs.setdefault("SpacePointsSCTName", 'SCT_SpacePoints') # InDetKeys.SCT_SpacePoints() - kwargs.setdefault("SpacePointsOverlapName", 'OverlapSpacePoints') # InDetKeys.OverlapSpacePoints()) - kwargs.setdefault("PRDtoTrackMap", prefix+'PRDtoTrackMap'+suffix if usePrdAssociationTool else "") - kwargs.setdefault("NeighborSearch", True) - kwargs.setdefault("LoadFull", False) - kwargs.setdefault("DoCosmics", flags.Beam.Type is BeamType.Cosmics) - kwargs.setdefault("pTmin", flags.InDet.Tracking.ActivePass.minSecondaryPt) - - InDetTRT_SeededSpacePointFinder = CompFactory.InDet.TRT_SeededSpacePointFinder_ATL(name = name, **kwargs) - acc.setPrivateTools(InDetTRT_SeededSpacePointFinder) - return acc - -def TRT_SeededTrackFinder_ATLCfg(flags, name='InDetTRT_SeededTrackMaker', InputCollections=[], **kwargs): - from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg - acc = MagneticFieldSvcCfg(flags) - - # - # --- TRT seeded back tracking tool - # - InDetPatternPropagator = acc.getPrimaryAndMerge(TC.InDetPatternPropagatorCfg()) - InDetPatternUpdator = acc.getPrimaryAndMerge(TC.InDetPatternUpdatorCfg()) - - InDetSiComTrackFinder = acc.popToolsAndMerge(TC.SiCombinatorialTrackFinder_xkCfg(flags)) - - if flags.InDet.Tracking.ActivePass.usePixel and flags.InDet.Tracking.ActivePass.useSCT: - InDetTRT_SeededSiRoadMaker = acc.popToolsAndMerge(SiDetElementsRoadMaker_xkCfg(flags)) - acc.addPublicTool(InDetTRT_SeededSiRoadMaker) - kwargs.setdefault("RoadTool", InDetTRT_SeededSiRoadMaker) - - # - # --- decide which TRT seed space point finder to use - # - InDetTRT_SeededSpacePointFinder = acc.popToolsAndMerge(TRT_SeededSpacePointFinder_ATLCfg(flags, InputCollections=InputCollections)) - acc.addPublicTool(InDetTRT_SeededSpacePointFinder) - - kwargs.setdefault("PropagatorTool", InDetPatternPropagator) - kwargs.setdefault("UpdatorTool", InDetPatternUpdator) - kwargs.setdefault("SeedTool", InDetTRT_SeededSpacePointFinder) - kwargs.setdefault("CombinatorialTrackFinder", InDetSiComTrackFinder) - kwargs.setdefault("pTmin", flags.InDet.Tracking.ActivePass.minSecondaryPt) - kwargs.setdefault("nHolesMax", flags.InDet.Tracking.ActivePass.SecondarynHolesMax) - kwargs.setdefault("nHolesGapMax", flags.InDet.Tracking.ActivePass.SecondarynHolesGapMax) - kwargs.setdefault("Xi2max", flags.InDet.Tracking.ActivePass.SecondaryXi2max) - kwargs.setdefault("Xi2maxNoAdd", flags.InDet.Tracking.ActivePass.SecondaryXi2maxNoAdd) - kwargs.setdefault("SearchInCaloROI", False) - if kwargs["SearchInCaloROI"]: - from InDetConfig.InDetRecCaloSeededROISelectionConfig import CaloClusterROI_SelectorCfg - acc.merge(CaloClusterROI_SelectorCfg(flags)) - kwargs.setdefault("InputClusterContainerName", "InDetCaloClusterROIs") # InDetKeys.CaloClusterROIContainer() - else: - kwargs.setdefault("InputClusterContainerName", "") - kwargs.setdefault("ConsistentSeeds", True) - kwargs.setdefault("BremCorrection", False) - - if flags.Beam.Type is BeamType.Cosmics: - kwargs.setdefault("nWClustersMin", 0) - - InDetTRT_SeededTrackTool = CompFactory.InDet.TRT_SeededTrackFinder_ATL(name = name, **kwargs) - acc.setPrivateTools(InDetTRT_SeededTrackTool) - return acc - -def TRT_SeededTrackFinderCfg(flags, name='InDetTRT_SeededTrackFinder', InputCollections=[], **kwargs): - acc = ComponentAccumulator() - - # - # --- Output key for the finder - # - TRTSeededTracks = 'TRTSeededTracks' # InDetKeys.TRTSeededTracks() - # - # TRT seeded back tracking algorithm - - # - # --- decide if use the association tool - # - if len(InputCollections) > 0: - usePrdAssociationTool = True - prefix = 'InDetSegment' - suffix = '' - else: - prefix = '' - suffix = '' - usePrdAssociationTool = False - - from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg - acc.merge(BeamSpotCondAlgCfg(flags)) - - if flags.InDet.Tracking.ActivePass.usePixel: - acc.addCondAlgo(CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name="InDetSiDetElementBoundaryLinksPixelCondAlg", - ReadKey="PixelDetectorElementCollection", - WriteKey="PixelDetElementBoundaryLinks_xk")) - if flags.InDet.Tracking.ActivePass.useSCT: - acc.addCondAlgo(CompFactory.InDet.SiDetElementsRoadCondAlg_xk(name="InDet__SiDetElementsRoadCondAlg_xk")) - - acc.addCondAlgo(CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name="InDetSiDetElementBoundaryLinksSCTCondAlg", - ReadKey="SCT_DetectorElementCollection", - WriteKey="SCT_DetElementBoundaryLinks_xk")) - - InDetTrackFitterBT = acc.popToolsAndMerge(TC.InDetTrackFitterBTCfg(flags)) - - InDetTrackSummaryToolNoHoleSearch = acc.getPrimaryAndMerge(TC.InDetTrackSummaryToolNoHoleSearchCfg(flags)) - - InDetTRTExtensionTool = acc.popToolsAndMerge(TC.InDetTRT_ExtensionToolCfg(flags)) - acc.addPublicTool(InDetTRTExtensionTool) - - from TrkConfig.AtlasExtrapolatorConfig import InDetExtrapolatorCfg - InDetExtrapolator = acc.getPrimaryAndMerge(InDetExtrapolatorCfg(flags)) - - InDetTRT_SeededTrackTool = acc.popToolsAndMerge(TRT_SeededTrackFinder_ATLCfg(flags, - InputCollections=InputCollections)) - acc.addPublicTool(InDetTRT_SeededTrackTool) - - kwargs.setdefault("RefitterTool", InDetTrackFitterBT) - kwargs.setdefault("TrackTool", InDetTRT_SeededTrackTool) - kwargs.setdefault("PRDtoTrackMap", prefix+'PRDtoTrackMap'+suffix if usePrdAssociationTool else "") - kwargs.setdefault("TrackSummaryTool", InDetTrackSummaryToolNoHoleSearch) - kwargs.setdefault("TrackExtensionTool", InDetTRTExtensionTool) - kwargs.setdefault("MinTRTonSegment", flags.InDet.Tracking.ActivePass.minSecondaryTRTonTrk) - kwargs.setdefault("MinTRTonly", flags.InDet.Tracking.ActivePass.minTRTonly) - kwargs.setdefault("TrtExtension", True) - kwargs.setdefault("SiExtensionCuts", flags.InDet.Tracking.ActivePass.SiExtensionCuts) - kwargs.setdefault("minPt", flags.InDet.Tracking.ActivePass.minSecondaryPt) - kwargs.setdefault("maxRPhiImp", flags.InDet.Tracking.ActivePass.maxSecondaryImpact) - kwargs.setdefault("maxZImp", flags.InDet.Tracking.ActivePass.maxZImpact) - kwargs.setdefault("maxEta", flags.InDet.Tracking.ActivePass.maxEta) - kwargs.setdefault("Extrapolator", InDetExtrapolator) - kwargs.setdefault("RejectShortExtension", flags.InDet.Tracking.ActivePass.rejectShortExtensions) - kwargs.setdefault("FinalRefit", False) - kwargs.setdefault("FinalStatistics", False) - kwargs.setdefault("OutputSegments", False) - kwargs.setdefault("InputSegmentsLocation", 'TRTSegments') # InDetKeys.TRT_Segments() - kwargs.setdefault("OutputTracksLocation", TRTSeededTracks) - kwargs.setdefault("CaloClusterEt", flags.InDet.Tracking.ActivePass.minRoIClusterEt) - - if flags.InDet.Tracking.ActivePass.RoISeededBackTracking: - from RegionSelector.RegSelToolConfig import regSelTool_SCT_Cfg - RegSelTool_SCT = acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags)) - acc.addPublicTool(RegSelTool_SCT) - - kwargs.setdefault("RegSelTool", RegSelTool_SCT) - kwargs.setdefault("CaloSeededRoI", True) - - InDetTRT_SeededTrackFinder = CompFactory.InDet.TRT_SeededTrackFinder(name = name, **kwargs) - acc.addEventAlgo(InDetTRT_SeededTrackFinder) - return acc - -def TrkAmbiguityScoreCfg(flags, name='InDetTRT_SeededAmbiguityScore', **kwargs): - acc = ComponentAccumulator() - # - # --- Output key for the finder - # - TRTSeededTracks = 'TRTSeededTracks' # InDetKeys.TRTSeededTracks() - - kwargs.setdefault("TrackInput", [ TRTSeededTracks ]) - kwargs.setdefault("TrackOutput", 'ScoredMap'+'InDetTRT_SeededAmbiguityScore') - - InDetAmbiguityScore = CompFactory.Trk.TrkAmbiguityScore(name = name, **kwargs) - acc.addEventAlgo(InDetAmbiguityScore) - return acc - -def InDetTRTAmbiTrackSelectionToolCfg(flags, name='InDetTRT_SeededAmbiTrackSelectionTool', **kwargs): - acc = ComponentAccumulator() - - InDetTRTDriftCircleCut = acc.popToolsAndMerge(TC.InDetTRTDriftCircleCutForPatternRecoCfg(flags)) - - InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge( TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) ) - - kwargs.setdefault("DriftCircleCutTool", InDetTRTDriftCircleCut) - kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("minScoreShareTracks", -1.) # off ! - kwargs.setdefault("minHits", flags.InDet.Tracking.ActivePass.minSecondaryClusters) - kwargs.setdefault("minNotShared", flags.InDet.Tracking.ActivePass.minSecondarySiNotShared) - kwargs.setdefault("maxShared", flags.InDet.Tracking.ActivePass.maxSecondaryShared) - kwargs.setdefault("minTRTHits", flags.InDet.Tracking.ActivePass.minSecondaryTRTonTrk) - kwargs.setdefault("UseParameterization", flags.InDet.Tracking.ActivePass.useParameterizedTRTCuts) - kwargs.setdefault("Cosmics", flags.Beam.Type is BeamType.Cosmics) - kwargs.setdefault("doPixelSplitting", flags.InDet.Tracking.doPixelClusterSplitting) - - acc.setPrivateTools(CompFactory.InDet.InDetAmbiTrackSelectionTool(name, **kwargs)) - return acc - -def SimpleAmbiguityProcessorToolCfg(flags, name='InDetTRT_SeededAmbiguityProcessor', ClusterSplitProbContainer="", **kwargs): - acc = ComponentAccumulator() - # - # --- load Ambiguity Processor - # - InDetTrackFitterBT = acc.popToolsAndMerge(TC.InDetTrackFitterBTCfg(flags)) - InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge( TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) ) - - # - # --- set up special Scoring Tool for TRT seeded tracks - # - if flags.Beam.Type is BeamType.Cosmics: - InDetTRT_SeededScoringTool = acc.popToolsAndMerge(TC.InDetCosmicScoringTool_TRTCfg(flags)) - InDetTRT_SeededSummaryTool = acc.popToolsAndMerge(TC.InDetTrackSummaryToolSharedHitsCfg(flags)) - else: - InDetTRT_SeededScoringTool = acc.popToolsAndMerge(TC.InDetTRT_SeededScoringToolCfg(flags)) - InDetTRT_SeededSummaryTool = acc.getPrimaryAndMerge(TC.InDetTrackSummaryToolCfg(flags)) - - InDetTRT_SeededAmbiTrackSelectionTool = acc.popToolsAndMerge(InDetTRTAmbiTrackSelectionToolCfg(flags)) - - kwargs.setdefault("Fitter", InDetTrackFitterBT) - kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("TrackSummaryTool", InDetTRT_SeededSummaryTool) - kwargs.setdefault("SelectionTool", InDetTRT_SeededAmbiTrackSelectionTool) - kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) - kwargs.setdefault("OutputClusterSplitProbabilityName", 'InDetTRT_SeededAmbiguityProcessorSplitProb'+flags.InDet.Tracking.ActivePass.extension) - kwargs.setdefault("RefitPrds", False) - kwargs.setdefault("SuppressTrackFit", False) - kwargs.setdefault("SuppressHoleSearch", False) - kwargs.setdefault("ScoringTool", InDetTRT_SeededScoringTool) - kwargs.setdefault("MatEffects", flags.InDet.Tracking.materialInteractionsType if flags.InDet.Tracking.materialInteractions else 0) - - InDetTRT_SeededAmbiguityProcessor = CompFactory.Trk.SimpleAmbiguityProcessorTool(name = name, **kwargs) - acc.setPrivateTools(InDetTRT_SeededAmbiguityProcessor) - return acc - -def TrkAmbiguitySolverCfg(flags, name='InDetTRT_SeededAmbiguitySolver', ClusterSplitProbContainer ='', **kwargs): - acc = ComponentAccumulator() - - ResolvedTRTSeededTracks = 'ResolvedTRTSeededTracks' # InDetKeys.ResolvedTRTSeededTracks() - - InDetTRT_SeededAmbiguityProcessor = acc.popToolsAndMerge(SimpleAmbiguityProcessorToolCfg(flags, - ClusterSplitProbContainer=ClusterSplitProbContainer)) - acc.addPublicTool(InDetTRT_SeededAmbiguityProcessor) - - kwargs.setdefault("TrackInput", 'ScoredMap'+'InDetTRT_SeededAmbiguityScore') - kwargs.setdefault("TrackOutput", ResolvedTRTSeededTracks) - kwargs.setdefault("AmbiguityProcessor", InDetTRT_SeededAmbiguityProcessor) - - InDetTRT_SeededAmbiguitySolver = CompFactory.Trk.TrkAmbiguitySolver(name = name, **kwargs) - acc.addEventAlgo(InDetTRT_SeededAmbiguitySolver) - return acc # ------------------------------------------------------------ # @@ -320,16 +15,16 @@ def BackTrackingCfg(flags, InputCollections = None, TrackCollectionKeys=[] , Tra # # ------------------------------------------------------------ - acc.merge(TRT_SeededTrackFinderCfg(flags, - InputCollections = InputCollections)) + from InDetConfig.TRT_SeededTrackFinderConfig import TRT_SeededTrackFinderCfg + acc.merge(TRT_SeededTrackFinderCfg(flags, InputCollections = InputCollections)) # ------------------------------------------------------------ # # --- Resolve back tracking tracks # # ------------------------------------------------------------ - acc.merge(TrkAmbiguityScoreCfg(flags)) - acc.merge(TrkAmbiguitySolverCfg(flags, - ClusterSplitProbContainer = ClusterSplitProbContainer)) + from TrkConfig.TrkAmbiguitySolverConfig import TrkAmbiguityScore_TRT_Cfg, TrkAmbiguitySolver_TRT_Cfg + acc.merge(TrkAmbiguityScore_TRT_Cfg(flags)) + acc.merge(TrkAmbiguitySolver_TRT_Cfg(flags, ClusterSplitProbContainer = ClusterSplitProbContainer)) return acc diff --git a/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py b/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py index ae4b275ef3b903bebbce32f0ad4052eaac92de36..0dfafb63eb8ada2410c4fe10a0a1c6b3a0621238 100644 --- a/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py +++ b/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py @@ -2,7 +2,6 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.Enums import BeamType -from InDetConfig.ITkRecToolConfig import ITkBoundaryCheckToolCfg, ITkPatternPropagatorCfg, ITkPatternUpdatorCfg import InDetConfig.ITkTrackingCommonConfig as TC from ActsTrkFinding.ActsSiSpacePointsSeedMakerConfig import ActsSiSpacePointsSeedMakerCfg @@ -54,86 +53,21 @@ def ITkSiSpacePointsSeedMakerCfg(flags, name="ITkSpSeedsMaker", InputCollections acc.setPrivateTools(ITkSiSpacePointsSeedMaker) return acc -def ITkSiDetElementsRoadMaker_xkCfg(flags, name="ITkSiRoadMaker", **kwargs) : - acc = ComponentAccumulator() - # - # --- SCT and Pixel detector elements road builder - # - ITkPatternPropagator = acc.getPrimaryAndMerge(ITkPatternPropagatorCfg(flags)) - - kwargs.setdefault("PropagatorTool", ITkPatternPropagator) - kwargs.setdefault("usePixel", flags.ITk.Tracking.ActivePass.useITkPixel ) - kwargs.setdefault("PixManagerLocation", 'ITkPixel') - kwargs.setdefault("useSCT", flags.ITk.Tracking.ActivePass.useITkStrip) - kwargs.setdefault("SCTManagerLocation", 'ITkStrip') - kwargs.setdefault("RoadWidth", flags.ITk.Tracking.ActivePass.roadWidth) - - ITkSiDetElementsRoadMaker = CompFactory.InDet.SiDetElementsRoadMaker_xk(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(ITkSiDetElementsRoadMaker) - return acc - -def ITkSiCombinatorialTrackFinder_xkCfg(flags, name="ITkSiComTrackFinder", **kwargs) : - acc = ComponentAccumulator() - - # - # --- Local track finding using sdCaloSeededSSSpace point seed - # - ITkRotCreatorDigital = acc.getPrimaryAndMerge(TC.ITkRotCreatorDigitalCfg(flags)) - ITkPatternPropagator = acc.getPrimaryAndMerge(ITkPatternPropagatorCfg(flags)) - ITkPatternUpdator = acc.popToolsAndMerge(ITkPatternUpdatorCfg(flags)) - - ITkBoundaryCheckTool = acc.popToolsAndMerge(ITkBoundaryCheckToolCfg(flags)) - - kwargs.setdefault("PropagatorTool", ITkPatternPropagator) - kwargs.setdefault("UpdatorTool", ITkPatternUpdator) - kwargs.setdefault("BoundaryCheckTool", ITkBoundaryCheckTool) - kwargs.setdefault("RIOonTrackTool", ITkRotCreatorDigital) - kwargs.setdefault("usePixel", flags.Detector.EnableITkPixel) - kwargs.setdefault("useSCT", flags.Detector.EnableITkStrip) - kwargs.setdefault("PixelClusterContainer", 'ITkPixelClusters') - kwargs.setdefault("SCT_ClusterContainer", 'ITkStripClusters') - kwargs.setdefault("PixelDetElementBoundaryLinks_xk", "ITkPixelDetElementBoundaryLinks_xk") - kwargs.setdefault("SCT_DetElementBoundaryLinks_xk", "ITkStripDetElementBoundaryLinks_xk") - kwargs.setdefault("SCTDetEleCollKey","ITkStripDetectorElementCollection") - kwargs.setdefault("ITkGeometry", True) - kwargs.setdefault("doFastTracking", flags.ITk.Tracking.doFastTracking) - - if flags.Detector.EnableITkPixel: - from PixelConditionsTools.ITkPixelConditionsSummaryConfig import ITkPixelConditionsSummaryCfg - kwargs.setdefault("PixelSummaryTool", acc.popToolsAndMerge(ITkPixelConditionsSummaryCfg(flags))) - else: - kwargs.setdefault("PixelSummaryTool", None) - - if flags.Detector.EnableITkStrip: - from SCT_ConditionsTools.ITkStripConditionsToolsConfig import ITkStripConditionsSummaryToolCfg - kwargs.setdefault("SctSummaryTool", acc.popToolsAndMerge(ITkStripConditionsSummaryToolCfg(flags))) - else: - kwargs.setdefault("SctSummaryTool", None) - - ITkSiComTrackFinder = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(ITkSiComTrackFinder) - return acc - def ITkSiTrackMaker_xkCfg(flags, name="ITkSiTrackMaker", InputCollections = None, **kwargs) : acc = ComponentAccumulator() + from InDetConfig.SiDetElementsRoadToolConfig import ITkSiDetElementsRoadMaker_xkCfg ITkSiDetElementsRoadMaker = acc.popToolsAndMerge(ITkSiDetElementsRoadMaker_xkCfg(flags)) if flags.ITk.Tracking.ActivePass.useITkPixel: - acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk( name = "ITkSiDetElementBoundaryLinksPixelCondAlg", - ReadKey = "ITkPixelDetectorElementCollection", - WriteKey = "ITkPixelDetElementBoundaryLinks_xk", - ITkGeometry = True ) ) - if flags.ITk.Tracking.ActivePass.useITkStrip: - acc.addCondAlgo(CompFactory.InDet.SiDetElementsRoadCondAlg_xk(name = "ITkSiDetElementsRoadCondAlg_xk", - PixelDetEleCollKey = "ITkPixelDetectorElementCollection", - SCTDetEleCollKey = "ITkStripDetectorElementCollection")) + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiDetElementBoundaryLinksCondAlg_xk_ITkPixel_Cfg + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_ITkPixel_Cfg(flags)) - acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk( name = "ITkSiDetElementBoundaryLinksSCTCondAlg", - ReadKey = "ITkStripDetectorElementCollection", - WriteKey = "ITkStripDetElementBoundaryLinks_xk", - ITkGeometry = True ) ) + if flags.ITk.Tracking.ActivePass.useITkStrip: + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiDetElementBoundaryLinksCondAlg_xk_ITkStrip_Cfg + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_ITkStrip_Cfg(flags)) + from InDetConfig.SiCombinatorialTrackFinderToolConfig import ITkSiCombinatorialTrackFinder_xkCfg track_finder = acc.popToolsAndMerge(ITkSiCombinatorialTrackFinder_xkCfg(flags)) kwargs.setdefault("useSCT", flags.ITk.Tracking.ActivePass.useITkStrip) @@ -269,188 +203,6 @@ def ITkCopyAlgForAmbiCfg(flags, name="ITkCopyAlgForAmbi", InputTrackCollection = acc.addEventAlgo(ITkCopyAlgForAmbi) return acc - -def ITkAmbiTrackSelectionToolCfg(flags, name="ITkAmbiTrackSelectionTool", **kwargs) : - acc = ComponentAccumulator() - - # ------------------------------------------------------------ - # - # ---------- Ambiguity solving - # - # ------------------------------------------------------------ - - # - # --- load InnerDetector TrackSelectionTool - # - - ITkPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(TC.ITkPRDtoTrackMapToolGangedPixelsCfg(flags)) - - kwargs.setdefault("DriftCircleCutTool", None) - kwargs.setdefault("AssociationTool" , ITkPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("minTRTHits" , 0) # used for Si only tracking !!! - kwargs.setdefault("UseParameterization" , False) - kwargs.setdefault("Cosmics" , flags.Beam.Type is BeamType.Cosmics) - kwargs.setdefault("doPixelSplitting" , flags.ITk.Tracking.doPixelClusterSplitting ) - kwargs.setdefault("doITk" , True) - - kwargs.setdefault("sharedProbCut" , flags.ITk.Tracking.pixelClusterSplitProb1) - kwargs.setdefault("sharedProbCut2" , flags.ITk.Tracking.pixelClusterSplitProb2) - kwargs.setdefault("minSiHitsToAllowSplitting" , 9) - kwargs.setdefault("minUniqueSCTHits" , 4) - kwargs.setdefault("minTrackChi2ForSharedHits" , 3) - kwargs.setdefault("minPtSplit" , 1000) #Only allow split clusters on track withe pt greater than this MeV - kwargs.setdefault("maxSharedModulesInROI" , 3) #Maximum number of shared modules for tracks in ROI - kwargs.setdefault("minNotSharedInROI" , 2) #Minimum number of unique modules for tracks in ROI - kwargs.setdefault("minSiHitsToAllowSplittingInROI" , 8) #Minimum number of Si hits to allow splittings for tracks in ROI - kwargs.setdefault("phiWidth" , 0.05) #Split cluster ROI size - kwargs.setdefault("etaWidth" , 0.05) #Split cluster ROI size - kwargs.setdefault("doEmCaloSeed" , flags.ITk.Tracking.doCaloSeededAmbi) #Only split in cluster in region of interest - kwargs.setdefault("InputEmClusterContainerName", 'ITkCaloClusterROIs') - if flags.Detector.EnableCalo: - from InDetConfig.ITkRecCaloSeededROISelectionConfig import ITkCaloClusterROI_SelectorCfg - acc.merge(ITkCaloClusterROI_SelectorCfg(flags)) - kwargs.setdefault("doHadCaloSeed" , flags.ITk.Tracking.doCaloSeededAmbi) #Do special cuts in region of interest - kwargs.setdefault("InputHadClusterContainerName", "ITkHadCaloClusterROIs" + "Bjet") - if flags.Detector.EnableCalo: - from InDetConfig.ITkRecCaloSeededROISelectionConfig import ITkHadCaloClusterROI_SelectorCfg - acc.merge(ITkHadCaloClusterROI_SelectorCfg(flags)) - kwargs.setdefault("minPtConv" , 10000) #Only allow split clusters on track withe pt greater than this MeV - kwargs.setdefault("minPtBjetROI" , 10000) - kwargs.setdefault("phiWidthEM" , 0.05) #Split cluster ROI size - kwargs.setdefault("etaWidthEM" , 0.05) #Split cluster ROI size - - if 'InDetEtaDependentCutsSvc' not in kwargs : - acc.merge(TC.ITkEtaDependentCutsSvcCfg(flags)) - kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"+flags.ITk.Tracking.ActivePass.extension)) - - ITkAmbiTrackSelectionTool = CompFactory.InDet.InDetDenseEnvAmbiTrackSelectionTool(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(ITkAmbiTrackSelectionTool) - return acc - -def ITkDenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, name = "ITkAmbiguityScoreProcessor", ClusterSplitProbContainer='', **kwargs) : - acc = ComponentAccumulator() - # - # --- set up different Scoring Tool for collisions and cosmics - # - if flags.Beam.Type is BeamType.Cosmics: - ITkAmbiScoringTool = acc.popToolsAndMerge(TC.ITkCosmicsScoringToolCfg(flags)) - else: - ITkAmbiScoringTool = acc.popToolsAndMerge(TC.ITkAmbiScoringToolCfg(flags)) - - from InDetConfig.ITkSiliconPreProcessing import ITkNnPixelClusterSplitProbToolCfg - ITkNnPixelClusterSplitProbTool = acc.popToolsAndMerge(ITkNnPixelClusterSplitProbToolCfg(flags)) - ITkPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(TC.ITkPRDtoTrackMapToolGangedPixelsCfg(flags)) - ITkPRDtoTrackMapTool = acc.popToolsAndMerge(TC.ITkPRDtoTrackMapToolCfg(flags)) - - kwargs.setdefault("sharedProbCut", flags.ITk.Tracking.pixelClusterSplitProb1) - kwargs.setdefault("sharedProbCut2", flags.ITk.Tracking.pixelClusterSplitProb2) - kwargs.setdefault("SplitClusterMap_new", 'SplitClusterAmbiguityMap'+flags.ITk.Tracking.ActivePass.extension) - - kwargs.setdefault("ScoringTool", ITkAmbiScoringTool) - kwargs.setdefault("SplitProbTool", ITkNnPixelClusterSplitProbTool if flags.ITk.Tracking.doPixelClusterSplitting else None,) - kwargs.setdefault("AssociationTool", ITkPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("AssociationToolNotGanged", ITkPRDtoTrackMapTool) - kwargs.setdefault("AssociationMapName", 'ITkPRDToTrackMap'+flags.ITk.Tracking.ActivePass.extension) - kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) - kwargs.setdefault("OutputClusterSplitProbabilityName", 'SplitProb'+flags.ITk.Tracking.ActivePass.extension) - - # DenseEnvironmentsAmbiguityScoreProcessorTool - ITkAmbiguityScoreProcessor = CompFactory.Trk.DenseEnvironmentsAmbiguityScoreProcessorTool(name=name+flags.ITk.Tracking.ActivePass.extension, **kwargs) - - acc.setPrivateTools(ITkAmbiguityScoreProcessor) - return acc - -def ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags, name = "ITkAmbiguityProcessor", **kwargs) : - acc = ComponentAccumulator() - - # - # --- set up different Scoring Tool for collisions and cosmics - # - if flags.Beam.Type is BeamType.Cosmics: - ITkAmbiScoringTool = acc.popToolsAndMerge(TC.ITkCosmicsScoringToolCfg(flags)) - else: - ITkAmbiScoringTool = acc.popToolsAndMerge(TC.ITkAmbiScoringToolCfg(flags)) - - fitter_args = {} - fitter_args.setdefault("DoHoleSearch", True) - - ITkBoundaryCheckTool = acc.popToolsAndMerge(ITkBoundaryCheckToolCfg(flags)) - fitter_args.setdefault("BoundaryCheckTool", ITkBoundaryCheckTool) - - fitter_list=[] - ITkTrackFitterAmbi = acc.popToolsAndMerge(TC.ITkTrackFitterAmbiCfg(flags, - name='ITkTrackFitterAmbi'+flags.ITk.Tracking.ActivePass.extension, - **fitter_args)) - fitter_list.append(ITkTrackFitterAmbi) - - ITkPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(TC.ITkPRDtoTrackMapToolGangedPixelsCfg(flags)) - - ambi_track_summary_tool = acc.getPrimaryAndMerge(TC.ITkTrackSummaryToolCfg( flags, - name = "ITkAmbiguityProcessorSplitProbTrackSummaryTool" + flags.ITk.Tracking.ActivePass.extension)) - - ITkAmbiTrackSelectionTool = acc.popToolsAndMerge(ITkAmbiTrackSelectionToolCfg(flags)) - - - kwargs.setdefault("Fitter", fitter_list) - kwargs.setdefault("AssociationTool", ITkPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("AssociationMapName", 'ITkPRDToTrackMap'+flags.ITk.Tracking.ActivePass.extension) - kwargs.setdefault("TrackSummaryTool", ambi_track_summary_tool) - kwargs.setdefault("ScoringTool", ITkAmbiScoringTool) - kwargs.setdefault("SelectionTool", ITkAmbiTrackSelectionTool) - kwargs.setdefault("InputClusterSplitProbabilityName", 'SplitProb'+flags.ITk.Tracking.ActivePass.extension) - kwargs.setdefault("OutputClusterSplitProbabilityName", 'ITkAmbiguityProcessorSplitProb'+flags.ITk.Tracking.ActivePass.extension) - kwargs.setdefault("SuppressHoleSearch", False) - kwargs.setdefault("tryBremFit", flags.ITk.Tracking.doBremRecovery and flags.Detector.EnableCalo and flags.ITk.Tracking.ActivePass.extension == "") # Disabled for second passes in reco - kwargs.setdefault("caloSeededBrem", flags.ITk.Tracking.doCaloSeededBrem and flags.Detector.EnableCalo) - kwargs.setdefault("pTminBrem", flags.ITk.Tracking.ActivePass.minPTBrem[0]) - kwargs.setdefault("RefitPrds", True) - kwargs.setdefault("KeepHolesFromBeforeRefit", False) - - # DenseEnvironmentsAmbiguityProcessorTool - ProcessorTool = CompFactory.Trk.DenseEnvironmentsAmbiguityProcessorTool - ITkAmbiguityProcessor = ProcessorTool(name=name+flags.ITk.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(ITkAmbiguityProcessor) - return acc - -def ITkTrkAmbiguityScoreCfg(flags, name="ITkAmbiguityScore", SiSPSeededTrackCollectionKey = None, ClusterSplitProbContainer='', **kwargs) : - acc = ComponentAccumulator() - # - # --- set input and output collection - # - InputTrackCollection = SiSPSeededTrackCollectionKey - - ITkAmbiguityScoreProcessor = acc.popToolsAndMerge(ITkDenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, ClusterSplitProbContainer=ClusterSplitProbContainer)) - - # - # --- configure Ambiguity (score) solver - # - kwargs.setdefault("TrackInput" , [ InputTrackCollection ]) - kwargs.setdefault("TrackOutput", 'ScoredMap'+'ITkAmbiguityScore'+ flags.ITk.Tracking.ActivePass.extension) - kwargs.setdefault("AmbiguityScoreProcessor" , ITkAmbiguityScoreProcessor ) ## TODO: check the case when it is None object - - ITkAmbiguityScore = CompFactory.Trk.TrkAmbiguityScore(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) - acc.addEventAlgo(ITkAmbiguityScore) - return acc - - -def ITkTrkAmbiguitySolverCfg(flags, name="ITkAmbiguitySolver", ResolvedTrackCollectionKey = None, **kwargs): - acc = ComponentAccumulator() - SiTrackCollection = ResolvedTrackCollectionKey - - # DenseEnvironmentsAmbiguityProcessorTool - ITkAmbiguityProcessor = acc.popToolsAndMerge(ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags)) - - # - # --- configure Ambiguity solver - # - kwargs.setdefault("TrackInput", 'ScoredMap'+'ITkAmbiguityScore'+ flags.ITk.Tracking.ActivePass.extension) - kwargs.setdefault("TrackOutput", SiTrackCollection) - kwargs.setdefault( "AmbiguityProcessor", ITkAmbiguityProcessor) - - ITkAmbiguitySolver = CompFactory.Trk.TrkAmbiguitySolver(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) - acc.addEventAlgo(ITkAmbiguitySolver ) - return acc - # ------------------------------------------------------------ # # ----------- Setup Si Pattern for New tracking @@ -490,6 +242,7 @@ def ITkTrackingSiPatternCfg(flags, InputCollections = None, ResolvedTrackCollect OutputTrackCollection = ResolvedTrackCollectionKey )) else: + from TrkConfig.TrkAmbiguitySolverConfig import ITkTrkAmbiguityScoreCfg, ITkTrkAmbiguitySolverCfg acc.merge(ITkTrkAmbiguityScoreCfg( flags, SiSPSeededTrackCollectionKey = SiSPSeededTrackCollectionKey, ClusterSplitProbContainer = ClusterSplitProbContainer)) diff --git a/InnerDetector/InDetConfig/python/InDetAmbiTrackSelectionToolConfig.py b/InnerDetector/InDetConfig/python/InDetAmbiTrackSelectionToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..2f9faf4702431d89fc0f14cad8255a960c787c90 --- /dev/null +++ b/InnerDetector/InDetConfig/python/InDetAmbiTrackSelectionToolConfig.py @@ -0,0 +1,179 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of InDetAmbiTrackSelectionTool package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import BeamType, LHCPeriod + +def InDetAmbiTrackSelectionToolCfg(flags, name = "InDetAmbiTrackSelectionTool", **kwargs) : + acc = ComponentAccumulator() + + # ------------------------------------------------------------ + # + # ---------- Ambiguity solving + # + # ------------------------------------------------------------ + + # + # --- load InnerDetector TrackSelectionTool + # + if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: + AmbiTrackSelectionTool = CompFactory.InDet.InDetDenseEnvAmbiTrackSelectionTool + else: + AmbiTrackSelectionTool = CompFactory.InDet.InDetAmbiTrackSelectionTool + + if 'UseParameterization' in kwargs and kwargs.get('UseParameterization',False) : + from InDetConfig.TrackingCommonConfig import InDetTRTDriftCircleCutForPatternRecoCfg + InDetTRTDriftCircleCut = acc.popToolsAndMerge(InDetTRTDriftCircleCutForPatternRecoCfg(flags)) + kwargs.setdefault("DriftCircleCutTool", InDetTRTDriftCircleCut) + + from InDetConfig.TrackingCommonConfig import InDetPRDtoTrackMapToolGangedPixelsCfg + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) + + kwargs.setdefault("AssociationTool" , InDetPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("minHits" , flags.InDet.Tracking.ActivePass.minClusters) + kwargs.setdefault("minNotShared" , flags.InDet.Tracking.ActivePass.minSiNotShared) + kwargs.setdefault("maxShared" , flags.InDet.Tracking.ActivePass.maxShared) + kwargs.setdefault("minTRTHits" , 0) # used for Si only tracking !!! + kwargs.setdefault("UseParameterization" , False) + kwargs.setdefault("Cosmics" , flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM") + kwargs.setdefault("doPixelSplitting" , flags.InDet.Tracking.doPixelClusterSplitting and flags.InDet.Tracking.ActivePass.extension != "DBM") + + if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: + kwargs.setdefault("sharedProbCut" , flags.InDet.Tracking.pixelClusterSplitProb1) + kwargs.setdefault("sharedProbCut2" , flags.InDet.Tracking.pixelClusterSplitProb2) + kwargs.setdefault("minSiHitsToAllowSplitting" , 8 if flags.GeoModel.Run is LHCPeriod.Run1 else 9) + kwargs.setdefault("minUniqueSCTHits" , 4) + kwargs.setdefault("minTrackChi2ForSharedHits" , 3) + kwargs.setdefault("minPtSplit" , 1000) #Only allow split clusters on track withe pt greater than this MeV + kwargs.setdefault("maxSharedModulesInROI" , 3) #Maximum number of shared modules for tracks in ROI + kwargs.setdefault("minNotSharedInROI" , 2) #Minimum number of unique modules for tracks in ROI + kwargs.setdefault("minSiHitsToAllowSplittingInROI" , 8) #Minimum number of Si hits to allow splittings for tracks in ROI + kwargs.setdefault("phiWidth" , 0.05) #Split cluster ROI size + kwargs.setdefault("etaWidth" , 0.05) #Split cluster ROI size + kwargs.setdefault("doEmCaloSeed" , flags.InDet.Tracking.doCaloSeededAmbi and flags.Detector.EnableCalo) #Only split in cluster in region of interest + kwargs.setdefault("InputEmClusterContainerName", 'InDetCaloClusterROIs') + if flags.InDet.Tracking.doCaloSeededAmbi: + from InDetConfig.InDetRecCaloSeededROISelectionConfig import CaloClusterROI_SelectorCfg + acc.merge(CaloClusterROI_SelectorCfg(flags)) + kwargs.setdefault("doHadCaloSeed" , flags.InDet.Tracking.doCaloSeededAmbi) #Do special cuts in region of interest + kwargs.setdefault("InputHadClusterContainerName", "InDetHadCaloClusterROIs" + "Bjet") + if flags.InDet.Tracking.doCaloSeededAmbi: + from InDetConfig.InDetRecCaloSeededROISelectionConfig import HadCaloClusterROI_SelectorCfg + acc.merge(HadCaloClusterROI_SelectorCfg(flags)) + kwargs.setdefault("minPtConv" , 10000) #Only allow split clusters on track withe pt greater than this MeV + kwargs.setdefault("minPtBjetROI" , 10000) + kwargs.setdefault("phiWidthEM" , 0.05) #Split cluster ROI size + kwargs.setdefault("etaWidthEM" , 0.05) #Split cluster ROI size + + elif flags.InDet.Tracking.ActivePass.extension == "DBM": + kwargs.setdefault("maxShared" , 1000) + kwargs.setdefault("maxTracksPerSharedPRD" , 2) + kwargs.setdefault("minHits" , 0) + kwargs.setdefault("minNotShared" , 0) + kwargs.setdefault("minScoreShareTracks" , 0.0) + kwargs.setdefault("minTRTHits" , 0) + kwargs.setdefault("sharedProbCut" , 0.1) + else: + kwargs.setdefault("sharedProbCut", 0.10) + + InDetAmbiTrackSelectionTool = AmbiTrackSelectionTool(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(InDetAmbiTrackSelectionTool) + return acc + +def InDetTRTAmbiTrackSelectionToolCfg(flags, name = 'InDetTRT_SeededAmbiTrackSelectionTool', **kwargs): + acc = ComponentAccumulator() + + from InDetConfig.TrackingCommonConfig import InDetTRTDriftCircleCutForPatternRecoCfg, InDetPRDtoTrackMapToolGangedPixelsCfg + InDetTRTDriftCircleCut = acc.popToolsAndMerge(InDetTRTDriftCircleCutForPatternRecoCfg(flags)) + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) + + kwargs.setdefault("DriftCircleCutTool", InDetTRTDriftCircleCut) + kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("minScoreShareTracks", -1.) # off ! + kwargs.setdefault("minHits", flags.InDet.Tracking.ActivePass.minSecondaryClusters) + kwargs.setdefault("minNotShared", flags.InDet.Tracking.ActivePass.minSecondarySiNotShared) + kwargs.setdefault("maxShared", flags.InDet.Tracking.ActivePass.maxSecondaryShared) + kwargs.setdefault("minTRTHits", flags.InDet.Tracking.ActivePass.minSecondaryTRTonTrk) + kwargs.setdefault("UseParameterization", flags.InDet.Tracking.ActivePass.useParameterizedTRTCuts) + kwargs.setdefault("Cosmics", flags.Beam.Type is BeamType.Cosmics) + kwargs.setdefault("doPixelSplitting", flags.InDet.Tracking.doPixelClusterSplitting) + + acc.setPrivateTools(CompFactory.InDet.InDetAmbiTrackSelectionTool(name, **kwargs)) + return acc + +def InDetTrigTrackSelectionToolCfg(flags, name = 'InDetTrigAmbiTrackSelectionTool', **kwargs): + acc = ComponentAccumulator() + + #TODO add configurations fro beamgas and cosmic see: trackSelectionTool_getter + from TrigInDetConfig.TrigInDetConfig import InDetPRDtoTrackMapToolGangedPixelsCfg + kwargs.setdefault("DriftCircleCutTool", None) + kwargs.setdefault("AssociationTool", acc.getPrimaryAndMerge( InDetPRDtoTrackMapToolGangedPixelsCfg(flags))) + kwargs.setdefault("minHits", flags.InDet.Tracking.ActivePass.minClusters) + kwargs.setdefault("minNotShared", flags.InDet.Tracking.ActivePass.minSiNotShared) + kwargs.setdefault("maxShared", flags.InDet.Tracking.ActivePass.maxShared) + kwargs.setdefault("minTRTHits", 0) # used for Si only tracking !!! + kwargs.setdefault("Cosmics", False) #there is a different instance + kwargs.setdefault("UseParameterization", False) + + acc.addPublicTool(CompFactory.InDet.InDetAmbiTrackSelectionTool(name, **kwargs), primary=True) + return acc + +def ITkAmbiTrackSelectionToolCfg(flags, name = "ITkAmbiTrackSelectionTool", **kwargs) : + acc = ComponentAccumulator() + + # ------------------------------------------------------------ + # + # ---------- Ambiguity solving + # + # ------------------------------------------------------------ + + # + # --- load InnerDetector TrackSelectionTool + # + + from InDetConfig.ITkTrackingCommonConfig import ITkPRDtoTrackMapToolGangedPixelsCfg + ITkPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(ITkPRDtoTrackMapToolGangedPixelsCfg(flags)) + + kwargs.setdefault("DriftCircleCutTool", None) + kwargs.setdefault("AssociationTool" , ITkPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("minTRTHits" , 0) # used for Si only tracking !!! + kwargs.setdefault("UseParameterization" , False) + kwargs.setdefault("Cosmics" , flags.Beam.Type is BeamType.Cosmics) + kwargs.setdefault("doPixelSplitting" , flags.ITk.Tracking.doPixelClusterSplitting ) + kwargs.setdefault("doITk" , True) + + kwargs.setdefault("sharedProbCut" , flags.ITk.Tracking.pixelClusterSplitProb1) + kwargs.setdefault("sharedProbCut2" , flags.ITk.Tracking.pixelClusterSplitProb2) + kwargs.setdefault("minSiHitsToAllowSplitting" , 9) + kwargs.setdefault("minUniqueSCTHits" , 4) + kwargs.setdefault("minTrackChi2ForSharedHits" , 3) + kwargs.setdefault("minPtSplit" , 1000) #Only allow split clusters on track withe pt greater than this MeV + kwargs.setdefault("maxSharedModulesInROI" , 3) #Maximum number of shared modules for tracks in ROI + kwargs.setdefault("minNotSharedInROI" , 2) #Minimum number of unique modules for tracks in ROI + kwargs.setdefault("minSiHitsToAllowSplittingInROI" , 8) #Minimum number of Si hits to allow splittings for tracks in ROI + kwargs.setdefault("phiWidth" , 0.05) #Split cluster ROI size + kwargs.setdefault("etaWidth" , 0.05) #Split cluster ROI size + kwargs.setdefault("doEmCaloSeed" , flags.ITk.Tracking.doCaloSeededAmbi) #Only split in cluster in region of interest + kwargs.setdefault("InputEmClusterContainerName", 'ITkCaloClusterROIs') + if flags.Detector.EnableCalo: + from InDetConfig.ITkRecCaloSeededROISelectionConfig import ITkCaloClusterROI_SelectorCfg + acc.merge(ITkCaloClusterROI_SelectorCfg(flags)) + kwargs.setdefault("doHadCaloSeed" , flags.ITk.Tracking.doCaloSeededAmbi) #Do special cuts in region of interest + kwargs.setdefault("InputHadClusterContainerName", "ITkHadCaloClusterROIs" + "Bjet") + if flags.Detector.EnableCalo: + from InDetConfig.ITkRecCaloSeededROISelectionConfig import ITkHadCaloClusterROI_SelectorCfg + acc.merge(ITkHadCaloClusterROI_SelectorCfg(flags)) + kwargs.setdefault("minPtConv" , 10000) #Only allow split clusters on track withe pt greater than this MeV + kwargs.setdefault("minPtBjetROI" , 10000) + kwargs.setdefault("phiWidthEM" , 0.05) #Split cluster ROI size + kwargs.setdefault("etaWidthEM" , 0.05) #Split cluster ROI size + + if 'InDetEtaDependentCutsSvc' not in kwargs : + from InDetConfig.ITkTrackingCommonConfig import ITkEtaDependentCutsSvcCfg + acc.merge(ITkEtaDependentCutsSvcCfg(flags)) + kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"+flags.ITk.Tracking.ActivePass.extension)) + + ITkAmbiTrackSelectionTool = CompFactory.InDet.InDetDenseEnvAmbiTrackSelectionTool(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(ITkAmbiTrackSelectionTool) + return acc diff --git a/InnerDetector/InDetConfig/python/ConversionFindingConfig.py b/InnerDetector/InDetConfig/python/InDetConversionFinderToolsConfig.py similarity index 60% rename from InnerDetector/InDetConfig/python/ConversionFindingConfig.py rename to InnerDetector/InDetConfig/python/InDetConversionFinderToolsConfig.py index 770cdb1c30fad335197c1436879aa28d95e0e213..fa04911820b2d56676eaef0bfbbc73aa608cfc4e 100644 --- a/InnerDetector/InDetConfig/python/ConversionFindingConfig.py +++ b/InnerDetector/InDetConfig/python/InDetConversionFinderToolsConfig.py @@ -1,10 +1,9 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of InDetConversionFinderTools package -# conversion/secondary vertex finding (for egamma) from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory - def ConversionPostSelectorCfg(flags, name="ConversionPostSelector"): acc = ComponentAccumulator() kwargs = {} @@ -20,7 +19,6 @@ def ConversionPostSelectorCfg(flags, name="ConversionPostSelector"): acc.setPrivateTools(tool) return acc - def SingleTrackConversionToolCfg(flags, name="SingleTrackConversionTool"): acc = ComponentAccumulator() kwargs = {} @@ -32,7 +30,6 @@ def SingleTrackConversionToolCfg(flags, name="SingleTrackConversionTool"): acc.setPrivateTools(tool) return acc - def TrackPairsSelectorCfg(flags, name="TrackPairsSelector"): acc = ComponentAccumulator() kwargs = {} @@ -48,53 +45,6 @@ def TrackPairsSelectorCfg(flags, name="TrackPairsSelector"): acc.setPrivateTools(tool) return acc - -def InDetConversionTrackSelectorToolCfg(flags, name="TrackSelector"): - acc = ComponentAccumulator() - kwargs = {} - from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg - 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 - kwargs["TRTTrksBinnedRatioTRT"] = flags.InDet.SecVertex.TrkSel.TRTTrksBinnedRatioTRT - kwargs["TRTTrksEtaBins"] = flags.InDet.SecVertex.TrkSel.TRTTrksEtaBins - kwargs["RatioTRT"] = flags.InDet.SecVertex.TrkSel.RatioTRT - kwargs["RatioV0"] = flags.InDet.SecVertex.TrkSel.RatioV0 - kwargs["maxSiD0"] = flags.InDet.SecVertex.TrkSel.maxSiD0 - kwargs["maxSiZ0"] = flags.InDet.SecVertex.TrkSel.maxSiZ0 - kwargs["maxTrtD0"] = flags.InDet.SecVertex.TrkSel.maxTrtD0 - kwargs["maxTrtZ0"] = flags.InDet.SecVertex.TrkSel.maxTrtZ0 - kwargs["minPt"] = 0. - kwargs["significanceD0_Si"] = flags.InDet.SecVertex.TrkSel.significanceD0_Si - kwargs["IsConversion"] = flags.InDet.SecVertex.TrkSel.IsConversion - - tool = CompFactory.InDet.InDetConversionTrackSelectorTool(name, **kwargs) - acc.setPrivateTools(tool) - return acc - - -def TrkVKalVrtFitterCfg(flags, name="TrkVKalVrtFitter"): - acc = ComponentAccumulator() - kwargs = {} - from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg - 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 - kwargs["IterationNumber"] = flags.InDet.SecVertex.Fitter.IterationNumber - kwargs["MakeExtendedVertex"] = flags.InDet.SecVertex.Fitter.MakeExtendedVertex - kwargs["Robustness"] = flags.InDet.SecVertex.Fitter.Robustness - kwargs["usePhiCnst"] = flags.InDet.SecVertex.Fitter.usePhiCnst - kwargs["useThetaCnst"] = flags.InDet.SecVertex.Fitter.useThetaCnst - kwargs["CovVrtForConstraint"] = flags.InDet.SecVertex.Fitter.CovVrtForConstraint - kwargs["VertexForConstraint"] = flags.InDet.SecVertex.Fitter.VertexForConstraint - - tool = CompFactory.Trk.TrkVKalVrtFitter(name, **kwargs) - acc.setPrivateTools(tool) - return acc - - def VertexPointEstimatorCfg(flags, name="VertexPointEstimator"): acc = ComponentAccumulator() kwargs = {} @@ -105,24 +55,28 @@ def VertexPointEstimatorCfg(flags, name="VertexPointEstimator"): acc.setPrivateTools(tool) return acc - -def ConversionFinderCfg(flags, name="ConversionFinderTool"): +def InDetConversionFinderToolsCfg(flags, name="ConversionFinderTool"): """Configures InDet::InDetConversionFinderTools """ acc = ComponentAccumulator() kwargs = {} + kwargs["PostSelector"] = acc.getPrimaryAndMerge( ConversionPostSelectorCfg(flags)) kwargs["SingleTrackConversionTool"] = acc.getPrimaryAndMerge( SingleTrackConversionToolCfg(flags)) kwargs["TrackPairsSelector"] = acc.getPrimaryAndMerge( TrackPairsSelectorCfg(flags)) + kwargs["VertexPointEstimator"] = acc.getPrimaryAndMerge( + VertexPointEstimatorCfg(flags)) + + from InDetConfig.InDetTrackSelectorToolConfig import InDetConversionTrackSelectorToolCfg kwargs["TrackSelectorTool"] = acc.getPrimaryAndMerge( InDetConversionTrackSelectorToolCfg(flags)) + + from TrkConfig.TrkVKalVrtFitterConfig import TrkVKalVrtFitterCfg kwargs["VertexFitterTool"] = acc.getPrimaryAndMerge( TrkVKalVrtFitterCfg(flags)) - kwargs["VertexPointEstimator"] = acc.getPrimaryAndMerge( - VertexPointEstimatorCfg(flags)) kwargs["TrackParticleCollection"] = flags.Egamma.Keys.Output.GSFTrackParticles kwargs["IsConversion"] = True kwargs["MaxDistVtxHit"] = flags.InDet.SecVertex.Finder.MaxDistVtxHit diff --git a/InnerDetector/InDetConfig/python/InDetTrackSelectorToolConfig.py b/InnerDetector/InDetConfig/python/InDetTrackSelectorToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..2d472fb7d8aca4dc726a11108f6834988aaedacf --- /dev/null +++ b/InnerDetector/InDetConfig/python/InDetTrackSelectorToolConfig.py @@ -0,0 +1,30 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of InDetTrackSelectorTool package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + + +def InDetConversionTrackSelectorToolCfg(flags, name="TrackSelector"): + acc = ComponentAccumulator() + kwargs = {} + from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg + 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 + kwargs["TRTTrksBinnedRatioTRT"] = flags.InDet.SecVertex.TrkSel.TRTTrksBinnedRatioTRT + kwargs["TRTTrksEtaBins"] = flags.InDet.SecVertex.TrkSel.TRTTrksEtaBins + kwargs["RatioTRT"] = flags.InDet.SecVertex.TrkSel.RatioTRT + kwargs["RatioV0"] = flags.InDet.SecVertex.TrkSel.RatioV0 + kwargs["maxSiD0"] = flags.InDet.SecVertex.TrkSel.maxSiD0 + kwargs["maxSiZ0"] = flags.InDet.SecVertex.TrkSel.maxSiZ0 + kwargs["maxTrtD0"] = flags.InDet.SecVertex.TrkSel.maxTrtD0 + kwargs["maxTrtZ0"] = flags.InDet.SecVertex.TrkSel.maxTrtZ0 + kwargs["minPt"] = 0. + kwargs["significanceD0_Si"] = flags.InDet.SecVertex.TrkSel.significanceD0_Si + kwargs["IsConversion"] = flags.InDet.SecVertex.TrkSel.IsConversion + + tool = CompFactory.InDet.InDetConversionTrackSelectorTool(name, **kwargs) + acc.setPrivateTools(tool) + return acc diff --git a/InnerDetector/InDetConfig/python/SiCombinatorialTrackFinderToolConfig.py b/InnerDetector/InDetConfig/python/SiCombinatorialTrackFinderToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..c54d866e397a4db8986376798a1b11979371cf2c --- /dev/null +++ b/InnerDetector/InDetConfig/python/SiCombinatorialTrackFinderToolConfig.py @@ -0,0 +1,166 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of SiCombinatorialTrackFinderTool_xk package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def SiDetElementBoundaryLinksCondAlg_xk_Pixel_Cfg(flags, name = "InDetSiDetElementBoundaryLinksPixelCondAlg", **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("ReadKey", "PixelDetectorElementCollection") + kwargs.setdefault("WriteKey", "PixelDetElementBoundaryLinks_xk") + + SiDetElementBoundaryLinksCondAlg = CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name, **kwargs) + acc.addEventAlgo(SiDetElementBoundaryLinksCondAlg) + return acc + +def SiDetElementBoundaryLinksCondAlg_xk_SCT_Cfg(flags, name = "InDetSiDetElementBoundaryLinksSCTCondAlg", **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("ReadKey", "SCT_DetectorElementCollection") + kwargs.setdefault("WriteKey", "SCT_DetElementBoundaryLinks_xk") + + SiDetElementBoundaryLinksCondAlg = CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name, **kwargs) + acc.addEventAlgo(SiDetElementBoundaryLinksCondAlg) + return acc + +def SiDetElementBoundaryLinksCondAlg_xk_ITkPixel_Cfg(flags, name = "ITkSiDetElementBoundaryLinksPixelCondAlg", **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("ReadKey", "ITkPixelDetectorElementCollection") + kwargs.setdefault("WriteKey", "ITkPixelDetElementBoundaryLinks_xk") + kwargs.setdefault("ITkGeometry", True) + + SiDetElementBoundaryLinksCondAlg = CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name, **kwargs) + acc.addEventAlgo(SiDetElementBoundaryLinksCondAlg) + return acc + +def SiDetElementBoundaryLinksCondAlg_xk_ITkStrip_Cfg(flags, name = "ITkSiDetElementBoundaryLinksStripCondAlg", **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("ReadKey", "ITkStripDetectorElementCollection") + kwargs.setdefault("WriteKey", "ITkStripDetElementBoundaryLinks_xk") + kwargs.setdefault("ITkGeometry", True) + + SiDetElementBoundaryLinksCondAlg = CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name, **kwargs) + acc.addEventAlgo(SiDetElementBoundaryLinksCondAlg) + return acc + +def SiCombinatorialTrackFinder_xkCfg(flags, name="InDetSiComTrackFinder", **kwargs) : + acc = ComponentAccumulator() + # + # --- Local track finding using sdCaloSeededSSSpace point seed + # + if flags.InDet.Tracking.doDBMstandalone: + from InDetConfig.TrackingCommonConfig import InDetRotCreatorDBMCfg + RotCreator = acc.popToolsAndMerge(InDetRotCreatorDBMCfg(flags)) + kwargs.setdefault("useSCT", False) + kwargs.setdefault("MagneticFieldMode", "NoField") + kwargs.setdefault("TrackQualityCut", 9.3) + else: + from InDetConfig.TrackingCommonConfig import InDetRotCreatorDigitalCfg + RotCreator = acc.popToolsAndMerge(InDetRotCreatorDigitalCfg(flags)) + kwargs.setdefault("useSCT", flags.Detector.EnableSCT) + + acc.addPublicTool(RotCreator) + kwargs.setdefault("RIOonTrackTool", RotCreator) + + from InDetConfig.TrackingCommonConfig import InDetPatternPropagatorCfg, InDetPatternUpdatorCfg + kwargs.setdefault("PropagatorTool", acc.getPrimaryAndMerge(InDetPatternPropagatorCfg())) + kwargs.setdefault("UpdatorTool", acc.getPrimaryAndMerge(InDetPatternUpdatorCfg())) + + from InDetConfig.InDetRecToolConfig import InDetBoundaryCheckToolCfg + kwargs.setdefault("BoundaryCheckTool", acc.popToolsAndMerge(InDetBoundaryCheckToolCfg(flags))) + + kwargs.setdefault("usePixel", flags.Detector.EnablePixel) + kwargs.setdefault("PixelClusterContainer", "PixelClusters") + kwargs.setdefault("SCT_ClusterContainer", "SCT_Clusters") + + if flags.Detector.EnablePixel: + from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg + kwargs.setdefault("PixelSummaryTool", acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags))) + else: + kwargs.setdefault("PixelSummaryTool", "") + + if flags.Detector.EnableSCT: + from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_ConditionsSummaryToolCfg + kwargs.setdefault("SctSummaryTool", acc.popToolsAndMerge(SCT_ConditionsSummaryToolCfg(flags))) + else: + kwargs.setdefault("SctSummaryTool", "") + + track_finder = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(track_finder) + return acc + +def SiCombinatorialTrackFinder_xk_Trig_Cfg( flags, name="InDetTrigSiComTrackFinder", **kwargs ): + """ + based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py + """ + acc = ComponentAccumulator() + from TrigInDetConfig.TrigInDetConfig import RungeKuttaPropagatorCfg, KalmanxkUpdatorCfg, RIO_OnTrackCreatorCfg + propagatorTool = acc.getPrimaryAndMerge( RungeKuttaPropagatorCfg( flags ) ) + patternUpdatorTool = acc.getPrimaryAndMerge( KalmanxkUpdatorCfg( flags ) ) + rioOnTrackTool = acc.getPrimaryAndMerge( RIO_OnTrackCreatorCfg( flags ) ) + + from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg + pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) ) + + from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_ConditionsSummaryToolCfg + sctCondSummaryTool = acc.popToolsAndMerge( SCT_ConditionsSummaryToolCfg( flags, withFlaggedCondTool=False, withTdaqTool=False ) ) + + kwargs.setdefault("PropagatorTool", propagatorTool) + kwargs.setdefault("UpdatorTool", patternUpdatorTool) + kwargs.setdefault("RIOonTrackTool", rioOnTrackTool) + kwargs.setdefault("usePixel", flags.Detector.EnablePixel) + kwargs.setdefault("useSCT", flags.Detector.EnableSCT) + kwargs.setdefault("PixelClusterContainer", 'PixelTrigClusters') + kwargs.setdefault("SCT_ClusterContainer", 'SCT_TrigClusters') + kwargs.setdefault("PixelSummaryTool", pixelCondSummaryTool) + kwargs.setdefault("SctSummaryTool", sctCondSummaryTool) + + SiCombinatorialTrackFinder = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name, **kwargs) + acc.setPrivateTools( SiCombinatorialTrackFinder ) + return acc + +def ITkSiCombinatorialTrackFinder_xkCfg(flags, name="ITkSiComTrackFinder", **kwargs) : + acc = ComponentAccumulator() + + # + # --- Local track finding using sdCaloSeededSSSpace point seed + # + from InDetConfig.ITkTrackingCommonConfig import ITkRotCreatorDigitalCfg + ITkRotCreatorDigital = acc.getPrimaryAndMerge(ITkRotCreatorDigitalCfg(flags)) + from InDetConfig.ITkRecToolConfig import ITkPatternPropagatorCfg, ITkPatternUpdatorCfg, ITkBoundaryCheckToolCfg + ITkPatternPropagator = acc.getPrimaryAndMerge(ITkPatternPropagatorCfg(flags)) + ITkPatternUpdator = acc.popToolsAndMerge(ITkPatternUpdatorCfg(flags)) + ITkBoundaryCheckTool = acc.popToolsAndMerge(ITkBoundaryCheckToolCfg(flags)) + + kwargs.setdefault("PropagatorTool", ITkPatternPropagator) + kwargs.setdefault("UpdatorTool", ITkPatternUpdator) + kwargs.setdefault("BoundaryCheckTool", ITkBoundaryCheckTool) + kwargs.setdefault("RIOonTrackTool", ITkRotCreatorDigital) + kwargs.setdefault("usePixel", flags.Detector.EnableITkPixel) + kwargs.setdefault("useSCT", flags.Detector.EnableITkStrip) + kwargs.setdefault("PixelClusterContainer", 'ITkPixelClusters') + kwargs.setdefault("SCT_ClusterContainer", 'ITkStripClusters') + kwargs.setdefault("PixelDetElementBoundaryLinks_xk", "ITkPixelDetElementBoundaryLinks_xk") + kwargs.setdefault("SCT_DetElementBoundaryLinks_xk", "ITkStripDetElementBoundaryLinks_xk") + kwargs.setdefault("SCTDetEleCollKey","ITkStripDetectorElementCollection") + kwargs.setdefault("ITkGeometry", True) + kwargs.setdefault("doFastTracking", flags.ITk.Tracking.doFastTracking) + + if flags.Detector.EnableITkPixel: + from PixelConditionsTools.ITkPixelConditionsSummaryConfig import ITkPixelConditionsSummaryCfg + kwargs.setdefault("PixelSummaryTool", acc.popToolsAndMerge(ITkPixelConditionsSummaryCfg(flags))) + else: + kwargs.setdefault("PixelSummaryTool", None) + + if flags.Detector.EnableITkStrip: + from SCT_ConditionsTools.ITkStripConditionsToolsConfig import ITkStripConditionsSummaryToolCfg + kwargs.setdefault("SctSummaryTool", acc.popToolsAndMerge(ITkStripConditionsSummaryToolCfg(flags))) + else: + kwargs.setdefault("SctSummaryTool", None) + + ITkSiComTrackFinder = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(ITkSiComTrackFinder) + return acc diff --git a/InnerDetector/InDetConfig/python/SiDetElementsRoadToolConfig.py b/InnerDetector/InDetConfig/python/SiDetElementsRoadToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..51174bf65bf6af57b387ecf5cb361b787b2e4252 --- /dev/null +++ b/InnerDetector/InDetConfig/python/SiDetElementsRoadToolConfig.py @@ -0,0 +1,73 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of SiDetElementsRoadTool_xk package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import BeamType + +def SiDetElementsRoadMaker_xkCfg(flags, name="InDetSiRoadMaker", **kwargs) : + acc = ComponentAccumulator() + # + # --- SCT and Pixel detector elements road builder + # + + # Create ReadCondHandle SiDetElementsLayerVectors_xk + acc.addCondAlgo(CompFactory.InDet.SiDetElementsRoadCondAlg_xk(name = "InDet__SiDetElementsRoadCondAlg_xk")) + + from InDetConfig.TrackingCommonConfig import InDetPatternPropagatorCfg + InDetPatternPropagator = acc.getPrimaryAndMerge(InDetPatternPropagatorCfg()) + + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + kwargs.setdefault("usePixel", flags.InDet.Tracking.ActivePass.usePixel ) + kwargs.setdefault("PixManagerLocation", 'Pixel') + kwargs.setdefault("useSCT", flags.InDet.Tracking.ActivePass.useSCT) + kwargs.setdefault("SCTManagerLocation", 'SCT') + kwargs.setdefault("RoadWidth", flags.InDet.Tracking.ActivePass.roadWidth) + + InDetSiDetElementsRoadMaker = CompFactory.InDet.SiDetElementsRoadMaker_xk(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(InDetSiDetElementsRoadMaker) + return acc + +def SiDetElementsRoadMaker_xk_TRT_Cfg(flags, name = 'InDetTRT_SeededSiRoad', **kwargs): + # + # Silicon det elements road maker tool + # + kwargs.setdefault("RoadWidth", 50. if flags.Beam.Type is BeamType.Cosmics else 35.) + kwargs.setdefault("MaxStep", 20.) + + return SiDetElementsRoadMaker_xkCfg(flags, name, **kwargs) + +def SiDetElementsRoadMaker_xk_Trig_Cfg( flags, name="InDetTrigSiDetElementsRoadMaker", **kwargs ): + acc = ComponentAccumulator() + + from TrigInDetConfig.TrigInDetConfig import RungeKuttaPropagatorCfg + RungeKuttaPropagator = acc.getPrimaryAndMerge(RungeKuttaPropagatorCfg(flags)) + kwargs.setdefault("PropagatorTool", RungeKuttaPropagator) + + return SiDetElementsRoadMaker_xkCfg(flags, name, **kwargs) + +def ITkSiDetElementsRoadMaker_xkCfg(flags, name="ITkSiRoadMaker", **kwargs) : + acc = ComponentAccumulator() + # + # --- ITk Strip and Pixel detector elements road builder + # + + # Create ReadCondHandle SiDetElementsLayerVectors_xk + acc.addCondAlgo(CompFactory.InDet.SiDetElementsRoadCondAlg_xk(name = "InDet__SiDetElementsRoadCondAlg_xk", + PixelDetEleCollKey = "ITkPixelDetectorElementCollection", + SCTDetEleCollKey = "ITkStripDetectorElementCollection")) + + from InDetConfig.ITkRecToolConfig import ITkPatternPropagatorCfg + ITkPatternPropagator = acc.getPrimaryAndMerge(ITkPatternPropagatorCfg(flags)) + + kwargs.setdefault("PropagatorTool", ITkPatternPropagator) + kwargs.setdefault("usePixel", flags.ITk.Tracking.ActivePass.useITkPixel ) + kwargs.setdefault("PixManagerLocation", 'ITkPixel') + kwargs.setdefault("useSCT", flags.ITk.Tracking.ActivePass.useITkStrip) + kwargs.setdefault("SCTManagerLocation", 'ITkStrip') + kwargs.setdefault("RoadWidth", flags.ITk.Tracking.ActivePass.roadWidth) + + ITkSiDetElementsRoadMaker = CompFactory.InDet.SiDetElementsRoadMaker_xk(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(ITkSiDetElementsRoadMaker) + return acc + diff --git a/InnerDetector/InDetConfig/python/TRT_SeededSpacePointFinderToolConfig.py b/InnerDetector/InDetConfig/python/TRT_SeededSpacePointFinderToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..ca797d35dbdd2fbf510dfb8c920bdef3c02005d4 --- /dev/null +++ b/InnerDetector/InDetConfig/python/TRT_SeededSpacePointFinderToolConfig.py @@ -0,0 +1,49 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of TRT_SeededSpacePointFinderTool package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import BeamType + +def SimpleTRT_SeededSpacePointFinder_ATLCfg(flags, name='InDetTRT_SeededSpFinder', InputCollections=[], **kwargs): + from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg + acc = MagneticFieldSvcCfg(flags) + + # + # --- decide if use the association tool + # + usePrdAssociationTool = (len(InputCollections) > 0) + + kwargs.setdefault("SpacePointsSCTName", 'SCT_SpacePoints') + kwargs.setdefault("PRDtoTrackMap", 'InDetSegmentPRDtoTrackMap' if usePrdAssociationTool else "") + kwargs.setdefault("PerigeeCut", 1000.) + kwargs.setdefault("DirectionPhiCut", .3) + kwargs.setdefault("DirectionEtaCut", 1.) + kwargs.setdefault("MaxHoles", 2) + kwargs.setdefault("RestrictROI", True) + + InDetTRT_SeededSpacePointFinder = CompFactory.InDet.SimpleTRT_SeededSpacePointFinder_ATL(name = name, **kwargs) + acc.setPrivateTools(InDetTRT_SeededSpacePointFinder) + return acc + +def TRT_SeededSpacePointFinder_ATLCfg(flags, name='InDetTRT_SeededSpFinder', InputCollections=[], **kwargs): + acc = ComponentAccumulator() + # + # --- decide if use the association tool + # + usePrdAssociationTool = (len(InputCollections) > 0) + + # + # --- defaul space point finder + # + kwargs.setdefault("SpacePointsSCTName", 'SCT_SpacePoints') + kwargs.setdefault("SpacePointsOverlapName", 'OverlapSpacePoints') + kwargs.setdefault("PRDtoTrackMap", 'InDetSegmentPRDtoTrackMap' if usePrdAssociationTool else "") + kwargs.setdefault("NeighborSearch", True) + kwargs.setdefault("LoadFull", False) + kwargs.setdefault("DoCosmics", flags.Beam.Type is BeamType.Cosmics) + kwargs.setdefault("pTmin", flags.InDet.Tracking.ActivePass.minSecondaryPt) + + InDetTRT_SeededSpacePointFinder = CompFactory.InDet.TRT_SeededSpacePointFinder_ATL(name = name, **kwargs) + acc.setPrivateTools(InDetTRT_SeededSpacePointFinder) + return acc diff --git a/InnerDetector/InDetConfig/python/TRT_SeededTrackFinderConfig.py b/InnerDetector/InDetConfig/python/TRT_SeededTrackFinderConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..b9a3568583589eabf21a494c06bfcd21551a3e53 --- /dev/null +++ b/InnerDetector/InDetConfig/python/TRT_SeededTrackFinderConfig.py @@ -0,0 +1,71 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of TRT_SeededTrackFinder package + +from AthenaConfiguration.ComponentFactory import CompFactory + +def TRT_SeededTrackFinderCfg(flags, name='InDetTRT_SeededTrackFinder', InputCollections=[], **kwargs): + + # TRT seeded back tracking algorithm + + # + # --- decide if use the association tool + # + usePrdAssociationTool = (len(InputCollections) > 0) + + from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg + acc = BeamSpotCondAlgCfg(flags) + + if flags.InDet.Tracking.ActivePass.usePixel: + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiDetElementBoundaryLinksCondAlg_xk_Pixel_Cfg + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_Pixel_Cfg(flags)) + + if flags.InDet.Tracking.ActivePass.useSCT: + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiDetElementBoundaryLinksCondAlg_xk_SCT_Cfg + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_SCT_Cfg(flags)) + + from InDetConfig.TrackingCommonConfig import InDetTrackFitterBTCfg, InDetTrackSummaryToolNoHoleSearchCfg, InDetTRT_ExtensionToolCfg + InDetTrackFitterBT = acc.popToolsAndMerge(InDetTrackFitterBTCfg(flags)) + InDetTrackSummaryToolNoHoleSearch = acc.getPrimaryAndMerge(InDetTrackSummaryToolNoHoleSearchCfg(flags)) + InDetTRTExtensionTool = acc.popToolsAndMerge(InDetTRT_ExtensionToolCfg(flags)) + acc.addPublicTool(InDetTRTExtensionTool) + + from TrkConfig.AtlasExtrapolatorConfig import InDetExtrapolatorCfg + InDetExtrapolator = acc.getPrimaryAndMerge(InDetExtrapolatorCfg(flags)) + + from InDetConfig.TRT_SeededTrackFinderToolConfig import TRT_SeededTrackFinder_ATLCfg + InDetTRT_SeededTrackTool = acc.popToolsAndMerge(TRT_SeededTrackFinder_ATLCfg(flags, InputCollections=InputCollections)) + acc.addPublicTool(InDetTRT_SeededTrackTool) + + kwargs.setdefault("RefitterTool", InDetTrackFitterBT) + kwargs.setdefault("TrackTool", InDetTRT_SeededTrackTool) + kwargs.setdefault("PRDtoTrackMap", 'InDetSegmentPRDtoTrackMap' if usePrdAssociationTool else "") + kwargs.setdefault("TrackSummaryTool", InDetTrackSummaryToolNoHoleSearch) + kwargs.setdefault("TrackExtensionTool", InDetTRTExtensionTool) + kwargs.setdefault("MinTRTonSegment", flags.InDet.Tracking.ActivePass.minSecondaryTRTonTrk) + kwargs.setdefault("MinTRTonly", flags.InDet.Tracking.ActivePass.minTRTonly) + kwargs.setdefault("TrtExtension", True) + kwargs.setdefault("SiExtensionCuts", flags.InDet.Tracking.ActivePass.SiExtensionCuts) + kwargs.setdefault("minPt", flags.InDet.Tracking.ActivePass.minSecondaryPt) + kwargs.setdefault("maxRPhiImp", flags.InDet.Tracking.ActivePass.maxSecondaryImpact) + kwargs.setdefault("maxZImp", flags.InDet.Tracking.ActivePass.maxZImpact) + kwargs.setdefault("maxEta", flags.InDet.Tracking.ActivePass.maxEta) + kwargs.setdefault("Extrapolator", InDetExtrapolator) + kwargs.setdefault("RejectShortExtension", flags.InDet.Tracking.ActivePass.rejectShortExtensions) + kwargs.setdefault("FinalRefit", False) + kwargs.setdefault("FinalStatistics", False) + kwargs.setdefault("OutputSegments", False) + kwargs.setdefault("InputSegmentsLocation", 'TRTSegments') + kwargs.setdefault("OutputTracksLocation", 'TRTSeededTracks') + kwargs.setdefault("CaloClusterEt", flags.InDet.Tracking.ActivePass.minRoIClusterEt) + + if flags.InDet.Tracking.ActivePass.RoISeededBackTracking: + from RegionSelector.RegSelToolConfig import regSelTool_SCT_Cfg + RegSelTool_SCT = acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags)) + acc.addPublicTool(RegSelTool_SCT) + + kwargs.setdefault("RegSelTool", RegSelTool_SCT) + kwargs.setdefault("CaloSeededRoI", True) + + InDetTRT_SeededTrackFinder = CompFactory.InDet.TRT_SeededTrackFinder(name = name, **kwargs) + acc.addEventAlgo(InDetTRT_SeededTrackFinder) + return acc diff --git a/InnerDetector/InDetConfig/python/TRT_SeededTrackFinderToolConfig.py b/InnerDetector/InDetConfig/python/TRT_SeededTrackFinderToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..f511cb75caa408cbd3088e45d27fb18b99d177c5 --- /dev/null +++ b/InnerDetector/InDetConfig/python/TRT_SeededTrackFinderToolConfig.py @@ -0,0 +1,57 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of TRT_SeededTrackFinderTool package + +from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import BeamType + +def TRT_SeededTrackFinder_ATLCfg(flags, name='InDetTRT_SeededTrackMaker', InputCollections=[], **kwargs): + from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg + acc = MagneticFieldSvcCfg(flags) + + # + # --- TRT seeded back tracking tool + # + from InDetConfig.TrackingCommonConfig import InDetPatternPropagatorCfg, InDetPatternUpdatorCfg + InDetPatternPropagator = acc.getPrimaryAndMerge(InDetPatternPropagatorCfg()) + InDetPatternUpdator = acc.getPrimaryAndMerge(InDetPatternUpdatorCfg()) + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiCombinatorialTrackFinder_xkCfg + InDetSiComTrackFinder = acc.popToolsAndMerge(SiCombinatorialTrackFinder_xkCfg(flags)) + + if flags.InDet.Tracking.ActivePass.usePixel and flags.InDet.Tracking.ActivePass.useSCT: + from InDetConfig.SiDetElementsRoadToolConfig import SiDetElementsRoadMaker_xk_TRT_Cfg + InDetTRT_SeededSiRoadMaker = acc.popToolsAndMerge(SiDetElementsRoadMaker_xk_TRT_Cfg(flags)) + acc.addPublicTool(InDetTRT_SeededSiRoadMaker) + kwargs.setdefault("RoadTool", InDetTRT_SeededSiRoadMaker) + + # + # --- decide which TRT seed space point finder to use + # + from InDetConfig.TRT_SeededSpacePointFinderToolConfig import TRT_SeededSpacePointFinder_ATLCfg + InDetTRT_SeededSpacePointFinder = acc.popToolsAndMerge(TRT_SeededSpacePointFinder_ATLCfg(flags, InputCollections=InputCollections)) + acc.addPublicTool(InDetTRT_SeededSpacePointFinder) + + kwargs.setdefault("PropagatorTool", InDetPatternPropagator) + kwargs.setdefault("UpdatorTool", InDetPatternUpdator) + kwargs.setdefault("SeedTool", InDetTRT_SeededSpacePointFinder) + kwargs.setdefault("CombinatorialTrackFinder", InDetSiComTrackFinder) + kwargs.setdefault("pTmin", flags.InDet.Tracking.ActivePass.minSecondaryPt) + kwargs.setdefault("nHolesMax", flags.InDet.Tracking.ActivePass.SecondarynHolesMax) + kwargs.setdefault("nHolesGapMax", flags.InDet.Tracking.ActivePass.SecondarynHolesGapMax) + kwargs.setdefault("Xi2max", flags.InDet.Tracking.ActivePass.SecondaryXi2max) + kwargs.setdefault("Xi2maxNoAdd", flags.InDet.Tracking.ActivePass.SecondaryXi2maxNoAdd) + kwargs.setdefault("SearchInCaloROI", False) + if kwargs["SearchInCaloROI"]: + from InDetConfig.InDetRecCaloSeededROISelectionConfig import CaloClusterROI_SelectorCfg + acc.merge(CaloClusterROI_SelectorCfg(flags)) + kwargs.setdefault("InputClusterContainerName", "InDetCaloClusterROIs") # InDetKeys.CaloClusterROIContainer() + else: + kwargs.setdefault("InputClusterContainerName", "") + kwargs.setdefault("ConsistentSeeds", True) + kwargs.setdefault("BremCorrection", False) + + if flags.Beam.Type is BeamType.Cosmics: + kwargs.setdefault("nWClustersMin", 0) + + InDetTRT_SeededTrackTool = CompFactory.InDet.TRT_SeededTrackFinder_ATL(name = name, **kwargs) + acc.setPrivateTools(InDetTRT_SeededTrackTool) + return acc diff --git a/InnerDetector/InDetConfig/python/TrackingCommonConfig.py b/InnerDetector/InDetConfig/python/TrackingCommonConfig.py index 179dead752d3565d0f85aebf2a4b1788b9150512..229468f239a0bd887cea3208564f6eff82096062 100644 --- a/InnerDetector/InDetConfig/python/TrackingCommonConfig.py +++ b/InnerDetector/InDetConfig/python/TrackingCommonConfig.py @@ -1159,37 +1159,6 @@ def InDetCosmicExtenScoringToolCfg(flags, name='InDetCosmicExtenScoringTool',**k acc.setPrivateTools(acc.popToolsAndMerge(InDetCosmicsScoringToolBaseCfg(flags, name = 'InDetCosmicExtenScoringTool', **kwargs))) return acc -def SiCombinatorialTrackFinder_xkCfg(flags, name='InDetSiComTrackFinder', **kwargs): - acc = ComponentAccumulator() - - InDetPatternPropagator = acc.getPrimaryAndMerge(InDetPatternPropagatorCfg()) - InDetPatternUpdator = acc.getPrimaryAndMerge(InDetPatternUpdatorCfg()) - - InDetRotCreatorDigital = acc.popToolsAndMerge(InDetRotCreatorDigitalCfg(flags)) - acc.addPublicTool(InDetRotCreatorDigital) - - from InDetConfig.InDetRecToolConfig import InDetBoundaryCheckToolCfg - InDetBoundaryCheckTool = acc.popToolsAndMerge(InDetBoundaryCheckToolCfg(flags)) - - kwargs.setdefault("PropagatorTool", InDetPatternPropagator) - kwargs.setdefault("UpdatorTool", InDetPatternUpdator) - kwargs.setdefault("BoundaryCheckTool", InDetBoundaryCheckTool) - kwargs.setdefault("RIOonTrackTool", InDetRotCreatorDigital) - kwargs.setdefault("usePixel", flags.Detector.EnablePixel) #DetFlags.haveRIO.pixel_on() - kwargs.setdefault("useSCT", flags.Detector.EnableSCT) - kwargs.setdefault("PixelClusterContainer", 'PixelClusters') #InDetKeys.PixelClusters() - kwargs.setdefault("SCT_ClusterContainer", 'SCT_Clusters') # InDetKeys.SCT_Clusters() - if "PixelSummaryTool" not in kwargs: - from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg - kwargs.setdefault("PixelSummaryTool", acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags))) - if "SctSummaryTool" not in kwargs: - from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_ConditionsSummaryToolCfg - kwargs.setdefault("SctSummaryTool", acc.popToolsAndMerge(SCT_ConditionsSummaryToolCfg(flags))) - - InDetSiComTrackFinder = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name=name, **kwargs) - acc.setPrivateTools(InDetSiComTrackFinder) - return acc - def InDetCosmicScoringTool_TRTCfg(flags, name='InDetCosmicExtenScoringTool',**kwargs) : acc = ComponentAccumulator() InDetTrackSummaryToolNoHoleSearch = acc.popToolsAndMerge(InDetTrackSummaryToolNoHoleSearchCfg(flags)) diff --git a/InnerDetector/InDetConfig/python/TrackingSiPatternConfig.py b/InnerDetector/InDetConfig/python/TrackingSiPatternConfig.py index 6ab8fe4c8af44e2b3fc59f06a2c9712faf4c430f..fc0afd675ecfcd5a5246ca12c7ffe990eb218030 100644 --- a/InnerDetector/InDetConfig/python/TrackingSiPatternConfig.py +++ b/InnerDetector/InDetConfig/python/TrackingSiPatternConfig.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -from AthenaConfiguration.Enums import BeamType, LHCPeriod +from AthenaConfiguration.Enums import BeamType import InDetConfig.TrackingCommonConfig as TC @@ -104,85 +104,26 @@ def SiZvertexMaker_xkCfg(flags, name="InDetZvertexMaker", InputCollections = Non acc.setPrivateTools(InDetZvertexMaker) return acc -def SiDetElementsRoadMaker_xkCfg(flags, name="InDetSiRoadMaker", **kwargs) : - acc = ComponentAccumulator() - # - # --- SCT and Pixel detector elements road builder - # - InDetPatternPropagator = acc.getPrimaryAndMerge(TC.InDetPatternPropagatorCfg()) - - kwargs.setdefault("PropagatorTool", InDetPatternPropagator) - kwargs.setdefault("usePixel", flags.InDet.Tracking.ActivePass.usePixel ) - kwargs.setdefault("PixManagerLocation", 'Pixel') - kwargs.setdefault("useSCT", flags.InDet.Tracking.ActivePass.useSCT) - kwargs.setdefault("SCTManagerLocation", 'SCT') - kwargs.setdefault("RoadWidth", flags.InDet.Tracking.ActivePass.roadWidth) - - InDetSiDetElementsRoadMaker = CompFactory.InDet.SiDetElementsRoadMaker_xk(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(InDetSiDetElementsRoadMaker) - return acc - -def SiCombinatorialTrackFinder_xkCfg(flags, name="InDetSiComTrackFinder", **kwargs) : - acc = ComponentAccumulator() - # - # --- Local track finding using sdCaloSeededSSSpace point seed - # - if flags.InDet.Tracking.doDBMstandalone: - RotCreator = acc.popToolsAndMerge(TC.InDetRotCreatorDBMCfg(flags)) - kwargs.setdefault("useSCT", False) - kwargs.setdefault("MagneticFieldMode", "NoField") - kwargs.setdefault("TrackQualityCut", 9.3) - else: - RotCreator = acc.popToolsAndMerge(TC.InDetRotCreatorDigitalCfg(flags)) - kwargs.setdefault("useSCT", flags.Detector.EnableSCT) - - acc.addPublicTool(RotCreator) - kwargs.setdefault("RIOonTrackTool", RotCreator) - - kwargs.setdefault("PropagatorTool", acc.getPrimaryAndMerge(TC.InDetPatternPropagatorCfg())) - kwargs.setdefault("UpdatorTool", acc.getPrimaryAndMerge(TC.InDetPatternUpdatorCfg())) - - from InDetConfig.InDetRecToolConfig import InDetBoundaryCheckToolCfg - kwargs.setdefault("BoundaryCheckTool", acc.popToolsAndMerge(InDetBoundaryCheckToolCfg(flags))) - - kwargs.setdefault("usePixel", flags.Detector.EnablePixel) - kwargs.setdefault("PixelClusterContainer", "PixelClusters") - kwargs.setdefault("SCT_ClusterContainer", "SCT_Clusters") - - if flags.Detector.EnablePixel: - from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg - kwargs.setdefault("PixelSummaryTool", acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags))) - else: - kwargs.setdefault("PixelSummaryTool", "") - - if flags.Detector.EnableSCT: - from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_ConditionsSummaryToolCfg - kwargs.setdefault("SctSummaryTool", acc.popToolsAndMerge(SCT_ConditionsSummaryToolCfg(flags))) - else: - kwargs.setdefault("SctSummaryTool", "") - - track_finder = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(track_finder) - return acc - def SiTrackMaker_xkCfg(flags, name="InDetSiTrackMaker", InputCollections = None, **kwargs) : acc = ComponentAccumulator() if flags.InDet.Tracking.ActivePass.usePixel: - acc.addCondAlgo(CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name="InDetSiDetElementBoundaryLinksPixelCondAlg", - ReadKey="PixelDetectorElementCollection", - WriteKey="PixelDetElementBoundaryLinks_xk")) - if flags.InDet.Tracking.ActivePass.useSCT: - acc.addCondAlgo(CompFactory.InDet.SiDetElementsRoadCondAlg_xk(name="InDet__SiDetElementsRoadCondAlg_xk")) + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiDetElementBoundaryLinksCondAlg_xk_Pixel_Cfg + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_Pixel_Cfg(flags)) - acc.addCondAlgo(CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name="InDetSiDetElementBoundaryLinksSCTCondAlg", - ReadKey="SCT_DetectorElementCollection", - WriteKey="SCT_DetElementBoundaryLinks_xk")) + if flags.InDet.Tracking.ActivePass.useSCT: + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiDetElementBoundaryLinksCondAlg_xk_SCT_Cfg + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_SCT_Cfg(flags)) kwargs.setdefault("useSCT", flags.InDet.Tracking.ActivePass.useSCT) kwargs.setdefault("usePixel", flags.InDet.Tracking.ActivePass.usePixel) + + from InDetConfig.SiDetElementsRoadToolConfig import SiDetElementsRoadMaker_xkCfg kwargs.setdefault("RoadTool", acc.popToolsAndMerge(SiDetElementsRoadMaker_xkCfg(flags))) + + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiCombinatorialTrackFinder_xkCfg kwargs.setdefault("CombinatorialTrackFinder", acc.popToolsAndMerge(SiCombinatorialTrackFinder_xkCfg(flags))) + kwargs.setdefault("pTmin", flags.InDet.Tracking.ActivePass.minPT) kwargs.setdefault("pTminBrem", flags.InDet.Tracking.ActivePass.minPTBrem) kwargs.setdefault("pTminSSS", flags.InDet.Tracking.ActivePass.pT_SSScut) @@ -300,276 +241,6 @@ def SiSPSeededTrackFinderCfg(flags, name="InDetSiSpTrackFinder", InputCollection acc.addEventAlgo(InDetSiSPSeededTrackFinder) return acc -def InDetAmbiTrackSelectionToolCfg(flags, name="InDetAmbiTrackSelectionTool", **kwargs) : - acc = ComponentAccumulator() - - # ------------------------------------------------------------ - # - # ---------- Ambiguity solving - # - # ------------------------------------------------------------ - - # - # --- load InnerDetector TrackSelectionTool - # - if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: - AmbiTrackSelectionTool = CompFactory.InDet.InDetDenseEnvAmbiTrackSelectionTool - else: - AmbiTrackSelectionTool = CompFactory.InDet.InDetAmbiTrackSelectionTool - - if 'UseParameterization' in kwargs and kwargs.get('UseParameterization',False) : - InDetTRTDriftCircleCut = acc.popToolsAndMerge(TC.InDetTRTDriftCircleCutForPatternRecoCfg(flags)) - kwargs.setdefault("DriftCircleCutTool", InDetTRTDriftCircleCut) - - InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) - - kwargs.setdefault("AssociationTool" , InDetPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("minHits" , flags.InDet.Tracking.ActivePass.minClusters) - kwargs.setdefault("minNotShared" , flags.InDet.Tracking.ActivePass.minSiNotShared) - kwargs.setdefault("maxShared" , flags.InDet.Tracking.ActivePass.maxShared) - kwargs.setdefault("minTRTHits" , 0) # used for Si only tracking !!! - kwargs.setdefault("UseParameterization" , False) - kwargs.setdefault("Cosmics" , flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM") - kwargs.setdefault("doPixelSplitting" , flags.InDet.Tracking.doPixelClusterSplitting and flags.InDet.Tracking.ActivePass.extension != "DBM") - - if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: - kwargs.setdefault("sharedProbCut" , flags.InDet.Tracking.pixelClusterSplitProb1) - kwargs.setdefault("sharedProbCut2" , flags.InDet.Tracking.pixelClusterSplitProb2) - kwargs.setdefault("minSiHitsToAllowSplitting" , 8 if flags.GeoModel.Run is LHCPeriod.Run1 else 9) - kwargs.setdefault("minUniqueSCTHits" , 4) - kwargs.setdefault("minTrackChi2ForSharedHits" , 3) - kwargs.setdefault("minPtSplit" , 1000) #Only allow split clusters on track withe pt greater than this MeV - kwargs.setdefault("maxSharedModulesInROI" , 3) #Maximum number of shared modules for tracks in ROI - kwargs.setdefault("minNotSharedInROI" , 2) #Minimum number of unique modules for tracks in ROI - kwargs.setdefault("minSiHitsToAllowSplittingInROI" , 8) #Minimum number of Si hits to allow splittings for tracks in ROI - kwargs.setdefault("phiWidth" , 0.05) #Split cluster ROI size - kwargs.setdefault("etaWidth" , 0.05) #Split cluster ROI size - kwargs.setdefault("doEmCaloSeed" , flags.InDet.Tracking.doCaloSeededAmbi and flags.Detector.EnableCalo) #Only split in cluster in region of interest - kwargs.setdefault("InputEmClusterContainerName", 'InDetCaloClusterROIs') - if flags.InDet.Tracking.doCaloSeededAmbi: - from InDetConfig.InDetRecCaloSeededROISelectionConfig import CaloClusterROI_SelectorCfg - acc.merge(CaloClusterROI_SelectorCfg(flags)) - kwargs.setdefault("doHadCaloSeed" , flags.InDet.Tracking.doCaloSeededAmbi) #Do special cuts in region of interest - kwargs.setdefault("InputHadClusterContainerName", "InDetHadCaloClusterROIs" + "Bjet") - if flags.InDet.Tracking.doCaloSeededAmbi: - from InDetConfig.InDetRecCaloSeededROISelectionConfig import HadCaloClusterROI_SelectorCfg - acc.merge(HadCaloClusterROI_SelectorCfg(flags)) - kwargs.setdefault("minPtConv" , 10000) #Only allow split clusters on track withe pt greater than this MeV - kwargs.setdefault("minPtBjetROI" , 10000) - kwargs.setdefault("phiWidthEM" , 0.05) #Split cluster ROI size - kwargs.setdefault("etaWidthEM" , 0.05) #Split cluster ROI size - - elif flags.InDet.Tracking.ActivePass.extension == "DBM": - kwargs.setdefault("maxShared" , 1000) - kwargs.setdefault("maxTracksPerSharedPRD" , 2) - kwargs.setdefault("minHits" , 0) - kwargs.setdefault("minNotShared" , 0) - kwargs.setdefault("minScoreShareTracks" , 0.0) - kwargs.setdefault("minTRTHits" , 0) - kwargs.setdefault("sharedProbCut" , 0.1) - else: - kwargs.setdefault("sharedProbCut", 0.10) - - InDetAmbiTrackSelectionTool = AmbiTrackSelectionTool(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(InDetAmbiTrackSelectionTool) - return acc - - -def DenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, name="InDetAmbiguityScoreProcessor", ClusterSplitProbContainer="", **kwargs): - acc = ComponentAccumulator() - # --- set up different Scoring Tool for collisions and cosmics - if flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM": - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetCosmicsScoringToolCfg(flags)) - elif flags.InDet.Tracking.ActivePass.extension == "R3LargeD0" and flags.InDet.Tracking.nnCutLargeD0Threshold > 0: - # Set up NN config - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetNNScoringToolSiCfg(flags)) - else: - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetAmbiScoringToolSiCfg(flags)) - kwargs.setdefault("ScoringTool", InDetAmbiScoringTool) - - from InDetConfig.SiliconPreProcessing import NnPixelClusterSplitProbToolCfg - kwargs.setdefault("SplitProbTool", acc.popToolsAndMerge(NnPixelClusterSplitProbToolCfg(flags)) if flags.InDet.Tracking.doPixelClusterSplitting else "") - - kwargs.setdefault("AssociationTool", acc.popToolsAndMerge(TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags))) - kwargs.setdefault("AssociationToolNotGanged", acc.popToolsAndMerge(TC.PRDtoTrackMapToolCfg())) - kwargs.setdefault("AssociationMapName", f"PRDToTrackMap{flags.InDet.Tracking.ActivePass.extension}") - - if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: - kwargs.setdefault("sharedProbCut", flags.InDet.Tracking.pixelClusterSplitProb1) - kwargs.setdefault("sharedProbCut2", flags.InDet.Tracking.pixelClusterSplitProb2) - kwargs.setdefault("SplitClusterMap_new", f"SplitClusterAmbiguityMap{flags.InDet.Tracking.ActivePass.extension}") - - kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) - kwargs.setdefault("OutputClusterSplitProbabilityName", f"SplitProb{flags.InDet.Tracking.ActivePass.extension}") - - ScoreProcessorTool = CompFactory.Trk.DenseEnvironmentsAmbiguityScoreProcessorTool - acc.setPrivateTools(ScoreProcessorTool(f"{name}{flags.InDet.Tracking.ActivePass.extension}", **kwargs)) - return acc - - -def DenseEnvironmentsAmbiguityProcessorToolCfg(flags, name="InDetAmbiguityProcessor", **kwargs): - acc = ComponentAccumulator() - - # --- set up different Scoring Tool for collisions and cosmics - if flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM": - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetCosmicsScoringToolCfg(flags)) - elif flags.InDet.Tracking.ActivePass.extension == "R3LargeD0" and flags.InDet.Tracking.nnCutLargeD0Threshold > 0: - # Set up NN config - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetNNScoringToolSiCfg(flags)) - else: - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetAmbiScoringToolSiCfg(flags)) - kwargs.setdefault("ScoringTool", InDetAmbiScoringTool) - - fitter_args = {} - - if flags.InDet.Tracking.holeSearchInGX2Fit: - fitter_args.setdefault("DoHoleSearch", True) - from InDetConfig.InDetRecToolConfig import InDetBoundaryCheckToolCfg - InDetBoundaryCheckTool = acc.popToolsAndMerge(InDetBoundaryCheckToolCfg(flags)) - fitter_args.setdefault("BoundaryCheckTool", InDetBoundaryCheckTool) - - fitter_list=[] - - if flags.InDet.Tracking.ActivePass.isLowPt: - InDetTrackFitterLowPt = acc.popToolsAndMerge(TC.InDetTrackFitterLowPtAmbiCfg(flags, - name='InDetTrackFitterLowPt'+flags.InDet.Tracking.ActivePass.extension, - **fitter_args)) - fitter_list.append(InDetTrackFitterLowPt) - else: - InDetTrackFitterAmbi = acc.popToolsAndMerge(TC.InDetTrackFitterAmbiCfg(flags, - name='InDetTrackFitterAmbi'+flags.InDet.Tracking.ActivePass.extension, - **fitter_args)) - fitter_list.append(InDetTrackFitterAmbi) - - if flags.InDet.Tracking.doRefitInvalidCov: - if not flags.InDet.Tracking.ActivePass.extension=="": - KalmanFitter = acc.popToolsAndMerge(TC.KalmanFitterCfg(flags, name='KalmanFitter'+flags.InDet.Tracking.ActivePass.extension)) - fitter_list.append(KalmanFitter) - - ReferenceKalmanFitter = acc.popToolsAndMerge(TC.ReferenceKalmanFitterCfg(flags, name='ReferenceKalmanFitter'+flags.InDet.Tracking.ActivePass.extension)) - fitter_list.append(ReferenceKalmanFitter) - else: - KalmanFitter = acc.popToolsAndMerge(TC.KalmanFitterCfg(flags)) - fitter_list.append(KalmanFitter) - - ReferenceKalmanFitter = acc.popToolsAndMerge(TC.ReferenceKalmanFitterCfg(flags)) - fitter_list.append(ReferenceKalmanFitter) - - InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) - - ambi_track_summary_tool = acc.getPrimaryAndMerge(TC.InDetTrackSummaryToolAmbiCfg(flags, - name = "InDetAmbiguityProcessorSplitProbTrackSummaryTool" + flags.InDet.Tracking.ActivePass.extension)) - - InDetAmbiTrackSelectionTool = acc.popToolsAndMerge(InDetAmbiTrackSelectionToolCfg(flags)) - - kwargs.setdefault("Fitter", fitter_list) - kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("AssociationMapName", 'PRDToTrackMap'+flags.InDet.Tracking.ActivePass.extension) - kwargs.setdefault("TrackSummaryTool", ambi_track_summary_tool) - kwargs.setdefault("SelectionTool", InDetAmbiTrackSelectionTool) - kwargs.setdefault("InputClusterSplitProbabilityName", 'SplitProb'+flags.InDet.Tracking.ActivePass.extension) - kwargs.setdefault("OutputClusterSplitProbabilityName", 'InDetAmbiguityProcessorSplitProb'+flags.InDet.Tracking.ActivePass.extension) - kwargs.setdefault("SuppressHoleSearch", False) - kwargs.setdefault("tryBremFit", flags.InDet.Tracking.doBremRecovery and (flags.InDet.Tracking.ActivePass.extension=="" or flags.InDet.Tracking.ActivePass.extension=="BLS") ) - kwargs.setdefault("caloSeededBrem", flags.InDet.Tracking.doCaloSeededBrem and flags.Detector.EnableCalo) - kwargs.setdefault("pTminBrem", flags.InDet.Tracking.ActivePass.minPTBrem) - kwargs.setdefault("RefitPrds", True) - kwargs.setdefault("KeepHolesFromBeforeRefit", False) - - InDetAmbiguityProcessor = CompFactory.Trk.DenseEnvironmentsAmbiguityProcessorTool(name=name+flags.InDet.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(InDetAmbiguityProcessor) - return acc - -def SimpleAmbiguityProcessorToolCfg(flags, name = "InDetAmbiguityProcessor", ClusterSplitProbContainer='', **kwargs) : - acc = ComponentAccumulator() - - # - # --- set up different Scoring Tool for collisions and cosmics - # - if flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM": - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetCosmicsScoringToolCfg(flags)) - elif flags.InDet.Tracking.ActivePass.extension == "R3LargeD0" and flags.InDet.Tracking.nnCutLargeD0Threshold > 0: - # Set up NN config - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetNNScoringToolSiCfg(flags)) - else: - InDetAmbiScoringTool = acc.popToolsAndMerge(TC.InDetAmbiScoringToolSiCfg(flags)) - - if flags.InDet.Tracking.ActivePass.isLowPt: - InDetTrackFitter = acc.popToolsAndMerge(TC.InDetTrackFitterLowPt(flags)) - else: - InDetTrackFitter = acc.popToolsAndMerge(TC.InDetTrackFitterCfg(flags)) - - InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) - - ambi_track_summary_tool = acc.getPrimaryAndMerge(TC.InDetTrackSummaryToolAmbiCfg(flags, - name = "InDetAmbiguityProcessorSplitProbTrackSummaryTool" + flags.InDet.Tracking.ActivePass.extension)) - - InDetAmbiTrackSelectionTool = acc.popToolsAndMerge(InDetAmbiTrackSelectionToolCfg(flags)) - - kwargs.setdefault("Fitter", InDetTrackFitter) - kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) - kwargs.setdefault("TrackSummaryTool", ambi_track_summary_tool) - kwargs.setdefault("ScoringTool", InDetAmbiScoringTool) - kwargs.setdefault("SelectionTool", InDetAmbiTrackSelectionTool) - kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) - kwargs.setdefault("OutputClusterSplitProbabilityName", 'InDetAmbiguityProcessorSplitProb'+flags.InDet.Tracking.ActivePass.extension) - kwargs.setdefault("SuppressHoleSearch", False) - kwargs.setdefault("tryBremFit", flags.InDet.Tracking.doBremRecovery and (flags.InDet.Tracking.ActivePass.extension=="" or flags.InDet.Tracking.ActivePass.extension=="BLS")) - kwargs.setdefault("caloSeededBrem", flags.InDet.Tracking.doCaloSeededBrem and flags.Detector.EnableCalo) - kwargs.setdefault("pTminBrem", flags.InDet.Tracking.ActivePass.minPTBrem) - kwargs.setdefault("RefitPrds", True) - kwargs.setdefault("MatEffects", flags.InDet.Tracking.materialInteractionsType if flags.InDet.Tracking.materialInteractions else 0) - - if flags.InDet.Tracking.ActivePass.extension == "Pixel" or flags.InDet.Tracking.ActivePass.extension == "DBM": - kwargs.setdefault("SuppressHoleSearch", True) - - InDetAmbiguityProcessor = CompFactory.Trk.SimpleAmbiguityProcessorTool(name=name+flags.InDet.Tracking.ActivePass.extension, **kwargs) - acc.setPrivateTools(InDetAmbiguityProcessor) - return acc - -def TrkAmbiguityScoreCfg(flags, name="InDetAmbiguityScore", SiSPSeededTrackCollectionKey = None, ClusterSplitProbContainer='', **kwargs) : - acc = ComponentAccumulator() - # - # --- set input and output collection - # - InputTrackCollection = SiSPSeededTrackCollectionKey - - if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: - InDetAmbiguityScoreProcessor = acc.popToolsAndMerge(DenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, ClusterSplitProbContainer=ClusterSplitProbContainer)) - else: - InDetAmbiguityScoreProcessor = None - - # - # --- configure Ambiguity (score) solver - # - kwargs.setdefault("TrackInput" , [ InputTrackCollection ]) - kwargs.setdefault("TrackOutput", 'ScoredMap'+'InDetAmbiguityScore'+ flags.InDet.Tracking.ActivePass.extension) - kwargs.setdefault("AmbiguityScoreProcessor" , InDetAmbiguityScoreProcessor ) ## TODO: check the case when it is None object - - InDetAmbiguityScore = CompFactory.Trk.TrkAmbiguityScore(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) - acc.addEventAlgo(InDetAmbiguityScore) - return acc - -def TrkAmbiguitySolverCfg(flags, name="InDetAmbiguitySolver", ResolvedTrackCollectionKey = None, ClusterSplitProbContainer='', **kwargs): - acc = ComponentAccumulator() - SiTrackCollection = ResolvedTrackCollectionKey - - if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: - InDetAmbiguityProcessor = acc.popToolsAndMerge(DenseEnvironmentsAmbiguityProcessorToolCfg(flags)) - else: - InDetAmbiguityProcessor = acc.popToolsAndMerge(SimpleAmbiguityProcessorToolCfg(flags, ClusterSplitProbContainer=ClusterSplitProbContainer)) - - # - # --- configure Ambiguity solver - # - kwargs.setdefault("TrackInput", 'ScoredMap'+'InDetAmbiguityScore'+ flags.InDet.Tracking.ActivePass.extension) - kwargs.setdefault("TrackOutput", SiTrackCollection) - kwargs.setdefault( "AmbiguityProcessor", InDetAmbiguityProcessor) - - InDetAmbiguitySolver = CompFactory.Trk.TrkAmbiguitySolver(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) - acc.addEventAlgo(InDetAmbiguitySolver ) - return acc - # ------------------------------------------------------------ # # ----------- Setup Si Pattern for New tracking @@ -601,6 +272,7 @@ def TrackingSiPatternCfg(flags, InputCollections = None, ResolvedTrackCollection # # ------------------------------------------------------------ + from TrkConfig.TrkAmbiguitySolverConfig import TrkAmbiguityScoreCfg, TrkAmbiguitySolverCfg acc.merge(TrkAmbiguityScoreCfg( flags, SiSPSeededTrackCollectionKey = SiSPSeededTrackCollectionKey, ClusterSplitProbContainer = ClusterSplitProbContainer)) diff --git a/Reconstruction/egamma/egammaAlgs/python/EMVertexBuilderConfig.py b/Reconstruction/egamma/egammaAlgs/python/EMVertexBuilderConfig.py index e5d98fcc6d71c94cf1811efb7a032b60409ef856..32adfd7e0eb59cdad7f366d271411a98755f0d25 100644 --- a/Reconstruction/egamma/egammaAlgs/python/EMVertexBuilderConfig.py +++ b/Reconstruction/egamma/egammaAlgs/python/EMVertexBuilderConfig.py @@ -16,9 +16,9 @@ def EMVertexBuilderCfg(flags, name="EMVertexBuilder", **kwargs): if "VertexFinderTool" not in kwargs: vtxFlags = flags.cloneAndReplace( "InDet.SecVertex", "InDet.SecVertexEGammaPileUp") - from InDetConfig.ConversionFindingConfig import ConversionFinderCfg + from InDetConfig.InDetConversionFinderToolsConfig import InDetConversionFinderToolsCfg kwargs["VertexFinderTool"] = acc.popToolsAndMerge( - ConversionFinderCfg(vtxFlags)) + InDetConversionFinderToolsCfg(vtxFlags)) alg = CompFactory.EMVertexBuilder(name, **kwargs) acc.addEventAlgo(alg) diff --git a/Tracking/TrkConfig/python/TrkAmbiguityProcessorConfig.py b/Tracking/TrkConfig/python/TrkAmbiguityProcessorConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..ef0acfb90afd39692b2bb955dfb003b70eec13f3 --- /dev/null +++ b/Tracking/TrkConfig/python/TrkAmbiguityProcessorConfig.py @@ -0,0 +1,321 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of TrkAmbiguityProcessor package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import BeamType + +def SimpleAmbiguityProcessorToolCfg(flags, name = "InDetAmbiguityProcessor", ClusterSplitProbContainer='', **kwargs) : + acc = ComponentAccumulator() + + # + # --- set up different Scoring Tool for collisions and cosmics + # + if flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM": + from InDetConfig.TrackingCommonConfig import InDetCosmicsScoringToolCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetCosmicsScoringToolCfg(flags)) + elif flags.InDet.Tracking.ActivePass.extension == "R3LargeD0" and flags.InDet.Tracking.nnCutLargeD0Threshold > 0: + # Set up NN config + from InDetConfig.TrackingCommonConfig import InDetNNScoringToolSiCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetNNScoringToolSiCfg(flags)) + else: + from InDetConfig.TrackingCommonConfig import InDetAmbiScoringToolSiCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetAmbiScoringToolSiCfg(flags)) + + if flags.InDet.Tracking.ActivePass.isLowPt: + from InDetConfig.TrackingCommonConfig import InDetTrackFitterLowPt + InDetTrackFitter = acc.popToolsAndMerge(InDetTrackFitterLowPt(flags)) + else: + from InDetConfig.TrackingCommonConfig import InDetTrackFitterCfg + InDetTrackFitter = acc.popToolsAndMerge(InDetTrackFitterCfg(flags)) + + from InDetConfig.TrackingCommonConfig import InDetPRDtoTrackMapToolGangedPixelsCfg, InDetTrackSummaryToolAmbiCfg + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) + ambi_track_summary_tool = acc.getPrimaryAndMerge(InDetTrackSummaryToolAmbiCfg(flags, name = "InDetAmbiguityProcessorSplitProbTrackSummaryTool" + flags.InDet.Tracking.ActivePass.extension)) + + from InDetConfig.InDetAmbiTrackSelectionToolConfig import InDetAmbiTrackSelectionToolCfg + InDetAmbiTrackSelectionTool = acc.popToolsAndMerge(InDetAmbiTrackSelectionToolCfg(flags)) + + kwargs.setdefault("Fitter", InDetTrackFitter) + kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("TrackSummaryTool", ambi_track_summary_tool) + kwargs.setdefault("ScoringTool", InDetAmbiScoringTool) + kwargs.setdefault("SelectionTool", InDetAmbiTrackSelectionTool) + kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) + kwargs.setdefault("OutputClusterSplitProbabilityName", 'InDetAmbiguityProcessorSplitProb'+flags.InDet.Tracking.ActivePass.extension) + kwargs.setdefault("SuppressHoleSearch", False) + kwargs.setdefault("tryBremFit", flags.InDet.Tracking.doBremRecovery and (flags.InDet.Tracking.ActivePass.extension=="" or flags.InDet.Tracking.ActivePass.extension=="BLS")) + kwargs.setdefault("caloSeededBrem", flags.InDet.Tracking.doCaloSeededBrem and flags.Detector.EnableCalo) + kwargs.setdefault("pTminBrem", flags.InDet.Tracking.ActivePass.minPTBrem) + kwargs.setdefault("RefitPrds", True) + kwargs.setdefault("MatEffects", flags.InDet.Tracking.materialInteractionsType if flags.InDet.Tracking.materialInteractions else 0) + + if flags.InDet.Tracking.ActivePass.extension == "Pixel" or flags.InDet.Tracking.ActivePass.extension == "DBM": + kwargs.setdefault("SuppressHoleSearch", True) + + InDetAmbiguityProcessor = CompFactory.Trk.SimpleAmbiguityProcessorTool(name=name+flags.InDet.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(InDetAmbiguityProcessor) + return acc + +def SimpleAmbiguityProcessorTool_TRT_Cfg(flags, name='InDetTRT_SeededAmbiguityProcessor', ClusterSplitProbContainer="", **kwargs): + acc = ComponentAccumulator() + # + # --- load Ambiguity Processor + # + from InDetConfig.TrackingCommonConfig import InDetTrackFitterBTCfg, InDetPRDtoTrackMapToolGangedPixelsCfg + InDetTrackFitterBT = acc.popToolsAndMerge(InDetTrackFitterBTCfg(flags)) + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) + + # + # --- set up special Scoring Tool for TRT seeded tracks + # + if flags.Beam.Type is BeamType.Cosmics: + from InDetConfig.TrackingCommonConfig import InDetCosmicScoringTool_TRTCfg, InDetTrackSummaryToolSharedHitsCfg + InDetTRT_SeededScoringTool = acc.popToolsAndMerge(InDetCosmicScoringTool_TRTCfg(flags)) + InDetTRT_SeededSummaryTool = acc.popToolsAndMerge(InDetTrackSummaryToolSharedHitsCfg(flags)) + else: + from InDetConfig.TrackingCommonConfig import InDetTRT_SeededScoringToolCfg, InDetTrackSummaryToolCfg + InDetTRT_SeededScoringTool = acc.popToolsAndMerge(InDetTRT_SeededScoringToolCfg(flags)) + InDetTRT_SeededSummaryTool = acc.getPrimaryAndMerge(InDetTrackSummaryToolCfg(flags)) + + from InDetConfig.InDetAmbiTrackSelectionToolConfig import InDetTRTAmbiTrackSelectionToolCfg + InDetTRT_SeededAmbiTrackSelectionTool = acc.popToolsAndMerge(InDetTRTAmbiTrackSelectionToolCfg(flags)) + + kwargs.setdefault("Fitter", InDetTrackFitterBT) + kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("TrackSummaryTool", InDetTRT_SeededSummaryTool) + kwargs.setdefault("SelectionTool", InDetTRT_SeededAmbiTrackSelectionTool) + kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) + kwargs.setdefault("OutputClusterSplitProbabilityName", 'InDetTRT_SeededAmbiguityProcessorSplitProb'+flags.InDet.Tracking.ActivePass.extension) + kwargs.setdefault("RefitPrds", False) + kwargs.setdefault("SuppressTrackFit", False) + kwargs.setdefault("SuppressHoleSearch", False) + kwargs.setdefault("ScoringTool", InDetTRT_SeededScoringTool) + kwargs.setdefault("MatEffects", flags.InDet.Tracking.materialInteractionsType if flags.InDet.Tracking.materialInteractions else 0) + + InDetTRT_SeededAmbiguityProcessor = CompFactory.Trk.SimpleAmbiguityProcessorTool(name = name, **kwargs) + acc.setPrivateTools(InDetTRT_SeededAmbiguityProcessor) + return acc + +def SimpleAmbiguityProcessorTool_Trig_Cfg(flags, name='InDetTrig_SeededAmbiguityProcessor', **kwargs): + import AthenaCommon.SystemOfUnits as Units + + acc = ComponentAccumulator() + + kwargs.setdefault("SuppressHoleSearch", False) #TODO False if flags.InDet.Tracking.ActivePass.name == 'cosmics' else True + #kwargs.setdefault("RefitPrds", False) #TODO clarify this setting False if flags.InDet.Tracking.ActivePass.name == 'cosmics' else True + kwargs.setdefault("tryBremFit", True if flags.InDet.Tracking.ActivePass.name == 'electron' and flags.InDet.Tracking.doBremRecovery else False) + kwargs.setdefault("pTminBrem", 5*Units.GeV) + kwargs.setdefault("MatEffects", 3) + + from TrigInDetConfig.TrigInDetConfig import FitterToolCfg, ambiguityScoringToolCfg, InDetPRDtoTrackMapToolGangedPixelsCfg, TrackSummaryToolCfg + kwargs.setdefault("Fitter",acc.getPrimaryAndMerge(FitterToolCfg(flags))) + kwargs.setdefault("ScoringTool", acc.getPrimaryAndMerge(ambiguityScoringToolCfg(flags))) + kwargs.setdefault("AssociationTool", acc.getPrimaryAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags))) + kwargs.setdefault("TrackSummaryTool", acc.popToolsAndMerge(TrackSummaryToolCfg(flags, useTRT=False, makePublic=False))) + + from InDetConfig.InDetAmbiTrackSelectionToolConfig import InDetTrigTrackSelectionToolCfg + kwargs.setdefault("SelectionTool", acc.getPrimaryAndMerge(InDetTrigTrackSelectionToolCfg(flags))) + + acc.setPrivateTools(CompFactory.Trk.SimpleAmbiguityProcessorTool(name, **kwargs)) + return acc + +def DenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, name="InDetAmbiguityScoreProcessor", ClusterSplitProbContainer="", **kwargs): + acc = ComponentAccumulator() + # --- set up different Scoring Tool for collisions and cosmics + if flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM": + from InDetConfig.TrackingCommonConfig import InDetCosmicsScoringToolCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetCosmicsScoringToolCfg(flags)) + elif flags.InDet.Tracking.ActivePass.extension == "R3LargeD0" and flags.InDet.Tracking.nnCutLargeD0Threshold > 0: + # Set up NN config + from InDetConfig.TrackingCommonConfig import InDetNNScoringToolSiCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetNNScoringToolSiCfg(flags)) + else: + from InDetConfig.TrackingCommonConfig import InDetAmbiScoringToolSiCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetAmbiScoringToolSiCfg(flags)) + kwargs.setdefault("ScoringTool", InDetAmbiScoringTool) + + from InDetConfig.SiliconPreProcessing import NnPixelClusterSplitProbToolCfg + kwargs.setdefault("SplitProbTool", acc.popToolsAndMerge(NnPixelClusterSplitProbToolCfg(flags)) if flags.InDet.Tracking.doPixelClusterSplitting else "") + + from InDetConfig.TrackingCommonConfig import InDetPRDtoTrackMapToolGangedPixelsCfg, PRDtoTrackMapToolCfg + kwargs.setdefault("AssociationTool", acc.popToolsAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags))) + kwargs.setdefault("AssociationToolNotGanged", acc.popToolsAndMerge(PRDtoTrackMapToolCfg())) + kwargs.setdefault("AssociationMapName", f"PRDToTrackMap{flags.InDet.Tracking.ActivePass.extension}") + + if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: + kwargs.setdefault("sharedProbCut", flags.InDet.Tracking.pixelClusterSplitProb1) + kwargs.setdefault("sharedProbCut2", flags.InDet.Tracking.pixelClusterSplitProb2) + kwargs.setdefault("SplitClusterMap_new", f"SplitClusterAmbiguityMap{flags.InDet.Tracking.ActivePass.extension}") + + kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) + kwargs.setdefault("OutputClusterSplitProbabilityName", f"SplitProb{flags.InDet.Tracking.ActivePass.extension}") + + ScoreProcessorTool = CompFactory.Trk.DenseEnvironmentsAmbiguityScoreProcessorTool + acc.setPrivateTools(ScoreProcessorTool(f"{name}{flags.InDet.Tracking.ActivePass.extension}", **kwargs)) + return acc + +def ITkDenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, name = "ITkAmbiguityScoreProcessor", ClusterSplitProbContainer='', **kwargs) : + acc = ComponentAccumulator() + # + # --- set up different Scoring Tool for collisions and cosmics + # + if flags.Beam.Type is BeamType.Cosmics: + from InDetConfig.ITkTrackingCommonConfig import ITkCosmicsScoringToolCfg + ITkAmbiScoringTool = acc.popToolsAndMerge(ITkCosmicsScoringToolCfg(flags)) + else: + from InDetConfig.ITkTrackingCommonConfig import ITkAmbiScoringToolCfg + ITkAmbiScoringTool = acc.popToolsAndMerge(ITkAmbiScoringToolCfg(flags)) + + from InDetConfig.ITkSiliconPreProcessing import ITkNnPixelClusterSplitProbToolCfg + ITkNnPixelClusterSplitProbTool = acc.popToolsAndMerge(ITkNnPixelClusterSplitProbToolCfg(flags)) + + from InDetConfig.ITkTrackingCommonConfig import ITkPRDtoTrackMapToolGangedPixelsCfg, ITkPRDtoTrackMapToolCfg + ITkPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(ITkPRDtoTrackMapToolGangedPixelsCfg(flags)) + ITkPRDtoTrackMapTool = acc.popToolsAndMerge(ITkPRDtoTrackMapToolCfg(flags)) + + kwargs.setdefault("sharedProbCut", flags.ITk.Tracking.pixelClusterSplitProb1) + kwargs.setdefault("sharedProbCut2", flags.ITk.Tracking.pixelClusterSplitProb2) + kwargs.setdefault("SplitClusterMap_new", 'SplitClusterAmbiguityMap'+flags.ITk.Tracking.ActivePass.extension) + + kwargs.setdefault("ScoringTool", ITkAmbiScoringTool) + kwargs.setdefault("SplitProbTool", ITkNnPixelClusterSplitProbTool if flags.ITk.Tracking.doPixelClusterSplitting else None,) + kwargs.setdefault("AssociationTool", ITkPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("AssociationToolNotGanged", ITkPRDtoTrackMapTool) + kwargs.setdefault("AssociationMapName", 'ITkPRDToTrackMap'+flags.ITk.Tracking.ActivePass.extension) + kwargs.setdefault("InputClusterSplitProbabilityName", ClusterSplitProbContainer) + kwargs.setdefault("OutputClusterSplitProbabilityName", 'SplitProb'+flags.ITk.Tracking.ActivePass.extension) + + # DenseEnvironmentsAmbiguityScoreProcessorTool + ITkAmbiguityScoreProcessor = CompFactory.Trk.DenseEnvironmentsAmbiguityScoreProcessorTool(name=name+flags.ITk.Tracking.ActivePass.extension, **kwargs) + + acc.setPrivateTools(ITkAmbiguityScoreProcessor) + return acc + +def DenseEnvironmentsAmbiguityProcessorToolCfg(flags, name="InDetAmbiguityProcessor", **kwargs): + acc = ComponentAccumulator() + + # --- set up different Scoring Tool for collisions and cosmics + if flags.Beam.Type is BeamType.Cosmics and flags.InDet.Tracking.ActivePass.extension != "DBM": + from InDetConfig.TrackingCommonConfig import InDetCosmicsScoringToolCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetCosmicsScoringToolCfg(flags)) + elif flags.InDet.Tracking.ActivePass.extension == "R3LargeD0" and flags.InDet.Tracking.nnCutLargeD0Threshold > 0: + # Set up NN config + from InDetConfig.TrackingCommonConfig import InDetNNScoringToolSiCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetNNScoringToolSiCfg(flags)) + else: + from InDetConfig.TrackingCommonConfig import InDetAmbiScoringToolSiCfg + InDetAmbiScoringTool = acc.popToolsAndMerge(InDetAmbiScoringToolSiCfg(flags)) + kwargs.setdefault("ScoringTool", InDetAmbiScoringTool) + + fitter_args = {} + + if flags.InDet.Tracking.holeSearchInGX2Fit: + fitter_args.setdefault("DoHoleSearch", True) + from InDetConfig.InDetRecToolConfig import InDetBoundaryCheckToolCfg + InDetBoundaryCheckTool = acc.popToolsAndMerge(InDetBoundaryCheckToolCfg(flags)) + fitter_args.setdefault("BoundaryCheckTool", InDetBoundaryCheckTool) + + fitter_list=[] + + if flags.InDet.Tracking.ActivePass.isLowPt: + from InDetConfig.TrackingCommonConfig import InDetTrackFitterLowPtAmbiCfg + InDetTrackFitterLowPt = acc.popToolsAndMerge(InDetTrackFitterLowPtAmbiCfg(flags, + name='InDetTrackFitterLowPt'+flags.InDet.Tracking.ActivePass.extension, + **fitter_args)) + fitter_list.append(InDetTrackFitterLowPt) + else: + from InDetConfig.TrackingCommonConfig import InDetTrackFitterAmbiCfg + InDetTrackFitterAmbi = acc.popToolsAndMerge(InDetTrackFitterAmbiCfg(flags, + name='InDetTrackFitterAmbi'+flags.InDet.Tracking.ActivePass.extension, + **fitter_args)) + fitter_list.append(InDetTrackFitterAmbi) + + if flags.InDet.Tracking.doRefitInvalidCov: + from InDetConfig.TrackingCommonConfig import KalmanFitterCfg, ReferenceKalmanFitterCfg + KalmanFitter = acc.popToolsAndMerge(KalmanFitterCfg(flags, name='KalmanFitter'+flags.InDet.Tracking.ActivePass.extension)) + fitter_list.append(KalmanFitter) + + ReferenceKalmanFitter = acc.popToolsAndMerge(ReferenceKalmanFitterCfg(flags, name='ReferenceKalmanFitter'+flags.InDet.Tracking.ActivePass.extension)) + fitter_list.append(ReferenceKalmanFitter) + + from InDetConfig.TrackingCommonConfig import InDetPRDtoTrackMapToolGangedPixelsCfg, InDetTrackSummaryToolAmbiCfg + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags)) + ambi_track_summary_tool = acc.getPrimaryAndMerge(InDetTrackSummaryToolAmbiCfg(flags, name = "InDetAmbiguityProcessorSplitProbTrackSummaryTool" + flags.InDet.Tracking.ActivePass.extension)) + + from InDetConfig.InDetAmbiTrackSelectionToolConfig import InDetAmbiTrackSelectionToolCfg + InDetAmbiTrackSelectionTool = acc.popToolsAndMerge(InDetAmbiTrackSelectionToolCfg(flags)) + + kwargs.setdefault("Fitter", fitter_list) + kwargs.setdefault("AssociationTool", InDetPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("AssociationMapName", 'PRDToTrackMap'+flags.InDet.Tracking.ActivePass.extension) + kwargs.setdefault("TrackSummaryTool", ambi_track_summary_tool) + kwargs.setdefault("SelectionTool", InDetAmbiTrackSelectionTool) + kwargs.setdefault("InputClusterSplitProbabilityName", 'SplitProb'+flags.InDet.Tracking.ActivePass.extension) + kwargs.setdefault("OutputClusterSplitProbabilityName", 'InDetAmbiguityProcessorSplitProb'+flags.InDet.Tracking.ActivePass.extension) + kwargs.setdefault("SuppressHoleSearch", False) + kwargs.setdefault("tryBremFit", flags.InDet.Tracking.doBremRecovery and (flags.InDet.Tracking.ActivePass.extension=="" or flags.InDet.Tracking.ActivePass.extension=="BLS") ) + kwargs.setdefault("caloSeededBrem", flags.InDet.Tracking.doCaloSeededBrem and flags.Detector.EnableCalo) + kwargs.setdefault("pTminBrem", flags.InDet.Tracking.ActivePass.minPTBrem) + kwargs.setdefault("RefitPrds", True) + kwargs.setdefault("KeepHolesFromBeforeRefit", False) + + InDetAmbiguityProcessor = CompFactory.Trk.DenseEnvironmentsAmbiguityProcessorTool(name=name+flags.InDet.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(InDetAmbiguityProcessor) + return acc + +def ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags, name = "ITkAmbiguityProcessor", **kwargs) : + acc = ComponentAccumulator() + + # + # --- set up different Scoring Tool for collisions and cosmics + # + if flags.Beam.Type is BeamType.Cosmics: + from InDetConfig.ITkTrackingCommonConfig import ITkCosmicsScoringToolCfg + ITkAmbiScoringTool = acc.popToolsAndMerge(ITkCosmicsScoringToolCfg(flags)) + else: + from InDetConfig.ITkTrackingCommonConfig import ITkAmbiScoringToolCfg + ITkAmbiScoringTool = acc.popToolsAndMerge(ITkAmbiScoringToolCfg(flags)) + + fitter_args = {} + fitter_args.setdefault("DoHoleSearch", True) + + from InDetConfig.ITkRecToolConfig import ITkBoundaryCheckToolCfg + ITkBoundaryCheckTool = acc.popToolsAndMerge(ITkBoundaryCheckToolCfg(flags)) + fitter_args.setdefault("BoundaryCheckTool", ITkBoundaryCheckTool) + + from InDetConfig.ITkTrackingCommonConfig import ITkTrackFitterAmbiCfg, ITkPRDtoTrackMapToolGangedPixelsCfg, ITkTrackSummaryToolCfg + fitter_list=[] + ITkTrackFitterAmbi = acc.popToolsAndMerge(ITkTrackFitterAmbiCfg(flags, + name='ITkTrackFitterAmbi'+flags.ITk.Tracking.ActivePass.extension, + **fitter_args)) + fitter_list.append(ITkTrackFitterAmbi) + + ITkPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge(ITkPRDtoTrackMapToolGangedPixelsCfg(flags)) + + ambi_track_summary_tool = acc.getPrimaryAndMerge(ITkTrackSummaryToolCfg( flags, + name = "ITkAmbiguityProcessorSplitProbTrackSummaryTool" + flags.ITk.Tracking.ActivePass.extension)) + + from InDetConfig.InDetAmbiTrackSelectionToolConfig import ITkAmbiTrackSelectionToolCfg + ITkAmbiTrackSelectionTool = acc.popToolsAndMerge(ITkAmbiTrackSelectionToolCfg(flags)) + + kwargs.setdefault("Fitter", fitter_list) + kwargs.setdefault("AssociationTool", ITkPRDtoTrackMapToolGangedPixels) + kwargs.setdefault("AssociationMapName", 'ITkPRDToTrackMap'+flags.ITk.Tracking.ActivePass.extension) + kwargs.setdefault("TrackSummaryTool", ambi_track_summary_tool) + kwargs.setdefault("ScoringTool", ITkAmbiScoringTool) + kwargs.setdefault("SelectionTool", ITkAmbiTrackSelectionTool) + kwargs.setdefault("InputClusterSplitProbabilityName", 'SplitProb'+flags.ITk.Tracking.ActivePass.extension) + kwargs.setdefault("OutputClusterSplitProbabilityName", 'ITkAmbiguityProcessorSplitProb'+flags.ITk.Tracking.ActivePass.extension) + kwargs.setdefault("SuppressHoleSearch", False) + kwargs.setdefault("tryBremFit", flags.ITk.Tracking.doBremRecovery and flags.Detector.EnableCalo and flags.ITk.Tracking.ActivePass.extension == "") # Disabled for second passes in reco + kwargs.setdefault("caloSeededBrem", flags.ITk.Tracking.doCaloSeededBrem and flags.Detector.EnableCalo) + kwargs.setdefault("pTminBrem", flags.ITk.Tracking.ActivePass.minPTBrem[0]) + kwargs.setdefault("RefitPrds", True) + kwargs.setdefault("KeepHolesFromBeforeRefit", False) + + # DenseEnvironmentsAmbiguityProcessorTool + ProcessorTool = CompFactory.Trk.DenseEnvironmentsAmbiguityProcessorTool + ITkAmbiguityProcessor = ProcessorTool(name=name+flags.ITk.Tracking.ActivePass.extension, **kwargs) + acc.setPrivateTools(ITkAmbiguityProcessor) + return acc diff --git a/Tracking/TrkConfig/python/TrkAmbiguitySolverConfig.py b/Tracking/TrkConfig/python/TrkAmbiguitySolverConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..78f55f0f979a53a473dd85707a1c71932a0ec6c4 --- /dev/null +++ b/Tracking/TrkConfig/python/TrkAmbiguitySolverConfig.py @@ -0,0 +1,130 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of TrkAmbiguitySolver package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def TrkAmbiguityScoreCfg(flags, name = "InDetAmbiguityScore", SiSPSeededTrackCollectionKey = None, ClusterSplitProbContainer = '', **kwargs) : + acc = ComponentAccumulator() + + if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: + from TrkConfig.TrkAmbiguityProcessorConfig import DenseEnvironmentsAmbiguityScoreProcessorToolCfg + InDetAmbiguityScoreProcessor = acc.popToolsAndMerge(DenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, ClusterSplitProbContainer=ClusterSplitProbContainer)) + else: + InDetAmbiguityScoreProcessor = None + + # + # --- configure Ambiguity (score) solver + # + kwargs.setdefault("TrackInput" , [ SiSPSeededTrackCollectionKey ]) + kwargs.setdefault("TrackOutput", 'ScoredMapInDetAmbiguityScore'+ flags.InDet.Tracking.ActivePass.extension) + kwargs.setdefault("AmbiguityScoreProcessor" , InDetAmbiguityScoreProcessor ) ## TODO: check the case when it is None object + + InDetAmbiguityScore = CompFactory.Trk.TrkAmbiguityScore(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) + acc.addEventAlgo(InDetAmbiguityScore) + return acc + +def TrkAmbiguityScore_TRT_Cfg(flags, name='InDetTRT_SeededAmbiguityScore', **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("TrackInput", [ 'TRTSeededTracks' ]) + kwargs.setdefault("TrackOutput", 'ScoredMapInDetTRT_SeededAmbiguityScore') + + InDetAmbiguityScore = CompFactory.Trk.TrkAmbiguityScore(name = name, **kwargs) + acc.addEventAlgo(InDetAmbiguityScore) + return acc + +def TrkAmbiguityScore_Trig_Cfg(flags, name='InDetTrig_SeededAmbiguityScore', **kwargs): + acc = ComponentAccumulator() + + kwargs.setdefault("TrackInput", [ flags.InDet.Tracking.ActivePass.trkTracks_FTF ]) + kwargs.setdefault("TrackOutput", f"ScoreMap{flags.InDet.Tracking.ActivePass.input_name}") + kwargs.setdefault("AmbiguityScoreProcessor", None) + + InDetAmbiguityScore = CompFactory.Trk.TrkAmbiguityScore(name = name, **kwargs) + acc.addEventAlgo(InDetAmbiguityScore) + return acc + +def ITkTrkAmbiguityScoreCfg(flags, name = "ITkAmbiguityScore", SiSPSeededTrackCollectionKey = None, ClusterSplitProbContainer = '', **kwargs) : + acc = ComponentAccumulator() + + from TrkConfig.TrkAmbiguityProcessorConfig import ITkDenseEnvironmentsAmbiguityScoreProcessorToolCfg + ITkAmbiguityScoreProcessor = acc.popToolsAndMerge(ITkDenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, ClusterSplitProbContainer = ClusterSplitProbContainer)) + + # + # --- configure Ambiguity (score) solver + # + kwargs.setdefault("TrackInput" , [ SiSPSeededTrackCollectionKey ]) + kwargs.setdefault("TrackOutput", 'ScoredMapITkAmbiguityScore'+ flags.ITk.Tracking.ActivePass.extension) + kwargs.setdefault("AmbiguityScoreProcessor" , ITkAmbiguityScoreProcessor ) ## TODO: check the case when it is None object + + ITkAmbiguityScore = CompFactory.Trk.TrkAmbiguityScore(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) + acc.addEventAlgo(ITkAmbiguityScore) + return acc + +def TrkAmbiguitySolverCfg(flags, name = "InDetAmbiguitySolver", ResolvedTrackCollectionKey = None, ClusterSplitProbContainer = '', **kwargs): + acc = ComponentAccumulator() + + if flags.InDet.Tracking.ActivePass.useTIDE_Ambi: + from TrkConfig.TrkAmbiguityProcessorConfig import DenseEnvironmentsAmbiguityProcessorToolCfg + InDetAmbiguityProcessor = acc.popToolsAndMerge(DenseEnvironmentsAmbiguityProcessorToolCfg(flags)) + else: + from TrkConfig.TrkAmbiguityProcessorConfig import SimpleAmbiguityProcessorToolCfg + InDetAmbiguityProcessor = acc.popToolsAndMerge(SimpleAmbiguityProcessorToolCfg(flags, ClusterSplitProbContainer = ClusterSplitProbContainer)) + + # + # --- configure Ambiguity solver + # + kwargs.setdefault("TrackInput", 'ScoredMapInDetAmbiguityScore'+ flags.InDet.Tracking.ActivePass.extension) + kwargs.setdefault("TrackOutput", ResolvedTrackCollectionKey) + kwargs.setdefault( "AmbiguityProcessor", InDetAmbiguityProcessor) + + InDetAmbiguitySolver = CompFactory.Trk.TrkAmbiguitySolver(name = name+flags.InDet.Tracking.ActivePass.extension, **kwargs) + acc.addEventAlgo(InDetAmbiguitySolver) + return acc + +def TrkAmbiguitySolver_TRT_Cfg(flags, name = 'InDetTRT_SeededAmbiguitySolver', ClusterSplitProbContainer = '', **kwargs): + acc = ComponentAccumulator() + + from TrkConfig.TrkAmbiguityProcessorConfig import SimpleAmbiguityProcessorTool_TRT_Cfg + InDetTRT_SeededAmbiguityProcessor = acc.popToolsAndMerge(SimpleAmbiguityProcessorTool_TRT_Cfg(flags, ClusterSplitProbContainer = ClusterSplitProbContainer)) + acc.addPublicTool(InDetTRT_SeededAmbiguityProcessor) + + kwargs.setdefault("TrackInput", 'ScoredMapInDetTRT_SeededAmbiguityScore') + kwargs.setdefault("TrackOutput", 'ResolvedTRTSeededTracks') + kwargs.setdefault("AmbiguityProcessor", InDetTRT_SeededAmbiguityProcessor) + + InDetTRT_SeededAmbiguitySolver = CompFactory.Trk.TrkAmbiguitySolver(name = name, **kwargs) + acc.addEventAlgo(InDetTRT_SeededAmbiguitySolver) + return acc + +def TrkAmbiguitySolver_Trig_Cfg(flags, name = 'InDetTrig_SeededAmbiguitySolver', **kwargs): + acc = ComponentAccumulator() + + from TrkConfig.TrkAmbiguityProcessorConfig import SimpleAmbiguityProcessorTool_Trig_Cfg + processorTool = acc.popToolsAndMerge(SimpleAmbiguityProcessorTool_Trig_Cfg(flags, name = f"InDetTrigMT_AmbiguityProcessor_{flags.InDet.Tracking.ActivePass.name}")) + + kwargs.setdefault("TrackInput", f"ScoreMap{flags.InDet.Tracking.ActivePass.input_name}") + kwargs.setdefault("TrackOutput", flags.InDet.Tracking.ActivePass.trkTracks_IDTrig+"_Amb") + kwargs.setdefault("AmbiguityProcessor", processorTool) + + AmbiguitySolver = CompFactory.Trk.TrkAmbiguitySolver(name = name, **kwargs) + acc.addEventAlgo(AmbiguitySolver) + return acc + +def ITkTrkAmbiguitySolverCfg(flags, name = "ITkAmbiguitySolver", ResolvedTrackCollectionKey = None, **kwargs): + acc = ComponentAccumulator() + + from TrkConfig.TrkAmbiguityProcessorConfig import ITkDenseEnvironmentsAmbiguityProcessorToolCfg + ITkAmbiguityProcessor = acc.popToolsAndMerge(ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags)) + + # + # --- configure Ambiguity solver + # + kwargs.setdefault("TrackInput", 'ScoredMapITkAmbiguityScore'+ flags.ITk.Tracking.ActivePass.extension) + kwargs.setdefault("TrackOutput", ResolvedTrackCollectionKey) + kwargs.setdefault( "AmbiguityProcessor", ITkAmbiguityProcessor) + + ITkAmbiguitySolver = CompFactory.Trk.TrkAmbiguitySolver(name = name+flags.ITk.Tracking.ActivePass.extension, **kwargs) + acc.addEventAlgo(ITkAmbiguitySolver ) + return acc diff --git a/Tracking/TrkConfig/python/TrkVKalVrtFitterConfig.py b/Tracking/TrkConfig/python/TrkVKalVrtFitterConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..9a8c2fcb22bb96489605df0e0146d75fabd789fe --- /dev/null +++ b/Tracking/TrkConfig/python/TrkVKalVrtFitterConfig.py @@ -0,0 +1,25 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Configuration of TrkVKalVrtFitter package + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def TrkVKalVrtFitterCfg(flags, name="TrkVKalVrtFitter"): + acc = ComponentAccumulator() + kwargs = {} + from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg + 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 + kwargs["IterationNumber"] = flags.InDet.SecVertex.Fitter.IterationNumber + kwargs["MakeExtendedVertex"] = flags.InDet.SecVertex.Fitter.MakeExtendedVertex + kwargs["Robustness"] = flags.InDet.SecVertex.Fitter.Robustness + kwargs["usePhiCnst"] = flags.InDet.SecVertex.Fitter.usePhiCnst + kwargs["useThetaCnst"] = flags.InDet.SecVertex.Fitter.useThetaCnst + kwargs["CovVrtForConstraint"] = flags.InDet.SecVertex.Fitter.CovVrtForConstraint + kwargs["VertexForConstraint"] = flags.InDet.SecVertex.Fitter.VertexForConstraint + + tool = CompFactory.Trk.TrkVKalVrtFitter(name, **kwargs) + acc.setPrivateTools(tool) + return acc diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/python/VKalVrtFitterConfig.py b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/python/VKalVrtFitterConfig.py deleted file mode 100644 index c8c1d358dbd4208eabb34e67d9e34573b62d1ba0..0000000000000000000000000000000000000000 --- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/python/VKalVrtFitterConfig.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration -# -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaConfiguration.ComponentFactory import CompFactory - -from AthenaCommon.Logging import logging -mlog = logging.getLogger('Trk__VKalVrtFitterConfig') - -def TrkVKalVrtFitterCfg(flags): - - acc = ComponentAccumulator() - - kwargs = {} - from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg - kwargs["Extrapolator"] = acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags)) - kwargs["FirstMeasuredPoint"] = False - kwargs["MakeExtendedVertex"] = False - - VKalVrt = CompFactory.Trk.TrkVKalVrtFitter(**kwargs) - mlog.info("VKalVrtFitter created") - acc.setPrivateTools(VKalVrt) - - return acc diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py index 24039383d19d5c81e5be80624140ab11a42ebf07..202d4ac744eca9a89184482d3956146fab2fc98a 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py @@ -13,21 +13,6 @@ def RungeKuttaPropagatorCfg(flags, name="InDetTrigPatternPropagator"): acc.addPublicTool( CompFactory.Trk.RungeKuttaPropagator( name ), primary=True ) return acc -def SiDetElementsRoadMaker_xkCfg( flags, name="InDetTrigSiDetElementsRoadMaker" ): - """ - based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py, should be moved elsewhere - """ - acc = ComponentAccumulator() - acc.addCondAlgo( CompFactory.InDet.SiDetElementsRoadCondAlg_xk() ) - tool = CompFactory.InDet.SiDetElementsRoadMaker_xk( name, - PropagatorTool = acc.getPrimaryAndMerge(RungeKuttaPropagatorCfg( flags )), - usePixel = flags.Detector.EnablePixel, - useSCT = flags.Detector.EnableSCT, - RoadWidth = flags.InDet.Tracking.ActivePass.roadWidth, - ) - acc.addPublicTool( tool, primary=True ) - return acc - def PixelClusterOnTrackCfg( flags, **kwargs ): """ based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py @@ -81,43 +66,16 @@ def KalmanxkUpdatorCfg(flags): acc.addPublicTool(CompFactory.Trk.KalmanUpdator_xk( "InDetTrigPatternUpdator" ), primary=True ) return acc -def SiCombinatorialTrackFinder_xkCfg( flags, name="InDetTrigSiComTrackFinder" ): - """ - based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py, should be moved elsewhere - """ - acc = ComponentAccumulator() - propagatorTool = acc.getPrimaryAndMerge( RungeKuttaPropagatorCfg( flags ) ) - patternUpdatorTool = acc.getPrimaryAndMerge( KalmanxkUpdatorCfg( flags ) ) - rioOnTrackTool = acc.getPrimaryAndMerge( RIO_OnTrackCreatorCfg( flags ) ) - - from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg - pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) ) - - from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_ConditionsSummaryToolCfg - sctCondSummaryTool = acc.popToolsAndMerge( SCT_ConditionsSummaryToolCfg( flags, withFlaggedCondTool=False, withTdaqTool=False ) ) - - - tool = CompFactory.InDet.SiCombinatorialTrackFinder_xk(name, - PropagatorTool = propagatorTool, - UpdatorTool = patternUpdatorTool, - RIOonTrackTool = rioOnTrackTool, - usePixel = flags.Detector.EnablePixel, - useSCT = flags.Detector.EnableSCT, - PixelClusterContainer = 'PixelTrigClusters', - SCT_ClusterContainer = 'SCT_TrigClusters', - PixelSummaryTool = pixelCondSummaryTool, - SctSummaryTool = sctCondSummaryTool - ) - acc.setPrivateTools( tool ) - return acc - def SiTrackMaker_xkCfg(flags, name="SiTrackMaker_xk"): """ based on: InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecNewTracking.py , should be moved elsewhere """ acc = ComponentAccumulator() - roadTool = acc.getPrimaryAndMerge( SiDetElementsRoadMaker_xkCfg( flags ) ) - combTrackFinderTool = acc.popToolsAndMerge( SiCombinatorialTrackFinder_xkCfg( flags ) ) + + from InDetConfig.SiDetElementsRoadToolConfig import SiDetElementsRoadMaker_xk_Trig_Cfg + roadTool = acc.popToolsAndMerge( SiDetElementsRoadMaker_xk_Trig_Cfg( flags ) ) + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiCombinatorialTrackFinder_xk_Trig_Cfg + combTrackFinderTool = acc.popToolsAndMerge( SiCombinatorialTrackFinder_xk_Trig_Cfg( flags ) ) from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline acc.merge(addFoldersSplitOnline( flags, "INDET", '/Indet/Onl/TrkErrorScaling', '/Indet/TrkErrorScaling', className="CondAttrListCollection") ) @@ -607,13 +565,9 @@ def ftfCfg(flags, roisKey, signature, signatureName): RegSelTool_SCT = sctRegSelTool, layerNumberTool = acc.getPublicTool("TrigL2LayerNumberTool_FTF") ) ) - # TODO remove once offline configured counterparts are available? - acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name= "InDetSiDetElementBoundaryLinksSCTCondAlg", - WriteKey = "SCT_DetElementBoundaryLinks_xk") ) - - acc.addCondAlgo( CompFactory.InDet.SiDetElementBoundaryLinksCondAlg_xk(name = "InDetSiDetElementBoundaryLinksPixelCondAlg", - ReadKey = "PixelDetectorElementCollection", - WriteKey = "PixelDetElementBoundaryLinks_xk") ) + from InDetConfig.SiCombinatorialTrackFinderToolConfig import SiDetElementBoundaryLinksCondAlg_xk_Pixel_Cfg, SiDetElementBoundaryLinksCondAlg_xk_SCT_Cfg + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_Pixel_Cfg(flags)) + acc.merge(SiDetElementBoundaryLinksCondAlg_xk_SCT_Cfg(flags)) ftf = CompFactory.TrigFastTrackFinder( name = "TrigFastTrackFinder_" + signature, LayerNumberTool = acc.getPublicTool( "TrigL2LayerNumberTool_FTF" ), @@ -792,9 +746,6 @@ def TRTRIOMakerCfg(flags): def _tracksPostAmbi(flags): return flags.InDet.Tracking.ActivePass.trkTracks_IDTrig+"_Amb" -def _ambiScore(flags): - return f"ScoreMap{flags.InDet.Tracking.ActivePass.input_name}" - def TRTExtensionToolCfg(flags): acc = ComponentAccumulator() @@ -881,26 +832,6 @@ def InDetPRDtoTrackMapToolGangedPixelsCfg(flags): acc.addPublicTool(tool, primary=True) return acc -def TrackSelectionToolCfg(flags): - acc = ComponentAccumulator() - - #TODO add configurations fro beamgas and cosmic see: trackSelectionTool_getter - tool = CompFactory.InDet.InDetAmbiTrackSelectionTool('InDetTrigAmbiTrackSelectionTool', - DriftCircleCutTool = None, #acc.getPrimaryAndMerge(TRTDriftCircleCutCfg(flags)), - AssociationTool = acc.getPrimaryAndMerge( InDetPRDtoTrackMapToolGangedPixelsCfg(flags) ), - minHits = flags.InDet.Tracking.ActivePass.minClusters, - minNotShared = flags.InDet.Tracking.ActivePass.minSiNotShared, - maxShared = flags.InDet.Tracking.ActivePass.maxShared, - minTRTHits = 0, # used for Si only tracking !!! - Cosmics = False, #there is a different instance - UseParameterization = False, - # sharedProbCut = 0.10, - # doPixelSplitting = InDetTrigFlags.doPixelClusterSplitting() - ) - acc.addPublicTool(tool, primary=True) - - return acc - def ambiguityScoringToolCfg(flags): acc = ComponentAccumulator() from TrkConfig.AtlasExtrapolatorConfig import InDetExtrapolatorCfg #TODO using offline, consider porting @@ -975,45 +906,12 @@ def FitterToolCfg(flags): # #only switch off for cosmics InDetTrigTrackFitter.Acceleration = False return acc -def ambiguityProcessorToolCfg(flags): - import AthenaCommon.SystemOfUnits as Units - - acc = ComponentAccumulator() - - tool = CompFactory.Trk.SimpleAmbiguityProcessorTool(name = f"{prefix}_AmbiguityProcessor_{flags.InDet.Tracking.ActivePass.name}", - SuppressHoleSearch = False, #TODO False if flags.InDet.Tracking.ActivePass.name == 'cosmics' else True, - #RefitPrds = False, #TODO clarify this setting False if flags.InDet.Tracking.ActivePass.name == 'cosmics' else True, - tryBremFit = True if flags.InDet.Tracking.ActivePass.name == 'electron' and flags.InDet.Tracking.doBremRecovery else False, - pTminBrem = 5*Units.GeV, - MatEffects = 3, - Fitter = acc.getPrimaryAndMerge(FitterToolCfg(flags)), - ScoringTool = acc.getPrimaryAndMerge(ambiguityScoringToolCfg(flags)), - AssociationTool = acc.getPrimaryAndMerge(InDetPRDtoTrackMapToolGangedPixelsCfg(flags)), - TrackSummaryTool = acc.popToolsAndMerge(TrackSummaryToolCfg(flags, name="InDetTrigTrackSummaryTool", - useTRT=False, makePublic=False)), - SelectionTool = acc.getPrimaryAndMerge(TrackSelectionToolCfg(flags) - ) - ) - acc.setPrivateTools(tool) - return acc - def ambiguitySolverAlgCfg(flags): acc = ComponentAccumulator() - scoreAlg = CompFactory.Trk.TrkAmbiguityScore(name = f"{prefix}TrkAmbiguityScore_{flags.InDet.Tracking.ActivePass.input_name}", - TrackInput = [ flags.InDet.Tracking.ActivePass.trkTracks_FTF ], - TrackOutput = _ambiScore(flags), - AmbiguityScoreProcessor = None - ) - acc.addEventAlgo(scoreAlg) - - processorTool = acc.popToolsAndMerge(ambiguityProcessorToolCfg(flags)) - solverAlg = CompFactory.Trk.TrkAmbiguitySolver(name = f"{prefix}TrkAmbiguitySolver_{flags.InDet.Tracking.ActivePass.input_name}", - TrackInput = _ambiScore(flags), - TrackOutput = _tracksPostAmbi(flags), - AmbiguityProcessor = processorTool - ) - acc.addEventAlgo(solverAlg) + from TrkConfig.TrkAmbiguitySolverConfig import TrkAmbiguityScore_Trig_Cfg, TrkAmbiguitySolver_Trig_Cfg + acc.merge(TrkAmbiguityScore_Trig_Cfg(flags, name = f"{prefix}TrkAmbiguityScore_{flags.InDet.Tracking.ActivePass.input_name}")) + acc.merge(TrkAmbiguitySolver_Trig_Cfg(flags, name = f"{prefix}TrkAmbiguitySolver_{flags.InDet.Tracking.ActivePass.input_name}")) return acc