ATLAS Offline Software
SCT_LorentzAngleConfig.py
Go to the documentation of this file.
1 """Define methods to configure SCTLorentzAngleTool
2 
3 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
7 from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_SiliconConditionsCfg
8 from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
9 
10 def SCT_LorentzAngleToolCfg(flags, name="SCTLorentzAngleTool", **kwargs):
11  """Return a SiLorentzAngleTool configured for SCT"""
12  acc = SCT_LorentzAngleCondAlgCfg(flags)
13  kwargs.setdefault("DetectorName", "SCT")
14  kwargs.setdefault("SiLorentzAngleCondData", "SCTSiLorentzAngleCondData")
15  kwargs.setdefault("DetEleCollKey", "SCT_DetectorElementCollection")
16  acc.setPrivateTools(CompFactory.SiLorentzAngleTool(name, **kwargs))
17  return acc
18 
19 def SCT_LorentzAngleCondAlgCfg(flags, name="SCTSiLorentzAngleCondAlg", **kwargs):
20 
21  # Condition algorithm
22  # construct with field services
23  acc = AtlasFieldCacheCondAlgCfg(flags)
24  # For SCT_ID and SCT_DetectorElementCollection used
25  # in SCTSiLorentzAngleCondAlg and SiLorentzAngleTool
26  acc.merge(SCT_ReadoutGeometryCfg(flags))
27  # set up SCTSiLorentzAngleCondAlg
28  forceUseGeoModel = kwargs.get("forceUseGeoModel",not (flags.InDet.useSctDCS or flags.Common.isOnline))
29  algkwargs = {}
30  algkwargs["UseMagFieldCache"] = kwargs.get("UseMagFieldCache", True)
31  algkwargs["UseMagFieldDcs"] = kwargs.get("UseMagFieldDcs", not flags.Common.isOnline)
32  algkwargs["UseGeoModel"] = forceUseGeoModel
33  algkwargs["useSctDefaults"] = kwargs.get("useSctDefaults", False)
34  if not algkwargs["useSctDefaults"]:
35  if kwargs.get("SiConditionsTool"):
36  algkwargs["SiConditionsTool"] = kwargs.get("SiConditionsTool")
37  else:
38  sikwargs = {}
39  if kwargs.get("DCSConditionsTool"):
40  sikwargs["DCSConditionsTool"] = kwargs.get("DCSConditionsTool")
41  sikwargs["ForceUseGeoModel"] = forceUseGeoModel
42  algkwargs["SiConditionsTool"] = acc.popToolsAndMerge(SCT_SiliconConditionsCfg(flags, **sikwargs))
43  acc.addCondAlgo(CompFactory.SCTSiLorentzAngleCondAlg(name, **algkwargs))
44  return acc
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:42
python.SCT_LorentzAngleConfig.SCT_LorentzAngleCondAlgCfg
def SCT_LorentzAngleCondAlgCfg(flags, name="SCTSiLorentzAngleCondAlg", **kwargs)
Definition: SCT_LorentzAngleConfig.py:19
python.SCT_LorentzAngleConfig.SCT_LorentzAngleToolCfg
def SCT_LorentzAngleToolCfg(flags, name="SCTLorentzAngleTool", **kwargs)
Definition: SCT_LorentzAngleConfig.py:10
python.SCT_ConditionsToolsConfig.SCT_SiliconConditionsCfg
def SCT_SiliconConditionsCfg(flags, name="SCT_Silicon", **kwargs)
Definition: SCT_ConditionsToolsConfig.py:451
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8