3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.Enums
import BeamType
6 from ActsConfig.ActsUtilities
import extractChildKwargs
9 name: str =
"ActsHgtdClusteringTool",
10 **kwargs) -> ComponentAccumulator:
12 acc.setPrivateTools(CompFactory.ActsTrk.HgtdClusteringTool(name, **kwargs))
16 name: str =
"ActsHgtdTimedClusteringTool",
17 **kwargs) -> ComponentAccumulator:
19 acc.setPrivateTools(CompFactory.ActsTrk.HgtdTimedClusteringTool(name, **kwargs))
23 name: str =
"ActsHgtdClusterizationAlg",
24 **kwargs) -> ComponentAccumulator:
27 if flags.HGTD.Geometry.useGeoModelXml:
28 from HGTD_GeoModelXml.HGTD_GeoModelConfig
import HGTD_ReadoutGeometryCfg
30 from HGTD_GeoModel.HGTD_GeoModelConfig
import HGTD_ReadoutGeometryCfg
33 kwargs.setdefault(
'RDOContainerName',
'HGTD_RDOs')
34 kwargs.setdefault(
'ClusterContainerName',
'HGTD_Clusters')
36 if 'ClusteringTool' not in kwargs:
37 from HGTD_Config.HGTD_ConfigFlags
import ClusteringStrategy
38 if flags.HGTD.Acts.ClusteringStrategy
is ClusteringStrategy.SinglePad:
43 if flags.Acts.doMonitoring
and 'MonTool' not in kwargs:
44 from ActsConfig.ActsMonitoringConfig
import ActsHgtdClusterizationMonitoringToolCfg
47 acc.addEventAlgo(CompFactory.ActsTrk.HgtdClusterizationAlg(name, **kwargs))
53 name: str =
"ActsPixelClusteringTool",
54 **kwargs) -> ComponentAccumulator:
57 from PixelConditionsAlgorithms.ITkPixelConditionsConfig
import ITkPixelChargeCalibCondAlgCfg, ITkPixelOfflineCalibCondAlgCfg
61 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import ITkPixelReadoutManagerCfg
64 if 'PixelRDOTool' not in kwargs:
65 from InDetConfig.SiClusterizationToolConfig
import ITkPixelRDOToolCfg
68 if "PixelLorentzAngleTool" not in kwargs:
69 from SiLorentzAngleTool.ITkPixelLorentzAngleConfig
import ITkPixelLorentzAngleToolCfg
73 'UseWeightedPosition',
74 not (flags.Tracking.doPixelDigitalClustering
or flags.Beam.Type
is BeamType.Cosmics)
77 kwargs.setdefault(
'UseBroadErrors', flags.Beam.Type
is BeamType.Cosmics)
79 acc.setPrivateTools(CompFactory.ActsTrk.PixelClusteringTool(name, **kwargs))
84 name: str =
"ActsStripClusteringTool",
85 **kwargs) -> ComponentAccumulator:
88 if 'LorentzAngleTool' not in kwargs:
89 from SiLorentzAngleTool.ITkStripLorentzAngleConfig
import ITkStripLorentzAngleToolCfg
92 if 'conditionsTool' not in kwargs:
93 from SCT_ConditionsTools.ITkStripConditionsToolsConfig
import ITkStripConditionsSummaryToolCfg
97 kwargs.setdefault(
"maxFiredStrips", 0)
99 if flags.ITk.selectStripIntimeHits
and 'timeBins' not in kwargs:
100 coll_25ns = flags.Beam.BunchSpacing<=25
and flags.Beam.Type
is BeamType.Collisions
101 kwargs.setdefault(
"timeBins",
"01X" if coll_25ns
else "X1X")
103 acc.setPrivateTools(CompFactory.ActsTrk.StripClusteringTool(name, **kwargs))
107 name: str =
'ActsPixelClusterizationAlg',
109 useCache: bool =
False,
110 **kwargs) -> ComponentAccumulator:
113 kwargs.setdefault(
"expectedClustersPerRDO", 32)
114 kwargs.setdefault(
"IDHelper",
"PixelID")
115 kwargs.setdefault(
"RDOContainerKey",
"ITkPixelRDOs")
116 kwargs.setdefault(
"ClustersKey",
"ITkPixelClusters")
118 kwargs.setdefault(
'RoIs',
'ActsRegionOfInterest')
120 kwargs.setdefault(
'ClusterCacheBackend',
'ActsPixelClusterCache_Back')
121 kwargs.setdefault(
'ClusterCache',
'ActsPixelClustersCache')
123 if 'RegSelTool' not in kwargs:
124 from RegionSelector.RegSelToolConfig
import regSelTool_ITkPixel_Cfg
127 if 'ClusteringTool' not in kwargs:
130 if flags.Acts.doMonitoring
and 'MonTool' not in kwargs:
131 from ActsConfig.ActsMonitoringConfig
import ActsITkPixelClusterizationMonitoringToolCfg
135 acc.addEventAlgo(CompFactory.ActsTrk.PixelClusterizationAlg(name, **kwargs))
137 acc.addEventAlgo(CompFactory.ActsTrk.PixelCacheClusterizationAlg(name, **kwargs))
141 name: str =
'ActsStripClusterizationAlg',
142 useCache: bool =
False,
143 **kwargs) -> ComponentAccumulator:
146 kwargs.setdefault(
"RDOContainerKey",
"ITkStripRDOs")
147 kwargs.setdefault(
"ClustersKey",
"ITkStripClusters")
148 kwargs.setdefault(
"expectedClustersPerRDO", 6)
149 kwargs.setdefault(
"IDHelper",
"SCT_ID")
151 kwargs.setdefault(
'RoIs',
'ActsRegionOfInterest')
153 kwargs.setdefault(
'ClusterCacheBackend',
'ActsStripClusterCache_Back')
154 kwargs.setdefault(
'ClusterCache',
'ActsStripClustersCache')
156 if 'RegSelTool' not in kwargs:
157 from RegionSelector.RegSelToolConfig
import regSelTool_ITkStrip_Cfg
160 if 'ClusteringTool' not in kwargs:
163 if flags.Acts.doMonitoring
and 'MonTool' not in kwargs:
164 from ActsConfig.ActsMonitoringConfig
import ActsITkStripClusterizationMonitoringToolCfg
168 acc.addEventAlgo(CompFactory.ActsTrk.StripClusterizationAlg(name, **kwargs))
170 acc.addEventAlgo(CompFactory.ActsTrk.StripCacheClusterizationAlg(name, **kwargs))
174 name: str =
"ActsClusterCacheCreatorAlg",
175 **kwargs) -> ComponentAccumulator:
177 kwargs.setdefault(
"PixelClustersCacheKey",
"ActsPixelClusterCache_Back")
178 kwargs.setdefault(
"StripClustersCacheKey",
"ActsStripClusterCache_Back")
179 acc.addEventAlgo(CompFactory.ActsTrk.Cache.CreatorAlg(name, **kwargs))
183 name: str =
"ActsPixelClusterPreparationAlg",
184 useCache: bool =
False,
185 **kwargs) -> ComponentAccumulator:
188 kwargs.setdefault(
'InputCollection',
'ITkPixelClusters')
189 kwargs.setdefault(
'DetectorElements',
'ITkPixelDetectorElementCollection')
191 if 'RegSelTool' not in kwargs:
192 from RegionSelector.RegSelToolConfig
import regSelTool_ITkPixel_Cfg
195 if flags.Acts.doMonitoring
and 'MonTool' not in kwargs:
196 from ActsConfig.ActsMonitoringConfig
import ActsDataPreparationMonitoringToolCfg
198 name =
"ActsPixelClusterPreparationMonitoringTool")))
201 acc.addEventAlgo(CompFactory.ActsTrk.PixelClusterDataPreparationAlg(name, **kwargs))
203 acc.addEventAlgo(CompFactory.ActsTrk.PixelClusterCacheDataPreparationAlg(name, **kwargs))
207 name: str =
"ActsStripClusterPreparationAlg",
208 useCache: bool =
False,
209 **kwargs) -> ComponentAccumulator:
212 kwargs.setdefault(
'InputCollection',
'ITkStripClusters')
213 kwargs.setdefault(
'DetectorElements',
'ITkStripDetectorElementCollection')
215 if 'RegSelTool' not in kwargs:
216 from RegionSelector.RegSelToolConfig
import regSelTool_ITkStrip_Cfg
219 if flags.Acts.doMonitoring
and 'MonTool' not in kwargs:
220 from ActsConfig.ActsMonitoringConfig
import ActsDataPreparationMonitoringToolCfg
222 name =
"ActsStripClusterPreparationMonitoringTool")))
225 acc.addEventAlgo(CompFactory.ActsTrk.StripClusterDataPreparationAlg(name, **kwargs))
227 acc.addEventAlgo(CompFactory.ActsTrk.StripClusterCacheDataPreparationAlg(name, **kwargs))
232 RoIs: str =
"ActsRegionOfInterest",
233 **kwargs: dict) -> ComponentAccumulator:
234 assert isinstance(RoIs, str)
235 assert isinstance(kwargs, dict)
246 kwargs.setdefault(
'processPixels', flags.Detector.EnableITkPixel)
247 kwargs.setdefault(
'processStrips', flags.Detector.EnableITkStrip)
248 kwargs.setdefault(
'processHGTD', flags.Acts.useHGTDClusterInTrackFinding
and not flags.Tracking.ActiveConfig.isSecondaryPass)
249 kwargs.setdefault(
'runCacheCreation', flags.Acts.useCache)
250 kwargs.setdefault(
'runReconstruction',
True)
251 kwargs.setdefault(
'runPreparation', flags.Acts.useCache)
254 if kwargs[
'runCacheCreation']:
259 if kwargs[
'runReconstruction']:
260 if kwargs[
'processPixels']:
264 if kwargs[
'processStrips']:
268 if kwargs[
'processHGTD']:
272 if kwargs[
'runPreparation']:
273 if kwargs[
'processPixels']:
278 if kwargs[
'processStrips']:
284 if flags.Acts.doAnalysis:
285 if kwargs[
'processPixels']:
286 from ActsConfig.ActsAnalysisConfig
import ActsPixelClusterAnalysisAlgCfg
289 if kwargs[
'processStrips']:
290 from ActsConfig.ActsAnalysisConfig
import ActsStripClusterAnalysisAlgCfg
297 previousActsExtension: str =
None) -> ComponentAccumulator:
298 assert previousActsExtension
is None or isinstance(previousActsExtension, str)
302 processPixels = flags.Detector.EnableITkPixel
303 processStrips = flags.Detector.EnableITkStrip
304 processHGTD = flags.Acts.useHGTDClusterInTrackFinding
and not flags.Tracking.ActiveConfig.isSecondaryPass
307 kwargs.setdefault(
'processPixels', processPixels)
308 kwargs.setdefault(
'processStrips', processStrips)
309 kwargs.setdefault(
'processHGTD', processHGTD)
327 if flags.Tracking.ActiveConfig.isSecondaryPass:
329 kwargs.setdefault(
'runCacheCreation',
False)
330 kwargs.setdefault(
'runReconstruction', flags.Acts.useCache)
331 kwargs.setdefault(
'runPreparation',
True)
334 kwargs.setdefault(
'runCacheCreation', flags.Acts.useCache)
335 kwargs.setdefault(
'runReconstruction',
True)
336 kwargs.setdefault(
'runPreparation', flags.Acts.useCache)
339 roisName = f
'{flags.Tracking.ActiveConfig.extension}RegionOfInterest'
341 if flags.Tracking.ActiveConfig.extension ==
'ActsLargeRadius':
342 roisName =
'ActsRegionOfInterest'
346 primaryPixelClustersName =
'ITkPixelClusters'
347 primaryStripClustersName =
'ITkStripClusters'
348 pixelClustersName = primaryPixelClustersName
349 stripClustersName = primaryStripClustersName
352 if flags.Tracking.ActiveConfig.isSecondaryPass:
353 pixelClustersName = f
'ITk{flags.Tracking.ActiveConfig.extension.replace("Acts", "")}PixelClusters'
354 stripClustersName = f
'ITk{flags.Tracking.ActiveConfig.extension.replace("Acts", "")}StripClusters'
357 if kwargs[
'runCacheCreation']:
358 kwargs.setdefault(
'ClusterCacheCreatorAlg.name', f
'{flags.Tracking.ActiveConfig.extension}ClusterCacheCreatorAlg')
361 if kwargs[
'runReconstruction']:
362 if kwargs[
'processPixels']:
363 kwargs.setdefault(
'PixelClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterizationAlg')
364 kwargs.setdefault(
'PixelClusterizationAlg.useCache', flags.Acts.useCache)
365 kwargs.setdefault(
'PixelClusterizationAlg.ClustersKey', pixelClustersName)
366 kwargs.setdefault(
'PixelClusterizationAlg.ClusterCache', f
'{flags.Tracking.ActiveConfig.extension}PixelClustersCache')
367 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
368 kwargs.setdefault(
'PixelClusterizationAlg.ExtraInputs', {(
'ActsTrk::PrepRawDataAssociation', f
'StoreGateSvc+{previousActsExtension}PrdMap')})
370 if kwargs[
'processStrips']:
371 kwargs.setdefault(
'StripClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterizationAlg')
372 kwargs.setdefault(
'StripClusterizationAlg.useCache', flags.Acts.useCache)
373 kwargs.setdefault(
'StripClusterizationAlg.ClustersKey', stripClustersName)
374 kwargs.setdefault(
'StripClusterizationAlg.ClusterCache', f
'{flags.Tracking.ActiveConfig.extension}StripClustersCache')
375 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
376 kwargs.setdefault(
'StripClusterizationAlg.ExtraInputs', {(
'ActsTrk::PrepRawDataAssociation', f
'StoreGateSvc+{previousActsExtension}PrdMap')})
378 if kwargs[
'processHGTD']:
379 kwargs.setdefault(
'HgtdClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}HgtdClusterizationAlg')
380 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
381 kwargs.setdefault(
'HgtdClusterizationAlg.ExtraInputs', {(
'ActsTrk::PrepRawDataAssociation', f
'StoreGateSvc+{previousActsExtension}PrdMap')})
385 if kwargs[
'runPreparation']:
386 if kwargs[
'processPixels']:
387 kwargs.setdefault(
'PixelClusterPreparationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterPreparationAlg')
388 kwargs.setdefault(
'PixelClusterPreparationAlg.useCache', flags.Acts.useCache)
389 kwargs.setdefault(
'PixelClusterPreparationAlg.OutputCollection', f
'{pixelClustersName}_Cached' if kwargs[
'runReconstruction']
else pixelClustersName)
391 if not flags.Acts.useCache:
393 kwargs.setdefault(
'PixelClusterPreparationAlg.InputCollection', pixelClustersName
if kwargs[
'runReconstruction']
else primaryPixelClustersName)
394 kwargs.setdefault(
'PixelClusterPreparationAlg.InputIDC',
'')
396 kwargs.setdefault(
'PixelClusterPreparationAlg.InputCollection',
'')
397 kwargs.setdefault(
'PixelClusterPreparationAlg.InputIDC', f
'{flags.Tracking.ActiveConfig.extension}PixelClustersCache')
399 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
400 kwargs.setdefault(
'PixelClusterPreparationAlg.InputPrdMap', f
'{previousActsExtension}PrdMap')
402 if kwargs[
'processStrips']:
403 kwargs.setdefault(
'StripClusterPreparationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterPreparationAlg')
404 kwargs.setdefault(
'StripClusterPreparationAlg.useCache', flags.Acts.useCache)
405 kwargs.setdefault(
'StripClusterPreparationAlg.OutputCollection', f
'{stripClustersName}_Cached' if kwargs[
'runReconstruction']
else stripClustersName)
406 if not flags.Acts.useCache:
407 kwargs.setdefault(
'StripClusterPreparationAlg.InputCollection', stripClustersName
if kwargs[
'runReconstruction']
else primaryStripClustersName)
408 kwargs.setdefault(
'StripClusterPreparationAlg.InputIDC',
'')
410 kwargs.setdefault(
'StripClusterPreparationAlg.InputCollection',
'')
411 kwargs.setdefault(
'StripClusterPreparationAlg.InputIDC', f
'{flags.Tracking.ActiveConfig.extension}StripClustersCache')
413 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
414 kwargs.setdefault(
'StripClusterPreparationAlg.InputPrdMap', f
'{previousActsExtension}PrdMap')
417 if flags.Acts.doAnalysis:
420 if kwargs[
'processPixels']:
421 kwargs.setdefault(
'PixelClusterAnalysisAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterAnalysisAlg')
422 kwargs.setdefault(
'PixelClusterAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
423 kwargs.setdefault(
'PixelClusterAnalysisAlg.MonGroupName', f
'{flags.Tracking.ActiveConfig.extension}ClusterAnalysisAlg')
424 kwargs.setdefault(
'PixelClusterAnalysisAlg.ClusterContainerKey', kwargs[
'PixelClusterPreparationAlg.OutputCollection']
if kwargs[
'runPreparation']
else kwargs[
'PixelClusterizationAlg.ClustersKey'])
426 if kwargs[
'processStrips']:
427 kwargs.setdefault(
'StripClusterAnalysisAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterAnalysisAlg')
428 kwargs.setdefault(
'StripClusterAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
429 kwargs.setdefault(
'StripClusterAnalysisAlg.MonGroupName', f
'{flags.Tracking.ActiveConfig.extension}ClusterAnalysisAlg')
430 kwargs.setdefault(
'StripClusterAnalysisAlg.ClusterContainerKey', kwargs[
'StripClusterPreparationAlg.OutputCollection']
if kwargs[
'runPreparation']
else kwargs[
'StripClusterizationAlg.ClustersKey'])
432 if kwargs[
'processHGTD']:
433 kwargs.setdefault(
'HgtdClusterAnalysisAlg.name', f
'{flags.Tracking.ActiveConfig.extension}HgtdClusterAnalysisAlg')
434 kwargs.setdefault(
'HgtdClusterAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
435 kwargs.setdefault(
'HgtdClusterAnalysisAlg.MonGroupName', f
'{flags.Tracking.ActiveConfig.extension}ClusterAnalysisAlg')