ATLAS Offline Software
EFSpacePointFormationConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 def EFSpacePointFormationCfg(flags, previousActsExtension = None, **kwargs) -> ComponentAccumulator:
7 
8  processPixels = flags.Detector.EnableITkPixel
9  processStrips = flags.Detector.EnableITkStrip
10 
11  kwargs = dict()
12  kwargs.setdefault('processPixels', processPixels)
13  kwargs.setdefault('processStrips', processStrips)
14 
15  # Similarly to Clusterization, space point formation is a three step process at maximum:
16  # (1) Cache Creation
17  # (2) Space Point formation algorithm (reconstruction of space points)
18  # (3) Preparation of collection for downstream algorithms
19  # What step is scheduled depends on the tracking pass and the activation
20  # or de-activation of caching mechanism.
21 
22  # Secondary passes do not need cache creation, that has to be performed
23  # on the primary pass, and only if the caching is enabled.
24  # Reconstruction can run on secondary passes only if the caching is enabled,
25  # this is because we may need to process detector elements not processed
26  # on the primary pass.
27  # Preparation has to be performed on secondary passes always, and on primary
28  # pass only if cache is enabled. In the latter case it is used to collect all
29  # the clusters from all views before passing them to the downstream algorithms
30 
31 
32  # Primary pass
33  kwargs.setdefault('runCacheCreation', flags.Acts.useCache)
34  kwargs.setdefault('runReconstruction', True)
35  kwargs.setdefault('runPreparation', flags.Acts.useCache)
36 
37  # Overlap Space Points may not be required
38  processOverlapSpacePoints = processStrips
39 
40  kwargs.setdefault('processOverlapSpacePoints', processOverlapSpacePoints)
41 
42  # Name of the RoI to be used
43  roisName = f'{flags.Tracking.ActiveConfig.extension}RegionOfInterest'
44 
45  # Cluster Collection name(s) and Space Point Collection name(s)
46  # The name depends on the tracking pass as well as the cache mechanism
47  pixelClustersName = 'ITkPixelClusters'
48  stripClustersName = 'ITkStripClusters'
49  pixelSpacePointsName = 'FPGAITkPixelSpacePoints'
50  stripSpacePointsName = 'FPGAITkStripSpacePoints'
51  stripOverlapSpacePointsName = 'ITkStripOverlapSpacePoints'
52  # if cache is enabled, add "_Cached" at the end
53  if flags.Acts.useCache:
54  pixelClustersName += "_Cached"
55  stripClustersName += "_Cached"
56 
57  # Primary collections for space points (i.e. produced by primary pass)
58  primaryPixelSpacePointsName = 'FPGAITkPixelSpacePoints'
59  primaryStripSpacePointsName = 'FPGAITkStripSpacePoints'
60  primaryStripOverlapSpacePointsName = 'ITkStripOverlapSpacePoints'
61 
62  # Configuration for (1)
63  if kwargs['runCacheCreation']:
64  kwargs.setdefault('SpacePointCacheCreatorAlg.name', f'{flags.Tracking.ActiveConfig.extension}SpacePointCacheCreatorAlg')
65 
66  # Configuration for (2)
67  if kwargs['runReconstruction']:
68  if kwargs['processPixels']:
69  kwargs.setdefault('PixelSpacePointFormationAlg.name', f'{flags.Tracking.ActiveConfig.extension}PixelSpacePointFormationAlg')
70  kwargs.setdefault('PixelSpacePointFormationAlg.useCache', flags.Acts.useCache)
71  kwargs.setdefault('PixelSpacePointFormationAlg.SPCache', f'{flags.Tracking.ActiveConfig.extension}PixelSpacePointCache')
72  kwargs.setdefault('PixelSpacePointFormationAlg.PixelClusters', pixelClustersName)
73  kwargs.setdefault('PixelSpacePointFormationAlg.PixelSpacePoints', pixelSpacePointsName)
74 
75  if kwargs['processStrips']:
76  kwargs.setdefault('StripSpacePointFormationAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripSpacePointFormationAlg')
77  kwargs.setdefault('StripSpacePointFormationAlg.useCache', flags.Acts.useCache)
78  kwargs.setdefault('StripSpacePointFormationAlg.SPCache', f'{flags.Tracking.ActiveConfig.extension}StripSpacePointCache')
79  kwargs.setdefault('StripSpacePointFormationAlg.StripClusters', stripClustersName)
80  kwargs.setdefault('StripSpacePointFormationAlg.StripSpacePoints', stripSpacePointsName)
81 
82  # Handling of Overlap Space Points
83  kwargs.setdefault('StripSpacePointFormationAlg.ProcessOverlapForStrip', kwargs['processOverlapSpacePoints'])
84  kwargs.setdefault('StripSpacePointFormationAlg.OSPCache', f'{flags.Tracking.ActiveConfig.extension}StripOverlapSpacePointCache')
85  if kwargs['processOverlapSpacePoints']:
86  kwargs.setdefault('StripSpacePointFormationAlg.StripOverlapSpacePoints', stripOverlapSpacePointsName)
87  else:
88  # Disable keys
89  kwargs.setdefault('StripSpacePointFormationAlg.StripOverlapSpacePoints', '')
90 
91  # Configuration for (3)
92  if kwargs['runPreparation']:
93  if kwargs['processPixels']:
94  kwargs.setdefault('PixelSpacePointPreparationAlg.name', f'{flags.Tracking.ActiveConfig.extension}PixelSpacePointPreparationAlg')
95  kwargs.setdefault('PixelSpacePointPreparationAlg.useCache', flags.Acts.useCache)
96  kwargs.setdefault('PixelSpacePointPreparationAlg.OutputCollection', f'{pixelSpacePointsName}_Cached' if kwargs['runReconstruction'] else pixelSpacePointsName)
97  # The input is one between the collection (w/o cache) and the IDC (w/ cache)
98  if not flags.Acts.useCache:
99  # Take the collection from the reconstruction step. If not available take the collection from the primary pass
100  kwargs.setdefault('PixelSpacePointPreparationAlg.InputCollection', pixelSpacePointsName if kwargs['runReconstruction'] else primaryPixelSpacePointsName)
101  kwargs.setdefault('PixelSpacePointPreparationAlg.InputIDC', '')
102  else:
103  kwargs.setdefault('PixelSpacePointPreparationAlg.InputCollection', '')
104  kwargs.setdefault('PixelSpacePointPreparationAlg.InputIDC', f'{flags.Tracking.ActiveConfig.extension}PixelSpacePointCache')
105 
106 
107  if kwargs['processStrips']:
108  kwargs.setdefault('StripSpacePointPreparationAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripSpacePointPreparationAlg')
109  kwargs.setdefault('StripSpacePointPreparationAlg.useCache', flags.Acts.useCache)
110  kwargs.setdefault('StripSpacePointPreparationAlg.OutputCollection', f'{stripSpacePointsName}_Cached' if kwargs['runReconstruction'] else stripSpacePointsName)
111  # The input is one between the collection (w/o cache) and the IDC (w/ cache)
112  if not flags.Acts.useCache:
113  # Take the collection from the reconstruction step. If not available take the collection from the primary pass
114  kwargs.setdefault('StripSpacePointPreparationAlg.InputCollection', stripSpacePointsName if kwargs['runReconstruction'] else primaryStripSpacePointsName)
115  kwargs.setdefault('StripSpacePointPreparationAlg.InputIDC', '')
116  else:
117  kwargs.setdefault('StripSpacePointPreparationAlg.InputCollection', '')
118  kwargs.setdefault('StripSpacePointPreparationAlg.InputIDC', f'{flags.Tracking.ActiveConfig.extension}StripSpacePointCache')
119 
120  if kwargs['processOverlapSpacePoints']:
121  kwargs.setdefault('StripOverlapSpacePointPreparationAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripOverlapSpacePointPreparationAlg')
122  kwargs.setdefault('StripOverlapSpacePointPreparationAlg.useCache', flags.Acts.useCache)
123  kwargs.setdefault('StripOverlapSpacePointPreparationAlg.OutputCollection', f'{stripOverlapSpacePointsName}_Cached' if kwargs['runReconstruction'] else stripOverlapSpacePointsName)
124  # The input is one between the collection (w/o cache) and the IDC (w/ cache)
125  if not flags.Acts.useCache:
126  # Take the collection from the reconstruction step. If not available take the collection from the primary pass
127  kwargs.setdefault('StripOverlapSpacePointPreparationAlg.InputCollection', stripOverlapSpacePointsName if kwargs['runReconstruction'] else primaryStripOverlapSpacePointsName)
128  kwargs.setdefault('StripOverlapSpacePointPreparationAlg.InputIDC', '')
129  else:
130  kwargs.setdefault('StripOverlapSpacePointPreparationAlg.InputCollection', '')
131  kwargs.setdefault('StripOverlapSpacePointPreparationAlg.InputIDC', f'{flags.Tracking.ActiveConfig.extension}StripOverlapSpacePointCache')
132 
133  # Analysis algo(s)
134  if flags.Acts.doAnalysis:
135  # Run analysis code on the resulting space point collection produced by this tracking pass
136  # This collection is the result of (3) if it ran, else the result of (2). We are sure at least one of them run
137  if kwargs['processPixels']:
138  kwargs.setdefault('PixelSpacePointAnalysisAlg.name', f'{flags.Tracking.ActiveConfig.extension}PixelSpacePointAnalysisAlg')
139  kwargs.setdefault('PixelSpacePointAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
140  kwargs.setdefault('PixelSpacePointAnalysisAlg.SpacePointContainerKey', kwargs['PixelSpacePointPreparationAlg.OutputCollection'] if kwargs['runPreparation'] else kwargs['PixelSpacePointFormationAlg.PixelSpacePoints'])
141 
142  if kwargs['processStrips']:
143  kwargs.setdefault('StripSpacePointAnalysisAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripSpacePointAnalysisAlg')
144  kwargs.setdefault('StripSpacePointAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
145  kwargs.setdefault('StripSpacePointAnalysisAlg.SpacePointContainerKey', kwargs['StripSpacePointPreparationAlg.OutputCollection'] if kwargs['runPreparation'] else kwargs['StripSpacePointFormationAlg.StripSpacePoints'])
146 
147  if kwargs['processOverlapSpacePoints']:
148  kwargs.setdefault('StripOverlapSpacePointAnalysisAlg.name', f'{flags.Tracking.ActiveConfig.extension}StripOverlapSpacePointAnalysisAlg')
149  kwargs.setdefault('StripOverlapSpacePointAnalysisAlg.extension', flags.Tracking.ActiveConfig.extension)
150  kwargs.setdefault('StripOverlapSpacePointAnalysisAlg.SpacePointContainerKey', kwargs['StripOverlapSpacePointPreparationAlg.OutputCollection'] if kwargs['runPreparation'] else kwargs['StripSpacePointFormationAlg.StripOverlapSpacePoints'])
151 
152  from ActsConfig.ActsSpacePointFormationConfig import ActsMainSpacePointFormationCfg
153  acc.merge(ActsMainSpacePointFormationCfg(flags, RoIs=roisName, **kwargs))
154  return acc
155 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
EFSpacePointFormationConfig.EFSpacePointFormationCfg
ComponentAccumulator EFSpacePointFormationCfg(flags, previousActsExtension=None, **kwargs)
Definition: EFSpacePointFormationConfig.py:5
ActsSpacePointFormationConfig.ActsMainSpacePointFormationCfg
ComponentAccumulator ActsMainSpacePointFormationCfg(flags, *str RoIs="ActsRegionOfInterest", **dict kwargs)
Definition: ActsSpacePointFormationConfig.py:192