ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_SiPropertiesConfig.py
Go to the documentation of this file.
1"""Define methods to configure SCT SiProperties
2
3Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4"""
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_SiliconConditionsCfg
8from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
9
10
11def SCT_SiPropertiesCondAlgCfg(flags, name="SCTSiPropertiesCondAlg", **kwargs):
12 """Return configured ComponentAccumulator and tool for SCT_SiProperties
13
14 SiConditionsTool and/or DCSConditionsTool may be provided in kwargs
15 """
16 acc = ComponentAccumulator()
17
18 # Condition algorithm
19 # SCTSiPropertiesCondAlg needs outputs of SCT_SiliconConditions algorithms
20 if not kwargs.get("SiConditionsTool"):
21 kwargs["SiConditionsTool"] = acc.popToolsAndMerge(SCT_SiliconConditionsCfg(flags))
22 # For SCT_ID and SCT_DetectorElementCollection
23 # used in SCTSiPropertiesCondAlg and SiPropertiesTool
24 acc.merge(SCT_ReadoutGeometryCfg(flags))
25 acc.addCondAlgo(CompFactory.SCTSiPropertiesCondAlg(name, **kwargs))
26 return acc
27
28
29def SCT_SiPropertiesToolCfg(flags, name="SCT_SiPropertiesTool", **kwargs):
30 """Return configured ComponentAccumulator and tool for SCT_SiProperties
31
32 SiConditionsTool and/or DCSConditionsTool may be provided in kwargs
33 """
34 SiConditionsTool = kwargs.pop("SiConditionsTool", None)
35 acc = SCT_SiPropertiesCondAlgCfg(flags, SiConditionsTool=SiConditionsTool)
36 kwargs.setdefault("DetectorName", "SCT")
37 kwargs.setdefault("ReadKey", "SCTSiliconPropertiesVector")
38 acc.setPrivateTools(CompFactory.SiPropertiesTool(name, **kwargs))
39 return acc
SCT_SiPropertiesToolCfg(flags, name="SCT_SiPropertiesTool", **kwargs)
SCT_SiPropertiesCondAlgCfg(flags, name="SCTSiPropertiesCondAlg", **kwargs)