3from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory
import CompFactory
5from AthenaConfiguration.Enums
import BeamType
6from ActsConfig.ActsUtilities
import extractChildKwargs
8from ActsConfig.ActsClusterizationConfig
import ActsClusterCacheCreatorAlgCfg
10 name: str =
"ActsIDPixelClusteringTool",
11 **kwargs) -> ComponentAccumulator:
12 acc = ComponentAccumulator()
14 kwargs.setdefault(
"isITk",
False)
16 from PixelConditionsAlgorithms.PixelConditionsConfig
import PixelChargeCalibCondCfg, PixelOfflineCalibCondAlgCfg
17 acc.merge(PixelChargeCalibCondCfg(flags))
18 acc.merge(PixelOfflineCalibCondAlgCfg(flags))
19 kwargs.setdefault(
"PixelChargeCalibCondData",
"PixelChargeCalibCondData")
21 if "PixelLorentzAngleTool" not in kwargs:
22 from SiLorentzAngleTool.PixelLorentzAngleConfig
import PixelLorentzAngleToolCfg
23 kwargs.setdefault(
"PixelLorentzAngleTool", acc.popToolsAndMerge( PixelLorentzAngleToolCfg(flags) ))
25 kwargs.setdefault(
"CheckGanged",
True)
26 kwargs.setdefault(
'UseWeightedPosition',
False)
27 kwargs.setdefault(
'UseBroadErrors', flags.Beam.Type
is BeamType.Cosmics)
29 acc.setPrivateTools(CompFactory.ActsTrk.PixelClusteringTool(name, **kwargs))
33 name: str =
"ActsIDStripClusteringTool",
34 **kwargs) -> ComponentAccumulator:
35 acc = ComponentAccumulator()
37 kwargs.setdefault(
"isITk",
False)
39 if 'LorentzAngleTool' not in kwargs:
40 from SiLorentzAngleTool.SCT_LorentzAngleConfig
import SCT_LorentzAngleToolCfg
41 kwargs.setdefault(
"LorentzAngleTool", acc.popToolsAndMerge(SCT_LorentzAngleToolCfg(flags)))
43 if "conditionsTool" not in kwargs:
44 from SCT_ConditionsTools.SCT_ConditionsToolsConfig
import SCT_ConditionsSummaryToolCfg
45 kwargs.setdefault(
"conditionsTool", acc.popToolsAndMerge(
46 SCT_ConditionsSummaryToolCfg(flags, withFlaggedCondTool=
False)))
48 if "StripDetElStatus" not in kwargs :
49 from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConfig
import (
50 SCT_DetectorElementStatusAlgWithoutFlaggedCfg)
51 acc.merge(SCT_DetectorElementStatusAlgWithoutFlaggedCfg(flags))
52 kwargs.setdefault(
"StripDetElStatus",
"SCTDetectorElementStatusWithoutFlagged")
55 kwargs.setdefault(
"maxFiredStrips", 384)
57 if flags.InDet.selectSCTIntimeHits:
58 coll_25ns = (flags.Beam.BunchSpacing <= 25
and
59 flags.Beam.Type
is BeamType.Collisions)
60 kwargs.setdefault(
"timeBins",
"01X" if coll_25ns
else "X1X")
62 kwargs.setdefault(
"StripDetEleCollKey",
"SCT_DetectorElementCollection")
64 acc.setPrivateTools(CompFactory.ActsTrk.StripClusteringTool(name, **kwargs))
68 name: str =
'ActsIDPixelClusterizationAlg',
70 useCache: bool =
False,
71 **kwargs) -> ComponentAccumulator:
72 acc = ComponentAccumulator()
74 kwargs.setdefault(
"IDHelper",
"PixelID")
75 kwargs.setdefault(
"RDOContainerKey",
"PixelRDOs")
76 kwargs.setdefault(
"ClustersKey",
"PixelClusters")
77 kwargs.setdefault(
"DetEleCollKey",
"PixelDetectorElementCollection")
79 kwargs.setdefault(
'RoIs',
'ActsRegionOfInterest')
81 kwargs.setdefault(
'ClusterCacheBackend',
'ActsPixelClusterCache_Back')
82 kwargs.setdefault(
'ClusterCache',
'ActsPixelClustersCache')
84 if 'RegSelTool' not in kwargs:
85 from RegionSelector.RegSelToolConfig
import regSelTool_Pixel_Cfg
86 kwargs.setdefault(
'RegSelTool', acc.popToolsAndMerge(regSelTool_Pixel_Cfg(flags)))
88 if 'ClusteringTool' not in kwargs:
91 if 'DetElStatus' not in kwargs:
92 from PixelConditionsAlgorithms.PixelConditionsConfig
import PixelDetectorElementStatusAlgCfg
93 acc.merge(PixelDetectorElementStatusAlgCfg(flags))
94 kwargs.setdefault(
'DetElStatus',
'PixelDetectorElementStatus')
97 acc.addEventAlgo(CompFactory.ActsTrk.PixelClusterizationAlg(name, **kwargs))
99 acc.addEventAlgo(CompFactory.ActsTrk.PixelCacheClusterizationAlg(name, **kwargs))
103 name: str =
'ActsIDStripClusterizationAlg',
104 useCache: bool =
False,
105 **kwargs) -> ComponentAccumulator:
106 acc = ComponentAccumulator()
108 kwargs.setdefault(
"RDOContainerKey",
"SCT_RDOs")
109 kwargs.setdefault(
"ClustersKey",
"SCT_Clusters")
110 kwargs.setdefault(
"IDHelper",
"SCT_ID")
111 kwargs.setdefault(
"DetEleCollKey",
"SCT_DetectorElementCollection")
113 kwargs.setdefault(
'RoIs',
'ActsRegionOfInterest')
115 kwargs.setdefault(
'ClusterCacheBackend',
'ActsStripClusterCache_Back')
116 kwargs.setdefault(
'ClusterCache',
'ActsStripClustersCache')
118 if 'RegSelTool' not in kwargs:
119 from RegionSelector.RegSelToolConfig
import regSelTool_SCT_Cfg
120 kwargs.setdefault(
'RegSelTool', acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags)))
122 if 'DetElStatus' not in kwargs :
123 from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConfig
import SCT_DetectorElementStatusAlgWithoutFlaggedCfg
124 acc.merge(SCT_DetectorElementStatusAlgWithoutFlaggedCfg(flags))
125 kwargs.setdefault(
"DetElStatus",
"SCTDetectorElementStatusWithoutFlagged")
127 if 'ClusteringTool' not in kwargs:
131 acc.addEventAlgo(CompFactory.ActsTrk.StripClusterizationAlg(name, **kwargs))
133 acc.addEventAlgo(CompFactory.ActsTrk.StripCacheClusterizationAlg(name, **kwargs))
137 name: str =
"ActsIDPixelClusterPreparationAlg",
138 useCache: bool =
False,
139 **kwargs) -> ComponentAccumulator:
140 acc = ComponentAccumulator()
142 kwargs.setdefault(
'InputCollection',
'PixelClusters')
143 kwargs.setdefault(
'DetectorElements',
'PixelDetectorElementCollection')
145 if 'RegSelTool' not in kwargs:
146 from RegionSelector.RegSelToolConfig
import regSelTool_Pixel_Cfg
147 kwargs.setdefault(
'RegSelTool', acc.popToolsAndMerge(regSelTool_Pixel_Cfg(flags)))
150 acc.addEventAlgo(CompFactory.ActsTrk.PixelClusterDataPreparationAlg(name, **kwargs))
152 acc.addEventAlgo(CompFactory.ActsTrk.PixelClusterCacheDataPreparationAlg(name, **kwargs))
156 name: str =
"ActsIDStripClusterPreparationAlg",
157 useCache: bool =
False,
158 **kwargs) -> ComponentAccumulator:
159 acc = ComponentAccumulator()
161 kwargs.setdefault(
'InputCollection',
'SCT_Clusters')
162 kwargs.setdefault(
'DetectorElements',
'SCT_DetectorElementCollection')
164 if 'RegSelTool' not in kwargs:
165 from RegionSelector.RegSelToolConfig
import regSelTool_SCT_Cfg
166 kwargs.setdefault(
'RegSelTool', acc.popToolsAndMerge(regSelTool_SCT_Cfg(flags)))
169 acc.addEventAlgo(CompFactory.ActsTrk.StripClusterDataPreparationAlg(name, **kwargs))
171 acc.addEventAlgo(CompFactory.ActsTrk.StripClusterCacheDataPreparationAlg(name, **kwargs))
176 RoIs: str =
"ActsRegionOfInterest",
177 **kwargs: dict) -> ComponentAccumulator:
178 assert isinstance(RoIs, str)
179 assert isinstance(kwargs, dict)
181 acc = ComponentAccumulator()
190 kwargs.setdefault(
'processPixels', flags.Detector.EnablePixel)
191 kwargs.setdefault(
'processStrips', flags.Detector.EnableSCT)
192 kwargs.setdefault(
'runCacheCreation', flags.Acts.useCache)
193 kwargs.setdefault(
'runReconstruction',
True)
194 kwargs.setdefault(
'runPreparation', flags.Acts.useCache)
197 if kwargs[
'runCacheCreation']:
198 acc.merge(ActsClusterCacheCreatorAlgCfg(flags,
199 **extractChildKwargs(prefix=
'ClusterCacheCreatorAlg.', **kwargs)))
202 if kwargs[
'runReconstruction']:
203 if kwargs[
'processPixels']:
206 **extractChildKwargs(prefix=
'PixelClusterizationAlg.', **kwargs)))
207 if kwargs[
'processStrips']:
210 **extractChildKwargs(prefix=
'StripClusterizationAlg.', **kwargs)))
213 if kwargs[
'runPreparation']:
214 if kwargs[
'processPixels']:
217 **extractChildKwargs(prefix=
'PixelClusterPreparationAlg.', **kwargs)))
219 if kwargs[
'processStrips']:
222 **extractChildKwargs(prefix=
'StripClusterPreparationAlg.', **kwargs)))
228 previousActsExtension: str =
None) -> ComponentAccumulator:
229 assert previousActsExtension
is None or isinstance(previousActsExtension, str)
231 acc = ComponentAccumulator()
233 processPixels = flags.Detector.EnablePixel
234 processStrips = flags.Detector.EnableSCT
237 kwargs.setdefault(
'processPixels', processPixels)
238 kwargs.setdefault(
'processStrips', processStrips)
258 kwargs.setdefault(
'runCacheCreation', flags.Acts.useCache)
259 kwargs.setdefault(
'runReconstruction',
True)
260 kwargs.setdefault(
'runPreparation', flags.Acts.useCache)
263 roisName = f
'{flags.Tracking.ActiveConfig.extension}RegionOfInterest'
265 if flags.Tracking.ActiveConfig.extension ==
'ActsLargeRadius':
266 roisName =
'ActsRegionOfInterest'
270 primaryPixelClustersName =
'PixelClusters'
271 primaryStripClustersName =
'SCT_Clusters'
272 pixelClustersName = primaryPixelClustersName
273 stripClustersName = primaryStripClustersName
276 if kwargs[
'runCacheCreation']:
277 kwargs.setdefault(
'ClusterCacheCreatorAlg.name', f
'{flags.Tracking.ActiveConfig.extension}ClusterCacheCreatorAlg')
280 if kwargs[
'runReconstruction']:
281 if kwargs[
'processPixels']:
282 kwargs.setdefault(
'PixelClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterizationAlg')
283 kwargs.setdefault(
'PixelClusterizationAlg.useCache', flags.Acts.useCache)
284 kwargs.setdefault(
'PixelClusterizationAlg.ClustersKey', pixelClustersName)
285 kwargs.setdefault(
'PixelClusterizationAlg.ClusterCache', f
'{flags.Tracking.ActiveConfig.extension}PixelClustersCache')
287 if kwargs[
'processStrips']:
288 kwargs.setdefault(
'StripClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterizationAlg')
289 kwargs.setdefault(
'StripClusterizationAlg.useCache', flags.Acts.useCache)
290 kwargs.setdefault(
'StripClusterizationAlg.ClustersKey', stripClustersName)
291 kwargs.setdefault(
'StripClusterizationAlg.ClusterCache', f
'{flags.Tracking.ActiveConfig.extension}StripClustersCache')
294 if kwargs[
'runPreparation']:
295 if kwargs[
'processPixels']:
296 kwargs.setdefault(
'PixelClusterPreparationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterPreparationAlg')
297 kwargs.setdefault(
'PixelClusterPreparationAlg.useCache', flags.Acts.useCache)
298 kwargs.setdefault(
'PixelClusterPreparationAlg.OutputCollection', f
'{pixelClustersName}_Cached' if kwargs[
'runReconstruction']
else pixelClustersName)
300 if not flags.Acts.useCache:
302 kwargs.setdefault(
'PixelClusterPreparationAlg.InputCollection', pixelClustersName
if kwargs[
'runReconstruction']
else primaryPixelClustersName)
303 kwargs.setdefault(
'PixelClusterPreparationAlg.InputIDC',
'')
305 kwargs.setdefault(
'PixelClusterPreparationAlg.InputCollection',
'')
306 kwargs.setdefault(
'PixelClusterPreparationAlg.InputIDC', f
'{flags.Tracking.ActiveConfig.extension}PixelClustersCache')
308 if kwargs[
'processStrips']:
309 kwargs.setdefault(
'StripClusterPreparationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterPreparationAlg')
310 kwargs.setdefault(
'StripClusterPreparationAlg.useCache', flags.Acts.useCache)
311 kwargs.setdefault(
'StripClusterPreparationAlg.OutputCollection', f
'{stripClustersName}_Cached' if kwargs[
'runReconstruction']
else stripClustersName)
312 if not flags.Acts.useCache:
313 kwargs.setdefault(
'StripClusterPreparationAlg.InputCollection', stripClustersName
if kwargs[
'runReconstruction']
else primaryStripClustersName)
314 kwargs.setdefault(
'StripClusterPreparationAlg.InputIDC',
'')
316 kwargs.setdefault(
'StripClusterPreparationAlg.InputCollection',
'')
317 kwargs.setdefault(
'StripClusterPreparationAlg.InputIDC', f
'{flags.Tracking.ActiveConfig.extension}StripClustersCache')
ComponentAccumulator ActsIDPixelClusterPreparationAlgCfg(flags, str name="ActsIDPixelClusterPreparationAlg", bool useCache=False, **kwargs)
ComponentAccumulator ActsIDMainClusterizationCfg(flags, *, str RoIs="ActsRegionOfInterest", **dict kwargs)
ComponentAccumulator ActsIDPixelClusteringToolCfg(flags, str name="ActsIDPixelClusteringTool", **kwargs)
ComponentAccumulator ActsIDStripClusterPreparationAlgCfg(flags, str name="ActsIDStripClusterPreparationAlg", bool useCache=False, **kwargs)
ComponentAccumulator ActsIDPixelClusterizationAlgCfg(flags, str name='ActsIDPixelClusterizationAlg', *, bool useCache=False, **kwargs)
ComponentAccumulator ActsIDStripClusteringToolCfg(flags, str name="ActsIDStripClusteringTool", **kwargs)
ComponentAccumulator ActsIDClusterizationCfg(flags, *, str previousActsExtension=None)
ComponentAccumulator ActsIDStripClusterizationAlgCfg(flags, str name='ActsIDStripClusterizationAlg', bool useCache=False, **kwargs)