diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py index dc5ebc16d704a764146cc85aaaeda1aa327cf140..7b11972e18305d8418a74ebf82fa1c9a20d28fec 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py @@ -1,11 +1,11 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration """ SubDetectorEnvelopes configurations for AtlasGeometryCommon Elmar Ritsch, 27/09/2013 """ -def getEnvelopeDefSvc(name="AtlasGeometry_EnvelopeDefSvc", **kwargs): +def getEnvelopeDefSvcProperties(**kwargs) : kwargs.setdefault("DBInDetNode" , 'InDetEnvelope' ) kwargs.setdefault("DBBeamPipeNode" , 'BeamPipeEnvelope' ) kwargs.setdefault("DBCaloNode" , 'CaloEnvelope' ) @@ -134,10 +134,18 @@ def getEnvelopeDefSvc(name="AtlasGeometry_EnvelopeDefSvc", **kwargs): Cavern.addRZ( 3000000.0 , 3000000.0 ) # r= 3km kwargs.setdefault("FallbackCavernR" , Cavern.getRs() ) kwargs.setdefault("FallbackCavernZ" , Cavern.getZs() ) + return kwargs +def getEnvelopeDefSvc(name="AtlasGeometry_EnvelopeDefSvc", **kwargs): from SubDetectorEnvelopes.SubDetectorEnvelopesConf import DetDescrDBEnvelopeSvc - return DetDescrDBEnvelopeSvc(name, **kwargs) + return DetDescrDBEnvelopeSvc(name, **getEnvelopeDefSvcProperties(**kwargs)) +def getEnvelopeDefSvcCfg(flags, name="AtlasGeometry_EnvelopeDefSvc", **kwargs): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from AthenaConfiguration.ComponentFactory import CompFactory + result = ComponentAccumulator() + result.addService( CompFactory.DetDescrDBEnvelopeSvc(name, **getEnvelopeDefSvcProperties(**kwargs)), primary=True) + return result # class used for more readable definitions of envelope volumes # -> create new volume boundary definitions @@ -279,6 +287,7 @@ def EnvelopeDefSvc(flags, **kwargs): kwargs.setdefault("FallbackCavernR" , Cavern.getRs() ) kwargs.setdefault("FallbackCavernZ" , Cavern.getZs() ) + from SubDetectorEnvelopes.SubDetectorEnvelopesConf import DetDescrDBEnvelopeSvc return DetDescrDBEnvelopeSvc(**kwargs) diff --git a/InnerDetector/InDetConfig/python/BackTrackingConfig.py b/InnerDetector/InDetConfig/python/BackTrackingConfig.py index e0aba1065e439c63579fabc9320857fe1988e985..d98c8c5a746ff1834f6cb7eb187654a49fc0b8e7 100644 --- a/InnerDetector/InDetConfig/python/BackTrackingConfig.py +++ b/InnerDetector/InDetConfig/python/BackTrackingConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory import InDetConfig.TrackingCommonConfig as TC @@ -225,7 +225,7 @@ def InDetAmbiTrackSelectionToolCfg(flags, name='InDetTRT_SeededAmbiTrackSelectio InDetTRTDriftCircleCut = TC.InDetTRTDriftCircleCutForPatternRecoCfg(flags) acc.addPublicTool(InDetTRTDriftCircleCut) - InDetPRDtoTrackMapToolGangedPixels = TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge( TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) ) acc.addPublicTool(InDetPRDtoTrackMapToolGangedPixels) kwargs.setdefault("DriftCircleCutTool", InDetTRTDriftCircleCut) @@ -251,7 +251,7 @@ def SimpleAmbiguityProcessorToolCfg(flags, name='InDetTRT_SeededAmbiguityProcess InDetTrackFitterBT = acc.popToolsAndMerge(TC.InDetTrackFitterBTCfg(flags)) acc.addPublicTool(InDetTrackFitterBT) - InDetPRDtoTrackMapToolGangedPixels = TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge( TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) ) acc.addPublicTool(InDetPRDtoTrackMapToolGangedPixels) # diff --git a/InnerDetector/InDetConfig/python/InDetRecToolConfig.py b/InnerDetector/InDetConfig/python/InDetRecToolConfig.py index 133d578a4adbd33fb939f0af3615db579291bedc..9ea97251538a89cb9e7fdced86e88ecc49e5e476 100644 --- a/InnerDetector/InDetConfig/python/InDetRecToolConfig.py +++ b/InnerDetector/InDetConfig/python/InDetRecToolConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from __future__ import print_function @@ -6,6 +6,9 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders +# @TODO retire once migration to TrackingGeometry conditions data is complete +from InDetRecExample.TrackingCommon import use_tracking_geometry_cond_alg + def InDetPrdAssociationToolCfg(name='InDetPrdAssociationTool',**kwargs) : acc = ComponentAccumulator() ''' @@ -520,6 +523,11 @@ def InDetTestPixelLayerToolCfg(flags, name = "InDetTestPixelLayerTool", **kwargs kwargs.setdefault( "PixelSummaryTool", tmpAcc.getPrimary()) result.merge(tmpAcc) + if 'Extrapolator' not in kwargs : + tmpAcc = InDetExtrapolatorCfg(flags) + kwargs.setdefault("Extrapolator", tmpAcc.getPrimary()) + result.merge(tmpAcc) + kwargs.setdefault("CheckActiveAreas", flags.InDet.checkDeadElementsOnTrack) kwargs.setdefault("CheckDeadRegions", flags.InDet.checkDeadElementsOnTrack) kwargs.setdefault("CheckDisabledFEs", flags.InDet.checkDeadElementsOnTrack) @@ -532,6 +540,9 @@ def InDetTestPixelLayerToolCfg(flags, name = "InDetTestPixelLayerTool", **kwargs def InDetPropagatorCfg(flags, name='InDetPropagator',**kwargs): the_name = makeName( name, kwargs) result = ComponentAccumulator() + from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg + result.merge(MagneticFieldSvcCfg(flags)) + tool = None if flags.InDet.propagatorType == "STEP": tool = CompFactory.Trk.STEP_Propagator( name = the_name, **kwargs) @@ -563,10 +574,17 @@ def InDetNavigatorCfg(flags, name='InDetNavigator', **kwargs): the_name = makeName( name, kwargs) result = ComponentAccumulator() if 'TrackingGeometrySvc' not in kwargs : - from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg - tmpAcc = TrackingGeometrySvcCfg(flags) - kwargs.setdefault("TrackingGeometrySvc", tmpAcc.getPrimary()) - result.merge(tmpAcc) + if not use_tracking_geometry_cond_alg : + from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg + tmpAcc = TrackingGeometrySvcCfg(flags) + kwargs.setdefault("TrackingGeometrySvc", tmpAcc.getPrimary()) + result.merge(tmpAcc) + if 'TrackingGeometryKey' not in kwargs : + if use_tracking_geometry_cond_alg : + from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg + result.merge( TrackingGeometryCondAlgCfg(flags) ) + # @TODO howto get the TrackingGeometryKey from the TrackingGeometryCondAlgCfg ? + kwargs.setdefault("TrackingGeometryKey", 'AtlasTrackingGeometry') tool = CompFactory.Trk.Navigator( name = the_name, **kwargs) result.addPublicTool( tool ) diff --git a/InnerDetector/InDetConfig/python/TRTStandaloneConfig.py b/InnerDetector/InDetConfig/python/TRTStandaloneConfig.py index 5ad88b0c4525bde2d12d0d3ff64608db2dd7ea1d..26458e800ef0bfdbd57dbd63f0c2e5e21519ae1d 100644 --- a/InnerDetector/InDetConfig/python/TRTStandaloneConfig.py +++ b/InnerDetector/InDetConfig/python/TRTStandaloneConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory import InDetConfig.TrackingCommonConfig as TC @@ -47,7 +47,7 @@ def TRT_SegmentToTrackToolCfg(flags, name ='InDetTRT_SegmentToTrackTool', extens # if usePrdAssociationTool: - asso_tool = TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) + asso_tool = acc.popToolsAndMerge( TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) ) acc.addPublicTool(asso_tool) else: asso_tool = None @@ -139,7 +139,7 @@ def TRT_SegmentsToTrackCfg( flags, name ='InDetTRT_SegmentsToTrack_Barrel', exte InDetTrackSummaryToolTRTTracks = acc.popToolsAndMerge(TC.InDetTrackSummaryToolTRTTracksCfg(flags)) acc.addPublicTool(InDetTrackSummaryToolTRTTracks) - InDetPRDtoTrackMapToolGangedPixels = TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) + InDetPRDtoTrackMapToolGangedPixels = acc.popToolsAndMerge( TC.InDetPRDtoTrackMapToolGangedPixelsCfg(flags) ) acc.addPublicTool(InDetPRDtoTrackMapToolGangedPixels) kwargs.setdefault("InputSegmentsCollection", BarrelSegments) @@ -314,4 +314,4 @@ if __name__ == "__main__": iovsvc.OutputLevel=5 top_acc.run(25) - top_acc.store(open("test_TRTStandaloneConfig.pkl", "wb")) \ No newline at end of file + top_acc.store(open("test_TRTStandaloneConfig.pkl", "wb")) diff --git a/InnerDetector/InDetConfig/python/TrackingCommonConfig.py b/InnerDetector/InDetConfig/python/TrackingCommonConfig.py index 53e47b9498bbb704c6e770db54fd814a301696cb..f6f1eaffb70f8f4580479c594d4873f2745483a3 100644 --- a/InnerDetector/InDetConfig/python/TrackingCommonConfig.py +++ b/InnerDetector/InDetConfig/python/TrackingCommonConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline @@ -6,6 +6,9 @@ from InDetConfig.InDetRecToolConfig import makeName import AthenaCommon.SystemOfUnits as Units ####################################################################### +# @TODO retire once migration to TrackingGeometry conditions data is complete +from InDetRecExample.TrackingCommon import use_tracking_geometry_cond_alg + def copyArgs(kwargs, copy_list): dict_copy={} for elm in copy_list : @@ -304,10 +307,12 @@ def InDetRefitRotCreatorCfg(flags, name='InDetRefitRotCreator', **kwargs): return acc def InDetPRDtoTrackMapToolGangedPixelsCfg(flags, name='PRDtoTrackMapToolGangedPixels', **kwargs): + acc = ComponentAccumulator() the_name = makeName( name, kwargs) kwargs.setdefault("PixelClusterAmbiguitiesMapName", 'PixelClusterAmbiguitiesMap') # InDetKeys.GangedPixelMap() kwargs.setdefault("addTRToutliers", True) - return CompFactory.InDet.InDetPRDtoTrackMapToolGangedPixels( name=the_name, **kwargs) + acc.setPrivateTools(CompFactory.InDet.InDetPRDtoTrackMapToolGangedPixels( name=the_name, **kwargs)) + return acc def InDetTrackPRD_AssociationCfg(flags, name='InDetTrackPRD_Association', **kwargs): acc = ComponentAccumulator() @@ -887,9 +892,18 @@ def InDetGlobalChi2FitterBaseCfg(flags, name='GlobalChi2FitterBase', **kwargs) : from InDetConfig.InDetRecToolConfig import InDetNavigatorCfg, InDetPropagatorCfg, InDetExtrapolatorCfg acc = ComponentAccumulator() - from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg - acc.merge(TrackingGeometrySvcCfg(flags)) - AtlasTrackingGeometrySvc = acc.getService('AtlasTrackingGeometrySvc') + if 'TrackingGeometrySvc' not in kwargs : + if not use_tracking_geometry_cond_alg : + from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg + acc.merge(TrackingGeometrySvcCfg(flags)) + kwargs.setdefault("TrackingGeometrySvc", acc.getService('AtlasTrackingGeometrySvc') ) + + if 'TrackingGeometryReadKey' not in kwargs : + if use_tracking_geometry_cond_alg : + from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg + acc.merge( TrackingGeometryCondAlgCfg(flags) ) + # @TODO howto get the TrackingGeometryKey from the TrackingGeometryCondAlgCfg ? + kwargs.setdefault("TrackingGeometryReadKey", 'AtlasTrackingGeometry') tmpAcc = InDetExtrapolatorCfg(flags) InDetExtrapolator = tmpAcc.getPrimary() @@ -916,7 +930,6 @@ def InDetGlobalChi2FitterBaseCfg(flags, name='GlobalChi2FitterBase', **kwargs) : kwargs.setdefault("PropagatorTool", InDetPropagator) kwargs.setdefault("MultipleScatteringTool", InDetMultipleScatteringUpdator) kwargs.setdefault("MeasurementUpdateTool", InDetUpdator) - kwargs.setdefault("TrackingGeometrySvc", AtlasTrackingGeometrySvc) kwargs.setdefault("MaterialUpdateTool", InDetMaterialEffectsUpdator) kwargs.setdefault("StraightLine", not flags.BField.solenoidOn) kwargs.setdefault("OutlierCut", 4) diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py index f592e04e99d870f4af5d73163e294dd0bc89cdaf..e7b5a0f97a74d3a3ab81e76cf5fd94e17a59b669 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilderCond.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration ###################################################### # ConfiguredInDetTrackingGeometry module @@ -15,10 +15,13 @@ from AthenaCommon.DetFlags import DetFlags # define the class class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryBuilderCond ): # constructor - def __init__(self,name = 'InDetTrackingGeometryBuilderCond', - namePrefix = '', - setLayerAssociation = True, - buildTrtStrawLayers = False): + # the name must already contain the prefix and suffix if desired + def __init__(self, + name = 'InDetTrackingGeometryBuilderCond', + namePrefix = '', + nameSuffix= 'Cond', + setLayerAssociation = True, + buildTrtStrawLayers = False): # get the ToolSvc from AthenaCommon.AppMgr import ToolSvc, ServiceMgr @@ -28,7 +31,7 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB # beampipe from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilderCond - BeamPipeBuilder = InDet__BeamPipeBuilderCond(name=namePrefix+'BeamPipeBuilderCond') + BeamPipeBuilder = InDet__BeamPipeBuilderCond(name=namePrefix+'BeamPipeBuilder'+nameSuffix) BeamPipeBuilder.BeamPipeRadius = TrkDetFlags.BeamPipeRadius() BeamPipeBuilder.BeamPipeThickness = TrkDetFlags.BeamPipeThickness() BeamPipeBuilder.BeamPipeMaterialBinsZ = TrkDetFlags.BeamPipeLayerMaterialBinsZ() @@ -45,7 +48,7 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB # PIXEL building if DetFlags.pixel_on(): from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilderCond - PixelLayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'PixelLayerBuilderCond') + PixelLayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'PixelLayerBuilder'+nameSuffix) PixelLayerBuilder.PixelCase = True PixelLayerBuilder.Identification = 'Pixel' PixelLayerBuilder.SiDetManagerLocation = 'Pixel' @@ -76,7 +79,7 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB if DetFlags.SCT_on(): # SCT building from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilderCond - SCT_LayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'SCT_LayerBuilderCond') + SCT_LayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'SCT_LayerBuilder'+nameSuffix) SCT_LayerBuilder.PixelCase = False SCT_LayerBuilder.Identification = 'SCT' SCT_LayerBuilder.SiDetManagerLocation = 'SCT' @@ -105,7 +108,7 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB if DetFlags.TRT_on(): from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__TRT_LayerBuilderCond - TRT_LayerBuilder = InDet__TRT_LayerBuilderCond(name=namePrefix+'TRT_LayerBuilderCond') + TRT_LayerBuilder = InDet__TRT_LayerBuilderCond(name=namePrefix+'TRT_LayerBuilder'+nameSuffix) # TRT barrel specifications TRT_LayerBuilder.ModelBarrelLayers = TrkDetFlags.TRT_BarrelModelLayers() TRT_LayerBuilder.BarrelLayerBinsZ = TrkDetFlags.TRT_BarrelLayerMaterialBinsZ() @@ -131,7 +134,7 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB # helpers for the InDetTrackingGeometry Builder : layer array creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator - InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator') + InDetLayerArrayCreator = Trk__LayerArrayCreator(name = namePrefix+'InDetLayerArrayCreator'+nameSuffix) InDetLayerArrayCreator.EmptyLayerMode = 2 # deletes empty material layers from arrays InDetLayerArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel() # add to ToolSvc @@ -139,14 +142,14 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB # helpers for the InDetTrackingGeometry Builder : volume array creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator - InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator') + InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = namePrefix+'InDetTrackingVolumeArrayCreator'+nameSuffix) InDetTrackingVolumeArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel() # add to ToolSvc ToolSvc += InDetTrackingVolumeArrayCreator # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper - InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper') + InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(name = namePrefix+'InDetTrackingVolumeHelper'+nameSuffix) InDetTrackingVolumeHelper.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel() # the material bins InDetTrackingVolumeHelper.BarrelLayerBinsZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz() @@ -158,7 +161,7 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB # helpers for the InDetTrackingGeometry Builder : cylinder volume creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator - InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator') + InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = namePrefix+'InDetCylinderVolumeCreator'+nameSuffix) # give him the layer array creator InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator @@ -180,8 +183,10 @@ class ConfiguredInDetTrackingGeometryBuilderCond( InDet__RobustTrackingGeometryB # add to SvcMgr ServiceMgr += AtlasEnvelopeSvc + if name.find('CondCond')>=0 : + raise exception('invalid name composition %s ' % (name)) # the tracking geometry builder - InDet__RobustTrackingGeometryBuilderCond.__init__(self,namePrefix+name,\ + super(ConfiguredInDetTrackingGeometryBuilderCond,self).__init__(name,\ BeamPipeBuilder = BeamPipeBuilder,\ LayerBuilders = layerbuilders, LayerBinningType = binnings, diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredStagedTrackingGeometryBuilderCond.py b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredStagedTrackingGeometryBuilderCond.py index 07abdcbba39dea1477dab3548a0ab10bb59fabdd..f429bae76c6f2b2bf8caad8d838a08da583c7253 100644 --- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredStagedTrackingGeometryBuilderCond.py +++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredStagedTrackingGeometryBuilderCond.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration ###################################################### # ConfiguredStagedTrackingGeometry module @@ -14,8 +14,9 @@ from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__StagedTrackin # define the class class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometryBuilderCond ): # constructor - def __init__(self,name = 'InDetTrackingGeometryBuilderCond', + def __init__(self,name = 'InDetTrackingGeometryBuilder', namePrefix = '', + nameSuffix = 'Cond', setLayerAssociation = True, buildTrtStrawLayers = False): @@ -28,7 +29,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # beampipe from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilderCond - BeamPipeBuilder = InDet__BeamPipeBuilderCond(name=namePrefix+'BeamPipeBuilderCond') + BeamPipeBuilder = InDet__BeamPipeBuilderCond(name=namePrefix+'BeamPipeBuilder'+nameSuffix) BeamPipeBuilder.BeamPipeRadius = TrkDetFlags.BeamPipeRadius() BeamPipeBuilder.BeamPipeThickness = TrkDetFlags.BeamPipeThickness() BeamPipeBuilder.BeamPipeMaterialBinsZ = TrkDetFlags.BeamPipeLayerMaterialBinsZ() @@ -37,7 +38,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # the layer providers from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerProviderCond - BeamPipeProvider = Trk__LayerProviderCond(name=namePrefix+'BeamPipeProviderCond') + BeamPipeProvider = Trk__LayerProviderCond(name=namePrefix+'BeamPipeProvider'+nameSuffix) BeamPipeProvider.LayerBuilder = BeamPipeBuilder ToolSvc += BeamPipeProvider @@ -53,7 +54,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # PIXEL building if DetFlags.pixel_on() : from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilderCond - PixelLayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'PixelLayerBuilderCond') + PixelLayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'PixelLayerBuilder'+nameSuffix) PixelLayerBuilder.PixelCase = True PixelLayerBuilder.Identification = 'Pixel' PixelLayerBuilder.SiDetManagerLocation = 'Pixel' @@ -73,7 +74,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry ToolSvc += PixelLayerBuilder # the layer providers - PixelLayerProvider = Trk__LayerProviderCond(name=namePrefix+'PixelLayerProviderCond') + PixelLayerProvider = Trk__LayerProviderCond(name=namePrefix+'PixelLayerProvider'+nameSuffix) PixelLayerProvider.LayerBuilder = PixelLayerBuilder ToolSvc += PixelLayerProvider layerProviders += [ PixelLayerProvider ] @@ -83,7 +84,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # SCT building if DetFlags.SCT_on() : - SCT_LayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'SCT_LayerBuilderCond') + SCT_LayerBuilder = InDet__SiLayerBuilderCond(name=namePrefix+'SCT_LayerBuilder'+nameSuffix) SCT_LayerBuilder.PixelCase = False SCT_LayerBuilder.Identification = 'SCT' SCT_LayerBuilder.SiDetManagerLocation = 'SCT' @@ -107,7 +108,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry ToolSvc += SCT_LayerBuilder # the layer providers - SCT_LayerProvider = Trk__LayerProviderCond(name=namePrefix+'SCT_LayerProviderCond') + SCT_LayerProvider = Trk__LayerProviderCond(name=namePrefix+'SCT_LayerProvider'+nameSuffix) SCT_LayerProvider.LayerBuilder = SCT_LayerBuilder ToolSvc += SCT_LayerProvider @@ -120,7 +121,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # TRT building if DetFlags.TRT_on() : from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__TRT_LayerBuilderCond - TRT_LayerBuilder = InDet__TRT_LayerBuilderCond(name=namePrefix+'TRT_LayerBuilderCond') + TRT_LayerBuilder = InDet__TRT_LayerBuilderCond(name=namePrefix+'TRT_LayerBuilder'+nameSuffix) # TRT barrel specifications TRT_LayerBuilder.ModelBarrelLayers = TrkDetFlags.TRT_BarrelModelLayers() TRT_LayerBuilder.BarrelLayerBinsZ = TrkDetFlags.TRT_BarrelLayerMaterialBinsZ() @@ -141,7 +142,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # the layer providers - TRT_LayerProvider = Trk__LayerProviderCond(name=namePrefix+'TRT_LayerProviderCond') + TRT_LayerProvider = Trk__LayerProviderCond(name=namePrefix+'TRT_LayerProvider'+nameSuffix) TRT_LayerProvider.LayerBuilder = TRT_LayerBuilder ToolSvc += TRT_LayerProvider @@ -154,7 +155,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # helpers for the InDetTrackingGeometry Builder : layer array creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator - InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator') + InDetLayerArrayCreator = Trk__LayerArrayCreator(name = namePrefix+'InDetLayerArrayCreator'+nameSuffix) InDetLayerArrayCreator.EmptyLayerMode = 2 # deletes empty material layers from arrays InDetLayerArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingHelperOutputLevel() # add to ToolSvc @@ -162,14 +163,14 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # helpers for the InDetTrackingGeometry Builder : volume array creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator - InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator') + InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = namePrefix+'InDetTrackingVolumeArrayCreator'+nameSuffix) InDetTrackingVolumeArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel() # add to ToolSvc ToolSvc += InDetTrackingVolumeArrayCreator # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper - InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper') + InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(name = namePrefix+'InDetTrackingVolumeHelper'+nameSuffix) InDetTrackingVolumeHelper.OutputLevel = TrkDetFlags.InDetBuildingHelperOutputLevel() # the material bins InDetTrackingVolumeHelper.BarrelLayerBinsZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz() @@ -181,7 +182,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry # helpers for the InDetTrackingGeometry Builder : cylinder volume creator from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator - InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator') + InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = namePrefix+'InDetCylinderVolumeCreator'+nameSuffix) # give him the layer array creator InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator @@ -204,7 +205,7 @@ class ConfiguredStagedTrackingGeometryBuilderCond( InDet__StagedTrackingGeometry ServiceMgr += AtlasEnvelopeSvc # the tracking geometry builder - InDet__StagedTrackingGeometryBuilderCond.__init__(self,namePrefix+name,\ + InDet__StagedTrackingGeometryBuilderCond.__init__(self,namePrefix+name+nameSuffix,\ LayerBuilders = layerProviders, LayerBinningTypeCenter = binningsCenter, LayerBinningTypeEndcap = binningsEndcap, diff --git a/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py b/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py index 577deebb141c5d7b11cca1b954c274f34bd8ac0b..9cfc7b69f39b00edaa6cdacf34670258f0d96867 100755 --- a/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py +++ b/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration ## set to true in case you would like to write out your own InDetAlignMon.root InDetAlignMonDoOutput = True @@ -229,9 +229,11 @@ if (InDetFlags.doPrintConfigurables()): # # Generic Tracks # +from InDetRecExample import TrackingCommon from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import IDAlignMonGenericTracks InDetAlignMonGenericTracks_noTrig = IDAlignMonGenericTracks (name = "InDetAlignMonGenericTracks_noTrig", trackSelection = m_alignMonTrackSelectionTool[1], + TrackToVertexIPEstimator = TrackingCommon.getTrackToVertexIPEstimator(), VxPrimContainerName = InDetKeys.xAODVertexContainer()) if jobproperties.Beam.beamType()=='cosmics' or jobproperties.Beam.beamType()=='singlebeam': @@ -374,6 +376,7 @@ else: InDetAlignMonGenericTracks = IDAlignMonGenericTracks (name = "InDetAlignMonGenericTracks", trackSelection = m_alignMonTrackSelectionTool[1], + TrackToVertexIPEstimator = TrackingCommon.getTrackToVertexIPEstimator(), tracksName = InDetKeys.ExtendedTracks(), VxPrimContainerName = InDetKeys.xAODVertexContainer()) diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py b/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py index 6e30e669d6d1392b5e4037bfd7cd1a62e06ebaa4..2365d4d6a768cda02b7ce2cfcf45b8ea9578c6c2 100644 --- a/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py +++ b/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py @@ -323,8 +323,10 @@ if (InDetFlags.doPrimaryVertex3DFinding()): #Mode1dFinder = # default, no setting needed ) else: + from InDetRecExample import TrackingCommon from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ZScanSeedFinder - InDetVtxSeedFinder = Trk__ZScanSeedFinder(name = "InDetZScanSeedFinder" + InDetVtxSeedFinder = Trk__ZScanSeedFinder(name = "InDetZScanSeedFinder", + IPEstimator = TrackingCommon.getTrackToVertexIPEstimator() #Mode1dFinder = # default, no setting needed ) diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py index d9f1d5d96e0fb7ee0802df388171104c9211285b..ee8158ebc1beff5f67a08dc7da16746b4b117b2e 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py @@ -632,7 +632,7 @@ def getTrackingGeometryCondAlg(name="AtlasTrackingGeometryCondAlg",**kwargs) : the_name = makeName( name, kwargs ) from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlg import ConfiguredTrackingGeometryCondAlg alg = ConfiguredTrackingGeometryCondAlg(the_name) - alg.TrackingGeometryWriteKey = 'AlignedTrackingGeometry' + # alg.TrackingGeometryWriteKey = 'AlignedTrackingGeometry' return alg @@ -1647,3 +1647,31 @@ def pixelClusterSplitProbName() : InDetNewTrackingCutsDisappearing = ConfiguredNewTrackingCuts("Disappearing") ClusterSplitProbContainer = 'InDetAmbiguityProcessorSplitProb'+InDetNewTrackingCutsDisappearing.extension() return ClusterSplitProbContainer if hasSplitProb(ClusterSplitProbContainer) else '' + +@makePublicTool +def getInDetFullLinearizedTrackFactory(name='InDetFullLinearizedTrackFactory', **kwargs) : + the_name = makeName( name, kwargs) + if 'Extrapolator' not in kwargs : + kwargs=setDefaults(kwargs,Extrapolator = getInDetExtrapolator()) # @TODO AtlasExtrapolator ? + + from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory + return Trk__FullLinearizedTrackFactory(the_name, **kwargs) + +@makePublicTool +def getTrackToVertexIPEstimator(name='TrackToVertexIPEstimator', **kwargs) : + the_name = makeName( name, kwargs) + if 'Extrapolator' not in kwargs : + kwargs=setDefaults(kwargs,Extrapolator = getInDetExtrapolator()) # @TODO AtlasExtrapolator ? + if 'LinearizedTrackFactory' not in kwargs : + kwargs=setDefaults(kwargs, LinearizedTrackFactory = getInDetFullLinearizedTrackFactory() ) + from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator + return Trk__TrackToVertexIPEstimator( the_name, **kwargs) + +@makePublicTool +def getV0Tools(name='V0Tools', **kwargs) : + the_name = makeName( name, kwargs) + if 'Extrapolator' not in kwargs : + from TrkExTools.AtlasExtrapolator import AtlasExtrapolator + kwargs=setDefaults(kwargs,Extrapolator = AtlasExtrapolator()) + from TrkVertexAnalysisUtils.TrkVertexAnalysisUtilsConf import Trk__V0Tools + return Trk__V0Tools(the_name, **kwargs) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetInclusiveSecVtx.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetInclusiveSecVtx.py index eedc2f5de18fceeb029f65c4bbe79c4fdf2b87e3..50097de652b3190508d0518d18d35827204668a4 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetInclusiveSecVtx.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetInclusiveSecVtx.py @@ -2,6 +2,7 @@ # -- Mar 3, 2016, Lianyou SHAN@bjIHEP #myPrint = VERBOSE +from InDetRecExample import TrackingCommon myPrint = INFO IncSecVtxMultiSeed = False @@ -56,15 +57,8 @@ ToolSvc += InDetSecVtxTrackSelectorTool if (InDetFlags.doPrintConfigurables()): printfunc (' InDetSecVtxTrackSelectorTool : ', InDetSecVtxTrackSelectorTool) -## InDetFlags.doVertexFinding is set off when start ISV from AOD -if rec.readAOD(): - printfunc (' Here ') - from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory - InDetLinFactory = Trk__FullLinearizedTrackFactory( name = "FullLinearizedTrackFactoryIncSecVtx", - Extrapolator = InDetExtrapolator ) - ToolSvc += InDetLinFactory - if (InDetFlags.doPrintConfigurables()): - printfunc (InDetLinFactory) +def getFullLinearizedTrackFactoryIncSecVtx() : + return TrackingCommon.getInDetFullLinearizedTrackFactory('FullLinearizedTrackFactoryIncSecVtx') ## two options for seedFinder if IncSecVtxMultiSeed : @@ -187,7 +181,7 @@ InDetIncSecVtxFitterTool = Trk__AdaptiveVertexFitter(name = "Adap MaxIterations = 8000, MaxDistToLinPoint = 0.2, InitialError = 0.2, - LinearizedTrackFactory = InDetLinFactory, + LinearizedTrackFactory = getFullLinearizedTrackFactoryIncSecVtx(), ImpactPoint3dEstimator = InDetImpactPoint3dEstimator, VertexUpdator = IncSecVertexUpdator, AnnealingMaker = InDetAnnealingMaker, @@ -205,7 +199,7 @@ InDetSecVtxFinderTool = InDet__InDetIterativeSecVtxFinderTool(name = "InDetSecV SecVtxTrackSelector = InDetSecVtxTrackSelectorTool, SeedFinder = InDetIncSecVtxSeedFinder, ImpactPoint3dEstimator = InDetImpactPoint3dEstimator, - LinearizedTrackFactory = InDetLinFactory, + LinearizedTrackFactory = getFullLinearizedTrackFactoryIncSecVtx(), useBeamConstraint = False, # significanceCutSeeding = 15., significanceCutSeeding = 9., diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py index 13db06af68b8a4ecebe8fa933d574b1b011056ce..339dea765e63baa1a9fce933c0c2c9bd3fd26c72 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py @@ -108,9 +108,10 @@ if not jobproperties.Beam.beamType()=='cosmics': printfunc (InDetAlignMonSivsTRT_noTrig) + from InDetRecExample import TrackingCommon from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import InDetAlignMonBeamSpot InDetAlignMonBeamSpot_noTrig = InDetAlignMonBeamSpot (name = "InDetAlignMonBeamSpot_noTrig", - extrapolator = InDetExtrapolator, + extrapolator = TrackingCommon.getInDetExtrapolator(), vxContainerName = InDetKeys.xAODVertexContainer(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) @@ -234,10 +235,12 @@ if (InDetFlags.doPrintConfigurables()): # # Generic Tracks # +from InDetRecExample import TrackingCommon from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import IDAlignMonGenericTracks InDetAlignMonGenericTracks_noTrig = IDAlignMonGenericTracks (name = "InDetAlignMonGenericTracks_noTrig", trackSelection = m_alignMonTrackSelectionTool[1], - VxPrimContainerName = InDetKeys.xAODVertexContainer()) + TrackToVertexIPEstimator = TrackingCommon.getTrackToVertexIPEstimator(), + VxPrimContainerName = InDetKeys.xAODVertexContainer()) if jobproperties.Beam.beamType()=='cosmics' or jobproperties.Beam.beamType()=='singlebeam': InDetAlignMonGenericTracks_noTrig.tracksName = InDetKeys.Tracks() @@ -383,6 +386,7 @@ else: InDetAlignMonGenericTracks = IDAlignMonGenericTracks (name = "InDetAlignMonGenericTracks", trackSelection = m_alignMonTrackSelectionTool[1], + TrackToVertexIPEstimator = TrackingCommon.getTrackToVertexIPEstimator(), tracksName = InDetKeys.ExtendedTracks(), VxPrimContainerName = InDetKeys.xAODVertexContainer()) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py index 2c45cf527b4253241031e26ddeb8dfdce8a5ce12..10004351cadd84675bf5f45a4ef38a807ad500ca 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py @@ -1,3 +1,4 @@ +from InDetRecExample import TrackingCommon if (not 'doIdGlobalErrorMon' in dir()): doIdGlobalErrorMon = False @@ -68,7 +69,8 @@ if InDetFlags.doMonitoringGlobal(): InDetGlobalTrackMonTool=InDetGlobalTrackMonTool( name = "InDetGlobalTrackMonTool", histoPathBase = "/GLOBAL", DoIBL = InDetFlags.doIBL(), - trackMax = 75) + trackMax = 75, + TrackToVertexIPEstimator = TrackingCommon.getTrackToVertexIPEstimator() ) TrackCollection = InDetKeys.UnslimmedTracks() @@ -78,15 +80,15 @@ if InDetFlags.doMonitoringGlobal(): CutLevel = "TightPrimary", maxNPixelHoles = 1, minPt = 5000, - TrackSummaryTool = InDetTrackSummaryTool, - Extrapolator = InDetExtrapolator) + TrackSummaryTool = TrackingCommon.getInDetTrackSummaryTool(), + Extrapolator = TrackingCommon.getInDetExtrapolator()) InDetTrackSelectionToolGlobalMon_TightPrimary = InDet__InDetTrackSelectionTool(name = "InDetTrackSelectionToolGlobalMon_TightPrimary", UseTrkTrackTools = True, CutLevel = "TightPrimary", minPt = 5000, - TrackSummaryTool = InDetTrackSummaryTool, - Extrapolator = InDetExtrapolator) + TrackSummaryTool = TrackingCommon.getInDetTrackSummaryTool(), + Extrapolator = TrackingCommon.getInDetExtrapolator()) #ToolSvc += InDetTrackSelectionToolGlobalMon_Baseline #ToolSvc += InDetTrackSelectionToolGlobalMon_TightPrimary diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py index c339889ee7f37952ee52d336dbebe350aaa7e042..43f1f8a59d0e2bbd2b8c186f194e9d9ef398b8b0 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # ''' @@ -20,7 +20,8 @@ from PixelMonitoring.PixelAthClusterMonAlgCfg import PixelAthClusterMonAlgCfg from PixelMonitoring.PixelMonitoringConf import PixelAthErrorMonAlg from PixelMonitoring.PixelAthErrorMonAlgCfg import PixelAthErrorMonAlgCfg -from InDetRecExample.InDetKeys import InDetKeys +from InDetRecExample.InDetKeys import InDetKeys +from InDetRecExample import TrackingCommon kwargsHitMonAlg = { 'doOnline' : True if athenaCommonFlags.isOnline() else False, #Histograms for online (athenaPT) running 'doLumiBlock' : False if athenaCommonFlags.isOnline() else True, #Turn on/off histograms stored for each lumi block @@ -64,13 +65,14 @@ if doClusterMonAlg: pixelAthClusterMonAlg = helper.addAlgorithm(PixelAthClusterMonAlg, 'PixelAthClusterMonAlg') for k, v in kwargsClusMonAlg.items(): setattr(pixelAthClusterMonAlg, k, v) + pixelAthClusterMonAlg.HoleSearchTool = TrackingCommon.getInDetHoleSearchTool() pixelAthClusterMonAlg.TrackSelectionTool.UseTrkTrackTools = True pixelAthClusterMonAlg.TrackSelectionTool.CutLevel = "TightPrimary" pixelAthClusterMonAlg.TrackSelectionTool.maxNPixelHoles = 1 pixelAthClusterMonAlg.TrackSelectionTool.maxD0 = 2 pixelAthClusterMonAlg.TrackSelectionTool.maxZ0 = 150 - pixelAthClusterMonAlg.TrackSelectionTool.TrackSummaryTool = InDetTrackSummaryTool - pixelAthClusterMonAlg.TrackSelectionTool.Extrapolator = InDetExtrapolator + pixelAthClusterMonAlg.TrackSelectionTool.TrackSummaryTool = TrackingCommon.getInDetTrackSummaryTool() + pixelAthClusterMonAlg.TrackSelectionTool.Extrapolator = TrackingCommon.getInDetExtrapolator() #print getattr(pixelAthClusterMonAlg, 'onTrack') PixelAthClusterMonAlgCfg(helper, pixelAthClusterMonAlg, **kwargsClusMonAlg) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py index ebbeda9763d18e6ee0c3398649b2a39283a76d03..4d9a125ae891dbcf4f1560e81034f1f7c2be2c83 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringSCT.py @@ -1,3 +1,4 @@ +from InDetRecExample import TrackingCommon useNewAlgs = True # Use new AthenaMT friendly DQ algorithms instead of DQ tools if useNewAlgs: @@ -95,7 +96,7 @@ else: InDetSCTHitEffMonTool = SCTHitEffMonTool(name = "InDetSCTHitEffMonTool", OutputLevel = 4, IsCosmic = InDetFlags.doCosmics(), - HoleSearch = InDetHoleSearchTool, + HoleSearch = TrackingCommon.getInDetHoleSearchTool(), ROTCreator = SCT_ClusterOnTrackTool, BunchCrossingTool = SCT_BunchCrossingTool, TrackName = tracksName) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py index 7452a73cef9738dc22cb78f510aa28f22395e040..cb554475f1a2d30d994dae8f1132789aff1c0b5a 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py @@ -541,16 +541,6 @@ if InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring() or if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) or InDetFlags.doSplitVertexFindingForMonitoring() and InDetFlags.primaryVertexSetup() != 'DummyVxFinder': - # - # --- load linearized track factory - # - from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory - InDetLinFactory = Trk__FullLinearizedTrackFactory(name = "InDetFullLinearizedTrackFactory", - Extrapolator = InDetExtrapolator ) - ToolSvc += InDetLinFactory - if (InDetFlags.doPrintConfigurables()): - printfunc (InDetLinFactory) - # # --- load configured Seed finder # @@ -573,7 +563,9 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o else: from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ZScanSeedFinder - InDetVtxSeedFinder = Trk__ZScanSeedFinder(name="InDetZScanSeedFinder" + from InDetRecExample import TrackingCommon + InDetVtxSeedFinder = Trk__ZScanSeedFinder(name="InDetZScanSeedFinder", + IPEstimator = TrackingCommon.getTrackToVertexIPEstimator() # Mode1dFinder = # default, no setting needed ) ToolSvc += InDetVtxSeedFinder @@ -771,8 +763,8 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o # from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter InDetVxFitterTool = Trk__FastVertexFitter(name = "InDetFastVertexFitterTool", - LinearizedTrackFactory = InDetLinFactory, - Extrapolator = InDetExtrapolator) + LinearizedTrackFactory = TrackingCommon.getInDetFullLinearizedTrackFactory(), + Extrapolator = TrackingCommon.getInDetExtrapolator()) elif InDetFlags.primaryVertexSetup() == 'DefaultFullFinding': # @@ -780,8 +772,8 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o # from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FullVertexFitter InDetVxFitterTool = Trk__FullVertexFitter(name = "InDetFullVertexFitterTool", - LinearizedTrackFactory = InDetLinFactory, - Extrapolator = InDetExtrapolator) + LinearizedTrackFactory = TrackingCommon.getInDetFullLinearizedTrackFactory(), + Extrapolator = TrackingCommon.getInDetExtrapolator()) elif InDetFlags.primaryVertexSetup() == 'DefaultKalmanFinding': # @@ -790,7 +782,7 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexFitter InDetVxFitterTool = Trk__SequentialVertexFitter(name = "InDetSequentialVxFitterTool", - LinearizedTrackFactory = InDetLinFactory, + LinearizedTrackFactory = TrackingCommon.getInDetFullLinearizedTrackFactory(), VertexSmoother = InDetVertexSmoother # VertexUpdator = # no setting required ) @@ -804,7 +796,7 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o from TrkVertexFitters.TrkVertexFittersConf import Trk__AdaptiveVertexFitter InDetVxFitterTool = Trk__AdaptiveVertexFitter(name = "InDetAdaptiveVxFitterTool", SeedFinder = InDetVtxSeedFinder, - LinearizedTrackFactory = InDetLinFactory, + LinearizedTrackFactory = TrackingCommon.getInDetFullLinearizedTrackFactory(), ImpactPoint3dEstimator = InDetImpactPoint3dEstimator, AnnealingMaker = InDetAnnealingMaker, VertexSmoother = InDetVertexSmoother) @@ -816,7 +808,7 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o # from TrkVertexFitters.TrkVertexFittersConf import Trk__AdaptiveMultiVertexFitter InDetVxFitterTool = Trk__AdaptiveMultiVertexFitter(name = "InDetAdaptiveMultiVertexFitter", - LinearizedTrackFactory = InDetLinFactory, + LinearizedTrackFactory = TrackingCommon.getInDetFullLinearizedTrackFactory(), ImpactPoint3dEstimator = InDetImpactPoint3dEstimator, AnnealingMaker = InDetAnnealingMaker, DoSmoothing = True) # false is default @@ -880,7 +872,7 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o TrackSelector=InDetTrackSelectorTool, SeedFinder=InDetVtxSeedFinder, ImpactPoint3dEstimator=InDetImpactPoint3dEstimator, - LinearizedTrackFactory=InDetLinFactory, + LinearizedTrackFactory=TrackingCommon.getInDetFullLinearizedTrackFactory(), useBeamConstraint=InDetFlags.useBeamConstraint(), significanceCutSeeding=12, maximumChi2cutForSeeding=49, @@ -907,7 +899,6 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o maxTracks=InDetPrimaryVertexingCuts.MaxTracks(), TrackingGeometryTool=actsTrackingGeometryTool, ExtrapolationTool=actsExtrapolationTool) - ToolSvc += InDetPriVxFinderTool if (InDetFlags.doPrintConfigurables()): printfunc(InDetPriVxFinderTool) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py index 8530ac3f8a5c4b799d1f338ab53cfaa419b73a23..af56b9f0026f7ce78742dacae6e9d5a0c385ec42 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecNtupleCreation.py @@ -215,7 +215,9 @@ if InDetFlags.doNtupleCreation(): if InDetFlags.doV0VtxNtuple(): from TrkVertexAnalysisUtils.TrkVertexAnalysisUtilsConf import Trk__V0Tools - InDetV0Tools = Trk__V0Tools(name = "InDetV0Tools") + from TrkExTools.AtlasExtrapolator import AtlasExtrapolator + InDetV0Tools = Trk__V0Tools(name = "InDetV0Tools", + Extrapolator = AtlasExtrapolator()) ToolSvc += InDetV0Tools if (InDetFlags.doPrintConfigurables()): print( InDetV0Tools ) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py index aabbe902cc2c1a13bcec1d8a6faf01830be215c4..a8b7204512fa58d0179aa9139ec0bb35df66dcd7 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPostProcessing.py @@ -276,10 +276,7 @@ if InDetFlags.doV0Finder(): if (InDetFlags.doPrintConfigurables()): printfunc (InDetV0VtxPointEstimator) - from TrkVertexAnalysisUtils.TrkVertexAnalysisUtilsConf import Trk__V0Tools - v0_tools = Trk__V0Tools(name = 'V0Tools', - Extrapolator = v0_InDetExtrapolator) - ToolSvc += v0_tools + v0_tools = TrackingCommon.getV0Tools() # # InDetV0FinderTool diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py index d6414e1cf0fe3a3fe1d2524113f3642809a07d2d..9666b2a6af2ccc8b7324d64bb1a5db46646cf68b 100644 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadToolsPost.py @@ -18,6 +18,27 @@ from InDetTrigRecExample.ConfiguredNewTrackingTrigCuts import EFIDTrackingCuts InDetTrigCutValues = EFIDTrackingCuts +from InDetRecExample.TrackingCommon import makePublicTool,makeName +@makePublicTool +def getInDetTrigFullLinearizedTrackFactory(name='InDetTrigFullLinearizedTrackFactory', **kwargs) : + the_name = makeName( name, kwargs) + if 'Extrapolator' not in kwargs : + from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator + kwargs.setdefault('Extrapolator', InDetTrigExtrapolator) # @TODO AtlasExtrapolator ? + + from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory + return Trk__FullLinearizedTrackFactory(the_name, **kwargs) + +@makePublicTool +def getInDetTrigTrackToVertexIPEstimator(name='InDetTrigTrackToVertexIPEstimator', **kwargs) : + the_name = makeName( name, kwargs) + if 'Extrapolator' not in kwargs : + from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigExtrapolator + kwargs.setdefault('Extrapolator', InDetTrigExtrapolator) # @TODO AtlasExtrapolator ? + if 'LinearizedTrackFactory' not in kwargs : + kwargs.setdefault('LinearizedTrackFactory', getInDetTrigFullLinearizedTrackFactory() ) + from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator + return Trk__TrackToVertexIPEstimator( the_name, **kwargs) #move from the TrigVxPrimary if InDetTrigFlags.doNewTracking(): @@ -40,7 +61,8 @@ if InDetTrigFlags.doNewTracking(): trackdistexppower = 2) else: from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ZScanSeedFinder - InDetTrigVtxSeedFinder = Trk__ZScanSeedFinder(name = "InDetTrigZScanSeedFinder" + InDetTrigVtxSeedFinder = Trk__ZScanSeedFinder(name = "InDetTrigZScanSeedFinder", + IPEstimator = getInDetTrigTrackToVertexIPEstimator() #Mode1dFinder = # default, no setting needed ) ToolSvc += InDetTrigVtxSeedFinder diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx index 0094d935302e8fa21db3a9ad5ec8cc2fdef1d667..d8efadd514c5ca4f15052f009ebade8f1d2f1fff 100644 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalTrackMonTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @file InDetGlobalTrackMonTool.cxx @@ -200,7 +200,10 @@ StatusCode InDetGlobalTrackMonTool::initialize() { ATH_CHECK( m_baseline_selTool.retrieve() ); ATH_CHECK( m_tight_selTool.retrieve() ); - ATH_CHECK( m_holes_search_tool.retrieve()); + if (m_holes_search_tool.empty() && m_DoHoles_Search) { + ATH_MSG_FATAL("Hole search enabled but HoleSearchTool not configured."); + } + ATH_CHECK( m_holes_search_tool.retrieve( DisableTool{!m_DoHoles_Search} )); sc = ManagedMonitorToolBase::initialize(); if(!sc.isSuccess()) return sc; diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py index 09e7956c59a16098728cc5541594b077d396dccb..53fbe247eb270c8d76243201733adf2eff0c55b3 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTHitEffMonAlg.py @@ -1,11 +1,12 @@ # -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # '''@file SCTHitEffMonAlg.py @author Ken Kreul @date 2019-10-30 @brief Based on AthenaMonitoring/ExampleMonitorAlgorithm.py ''' +from InDetConfig import InDetRecToolConfig def dedicatedTitle(i, isub): m_element = i @@ -37,7 +38,11 @@ def SCTHitEffMonAlgConfig(inputFlags): # base class configuration following the inputFlags. The returned object # is the algorithm. from AthenaConfiguration.ComponentFactory import CompFactory - myMonAlg = helper.addAlgorithm(CompFactory.SCTHitEffMonAlg, 'SCTHitEffMonAlg') + + InDetTrackHoleSearchTool_acc = InDetRecToolConfig.InDetTrackHoleSearchToolCfg(inputFlags) + InDetTrackHoleSearchTool = InDetTrackHoleSearchTool_acc.getPrimary() + result.merge( InDetTrackHoleSearchTool_acc ) + myMonAlg = helper.addAlgorithm(CompFactory.SCTHitEffMonAlg, 'SCTHitEffMonAlg', HoleSearch=InDetTrackHoleSearchTool) # # If for some really obscure reason you need to instantiate an algorithm # # yourself, the AddAlgorithm method will still configure the base # # properties and add the algorithm to the monitoring sequence. diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py index 80b32b8e25ed33b206d382cf4d32b6e776a1c002..e15f2c30603eb8bf36c0a06cb4971e8dba704aae 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # '''@file SCTLorentzMonAlg.py @@ -7,6 +7,7 @@ @date 2019-04-02 @brief Based on AthenaMonitoring/ExampleMonitorAlgorithm.py ''' +from InDetConfig import TrackingCommonConfig def SCTLorentzMonAlgConfig(inputFlags): @@ -29,7 +30,9 @@ def SCTLorentzMonAlgConfig(inputFlags): # base class configuration following the inputFlags. The returned object # is the algorithm. from AthenaConfiguration.ComponentFactory import CompFactory - myMonAlg = helper.addAlgorithm(CompFactory.SCTLorentzMonAlg, 'SCTLorentzMonAlg') + myMonAlg = helper.addAlgorithm(CompFactory.SCTLorentzMonAlg, + 'SCTLorentzMonAlg', + AssociationTool = result.popToolsAndMerge(TrackingCommonConfig.InDetPRDtoTrackMapToolGangedPixelsCfg(inputFlags)) ) # # If for some really obscure reason you need to instantiate an algorithm # # yourself, the AddAlgorithm method will still configure the base diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py index 72cf3e03e4883aa6a77da7cc3c36f8431677ffd6..6c26cd33a6b2c5c6389be13b8ae4ad4456549b0b 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # '''@file TrackingConfigurationWorkaround.py @@ -7,6 +7,7 @@ @date 2019-12-17 @brief Centralize the DQ workarounds for setting up ID tracking tools in new-style config, until this is provided centrally ''' +from InDetConfig import InDetRecToolConfig def TrackSummaryToolWorkaround(flags): from AthenaConfiguration.ComponentFactory import CompFactory @@ -16,85 +17,27 @@ def TrackSummaryToolWorkaround(flags): ############################## TO RUN TRACKSUMMARYTOOL ##################### # Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py - from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg - result.merge(PixelConfigCondAlgCfg(flags)) - from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg - InDetPixelConditionsSummaryTool = result.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) + InDetPixelConditionsSummaryTool = result.popToolsAndMerge(InDetRecToolConfig.PixelConditionsSummaryToolCfg(flags)) - # Taken from Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py - # AtlasExtrapolatorConfig can give only private extrapolator. We need public extrapolator. - from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg - trackGeomCfg = TrackingGeometrySvcCfg(flags) - geom_svc = trackGeomCfg.getPrimary() - geom_svc.GeometryBuilder.Compactify = False ######## To avoid crash ######## - result.merge(trackGeomCfg) - from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg - result.merge(MagneticFieldSvcCfg(flags)) - AtlasNavigator = CompFactory.Trk.Navigator(name = 'AtlasNavigator') - AtlasNavigator.TrackingGeometrySvc = geom_svc - result.addPublicTool(AtlasNavigator) - - # Taken from InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py - InDetPropagator = CompFactory.Trk.RungeKuttaPropagator(name = 'InDetPropagator') - InDetPropagator.AccuracyParameter = 0.0001 - InDetPropagator.MaxStraightLineStep = .004 - result.addPublicTool(InDetPropagator) - InDetMaterialUpdator = CompFactory.Trk.MaterialEffectsUpdator(name = "InDetMaterialEffectsUpdator") - result.addPublicTool(InDetMaterialUpdator) - InDetSubPropagators = [] - InDetSubUpdators = [] - # -------------------- set it depending on the geometry ---------------------------------------------------- - # default for ID is (Rk,Mat) - InDetSubPropagators += [ InDetPropagator.name ] - InDetSubUpdators += [ InDetMaterialUpdator.name ] - # default for Calo is (Rk,MatLandau) - InDetSubPropagators += [ InDetPropagator.name ] - InDetSubUpdators += [ InDetMaterialUpdator.name ] - # default for MS is (STEP,Mat) - #InDetSubPropagators += [ InDetStepPropagator.name ] - InDetSubUpdators += [ InDetMaterialUpdator.name ] - #from TrkExTools.TrkExToolsConf import Trk__Extrapolator - InDetExtrapolator = CompFactory.Trk.Extrapolator(name = 'InDetExtrapolator', - Propagators = [ InDetPropagator ], - MaterialEffectsUpdators = [ InDetMaterialUpdator ], - Navigator = AtlasNavigator, - SubPropagators = InDetSubPropagators, - SubMEUpdators = InDetSubUpdators) - result.addPublicTool(InDetExtrapolator) - InDetTestPixelLayerTool = CompFactory.InDet.InDetTestPixelLayerTool(name = "InDetTestPixelLayerTool", + InDetTestPixelLayerTool = result.popToolsAndMerge(InDetRecToolConfig.InDetTestPixelLayerToolCfg(flags, PixelSummaryTool = InDetPixelConditionsSummaryTool, CheckActiveAreas=True, CheckDeadRegions=True, - CheckDisabledFEs=True) + CheckDisabledFEs=True)) result.addPublicTool(InDetTestPixelLayerTool) - InDetBoundaryCheckTool = CompFactory.InDet.InDetBoundaryCheckTool( - name="InDetBoundaryCheckTool", - UsePixel=flags.Detector.GeometryPixel, - UseSCT=flags.Detector.GeometrySCT, - PixelLayerTool=InDetTestPixelLayerTool - ) - result.addPublicTool(InDetBoundaryCheckTool) - InDetHoleSearchTool = CompFactory.InDet.InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", - Extrapolator = InDetExtrapolator, - CountDeadModulesAfterLastHit = True, - BoundaryCheckTool=InDetBoundaryCheckTool) - result.addPublicTool(InDetHoleSearchTool) - InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name = "InDetPrdAssociationTool_setup", - PixelClusterAmbiguitiesMapName = "PixelClusterAmbiguitiesMap", - SetupCorrect = True, - addTRToutliers = True) - result.addPublicTool(InDetPrdAssociationTool) - InDetTrackSummaryHelperTool = CompFactory.InDet.InDetTrackSummaryHelperTool(name = "InDetSummaryHelper", - AssoTool = InDetPrdAssociationTool, - PixelToTPIDTool = '', - TestBLayerTool = '', - RunningTIDE_Ambi = flags.InDet.doTIDE_Ambi, - DoSharedHits = False, - HoleSearch = InDetHoleSearchTool, - usePixel = flags.Detector.GeometryPixel, - useSCT = flags.Detector.GeometrySCT, - useTRT = flags.Detector.GeometryTRT) + + InDetBoundaryCheckTool_acc = InDetRecToolConfig.InDetBoundaryCheckToolCfg(flags, PixelLayerTool = InDetTestPixelLayerTool) + InDetHoleSearchTool_acc = InDetRecToolConfig.InDetTrackHoleSearchToolCfg(flags, + BoundaryCheckTool= result.popToolsAndMerge(InDetBoundaryCheckTool_acc) ) + InDetHoleSearchTool = InDetHoleSearchTool_acc.getPrimary() + result.merge(InDetHoleSearchTool_acc) + + InDetTrackSummaryHelperTool_acc = InDetRecToolConfig.InDetTrackSummaryHelperToolCfg(flags,HoleSearch=InDetHoleSearchTool) + InDetTrackSummaryHelperTool=InDetTrackSummaryHelperTool_acc.getPrimary() + result.merge(InDetTrackSummaryHelperTool_acc) + + # @TODO should there be a version InDetRecToolConfig ? InDetTrackSummaryTool = CompFactory.Trk.TrackSummaryTool(name = "InDetTrackSummaryTool", InDetSummaryHelperTool = InDetTrackSummaryHelperTool, doSharedHits = False, diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTHitEffMonAlg_jobOptions.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTHitEffMonAlg_jobOptions.py index 92958dcde1a5191bc4a16e1c4bc8001d80a8e7e7..4283b61edc101291fe27e6ae204920dc1b310694 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTHitEffMonAlg_jobOptions.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTHitEffMonAlg_jobOptions.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # '''@file SCTHitEffMonAlg_jobOptions.py @@ -23,6 +23,8 @@ helper = AthMonitorCfgHelperOld(DQMonFlags, "SCTHitEffMonitor") from SCT_Monitoring.SCT_MonitoringConf import SCTHitEffMonAlg myMonAlg = helper.addAlgorithm(SCTHitEffMonAlg, "SCTHitEffMonAlg") +from InDetRecExample import TrackingCommon +myMonAlg.HoleSearch = TrackingCommon.getInDetHoleSearchTool() myMonAlg.TriggerChain = '' diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx index 305d9e7a5a5296b2ceb6bd07498e3547af1fa0d4..39b69ef465fb8eb89c95d47314142357db5f8ce6 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCTLorentzMonAlg.h" @@ -10,6 +10,7 @@ #include "InDetPrepRawData/SiCluster.h" #include "InDetRIO_OnTrack/SiClusterOnTrack.h" #include "TrkTrackSummary/TrackSummary.h" +#include "TrkEventUtils/PRDtoTrackMap.h" #include <cmath> #include <memory> @@ -24,12 +25,7 @@ StatusCode SCTLorentzMonAlg::initialize() { ATH_CHECK(m_trackSummaryTool.retrieve()); ATH_CHECK(m_tracksName.initialize()); ATH_CHECK(m_SCTDetEleCollKey.initialize()); - - if (m_rejectSharedHits) { - ATH_CHECK(m_assoTool.retrieve()); - } else { - m_assoTool.disable(); - } + ATH_CHECK(m_assoTool.retrieve(DisableTool{!m_rejectSharedHits} )); return AthMonitorAlgorithm::initialize(); } @@ -72,9 +68,12 @@ StatusCode SCTLorentzMonAlg::fillHistograms(const EventContext& ctx) const { } // Prepare AssociationTool - Trk::IPRD_AssociationTool::Maps maps; - for (const Trk::Track* track : *tracks) { - ATH_CHECK(m_assoTool->addPRDs(maps, *track)); + std::unique_ptr<Trk::PRDtoTrackMap> prd_to_track_map; + if (m_rejectSharedHits) { + prd_to_track_map = m_assoTool->createPRDtoTrackMap(); + for (const Trk::Track* track : *tracks) { + ATH_CHECK( m_assoTool->addPRDs(*prd_to_track_map,*track) ); + } } for (const Trk::Track* track: *tracks) { @@ -106,7 +105,7 @@ StatusCode SCTLorentzMonAlg::fillHistograms(const EventContext& ctx) const { const InDet::SiClusterOnTrack* clus{dynamic_cast<const InDet::SiClusterOnTrack*>(tsos->measurementOnTrack())}; if (clus) { // Is it a SiCluster? If yes... // Reject shared hits if you want - if (m_rejectSharedHits and m_assoTool->isShared(maps, *(clus->prepRawData()))) { + if (prd_to_track_map and prd_to_track_map->isShared(*(clus->prepRawData())) ) { continue; } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h index 3957f57b0985427791cfc4f3a3137ea1bed5c64f..4b4f1c110dc37f0752ad15fdddc99fe21c162422 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonAlg.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef SCTLORENTZMONALG_H @@ -14,7 +14,8 @@ #include "StoreGate/ReadHandleKey.h" #include "TrkTrack/TrackCollection.h" #include "TrkToolInterfaces/ITrackSummaryTool.h" -#include "TrkToolInterfaces/IPRD_AssociationTool.h" +#include "TrkToolInterfaces/IPRDtoTrackMapTool.h" + class SCT_ID; @@ -32,7 +33,7 @@ class SCTLorentzMonAlg : public AthMonitorAlgorithm { const SCT_ID* m_pSCTHelper{nullptr}; ToolHandle<Trk::ITrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryTool"}; - ToolHandle<Trk::IPRD_AssociationTool> m_assoTool{this, "AssociationTool", "InDet::InDetPRD_AssociationToolGangedPixels"}; + ToolHandle<Trk::IPRDtoTrackMapTool> m_assoTool{this, "AssociationTool", "InDet::InDetPRDtoTrackMapToolGangedPixels" }; /// Name of the Track collection to use SG::ReadHandleKey<TrackCollection> m_tracksName{this, "tracksName", "CombinedInDetTracks"}; diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py index d6661689d22668b1b91c4c188fdf2bee9bd8afce..1a3f91769ea599758117ac652f34dc6da70d8bd0 100644 --- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py +++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py @@ -1,6 +1,31 @@ # -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # + +def TRTHoleSearchCfg(flags, **kwargs) : + from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from AthenaConfiguration.ComponentFactory import CompFactory + + acc=ComponentAccumulator() + kwargs.setdefault('name','TRTTrackHoleSearchTool') + if 'Extrapolator' not in kwargs : + extrapolator = acc.popToolsAndMerge( AtlasExtrapolatorCfg(flags) ) + acc.addPublicTool(extrapolator) + kwargs.setdefault('extrapolator',extrapolator) + acc.setPrivateTools( CompFactory.TRTTrackHoleSearchTool(**kwargs) ) + return acc + +def TRTHoleSearch(name='TRTTrackHoleSearchTool', **kwargs) : + kwargs.setdefault('name',name) + if 'Extrapolator' not in kwargs : + from TrkExTools.AtlasExtrapolator import AtlasExtrapolator + kwargs=setDefaults(kwargs,Extrapolator = AtlasExtrapolator()) + + from TRT_TrackHoleSearch.TRT_TrackHoleSearchConf import TRTTrackHoleSearchTool + return TRTTrackHoleSearchTool(**kwargs) + + def TRTMonitoringRun3RAW_AlgConfig(inputFlags): from AthenaConfiguration.ComponentFactory import isRun3Cfg if isRun3Cfg(): @@ -21,9 +46,14 @@ def TRTMonitoringRun3RAW_AlgConfig(inputFlags): TrackSummaryTool= "InDetTrackSummaryTool" ) + # @TODO really run the TRT hole search ? Hole search still seems to use a condition service if isRun3Cfg(): from SCT_Monitoring.TrackSummaryToolWorkaround import TrackSummaryToolWorkaround algTRTMonitoringRun3RAW.TrackSummaryTool = rv.popToolsAndMerge(TrackSummaryToolWorkaround(inputFlags)) + algTRTMonitoringRun3RAW.trt_hole_search= rv.popToolsAndMerge( TRTHoleSearchCfg(inputFlags) ) + else : + algTRTMonitoringRun3RAW.trt_hole_search=TRTHoleSearch() + maxLumiBlock = 200 numberOfBarrelStacks = 32 diff --git a/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py b/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py index 3dd674e195c817c5f21cf6473948c54a66320c1a..6fc38cd6fe64ee361f5e760d9fcd7cfed122be55 100644 --- a/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py +++ b/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py @@ -214,6 +214,17 @@ InDetExtrapolator = Trk__Extrapolator(name = 'InDetExtrapolat ToolSvc += InDetExtrapolator if InDetFlags.doPrintConfigurables: print InDetExtrapolator +from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory +InDetFullLinearizedTrackFactory = Trk__FullLinearizedTrackFactory('InDetFullLinearizedTrackFactory', Extrapolator = InDetTrigExtrapolator) +ToolSvc += InDetFullLinearizedTrackFactory + +from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator +InDetTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator( 'InDetTrackToVertexIPEstimator', + Extrapolator = InDetExtrapolator, + LinearizedTrackFactory = InDetFullLinearizedTrackFactory) +ToolSvc += InDetTrackToVertexIPEstimator + + # LEVEL 4 @@ -311,10 +322,11 @@ if (InDetFlags.doPrimaryVertex3DFinding()): ) else: from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ZScanSeedFinder - InDetVtxSeedFinder = Trk__ZScanSeedFinder(name = "InDetZScanSeedFinder" - #Mode1dFinder = # default, no setting needed - ) - + InDetVtxSeedFinder = Trk__ZScanSeedFinder(name = "InDetZScanSeedFinder", + IPEstimator = InDetTrackToVertexIPEstimator + #Mode1dFinder = # default, no setting needed + ) + ToolSvc += InDetVtxSeedFinder if InDetFlags.doPrintConfigurables: print InDetVtxSeedFinder diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/share/IDTIDE1.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/share/IDTIDE1.py index 38cae8a995bcb507c11208efb619215f9604e05e..9ebde5bde7787ad6f3a2b96437762d0908c9e14e 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/share/IDTIDE1.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/share/IDTIDE1.py @@ -15,6 +15,7 @@ from DerivationFrameworkCore.DerivationFrameworkMaster import * from DerivationFrameworkInDet.InDetCommon import * from InDetPrepRawDataToxAOD.InDetDxAODJobProperties import InDetDxAODFlags +from InDetRecExcample import TrackingCommon from AthenaCommon.Logging import logging msg = logging.getLogger( "IDTIDE1" ) @@ -53,9 +54,7 @@ evtStream = augStream.GetEventStream() #==================================================================== # CP GROUP TOOLS #==================================================================== -from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator -IDTIDE1IPETool = Trk__TrackToVertexIPEstimator(name = "IDTIDE1IPETool") -ToolSvc += IDTIDE1IPETool +IDTIDE1IPETool = TrackingCommon.getTrackToVertexIPEstimator(name = "IDTIDE1IPETool") _info(IDTIDE1IPETool) #Setup tools @@ -83,13 +82,12 @@ _info(IDTIDE1TrackToVertexWrapper) from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackStateOnSurfaceDecorator -import InDetRecExample.TrackingCommon DFTSOS = DerivationFramework__TrackStateOnSurfaceDecorator(name = "DFTrackStateOnSurfaceDecorator", ContainerName = "InDetTrackParticles", IsSimulation = False, DecorationPrefix = "", StoreTRT = idDxAOD_doTrt, - TRT_ToT_dEdx = InDetRecExample.TrackingCommon.getInDetTRT_dEdxTool() if idDxAOD_doTrt else "", + TRT_ToT_dEdx = TrackingCommon.getInDetTRT_dEdxTool() if idDxAOD_doTrt else "", StoreSCT = idDxAOD_doSct, StorePixel = idDxAOD_doPix, OutputLevel =INFO) @@ -235,7 +233,7 @@ if idDxAOD_doPix: _info("Add Pixel xAOD ToTConversionSetter: %s Properties: %s", PixelChargeToTConversionSetter, PixelChargeToTConversionSetter.properties()) from InDetPrepRawDataToxAOD.InDetPrepRawDataToxAODConf import PixelPrepDataToxAOD xAOD_PixelPrepDataToxAOD = PixelPrepDataToxAOD( name = "xAOD_PixelPrepDataToxAOD", - ClusterSplitProbabilityName = InDetRecExample.TrackingCommon.pixelClusterSplitProbName()) + ClusterSplitProbabilityName = TrackingCommon.pixelClusterSplitProbName()) xAOD_PixelPrepDataToxAOD.OutputLevel=INFO xAOD_PixelPrepDataToxAOD.UseTruthInfo=IsMonteCarlo _info( "Add Pixel xAOD TrackMeasurementValidation: %s", xAOD_PixelPrepDataToxAOD) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAugmenterAlgConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAugmenterAlgConfig.py index 8a5a822f4a8c94e4e3c832f0b81a396f988165ac..8813f51ea11f8a693a96809fbedbb9a2368b636b 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAugmenterAlgConfig.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTagTrackAugmenterAlgConfig.py @@ -1,7 +1,9 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from JetTagTools.BTagTrackToVertexIPEstimatorConfig import BTagTrackToVertexIPEstimatorCfg +from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg Analysis__BTagTrackAugmenterAlg=CompFactory.Analysis.BTagTrackAugmenterAlg @@ -14,10 +16,16 @@ def BTagTrackAugmenterAlgCfg(ConfigFlags, TrackCollection = 'InDetTrackParticles acc = ComponentAccumulator() # Minimal configuration + # @TODO why is options re-initialised to an empty dict ? options = {} options['name'] = ('BTagTrackAugmenter').lower() options['TrackContainer'] = TrackCollection options['PrimaryVertexContainer'] = PrimaryVertexCollectionName + if 'TrackToVertexIPEstimator' not in options : + options.setdefault('TrackToVertexIPEstimator',acc.popToolsAndMerge(BTagTrackToVertexIPEstimatorCfg(ConfigFlags, 'TrkToVxIPEstimator') )) + if 'Extrapolator' not in options : + exrtrapolator_acc = AtlasExtrapolatorCfg(ConfigFlags) + options.setdefault('Extrapolator', acc.popToolsAndMerge(exrtrapolator_acc)) # -- create the track augmenter algorithm acc.addEventAlgo(Analysis__BTagTrackAugmenterAlg(**options)) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py index 3103ddcbf7ff76f493d942c566c321d910cad152..c47752423311afaf065b4513b3e79eb86128a984 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Configuration functions for NewJetFitterTag # Author: Wouter van den Wollenberg (2013-2014) @@ -91,6 +91,8 @@ def toolJetFitterFullLinearizedTrackFactory(name, useBTagFlagsDefaults = True, * **options: Python dictionary with options for the tool. output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" options['name'] = name + if 'Extrapolator' not in options : + options.setdefault('Extrapolator',toolJetFitterExtrapolator('JetFitterExtrapolator')) #@TODO ro use InDetExtrapolator ? from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory return Trk__FullLinearizedTrackFactory(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py index 1ca269490376f95a982757642bc3b9564d54abdf..a58351595e598ebeb88c055faacb24c8d00301d6 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTrigCollection.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Configuration functions for NewJetFitterTag # Author: Wouter van den Wollenberg (2013-2014) @@ -91,6 +91,8 @@ def toolJetFitterFullLinearizedTrackFactory(name, useBTagFlagsDefaults = True, * **options: Python dictionary with options for the tool. output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" options['name'] = name + if 'Extrapolator' not in options : + options.setdefault('Extrapolator',toolJetFitterExtrapolator('JetFitterExtrapolator')) #@TODO ro use InDetExtrapolator ? from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory return Trk__FullLinearizedTrackFactory(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterFullLinearizedTrackFactoryConfig.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterFullLinearizedTrackFactoryConfig.py index 6e98d3075ca2496f6b9b75a6bbd6adfd2589b5e0..cf46cd5d351ac843953f1e47431b720814572bdf 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterFullLinearizedTrackFactoryConfig.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/JetFitterFullLinearizedTrackFactoryConfig.py @@ -1,10 +1,12 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg Trk__FullLinearizedTrackFactory=CompFactory.Trk.FullLinearizedTrackFactory + def JetFitterFullLinearizedTrackFactoryCfg(name, useBTagFlagsDefaults = True, **options): """Sets up a JetFitterFullLinearizedTrackFactory tool and returns it. @@ -16,6 +18,17 @@ def JetFitterFullLinearizedTrackFactoryCfg(name, useBTagFlagsDefaults = True, ** output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" acc = ComponentAccumulator() options['name'] = name + + # @TODO migrate to run3 style job options + if 'Extrapolator' not in options : + # @TODO the ConfigFlags should be passed from the outside as argument + from AthenaConfiguration.AllConfigFlags import ConfigFlags + flags=ConfigFlags + Extrapolator_acc = AtlasExtrapolatorCfg(flags) + extrapolator=acc.popToolsAndMerge(Extrapolator_acc) + acc.addPublicTool(extrapolator) + options.setdefault('Extrapolator', extrapolator) + acc.setPrivateTools(Trk__FullLinearizedTrackFactory(**options)) return acc diff --git a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py index f4ee36558e9f3375939e8f6f5a410612a8914f86..c95b08413e533e3d5e81e79bdebe3d5bdf96926d 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py +++ b/Reconstruction/MuonIdentification/MuonCombinedConfig/python/MuonCombinedRecToolsConfig.py @@ -63,6 +63,15 @@ def MuonCombinedTrackSummaryToolCfg(flags, name="", **kwargs): result.setPrivateTools(track_summary_tool) return result +def MuonTrackToVertexCfg(flags, name = 'MuonTrackToVertexTool', **kwargs ): + acc = ComponentAccumulator() + if 'Extrapolator' not in kwargs: + accExtrapolator = AtlasExtrapolatorCfg(flags, 'AtlasExtrapolator') + atlasExtrapolator = accExtrapolator.popPrivateTools() + acc.merge(accExtrapolator) + kwargs.setdefault('Extrapolator', atlasExtrapolator) + acc.setPrivateTools(CompFactory.Reco.TrackToVertex( name, **kwargs)) + return acc def MuonCombinedInDetDetailedTrackSelectorToolCfg(flags, name="MuonCombinedInDetDetailedTrackSelectorTool",**kwargs): if flags.Beam.Type == 'collisions': @@ -123,6 +132,9 @@ def MuonCombinedParticleCreatorCfg(flags, name="MuonCombinedParticleCreator",**k kwargs.setdefault("TrackSummaryTool", acc.getPrimary() ) result.merge (acc) + if 'TrackToVertex' not in kwargs : + kwargs.setdefault('TrackToVertex',result.popToolsAndMerge(MuonTrackToVertexCfg(flags))) + kwargs.setdefault("KeepAllPerigee",True ) kwargs.setdefault("UseMuonSummaryTool",True ) if flags.Beam.Type=="cosmics": diff --git a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py index 5d979c322c59b1c31a82237c42942b65c04bb6e6..6b125336b1fd93a43c561672c3105f283a02833a 100644 --- a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py +++ b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py @@ -30,7 +30,8 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) : # constructor def __init__(self,name = 'AtlasTrackingGeometryCondAlg'): - + nameSuffix='Cond' + atlas_tracking_geometry_name = 'AtlasTrackingGeometry' if TrkDetFlags.ConfigurationOutputLevel() < 3 : print ('[ Configuration : start ] *** '+name+' ********************************') print ('[ TrackingGeometryCondAlg ]') @@ -43,7 +44,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) : # the geometry builder alg tool from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilderCond - AtlasGeometryBuilder = Trk__GeometryBuilderCond(name = 'AtlasGeometryBuilderCond') + AtlasGeometryBuilder = Trk__GeometryBuilderCond(name = 'AtlasGeometryBuilder'+nameSuffix) # switch the building outputlevel on AtlasGeometryBuilder.OutputLevel = TrkDetFlags.ConfigurationOutputLevel() @@ -66,8 +67,8 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) : from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilderCond import ConfiguredInDetTrackingGeometryBuilderCond as IDGeometryBuilder else: from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilderCond import ConfiguredStagedTrackingGeometryBuilderCond as IDGeometryBuilder - InDetTrackingGeometryBuilder = IDGeometryBuilder(name ='InDetTrackingGeometryBuilderCond') - + InDetTrackingGeometryBuilder = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder'+nameSuffix,nameSuffix=nameSuffix) + InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc InDetTrackingGeometryBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel() # and give it to the Geometry Builder @@ -81,7 +82,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) : ToolSvc += CaloVolumeCreator from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilderCond import ConfiguredCaloTrackingGeometryBuilderCond as ConfiguredCaloGeo - CaloTrackingGeometryBuilder = ConfiguredCaloGeo(name='CaloTrackingGeometryBuilderCond') + CaloTrackingGeometryBuilder = ConfiguredCaloGeo(name='CaloTrackingGeometryBuilder'+nameSuffix) CaloTrackingGeometryBuilder.TrackingVolumeCreator = CaloVolumeCreator CaloTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc CaloTrackingGeometryBuilder.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel() @@ -163,6 +164,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) : Trk__TrackingGeometryCondAlg.__init__(self,name, GeometryBuilder = AtlasGeometryBuilder, GeometryProcessors = AtlasGeometryProcessors, + TrackingGeometryWriteKey = atlas_tracking_geometry_name, OutputLevel = TrkDetFlags.ConfigurationOutputLevel()) # screen output of the configuration if TrkDetFlags.ConfigurationOutputLevel() < 3 : diff --git a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py index 4d3b00034120b0ba208abd3d24a479d4a274b1e6..1db2a0e41af595d6d17d33b6d2121c9c657871ac 100644 --- a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py +++ b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py @@ -4,7 +4,7 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory Trk__TrackingGeometryCondAlg=CompFactory.Trk.TrackingGeometryCondAlg from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline -from SubDetectorEnvelopes.SubDetectorEnvelopesConfig import getEnvelopeDefSvc +from SubDetectorEnvelopes.SubDetectorEnvelopesConfig import getEnvelopeDefSvcCfg # This file is a placeholder - the entire way we build geometry needs to be rewritten so this is to unblock new configuration developments for the moment. # It is based on: https://gitlab.cern.ch/atlas/athena/blob/master/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py#L112 @@ -28,14 +28,14 @@ def _setupCondDB(flags, CoolDataBaseFolder, quiet=True): result.merge( addFoldersSplitOnline(flags,'GLOBAL',[cfolder],[cfolder],splitMC=True) ) return result -def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, namePrefix='', setLayerAssociation = True, buildTrtStrawLayers = False): +def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, namePrefix='', nameSuffix='',setLayerAssociation = True, buildTrtStrawLayers = False): # Based on https://gitlab.cern.ch/atlas/athena/blob/master/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilder.py # A lot of comments below are to help people understand differences from the above, in case we need to revert some simplifications I made # i.e. this is far from complete, but is better than what was there before. - - # beampipe - InDet__BeamPipeBuilder=CompFactory.InDet__BeamPipeBuilderCond - beamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder') + + # beampipe + InDet__BeamPipeBuilder=CompFactory.InDet.BeamPipeBuilderCond + beamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder'+nameSuffix) result.addPublicTool(beamPipeBuilder) layerbuilders = [] @@ -44,8 +44,8 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, # Pixel if flags.Detector.GeometryPixel: - InDet__SiLayerBuilder=CompFactory.InDet__SiLayerBuilderCond - PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder') + InDet__SiLayerBuilder=CompFactory.InDet.SiLayerBuilderCond + PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder'+nameSuffix) PixelLayerBuilder.PixelCase = True PixelLayerBuilder.Identification = 'Pixel' PixelLayerBuilder.SiDetManagerLocation = 'Pixel' @@ -71,8 +71,8 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, if flags.Detector.GeometrySCT: # SCT building - InDet__SiLayerBuilder=CompFactory.InDet__SiLayerBuilderCond - SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder') + InDet__SiLayerBuilder=CompFactory.InDet.SiLayerBuilderCond + SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder'+nameSuffix) SCT_LayerBuilder.PixelCase = False SCT_LayerBuilder.Identification = 'SCT' SCT_LayerBuilder.SiDetManagerLocation = 'SCT' @@ -94,8 +94,8 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, colors += [ 4 ] if flags.Detector.GeometryTRT: - InDet__TRT_LayerBuilder=CompFactory.InDet__TRT_LayerBuilderCond - TRT_LayerBuilder = InDet__TRT_LayerBuilder(name=namePrefix+'TRT_LayerBuilder') + InDet__TRT_LayerBuilder=CompFactory.InDet.TRT_LayerBuilderCond + TRT_LayerBuilder = InDet__TRT_LayerBuilder(name=namePrefix+'TRT_LayerBuilder'+nameSuffix) # TRT barrel specifications - assume defaults # SCT endcap specifications - assume defaults @@ -113,44 +113,46 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, colors += [ 5 ] # helpers for the InDetTrackingGeometry Builder : layer array creator - Trk__LayerArrayCreator=CompFactory.Trk__LayerArrayCreator - InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator') + Trk__LayerArrayCreator=CompFactory.Trk.LayerArrayCreator + InDetLayerArrayCreator = Trk__LayerArrayCreator(name = namePrefix+'InDetLayerArrayCreator'+nameSuffix) InDetLayerArrayCreator.EmptyLayerMode = 2 # deletes empty material layers from arrays # add to ToolSvc result.addPublicTool(InDetLayerArrayCreator) # helpers for the InDetTrackingGeometry Builder : volume array creator - Trk__TrackingVolumeArrayCreator=CompFactory.Trk__TrackingVolumeArrayCreator - InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator') + Trk__TrackingVolumeArrayCreator=CompFactory.Trk.TrackingVolumeArrayCreator + InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = namePrefix+'InDetTrackingVolumeArrayCreator'+nameSuffix) # add to ToolSvc result.addPublicTool(InDetTrackingVolumeArrayCreator) # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing - Trk__TrackingVolumeHelper=CompFactory.Trk__TrackingVolumeHelper - InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper') + Trk__TrackingVolumeHelper=CompFactory.Trk.TrackingVolumeHelper + InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(name =namePrefix+'InDetTrackingVolumeHelper'+nameSuffix) # the material bins - assume defaults # add to ToolSvc result.addPublicTool(InDetTrackingVolumeHelper) # helpers for the InDetTrackingGeometry Builder : cylinder volume creator - Trk__CylinderVolumeCreator=CompFactory.Trk__CylinderVolumeCreator - InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator') + Trk__CylinderVolumeCreator=CompFactory.Trk.CylinderVolumeCreator + InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = namePrefix+'InDetCylinderVolumeCreator'+nameSuffix) # give it the layer array creator - assume defaults # specifiy the binning, passive layers, entry layers - assume defaults # add to ToolSvc result.addPublicTool(InDetCylinderVolumeCreator) + if (namePrefix+name+nameSuffix).find('CondCond')>=0 : + raise Exception('Invalid name composition %s + %s + %s ' % (namePrefix,name,nameSuffix)) # the tracking geometry builder - InDet__RobustTrackingGeometryBuilder=CompFactory.InDet__RobustTrackingGeometryBuilderCond - return InDet__RobustTrackingGeometryBuilder(namePrefix+name, - BeamPipeBuilder = beamPipeBuilder, - LayerBuilders = layerbuilders, - LayerBinningType = binnings, - ColorCodes = colors, - EnvelopeDefinitionSvc = envelopeDefinitionSvc, - VolumeEnclosureDiscPositions = [ 3000., 3450. ], - TrackingVolumeCreator = InDetCylinderVolumeCreator, - LayerArrayCreator = InDetLayerArrayCreator) + InDet__RobustTrackingGeometryBuilder=CompFactory.InDet.RobustTrackingGeometryBuilderCond + return InDet__RobustTrackingGeometryBuilder(namePrefix+name+nameSuffix, + BeamPipeBuilder = beamPipeBuilder, + LayerBuilders = layerbuilders, + LayerBinningType = binnings, + ColorCodes = colors, + EnvelopeDefinitionSvc = envelopeDefinitionSvc, + VolumeEnclosureDiscPositions = [ 3000., 3450. ], + TrackingVolumeCreator = InDetCylinderVolumeCreator, + LayerArrayCreator = InDetLayerArrayCreator) # FIXME - not sure what to do about the following: # BuildBoundaryLayers = TrkDetFlags.InDetBuildMaterialBoundaries(), @@ -163,23 +165,24 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, # Barrel Entry layers (in old config) etc were removed in 323990adfce581a635ae1809fd2ecc6a093a704c (!) # Replaces https://gitlab.cern.ch/atlas/athena/blob/master/Calorimeter/CaloTrackingGeometry/python/ConfiguredCaloTrackingGeometryBuilder.py -def _getCaloTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, trackingVolumeHelper, namePrefix=''): +def _getCaloTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, trackingVolumeHelper, namePrefix='',nameSuffix=''): # The following replaces LArCalorimeter/LArTrackingGeometry/python/ConfiguredLArVolumeBuilder.py - LAr__LArVolumeBuilder=CompFactory.LAr__LArVolumeBuilder - lArVolumeBuilder = LAr__LArVolumeBuilder(TrackingVolumeHelper = trackingVolumeHelper,) + LAr__LArVolumeBuilder=CompFactory.LAr.LArVolumeBuilder + lArVolumeBuilder = LAr__LArVolumeBuilder(namePrefix+'LArVolumeBuilder'+nameSuffix,TrackingVolumeHelper = trackingVolumeHelper,) result.addPublicTool(lArVolumeBuilder) # The following replaces TileCalorimeter/TileTrackingGeometry/python/ConfiguredTileVolumeBuilder.py - Tile__TileVolumeBuilder=CompFactory.Tile__TileVolumeBuilder - tileVolumeBuilder = Tile__TileVolumeBuilder( TrackingVolumeHelper = trackingVolumeHelper, ) + Tile__TileVolumeBuilder=CompFactory.Tile.TileVolumeBuilder + tileVolumeBuilder = Tile__TileVolumeBuilder( namePrefix+'TileVolumeBuilder'+nameSuffix, TrackingVolumeHelper = trackingVolumeHelper, ) result.addPublicTool(tileVolumeBuilder) - Calo__CaloTrackingGeometryBuilder=CompFactory.Calo__CaloTrackingGeometryBuilderCond - return Calo__CaloTrackingGeometryBuilder(namePrefix+name, LArVolumeBuilder = lArVolumeBuilder, - TileVolumeBuilder = tileVolumeBuilder, - TrackingVolumeHelper = trackingVolumeHelper, - EnvelopeDefinitionSvc = envelopeDefinitionSvc, - ) + Calo__CaloTrackingGeometryBuilder=CompFactory.Calo.CaloTrackingGeometryBuilderCond + return Calo__CaloTrackingGeometryBuilder(namePrefix+name+nameSuffix, + LArVolumeBuilder = lArVolumeBuilder, + TileVolumeBuilder = tileVolumeBuilder, + TrackingVolumeHelper = trackingVolumeHelper, + EnvelopeDefinitionSvc = envelopeDefinitionSvc, + ) # Originally this function would use was TrkDetFlags.MaterialSource() and TrkDetFlags.MaterialValidation(). For new configuration, (temporarily?) pass as parameters. # https://gitlab.cern.ch/atlas/athena/blob/master/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py#L112 @@ -187,53 +190,68 @@ def TrackingGeometryCondAlgCfg( flags , name = 'AtlasTrackingGeometryCondAlg', d """ Sets up the Tracking Geometry Conditions Algorithm """ + namePrefix='' + nameSuffix='Cond' result = ComponentAccumulator() atlas_tracking_geometry_name = 'AtlasTrackingGeometry' Trk__GeometryBuilder=CompFactory.Trk.GeometryBuilderCond atlas_geometry_builder = Trk__GeometryBuilder(name = 'AtlasGeometryBuilder') - atlas_env_def_service = getEnvelopeDefSvc() - result.addService(atlas_env_def_service) + atlas_env_def_service_acc = getEnvelopeDefSvcCfg(flags) + atlas_env_def_service = atlas_env_def_service_acc.getPrimary() + result.merge(atlas_env_def_service_acc) # Depending on the job configuration, setup the various detector builders, and add to atlas_geometry_builder if flags.Detector.GeometryID: # TODO Not sure how to handle TrkDetFlags, specifically ISF_FatrasCustomGeometry, XMLFastCustomGeometry, SLHC_Geometry # So, here we only setup the default InDet geometry builder! - inDetTrackingGeometryBuilder = _getInDetTrackingGeometryBuilder(name ='InDetTrackingGeometryBuilder', flags=flags, result=result, envelopeDefinitionSvc=atlas_env_def_service) + inDetTrackingGeometryBuilder = _getInDetTrackingGeometryBuilder(name ='InDetTrackingGeometryBuilder', + flags=flags, + result=result, + envelopeDefinitionSvc=atlas_env_def_service, + buildTrtStrawLayers=flags.Beam.Type=='cosmics', + namePrefix=namePrefix, + nameSuffix=nameSuffix) result.addPublicTool(inDetTrackingGeometryBuilder) atlas_geometry_builder.InDetTrackingGeometryBuilder = inDetTrackingGeometryBuilder if flags.Detector.GeometryCalo: - Trk__CylinderVolumeCreator=CompFactory.Trk__CylinderVolumeCreator - caloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator") + Trk__CylinderVolumeCreator=CompFactory.Trk.CylinderVolumeCreator + caloVolumeCreator = Trk__CylinderVolumeCreator(namePrefix+"CaloVolumeCreator"+nameSuffix) result.addPublicTool(caloVolumeCreator) - Trk__TrackingVolumeHelper=CompFactory.Trk__TrackingVolumeHelper - trackingVolumeHelper = Trk__TrackingVolumeHelper(name='TrackingVolumeHelper') + Trk__TrackingVolumeHelper=CompFactory.Trk.TrackingVolumeHelper + trackingVolumeHelper = Trk__TrackingVolumeHelper(name=namePrefix+'TrackingVolumeHelper'+nameSuffix) result.addPublicTool(trackingVolumeHelper) - caloTrackingGeometryBuilder = _getCaloTrackingGeometryBuilder(name ='CaloTrackingGeometryBuilder', flags=flags, result=result, envelopeDefinitionSvc=atlas_env_def_service, trackingVolumeHelper=trackingVolumeHelper) + caloTrackingGeometryBuilder = _getCaloTrackingGeometryBuilder(name ='CaloTrackingGeometryBuilder', + flags=flags, + result=result, + envelopeDefinitionSvc=atlas_env_def_service, + trackingVolumeHelper=trackingVolumeHelper, + namePrefix=namePrefix, + nameSuffix=nameSuffix) result.addPublicTool(caloTrackingGeometryBuilder) atlas_geometry_builder.CaloTrackingGeometryBuilder = caloTrackingGeometryBuilder if flags.Detector.GeometryMuon: # Copied from from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder - Muon__MuonStationTypeBuilder=CompFactory.Muon__MuonStationTypeBuilder - muonStationTypeBuilder= Muon__MuonStationTypeBuilder(name = 'MuonStationTypeBuilder') + muonStationTypeBuilder=CompFactory.Muon.MuonStationTypeBuilder(name = namePrefix+'MuonStationTypeBuilder'+nameSuffix) result.addPublicTool(muonStationTypeBuilder) - - Muon__MuonStationBuilder=CompFactory.Muon__MuonStationBuilder - muonStationBuilder= Muon__MuonStationBuilder(name = 'MuonStationBuilder') + + Muon__MuonStationBuilder=CompFactory.Muon.MuonStationBuilder + muonStationBuilder= Muon__MuonStationBuilder(name = namePrefix+'MuonStationBuilder'+nameSuffix) muonStationBuilder.StationTypeBuilder = muonStationTypeBuilder result.addPublicTool(muonStationBuilder) - Muon__MuonInertMaterialBuilder=CompFactory.Muon__MuonInertMaterialBuilder - muonInertMaterialBuilder= Muon__MuonInertMaterialBuilder(name = 'MuonInertMaterialBuilder') + Muon__MuonInertMaterialBuilder=CompFactory.Muon.MuonInertMaterialBuilder + muonInertMaterialBuilder= Muon__MuonInertMaterialBuilder(name = namePrefix+'MuonInertMaterialBuilder'+nameSuffix) result.addPublicTool(muonInertMaterialBuilder) - Muon__MuonTrackingGeometryBuilder=CompFactory.Muon__MuonTrackingGeometryBuilderCond - muonTrackingGeometryBuilder= Muon__MuonTrackingGeometryBuilder(name = 'MuonTrackingGeometryBuilder', EnvelopeDefinitionSvc=atlas_env_def_service) + Muon__MuonTrackingGeometryBuilder=CompFactory.Muon.MuonTrackingGeometryBuilderCond + muonTrackingGeometryBuilder= Muon__MuonTrackingGeometryBuilder(name = namePrefix+'MuonTrackingGeometryBuilder'+nameSuffix, + EnvelopeDefinitionSvc=atlas_env_def_service) result.addPublicTool(muonTrackingGeometryBuilder) atlas_geometry_builder.MuonTrackingGeometryBuilder = muonTrackingGeometryBuilder @@ -244,26 +262,25 @@ def TrackingGeometryCondAlgCfg( flags , name = 'AtlasTrackingGeometryCondAlg', d if flags.TrackingGeometry.MaterialSource == 'COOL': CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialV2' # Was from TrkDetFlags.MaterialStoreGateKey() # the material provider - Trk__LayerMaterialProvider=CompFactory.Trk__LayerMaterialProvider + Trk__LayerMaterialProvider=CompFactory.Trk.LayerMaterialProvider atlasMaterialProvider = Trk__LayerMaterialProvider('AtlasMaterialProvider', LayerMaterialMapName=CoolDataBaseFolder) atlas_geometry_processors += [ atlasMaterialProvider ] # Setup DBs result.merge(_setupCondDB(flags, CoolDataBaseFolder)) elif flags.TrackingGeometry.MaterialSource == 'Input': - Trk__InputLayerMaterialProvider=CompFactory.Trk__InputLayerMaterialProvider + Trk__InputLayerMaterialProvider=CompFactory.Trk.InputLayerMaterialProvider atlasMaterialProvider = Trk__InputLayerMaterialProvider('AtlasMaterialProvider') atlas_geometry_processors += [ atlasMaterialProvider ] if doMaterialValidation: - Trk__LayerMaterialInspector=CompFactory.Trk__LayerMaterialInspector + Trk__LayerMaterialInspector=CompFactory.Trk.LayerMaterialInspector atlasLayerMaterialInspector = Trk__LayerMaterialInspector('AtlasLayerMaterialInspector') atlas_geometry_processors += [ atlasLayerMaterialInspector ] condAlg = Trk__TrackingGeometryCondAlg( name, GeometryBuilder = atlas_geometry_builder, TrackingGeometryWriteKey = atlas_tracking_geometry_name, - GeometryProcessors = atlas_geometry_processors, - BuildGeometryFromTagInfo = True) + GeometryProcessors = atlas_geometry_processors) result.addCondAlgo(condAlg, primary = True) return result diff --git a/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py b/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py index 1e8f7c0cafd1e52f026981798f7a5dd64223a960..fb4158dd026f93bef146ff1075cdf5851af45e45 100644 --- a/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py +++ b/Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # New configuration for ATLAS extrapolator # Based heavily on AtlasExtrapolator.py @@ -6,10 +6,36 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg +# @TODO reture once migration to tracking geometry cond alg is complete +from InDetRecExample.TrackingCommon import use_tracking_geometry_cond_alg # import the Extrapolator configurable Trk__Extrapolator=CompFactory.Trk.Extrapolator +def AtlasNavigatorCfg(flags, name='AtlasNavigator') : + # get the correct TrackingGeometry setup + result=ComponentAccumulator() + geom_svc=None + geom_cond_key='' + if not use_tracking_geometry_cond_alg : + from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg + acc = TrackingGeometrySvcCfg(flags) + geom_svc = acc.getPrimary() + result.merge(acc) + else : + from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg + result.merge( TrackingGeometryCondAlgCfg(flags) ); + geom_cond_key = 'AtlasTrackingGeometry' + # @TOOD how to get the key of the TrackingGeometry conditions data ? + # the UNIQUE NAVIGATOR ( === UNIQUE GEOMETRY) -------------------------------------------------------------- + Trk__Navigator=CompFactory.Trk.Navigator + AtlasNavigator = Trk__Navigator(name = 'AtlasNavigator', + TrackingGeometrySvc = geom_svc, + TrackingGeometryKey = geom_cond_key) + result.setPrivateTools(AtlasNavigator) + return result + + # define the class def AtlasExtrapolatorCfg( flags, name = 'AtlasExtrapolator' ): result=ComponentAccumulator() @@ -17,12 +43,6 @@ def AtlasExtrapolatorCfg( flags, name = 'AtlasExtrapolator' ): acc = MagneticFieldSvcCfg(flags) result.merge(acc) - # get the correct TrackingGeometry setup - from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg - acc = TrackingGeometrySvcCfg(flags) - geom_svc = acc.getPrimary() - result.merge(acc) - # PROPAGATOR DEFAULTS -------------------------------------------------------------------------------------- AtlasPropagators = [] @@ -55,10 +75,7 @@ def AtlasExtrapolatorCfg( flags, name = 'AtlasExtrapolator' ): AtlasUpdators += [ AtlasMaterialEffectsUpdatorLandau ] - # the UNIQUE NAVIGATOR ( === UNIQUE GEOMETRY) -------------------------------------------------------------- - Trk__Navigator=CompFactory.Trk.Navigator - AtlasNavigator = Trk__Navigator(name = 'AtlasNavigator') - AtlasNavigator.TrackingGeometrySvc = geom_svc + AtlasNavigator=result.popToolsAndMerge( AtlasNavigatorCfg(flags) ) result.addPublicTool(AtlasNavigator) #TODO remove one day # CONFIGURE PROPAGATORS/UPDATORS ACCORDING TO GEOMETRY SIGNATURE diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/NeutralParticleParameterCalculator.cxx b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/NeutralParticleParameterCalculator.cxx index 9ca11c041bf0cfd4b85c70b17bcedc0d23169e5a..0050a2fea49878d68679f3cea0394faafb3ecab9 100755 --- a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/NeutralParticleParameterCalculator.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/NeutralParticleParameterCalculator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /********************************************************************* @@ -33,16 +33,9 @@ namespace Trk NeutralParticleParameterCalculator::~NeutralParticleParameterCalculator() = default; StatusCode NeutralParticleParameterCalculator::initialize() - { - if (!m_LinearizedTrackFactory.empty()) { - StatusCode sc=m_LinearizedTrackFactory.retrieve(); - if (sc.isFailure()) { - msg(MSG::WARNING) << "Could not find TrackLinearizer tool." << endmsg; - m_linearizedTrackFactoryIsAvailable=false; - } else { - m_linearizedTrackFactoryIsAvailable=true; - } - } + { + ATH_CHECK(m_LinearizedTrackFactory.retrieve( DisableTool{ m_LinearizedTrackFactory.empty() } )); + m_linearizedTrackFactoryIsAvailable = !m_LinearizedTrackFactory.empty(); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/share/RunJpsiFinder.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/share/RunJpsiFinder.py index ac61cfcf55a73c010f32941aed4b94c0e2d1a0f8..42ef243d6eac6ca7a8e9d2f58f6dfdb50af05b44 100644 --- a/Trigger/TrigMonitoring/TrigBphysMonitoring/share/RunJpsiFinder.py +++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/share/RunJpsiFinder.py @@ -50,9 +50,11 @@ topSequence += JpsiAlg(JpsiCandidatesOutputName = "JpsiCandidates", # Set up the decorators and the alg to do the work from TrigBphysMonitoring.TrigBphysMonitoringConf import BphysTrigDiMuDecoratorTool from TrigBphysMonitoring.TrigBphysMonitoringConf import BphysTrigDecoratorAlg +from InDetRecExample import TrackingCommon dimuDeco = BphysTrigDiMuDecoratorTool(name = "BphysTrigDiMuDecoratorTool", - OutputLevel=INFO) + V0Tools = TrackingCommon.getV0Tools(), + OutputLevel=INFO) ToolSvc += dimuDeco printfunc (dimuDeco) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py index 026e344fa8ed604f79b56cabc816c6ef3ff40190..e7d393c5782a8a2ff505c09ad9f90aa0e99c8ee8 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetConfig.py @@ -150,7 +150,9 @@ def InDetTestPixelLayerToolCfg(flags, **kwargs): from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg pixelCondSummaryTool = acc.popToolsAndMerge( PixelConditionsSummaryCfg(flags) ) from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg - extrapolator = acc.popToolsAndMerge( InDetExtrapolatorCfg( flags, name = "InDetTrigExtrapolator" ) ) + extrapolator_acc = InDetExtrapolatorCfg( flags, name = "InDetTrigExtrapolator" ) + extrapolator = acc.getPrimary() + acc.merge(extrapolator_acc) tool = CompFactory.InDet.InDetTestPixelLayerTool("InDetTrigTestPixelLayerTool", PixelSummaryTool = pixelCondSummaryTool, @@ -653,14 +655,26 @@ def ftfCfg(flags, roisKey, signature, signatureName): return acc +def TrigTrackToVertexCfg(flags, name = 'TrigTrackToVertexTool', **kwargs ): + acc = ComponentAccumulator() + if 'Extrapolator' not in kwargs: + from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg + extrapolator_acc = InDetExtrapolatorCfg( flags, name = "InDetTrigExtrapolator" ) + extrapolator = extrapolator_acc.getPrimary() + acc.merge(extrapolator_acc) + kwargs.setdefault('Extrapolator', extrapolator) # @TODO or atlas extrapolator ? + tool = CompFactory.Reco.TrackToVertex( name, **kwargs) + acc.setPrivateTools(tool) + return acc def trackConverterCfg(flags, signature, signatureName): acc = ComponentAccumulator() acc.merge( TrackSummaryToolCfg(flags, name="InDetTrigFastTrackSummaryTool") ) - + track_to_vertex = acc.popToolsAndMerge( TrigTrackToVertexCfg(flags) ) creatorTool = CompFactory.Trk.TrackParticleCreatorTool( name = "InDetTrigParticleCreatorToolFTF", TrackSummaryTool = acc.getPublicTool( "InDetTrigFastTrackSummaryTool" ), + TrackToVertex = track_to_vertex, KeepParameters = True, ComputeAdditionalInfo = True, ExtraSummaryTypes = ['eProbabilityComb', 'eProbabilityHT', 'TRTTrackOccupancy', 'TRTdEdx', 'TRTdEdxUsedHits']) @@ -668,7 +682,7 @@ def trackConverterCfg(flags, signature, signatureName): trackParticleCnv=CompFactory.InDet.TrigTrackingxAODCnvMT(name = "InDetTrigTrackParticleCreatorAlg" + signature, TrackName = __trackCollName(signatureName), TrackParticlesName = recordable("HLT_IDTrack_"+signatureName+"_FTF"), - ParticleCreatorTool = acc.getPublicTool("InDetTrigParticleCreatorToolFTF")) + ParticleCreatorTool = creatorTool) acc.addEventAlgo(trackParticleCnv) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py index 7a6099af8af8c705fdee1174af2dff53f8600a8a..85c579648f88d3c6dcf7180487797ecf41fce678 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration __author__ = "Mark Sutton and Lukas Novotny" __doc__ = "vertexFinder_builder" @@ -376,9 +376,10 @@ def adaptiveMultiVertexSeedFinder_builder( signature , doVtx3DFinding): trackdistexppower = 2) else: - + from InDetTrigRecExample.InDetTrigConfigRecLoadToolsPost import getInDetTrigTrackToVertexIPEstimator from TrkVertexSeedFinderTools.TrkVertexSeedFinderToolsConf import Trk__ZScanSeedFinder - seedFinder = Trk__ZScanSeedFinder(name = "InDetTrigZScanSeedFinder" + signature + seedFinder = Trk__ZScanSeedFinder(name = "InDetTrigZScanSeedFinder" + signature, + IPEstimator = getInDetTrigTrackToVertexIPEstimator() # Mode1dFinder = # default, no setting needed ) ToolSvc += seedFinder