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 name: str =
'ActsHgtdClusterPreparationAlg',
234 useCache: bool =
False,
235 **kwargs) -> ComponentAccumulator:
237 kwargs.setdefault(
'InputCollection',
'HGTDClusters')
238 kwargs.setdefault(
'DetectorElements',
'HGTD_DetectorElementCollection')
242 if flags.Acts.doMonitoring
and 'MonTool' not in kwargs:
243 from ActsConfig.ActsMonitoringConfig
import ActsDataPreparationMonitoringToolCfg
245 name =
"ActsHgtdClusterPreparationMonitoringTool")))
247 acc.addEventAlgo(CompFactory.ActsTrk.HgtdClusterDataPreparationAlg(name, **kwargs))
253 RoIs: str =
"ActsRegionOfInterest",
254 **kwargs: dict) -> ComponentAccumulator:
255 assert isinstance(RoIs, str)
256 assert isinstance(kwargs, dict)
267 kwargs.setdefault(
'processPixels', flags.Detector.EnableITkPixel)
268 kwargs.setdefault(
'processStrips', flags.Detector.EnableITkStrip)
269 kwargs.setdefault(
'processHGTD', flags.Acts.useHGTDClusterInTrackFinding
and flags.Detector.EnableHGTD)
270 kwargs.setdefault(
'runCacheCreation', flags.Acts.useCache)
271 kwargs.setdefault(
'runReconstruction',
True)
272 kwargs.setdefault(
'runPreparation', flags.Acts.useCache)
275 if kwargs[
'runCacheCreation']:
280 if kwargs[
'runReconstruction']:
281 if kwargs[
'processPixels']:
285 if kwargs[
'processStrips']:
289 if kwargs[
'processHGTD']:
293 if kwargs[
'runPreparation']:
294 if kwargs[
'processPixels']:
299 if kwargs[
'processStrips']:
304 if kwargs[
'processHGTD']:
310 if flags.Acts.doAnalysis:
311 if kwargs[
'processPixels']:
312 from ActsConfig.ActsAnalysisConfig
import ActsPixelClusterAnalysisAlgCfg
315 if kwargs[
'processStrips']:
316 from ActsConfig.ActsAnalysisConfig
import ActsStripClusterAnalysisAlgCfg
323 previousActsExtension: str =
None) -> ComponentAccumulator:
324 assert previousActsExtension
is None or isinstance(previousActsExtension, str)
328 processPixels = flags.Detector.EnableITkPixel
329 processStrips = flags.Detector.EnableITkStrip
330 processHGTD = flags.Acts.useHGTDClusterInTrackFinding
and flags.Detector.EnableHGTD
333 kwargs.setdefault(
'processPixels', processPixels)
334 kwargs.setdefault(
'processStrips', processStrips)
335 kwargs.setdefault(
'processHGTD', processHGTD)
353 if flags.Tracking.ActiveConfig.isSecondaryPass:
355 kwargs.setdefault(
'runCacheCreation',
False)
356 kwargs.setdefault(
'runReconstruction', flags.Acts.useCache)
357 kwargs.setdefault(
'runPreparation',
True)
360 kwargs.setdefault(
'runCacheCreation', flags.Acts.useCache)
361 kwargs.setdefault(
'runReconstruction',
True)
362 kwargs.setdefault(
'runPreparation', flags.Acts.useCache)
365 roisName = f
'{flags.Tracking.ActiveConfig.extension}RegionOfInterest'
367 if flags.Tracking.ActiveConfig.extension ==
'ActsLargeRadius':
368 roisName =
'ActsRegionOfInterest'
372 primaryPixelClustersName =
'ITkPixelClusters'
373 primaryStripClustersName =
'ITkStripClusters'
374 primaryHgtdClustersName =
'HGTD_Clusters'
375 pixelClustersName = primaryPixelClustersName
376 stripClustersName = primaryStripClustersName
377 hgtdClustersName = primaryHgtdClustersName
380 if flags.Tracking.ActiveConfig.isSecondaryPass:
381 keyPrefix = flags.Tracking.ActiveConfig.extension.replace(
"Acts",
"")
382 pixelClustersName = f
'ITk{keyPrefix}PixelClusters'
383 stripClustersName = f
'ITk{keyPrefix}StripClusters'
384 hgtdClustersName = f
'{keyPrefix}HGTD_Clusters'
387 if kwargs[
'runCacheCreation']:
388 kwargs.setdefault(
'ClusterCacheCreatorAlg.name', f
'{flags.Tracking.ActiveConfig.extension}ClusterCacheCreatorAlg')
391 if kwargs[
'runReconstruction']:
392 if kwargs[
'processPixels']:
393 kwargs.setdefault(
'PixelClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterizationAlg')
394 kwargs.setdefault(
'PixelClusterizationAlg.useCache', flags.Acts.useCache)
395 kwargs.setdefault(
'PixelClusterizationAlg.ClustersKey', pixelClustersName)
396 kwargs.setdefault(
'PixelClusterizationAlg.ClusterCache', f
'{flags.Tracking.ActiveConfig.extension}PixelClustersCache')
397 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
398 kwargs.setdefault(
'PixelClusterizationAlg.ExtraInputs', {(
'ActsTrk::PrepRawDataAssociation', f
'StoreGateSvc+{previousActsExtension}PrdMap')})
400 if kwargs[
'processStrips']:
401 kwargs.setdefault(
'StripClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterizationAlg')
402 kwargs.setdefault(
'StripClusterizationAlg.useCache', flags.Acts.useCache)
403 kwargs.setdefault(
'StripClusterizationAlg.ClustersKey', stripClustersName)
404 kwargs.setdefault(
'StripClusterizationAlg.ClusterCache', f
'{flags.Tracking.ActiveConfig.extension}StripClustersCache')
405 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
406 kwargs.setdefault(
'StripClusterizationAlg.ExtraInputs', {(
'ActsTrk::PrepRawDataAssociation', f
'StoreGateSvc+{previousActsExtension}PrdMap')})
408 if kwargs[
'processHGTD']:
409 kwargs.setdefault(
'HgtdClusterizationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}HgtdClusterizationAlg')
411 kwargs.setdefault(
'HgtdClusterizationAlg.ClusterContainerName', hgtdClustersName)
412 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
413 kwargs.setdefault(
'HgtdClusterizationAlg.ExtraInputs', {(
'ActsTrk::PrepRawDataAssociation', f
'StoreGateSvc+{previousActsExtension}PrdMap')})
417 if kwargs[
'runPreparation']:
418 if kwargs[
'processPixels']:
419 kwargs.setdefault(
'PixelClusterPreparationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterPreparationAlg')
420 kwargs.setdefault(
'PixelClusterPreparationAlg.useCache', flags.Acts.useCache)
421 kwargs.setdefault(
'PixelClusterPreparationAlg.OutputCollection', f
'{pixelClustersName}_Cached' if kwargs[
'runReconstruction']
else pixelClustersName)
423 if not flags.Acts.useCache:
425 kwargs.setdefault(
'PixelClusterPreparationAlg.InputCollection', pixelClustersName
if kwargs[
'runReconstruction']
else primaryPixelClustersName)
426 kwargs.setdefault(
'PixelClusterPreparationAlg.InputIDC',
'')
428 kwargs.setdefault(
'PixelClusterPreparationAlg.InputCollection',
'')
429 kwargs.setdefault(
'PixelClusterPreparationAlg.InputIDC', f
'{flags.Tracking.ActiveConfig.extension}PixelClustersCache')
431 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
432 kwargs.setdefault(
'PixelClusterPreparationAlg.InputPrdMap', f
'{previousActsExtension}PrdMap')
434 if kwargs[
'processStrips']:
435 kwargs.setdefault(
'StripClusterPreparationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterPreparationAlg')
436 kwargs.setdefault(
'StripClusterPreparationAlg.useCache', flags.Acts.useCache)
437 kwargs.setdefault(
'StripClusterPreparationAlg.OutputCollection', f
'{stripClustersName}_Cached' if kwargs[
'runReconstruction']
else stripClustersName)
438 if not flags.Acts.useCache:
439 kwargs.setdefault(
'StripClusterPreparationAlg.InputCollection', stripClustersName
if kwargs[
'runReconstruction']
else primaryStripClustersName)
440 kwargs.setdefault(
'StripClusterPreparationAlg.InputIDC',
'')
442 kwargs.setdefault(
'StripClusterPreparationAlg.InputCollection',
'')
443 kwargs.setdefault(
'StripClusterPreparationAlg.InputIDC', f
'{flags.Tracking.ActiveConfig.extension}StripClustersCache')
445 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
446 kwargs.setdefault(
'StripClusterPreparationAlg.InputPrdMap', f
'{previousActsExtension}PrdMap')
448 if kwargs[
'processHGTD']:
449 kwargs.setdefault(
'HgtdClusterPreparationAlg.name', f
'{flags.Tracking.ActiveConfig.extension}HgtdClusterPreparationAlg')
450 kwargs.setdefault(
'HgtdClusterPreparationAlg.OutputCollection', f
'{hgtdClustersName}_Cached' if kwargs[
'runReconstruction']
else hgtdClustersName)
451 kwargs.setdefault(
'HgtdClusterPreparationAlg.InputCollection', hgtdClustersName
if kwargs[
'runReconstruction']
else primaryHgtdClustersName)
452 kwargs.setdefault(
'HgtdClusterPreparationAlg.InputIDC',
'')
453 if flags.Tracking.ActiveConfig.isSecondaryPass
and previousActsExtension
is not None:
454 kwargs.setdefault(
'HgtdClusterPreparationAlg.InputPrdMap', f
'{previousActsExtension}PrdMap')
457 if flags.Acts.doAnalysis:
460 if kwargs[
'processPixels']:
461 kwargs.setdefault(
'PixelClusterAnalysisAlg.name', f
'{flags.Tracking.ActiveConfig.extension}PixelClusterAnalysisAlg')
462 kwargs.setdefault(
'PixelClusterAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
463 kwargs.setdefault(
'PixelClusterAnalysisAlg.MonGroupName', f
'{flags.Tracking.ActiveConfig.extension}ClusterAnalysisAlg')
464 kwargs.setdefault(
'PixelClusterAnalysisAlg.ClusterContainerKey', kwargs[
'PixelClusterPreparationAlg.OutputCollection']
if kwargs[
'runPreparation']
else kwargs[
'PixelClusterizationAlg.ClustersKey'])
466 if kwargs[
'processStrips']:
467 kwargs.setdefault(
'StripClusterAnalysisAlg.name', f
'{flags.Tracking.ActiveConfig.extension}StripClusterAnalysisAlg')
468 kwargs.setdefault(
'StripClusterAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
469 kwargs.setdefault(
'StripClusterAnalysisAlg.MonGroupName', f
'{flags.Tracking.ActiveConfig.extension}ClusterAnalysisAlg')
470 kwargs.setdefault(
'StripClusterAnalysisAlg.ClusterContainerKey', kwargs[
'StripClusterPreparationAlg.OutputCollection']
if kwargs[
'runPreparation']
else kwargs[
'StripClusterizationAlg.ClustersKey'])
472 if kwargs[
'processHGTD']:
473 kwargs.setdefault(
'HgtdClusterAnalysisAlg.name', f
'{flags.Tracking.ActiveConfig.extension}HgtdClusterAnalysisAlg')
474 kwargs.setdefault(
'HgtdClusterAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
475 kwargs.setdefault(
'HgtdClusterAnalysisAlg.MonGroupName', f
'{flags.Tracking.ActiveConfig.extension}ClusterAnalysisAlg')