Skip to content
Snippets Groups Projects
Commit 14cdd33b authored by Goetz Gaycken's avatar Goetz Gaycken
Browse files

Use common tool configuration for SCT and TRT monitoring.

Use common configurations for SCT conditions summary, hole search and track
summary tools.
parent 14a581f9
No related branches found
No related tags found
No related merge requests found
# 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
import AthenaCommon.SystemOfUnits as Units
from InDetConfig import InDetRecToolConfig
#///////////// Temporary location TrackingSiPatternConfig configurations ///////////////////////
def SiCombinatorialTrackFinder_xkCfg(flags, name="InDetSiComTrackFinder", **kwargs) :
......@@ -46,9 +47,9 @@ def SiCombinatorialTrackFinder_xkCfg(flags, name="InDetSiComTrackFinder", **kwar
kwargs.setdefault("TrackQualityCut", 9.3)
if flags.Detector.RecoSCT:
InDetSCT_ConditionsSummaryTool = CompFactory.SCT_ConditionsSummaryTool(name = 'InDetSCT_ConditionsSummaryTool')
InDetSCT_ConditionsSummaryTool = acc.popToolsAndMerge( InDetRecToolConfig.InDetSCT_ConditionsSummaryToolCfg(flags) )
acc.addPublicTool(InDetSCT_ConditionsSummaryTool)
kwargs.setdefault("SctSummaryTool", InDetSCT_ConditionsSummaryTool)
kwargs.setdefault("SctSummaryTool", InDetSCT_ConditionsSummaryTool )
else:
kwargs.setdefault("SctSummaryTool", None)
......
#
# 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 SCTErrMonAlg_jobOptions.py
......@@ -7,6 +7,7 @@
@date 2020-10-08
@brief New style configuration of SCTErrMonAlg
'''
from InDetConfig import InDetRecToolConfig
def SCTErrMonAlgConfig(inputFlags):
......@@ -20,26 +21,7 @@ def SCTErrMonAlgConfig(inputFlags):
myMonAlg = helper.addAlgorithm(CompFactory.SCTErrMonAlg, 'SCTErrMonAlg')
myMonAlg.TriggerChain = ""
# SCT conditions tools (update is necessary when the ID configuration in the new job framework is ready.)
ConditionsTools = []
myMonAlg.conditionsTool = CompFactory.SCT_ConfigurationConditionsTool(name="InDetSCT_ConfigurationConditionsTool")
ConditionsTools += [myMonAlg.conditionsTool]
myMonAlg.SCT_ByteStreamErrorsTool = CompFactory.SCT_ByteStreamErrorsTool(name="SCT_ByteStreamErrorsTool")
myMonAlg.SCT_ByteStreamErrorsTool.ConfigTool = myMonAlg.conditionsTool
ConditionsTools += [myMonAlg.SCT_ByteStreamErrorsTool]
if inputFlags.InDet.useDCS:
myMonAlg.SCT_DCSConditionsTool = CompFactory.SCT_DCSConditionsTool(name="InDetSCT_DCSConditionsTool")
ConditionsTools += [myMonAlg.SCT_DCSConditionsTool]
else:
myMonAlg.UseDCS = False
ConditionsTools += [CompFactory.SCT_ReadCalibDataTool(name="InDetSCT_ReadCalibDataTool")]
if not inputFlags.Common.isOnline:
ConditionsTools += [CompFactory.SCT_MonitorConditionsTool(name="InDetSCT_MonitorConditionsTool")]
if not inputFlags.Input.isMC:
ConditionsTools += [CompFactory.SCT_TdaqEnabledTool(name="InDetSCT_TdaqEnabledTool")]
kwargs = {}
kwargs.setdefault("ConditionsTools", ConditionsTools)
myMonAlg.SCT_ConditionsSummaryTool = CompFactory.SCT_ConditionsSummaryTool(name="InDetSCT_ConditionsSummaryTool", **kwargs)
myMonAlg.SCT_ConditionsSummaryTool = result.popToolsAndMerge( InDetRecToolConfig.InDetSCT_ConditionsSummaryToolCfg(inputFlags) )
## The following does not work when running Reco_tf.py
## because it configures condition algorithms
......
......@@ -7,45 +7,13 @@
@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
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from InDetConfig import TrackingCommonConfig
def TrackSummaryToolWorkaround(flags):
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
result = ComponentAccumulator()
############################## WORKAROUND (START) ##########################
############################## TO RUN TRACKSUMMARYTOOL #####################
# Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
InDetPixelConditionsSummaryTool = result.popToolsAndMerge(InDetRecToolConfig.PixelConditionsSummaryToolCfg(flags))
InDetTestPixelLayerTool = result.popToolsAndMerge(InDetRecToolConfig.InDetTestPixelLayerToolCfg(flags,
PixelSummaryTool = InDetPixelConditionsSummaryTool,
CheckActiveAreas=True,
CheckDeadRegions=True,
CheckDisabledFEs=True))
result.addPublicTool(InDetTestPixelLayerTool)
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,
doHolesInDet = True,
TRT_ElectronPidTool = '',
PixelToTPIDTool = '')
result.setPrivateTools(InDetTrackSummaryTool)
############################## WORKAROUND (END) ############################
result.setPrivateTools( result.popToolsAndMerge(TrackingCommonConfig.InDetTrackSummaryToolCfg(flags) ) )
# To run job only with ID
if hasattr(flags, "Detector") and hasattr(flags.Detector, "GeometryMuon") and hasattr(flags.Detector, "GeometryID"):
......
#
# 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,104 +7,10 @@
@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 AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from InDetConfig import TrackingCommonConfig
def TrackSummaryToolWorkaround(flags):
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
result = ComponentAccumulator()
############################## WORKAROUND (START) ##########################
############################## TO RUN TRACKSUMMARYTOOL #####################
# Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg
result.merge(PixelConfigCondAlgCfg(flags,
UseCalibConditions=True,
UseDeadmapConditions=True,
UseDCSStateConditions=False,
UseDCSStatusConditions=False,
UseDCSHVConditions=True,
UseDCSTemperatureConditions=True,
UseTDAQConditions=False))
from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
InDetPixelConditionsSummaryTool = result.popToolsAndMerge(PixelConditionsSummaryCfg(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",
PixelSummaryTool = InDetPixelConditionsSummaryTool,
CheckActiveAreas=True,
CheckDeadRegions=True,
CheckDisabledFEs=True)
result.addPublicTool(InDetTestPixelLayerTool)
InDetHoleSearchTool = CompFactory.InDet.InDetTrackHoleSearchTool(name = "InDetHoleSearchTool",
Extrapolator = InDetExtrapolator,
PixelSummaryTool = InDetPixelConditionsSummaryTool,
usePixel = flags.Detector.GeometryPixel,
useSCT = flags.Detector.GeometrySCT,
CountDeadModulesAfterLastHit = True,
PixelLayerTool = InDetTestPixelLayerTool)
result.addPublicTool(InDetHoleSearchTool)
InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name = "InDetPrdAssociationTool",
PixelClusterAmbiguitiesMapName = "PixelClusterAmbiguitiesMap",
SetupCorrect = True,
addTRToutliers = True)
result.addPublicTool(InDetPrdAssociationTool)
InDetTrackSummaryHelperTool = CompFactory.InDet.InDetTrackSummaryHelperTool(name = "InDetSummaryHelper",
AssoTool = InDetPrdAssociationTool,
PixelToTPIDTool = None,
TestBLayerTool = None,
RunningTIDE_Ambi = True,
DoSharedHits = False,
HoleSearch = InDetHoleSearchTool,
usePixel = flags.Detector.GeometryPixel,
useSCT = flags.Detector.GeometrySCT,
useTRT = flags.Detector.GeometryTRT)
InDetTrackSummaryTool = CompFactory.Trk.TrackSummaryTool(name = "InDetTrackSummaryTool",
InDetSummaryHelperTool = InDetTrackSummaryHelperTool,
doSharedHits = False,
doHolesInDet = True,
TRT_ElectronPidTool = None,
TRT_ToT_dEdxTool = None,
PixelToTPIDTool = None)
result.setPrivateTools(InDetTrackSummaryTool)
############################## WORKAROUND (END) ############################
result.setPrivateTools( result.popToolsAndMerge(TrackingCommonConfig.InDetTrackSummaryToolCfg(flags) ) )
return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment