ATLAS Offline Software
SiliconPreProcessing.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.Enums import Format
4 
7  # ------------------------------------------------------------
8  #
9  # ----------- Data-Preparation stage
10  #
11  # ------------------------------------------------------------
12  #
13  # ----------- PrepRawData creation from Raw Data Objects
14  #
15 
16  #
17  # --- Slim BCM RDOs by zero-suppressing
18  #
19  if flags.Detector.EnableBCM:
20  if flags.Input.Format is Format.BS:
21  from BCM_RawDataByteStreamCnv.BCM_RawDataByteStreamCnvConfig import (
22  BCM_RawDataProviderAlgCfg)
23  acc.merge(BCM_RawDataProviderAlgCfg(flags))
24  from InDetConfig.BCM_ZeroSuppressionConfig import BCM_ZeroSuppressionCfg
25  acc.merge(BCM_ZeroSuppressionCfg(flags))
26 
27  #
28  # -- Pixel Clusterization
29  #
30  if (flags.Detector.EnablePixel and
31  (flags.Input.Format is Format.BS
32  or 'PixelRDOs' in flags.Input.Collections
33  or f'{flags.Overlay.BkgPrefix}PixelRDOs' in flags.Input.Collections)):
34  #
35  # --- PixelClusterization algorithm
36  #
37  from InDetConfig.InDetPrepRawDataFormationConfig import (
38  PixelClusterizationCfg)
39  acc.merge(PixelClusterizationCfg(flags))
40  if flags.InDet.doSplitReco:
41  from InDetConfig.InDetPrepRawDataFormationConfig import (
42  PixelClusterizationPUCfg)
43  acc.merge(PixelClusterizationPUCfg(flags))
44  #
45  # --- SCT Clusterization
46  #
47  if (flags.Detector.EnableSCT and
48  (flags.Input.Format is Format.BS
49  or 'SCT_RDOs' in flags.Input.Collections
50  or f'{flags.Overlay.BkgPrefix}SCT_RDOs' in flags.Input.Collections)):
51 
52  #
53  # --- SCT_Clusterization algorithm
54  #
55  from InDetConfig.InDetPrepRawDataFormationConfig import (
56  SCTClusterizationCfg)
57  acc.merge(SCTClusterizationCfg(flags))
58  if flags.InDet.doSplitReco:
59  from InDetConfig.InDetPrepRawDataFormationConfig import (
60  SCTClusterizationPUCfg)
61  acc.merge(SCTClusterizationPUCfg(flags))
62 
63  #
64  # ----------- form SpacePoints from clusters in SCT and Pixels
65  #
66  #
67  from InDetConfig.SiSpacePointFormationConfig import (
68  InDetSiTrackerSpacePointFinderCfg)
69  acc.merge(InDetSiTrackerSpacePointFinderCfg(flags))
70 
71  # this truth must only be done if you do PRD and SpacePointformation
72  # If you only do the latter (== running on ESD) then the needed input (simdata)
73  # is not in ESD but the resulting truth (clustertruth) is already there ...
74  if (flags.InDet.doTruth and
75  (not flags.Detector.EnableSCT or
76  'SCT_SDO_Map' in flags.Input.Collections) and
77  (not flags.Detector.EnablePixel or
78  'PixelSDO_Map' in flags.Input.Collections)):
79 
80  from InDetConfig.InDetTruthAlgsConfig import (
81  InDetPRD_MultiTruthMakerSiCfg)
82  acc.merge(InDetPRD_MultiTruthMakerSiCfg(flags))
83  if flags.InDet.doSplitReco:
84  from InDetConfig.InDetTruthAlgsConfig import (
85  InDetPRD_MultiTruthMakerSiPUCfg)
86  acc.merge(InDetPRD_MultiTruthMakerSiPUCfg(flags))
87 
88  return acc
89 
90 
92  *,
93  previousActsExtension: str = None):
94  acc = ComponentAccumulator()
95  # ------------------------------------------------------------
96  #
97  # ----------- Data-Preparation stage
98  #
99  # ------------------------------------------------------------
100  #
101  # ----------- PrepRawData creation from Raw Data Objects
102  #
103 
104  #
105  # --- Slim BCM RDOs by zero-suppressing
106  #
107  if flags.Detector.EnableBCMPrime:
108  from InDetConfig.BCM_ZeroSuppressionConfig import BCM_ZeroSuppressionCfg
109  acc.merge(BCM_ZeroSuppressionCfg(flags))
110  #
111  # -- Clusterization Algorithms
112  #
113  if flags.Tracking.ActiveConfig.doAthenaCluster:
114  from InDetConfig.InDetPrepRawDataFormationConfig import (
115  AthenaTrkClusterizationCfg)
116  acc.merge(AthenaTrkClusterizationCfg(flags))
117  # if we require HGTD clusters in the ACTS Track reconstruction we have to create the clusters here
118  if flags.Acts.useHGTDClusterInTrackFinding and flags.Detector.EnableHGTD:
119  from HGTD_Config.HGTD_PrepRawDataFormationConfig import PadClusterizationCfg
120  acc.merge(PadClusterizationCfg(flags))
121 
122  if flags.Tracking.ActiveConfig.doActsCluster:
123  # If ACTS clusterization is activated, then schedule RoI creator
124  from ActsConfig.ActsRegionsOfInterestConfig import ActsRegionsOfInterestCreatorAlgCfg
125  acc.merge(ActsRegionsOfInterestCreatorAlgCfg(flags,
126  name=f"{flags.Tracking.ActiveConfig.extension}RegionsOfInterestCreatorAlg"))
127 
128  from ActsConfig.ActsClusterizationConfig import ActsClusterizationCfg
129  acc.merge(ActsClusterizationCfg(flags, previousActsExtension=previousActsExtension))
130 
131  # In case of FPGA-based clusterization, schedule the corresponding data preparation (FPGA/simulation)
132  if flags.Tracking.ActiveConfig.doFPGACluster:
133  if flags.Tracking.ActiveConfig.doFPGATrackSim:
134  from FPGATrackSimConfTools.FPGATrackSimDataPrepConfig import FPGATrackSimClusteringCfg
135  acc.merge(FPGATrackSimClusteringCfg(flags))
136  else:
137  from EFTrackingFPGAPipeline.F100IntegrationConfig import FPGADataPreparation
138  acc.merge(FPGADataPreparation(flags))
139 
140 
141  #
142  # --- Cluster EDM converters
143  #
144  if flags.Tracking.ActiveConfig.doAthenaToActsCluster:
145  #
146  # --- InDet -> xAOD Cluster EDM converter
147  #
148  from InDetConfig.InDetPrepRawDataFormationConfig import (
149  ITkInDetToXAODClusterConversionCfg)
150  acc.merge(ITkInDetToXAODClusterConversionCfg(flags))
151  # if we need HGTD clusters, we convert them as well
152  if flags.Acts.useHGTDClusterInTrackFinding and flags.Detector.EnableHGTD:
153  from InDetConfig.InDetPrepRawDataFormationConfig import HGTDInDetToXAODClusterConversionCfg
154  acc.merge(HGTDInDetToXAODClusterConversionCfg(flags))
155 
156 
157  if flags.Tracking.ActiveConfig.doActsToAthenaCluster:
158  #
159  # --- xAOD -> InDet Cluster EDM converter
160  #
161  from InDetConfig.InDetPrepRawDataFormationConfig import (
162  ITkXAODToInDetClusterConversionCfg)
163  acc.merge(ITkXAODToInDetClusterConversionCfg(flags))
164 
165  #
166  # ----------- form SpacePoints from clusters in SCT and Pixels
167  #
168  if flags.Tracking.ActiveConfig.doAthenaSpacePoint:
169  if flags.Tracking.doITkFastTracking:
170  from InDetConfig.SiSpacePointFormationConfig import (
171  ITkFastSiTrackerSpacePointFinderCfg)
172  acc.merge(ITkFastSiTrackerSpacePointFinderCfg(flags))
173  else:
174  from InDetConfig.SiSpacePointFormationConfig import (
175  ITkSiTrackerSpacePointFinderCfg)
176  acc.merge(ITkSiTrackerSpacePointFinderCfg(flags))
177 
178  if flags.Tracking.ActiveConfig.doFPGASpacePoint:
179  from EFTrackingFPGAIntegration.EFSpacePointFormationConfig import (
180  EFSpacePointFormationCfg)
181  acc.merge(EFSpacePointFormationCfg(flags, previousActsExtension=previousActsExtension))
182 
183  if flags.Tracking.ActiveConfig.doActsSpacePoint:
184  from ActsConfig.ActsSpacePointFormationConfig import (
185  ActsSpacePointFormationCfg)
186  acc.merge(ActsSpacePointFormationCfg(flags, previousActsExtension=previousActsExtension))
187 
188  #
189  # --- Space Point EDM converters
190  #
191  if flags.Tracking.ActiveConfig.doAthenaToActsSpacePoint:
192  #
193  # --- InDet -> xAOD Space Point EDM converter
194  #
195  from InDetConfig.SiSpacePointFormationConfig import (
196  InDetToXAODSpacePointConversionCfg)
197  acc.merge(InDetToXAODSpacePointConversionCfg(flags))
198 
199  # this truth must only be done if you do PRD and SpacePointformation
200  # If you only do the latter (== running on ESD) then the needed input (simdata)
201  # is not in ESD but the resulting truth (clustertruth) is already there ...
202  if flags.Tracking.doTruth:
203  if flags.Tracking.ActiveConfig.doAthenaCluster or flags.Tracking.ActiveConfig.doActsToAthenaCluster:
204  from InDetConfig.InDetTruthAlgsConfig import ITkPRD_MultiTruthMakerSiCfg
205  acc.merge(ITkPRD_MultiTruthMakerSiCfg(flags))
206 
207  if flags.Tracking.ActiveConfig.doActsCluster or flags.Tracking.ActiveConfig.doAthenaToActsCluster or flags.Tracking.ActiveConfig.doFPGACluster:
208  from ActsConfig.ActsTruthConfig import ActsTruthAssociationAlgCfg, ActsTruthParticleHitCountAlgCfg
209  acc.merge(ActsTruthAssociationAlgCfg(flags))
210  acc.merge(ActsTruthParticleHitCountAlgCfg(flags))
211 
212 
213  return acc
214 
215 
216 if __name__ == "__main__":
217  from AthenaConfiguration.AllConfigFlags import initConfigFlags
218  flags = initConfigFlags()
219 
220  from AthenaConfiguration.TestDefaults import defaultTestFiles
221  flags.Input.Files = defaultTestFiles.RDO_RUN2
222 
223  flags.Tracking.doPixelClusterSplitting = True
224 
225  numThreads = 1
226  flags.Concurrency.NumThreads = numThreads
227  flags.Concurrency.NumConcurrentEvents = numThreads
228 
229  flags.lock()
230  flags.dump()
231 
232  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
233  top_acc = MainServicesCfg(flags)
234 
235  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
236  top_acc.merge(PoolReadCfg(flags))
237 
238  top_acc.merge(InDetRecPreProcessingSiliconCfg(flags))
239 
240  iovsvc = top_acc.getService('IOVDbSvc')
241  iovsvc.OutputLevel = 5
242 
243  top_acc.printConfig()
244  top_acc.run(25)
245  top_acc.store(open("test_SiliconPreProcessing.pkl", "wb"))
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.SiSpacePointFormationConfig.InDetSiTrackerSpacePointFinderCfg
def InDetSiTrackerSpacePointFinderCfg(flags, name="InDetSiTrackerSpacePointFinder", **kwargs)
Definition: SiSpacePointFormationConfig.py:63
python.SiliconPreProcessing.InDetRecPreProcessingSiliconCfg
def InDetRecPreProcessingSiliconCfg(flags)
Definition: SiliconPreProcessing.py:5
python.BCM_ZeroSuppressionConfig.BCM_ZeroSuppressionCfg
def BCM_ZeroSuppressionCfg(flags, name="InDetBCM_ZeroSuppression", **kwargs)
Definition: BCM_ZeroSuppressionConfig.py:8
ActsTruthConfig.ActsTruthParticleHitCountAlgCfg
ComponentAccumulator ActsTruthParticleHitCountAlgCfg(flags, str name='ActsTruthParticleHitCountAlg', **dict kwargs)
Definition: ActsTruthConfig.py:86
python.SiSpacePointFormationConfig.ITkFastSiTrackerSpacePointFinderCfg
def ITkFastSiTrackerSpacePointFinderCfg(flags)
Definition: SiSpacePointFormationConfig.py:177
python.SiliconPreProcessing.ITkRecPreProcessingSiliconCfg
def ITkRecPreProcessingSiliconCfg(flags, *str previousActsExtension=None)
Definition: SiliconPreProcessing.py:91
ActsSpacePointFormationConfig.ActsSpacePointFormationCfg
ComponentAccumulator ActsSpacePointFormationCfg(flags, *previousActsExtension=None)
Definition: ActsSpacePointFormationConfig.py:285
EFSpacePointFormationConfig.EFSpacePointFormationCfg
ComponentAccumulator EFSpacePointFormationCfg(flags, previousActsExtension=None, **kwargs)
Definition: EFSpacePointFormationConfig.py:5
python.HGTD_PrepRawDataFormationConfig.PadClusterizationCfg
def PadClusterizationCfg(flags, name="PadClusterizationAlg", **kwargs)
Definition: HGTD_PrepRawDataFormationConfig.py:25
ActsRegionsOfInterestConfig.ActsRegionsOfInterestCreatorAlgCfg
ComponentAccumulator ActsRegionsOfInterestCreatorAlgCfg(flags, str name="ActsRegionsOfInterestCreatorAlg", **kwargs)
Definition: ActsRegionsOfInterestConfig.py:33
python.SiSpacePointFormationConfig.InDetToXAODSpacePointConversionCfg
ComponentAccumulator InDetToXAODSpacePointConversionCfg(flags, str name="InDetToXAODSpacePointConversion", **kwargs)
Definition: SiSpacePointFormationConfig.py:8
F100IntegrationConfig.FPGADataPreparation
def FPGADataPreparation(flags, runStandalone=False)
Definition: F100IntegrationConfig.py:206
BCM_RawDataByteStreamCnvConfig.BCM_RawDataProviderAlgCfg
def BCM_RawDataProviderAlgCfg(flags)
Definition: BCM_RawDataByteStreamCnvConfig.py:7
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:312
python.FPGATrackSimDataPrepConfig.FPGATrackSimClusteringCfg
def FPGATrackSimClusteringCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:548
python.InDetPrepRawDataFormationConfig.PixelClusterizationCfg
def PixelClusterizationCfg(flags, name="InDetPixelClusterization", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:60
python.InDetPrepRawDataFormationConfig.PixelClusterizationPUCfg
def PixelClusterizationPUCfg(flags, name="InDetPixelClusterizationPU", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:82
python.InDetPrepRawDataFormationConfig.ITkInDetToXAODClusterConversionCfg
def ITkInDetToXAODClusterConversionCfg(flags, name="ITkInDetToXAODClusterConversion", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:39
python.InDetPrepRawDataFormationConfig.ITkXAODToInDetClusterConversionCfg
def ITkXAODToInDetClusterConversionCfg(flags, name="ITkXAODToInDetClusterConversion", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:47
ActsClusterizationConfig.ActsClusterizationCfg
ComponentAccumulator ActsClusterizationCfg(flags, *str previousActsExtension=None)
Definition: ActsClusterizationConfig.py:328
python.InDetTruthAlgsConfig.InDetPRD_MultiTruthMakerSiCfg
def InDetPRD_MultiTruthMakerSiCfg(flags, name="InDetPRD_MultiTruthMakerSi", **kwargs)
Definition: InDetTruthAlgsConfig.py:9
Trk::open
@ open
Definition: BinningType.h:40
python.InDetPrepRawDataFormationConfig.AthenaTrkClusterizationCfg
def AthenaTrkClusterizationCfg(flags)
Definition: InDetPrepRawDataFormationConfig.py:338
python.InDetTruthAlgsConfig.ITkPRD_MultiTruthMakerSiCfg
def ITkPRD_MultiTruthMakerSiCfg(flags, name="ITkPRD_MultiTruthMakerSi", **kwargs)
Definition: InDetTruthAlgsConfig.py:94
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.SiSpacePointFormationConfig.ITkSiTrackerSpacePointFinderCfg
def ITkSiTrackerSpacePointFinderCfg(flags, name="ITkSiTrackerSpacePointFinder", **kwargs)
Definition: SiSpacePointFormationConfig.py:125
ActsTruthConfig.ActsTruthAssociationAlgCfg
ComponentAccumulator ActsTruthAssociationAlgCfg(flags, **dict kwargs)
Definition: ActsTruthConfig.py:108
python.InDetTruthAlgsConfig.InDetPRD_MultiTruthMakerSiPUCfg
def InDetPRD_MultiTruthMakerSiPUCfg(flags, name="InDetPRD_MultiTruthMakerSiPU", **kwargs)
Definition: InDetTruthAlgsConfig.py:50
python.InDetPrepRawDataFormationConfig.SCTClusterizationPUCfg
def SCTClusterizationPUCfg(flags, name="InDetSCT_ClusterizationPU", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:181
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:71
python.InDetPrepRawDataFormationConfig.HGTDInDetToXAODClusterConversionCfg
def HGTDInDetToXAODClusterConversionCfg(flags, name="HGTDInDetToXAODClusterConversion", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:26
python.InDetPrepRawDataFormationConfig.SCTClusterizationCfg
def SCTClusterizationCfg(flags, name="InDetSCT_Clusterization", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:154