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 
5 
8  # ------------------------------------------------------------
9  #
10  # ----------- Data-Preparation stage
11  #
12  # ------------------------------------------------------------
13  #
14  # ----------- PrepRawData creation from Raw Data Objects
15  #
16 
17  #
18  # --- Slim BCM RDOs by zero-suppressing
19  #
20  if flags.Detector.EnableBCM:
21  if flags.Input.Format is Format.BS:
22  from BCM_RawDataByteStreamCnv.BCM_RawDataByteStreamCnvConfig import (
23  BCM_RawDataProviderAlgCfg)
24  acc.merge(BCM_RawDataProviderAlgCfg(flags))
25  from InDetConfig.BCM_ZeroSuppressionConfig import BCM_ZeroSuppressionCfg
26  acc.merge(BCM_ZeroSuppressionCfg(flags))
27 
28  #
29  # -- Pixel Clusterization
30  #
31  if (flags.Detector.EnablePixel and
32  (flags.Input.Format is Format.BS
33  or 'PixelRDOs' in flags.Input.Collections)):
34 
35  #
36  # --- PixelClusterization algorithm
37  #
38  from InDetConfig.InDetPrepRawDataFormationConfig import (
39  PixelClusterizationCfg)
40  acc.merge(PixelClusterizationCfg(flags))
41  if flags.InDet.doSplitReco:
42  from InDetConfig.InDetPrepRawDataFormationConfig import (
43  PixelClusterizationPUCfg)
44  acc.merge(PixelClusterizationPUCfg(flags))
45  #
46  # --- SCT Clusterization
47  #
48  if (flags.Detector.EnableSCT and
49  (flags.Input.Format is Format.BS
50  or '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 
118  if flags.Tracking.ActiveConfig.doActsCluster:
119  # If ACTS clusterization is activated, then schedule RoI creator
120  from ActsConfig.ActsRegionsOfInterestConfig import ActsRegionsOfInterestCreatorAlgCfg
121  acc.merge(ActsRegionsOfInterestCreatorAlgCfg(flags,
122  name=f"{flags.Tracking.ActiveConfig.extension}RegionsOfInterestCreatorAlg"))
123 
124  from ActsConfig.ActsClusterizationConfig import ActsClusterizationCfg
125  acc.merge(ActsClusterizationCfg(flags, previousActsExtension=previousActsExtension))
126 
127  #
128  # --- Cluster EDM converters
129  #
130  if flags.Tracking.ActiveConfig.doAthenaToActsCluster:
131  #
132  # --- InDet -> xAOD Cluster EDM converter
133  #
134  from InDetConfig.InDetPrepRawDataFormationConfig import (
135  ITkInDetToXAODClusterConversionCfg)
136  acc.merge(ITkInDetToXAODClusterConversionCfg(flags))
137 
138  if flags.Tracking.ActiveConfig.doActsToAthenaCluster:
139  #
140  # --- xAOD -> InDet Cluster EDM converter
141  #
142  from InDetConfig.InDetPrepRawDataFormationConfig import (
143  ITkXAODToInDetClusterConversionCfg)
144  acc.merge(ITkXAODToInDetClusterConversionCfg(flags))
145 
146  #
147  # ----------- form SpacePoints from clusters in SCT and Pixels
148  #
149  if flags.Tracking.ActiveConfig.doAthenaSpacePoint:
150  if flags.Tracking.doITkFastTracking:
151  from InDetConfig.SiSpacePointFormationConfig import (
152  ITkFastSiTrackerSpacePointFinderCfg)
153  acc.merge(ITkFastSiTrackerSpacePointFinderCfg(flags))
154  else:
155  from InDetConfig.SiSpacePointFormationConfig import (
156  ITkSiTrackerSpacePointFinderCfg)
157  acc.merge(ITkSiTrackerSpacePointFinderCfg(flags))
158 
159  if flags.Tracking.ActiveConfig.doActsSpacePoint:
160  from ActsConfig.ActsSpacePointFormationConfig import (
161  ActsSpacePointFormationCfg)
162  acc.merge(ActsSpacePointFormationCfg(flags, previousActsExtension=previousActsExtension))
163 
164  #
165  # --- Space Point EDM converters
166  #
167  if flags.Tracking.ActiveConfig.doAthenaToActsSpacePoint:
168  #
169  # --- InDet -> xAOD Space Point EDM converter
170  #
171  from InDetConfig.SiSpacePointFormationConfig import (
172  InDetToXAODSpacePointConversionCfg)
173  acc.merge(InDetToXAODSpacePointConversionCfg(flags))
174 
175  # this truth must only be done if you do PRD and SpacePointformation
176  # If you only do the latter (== running on ESD) then the needed input (simdata)
177  # is not in ESD but the resulting truth (clustertruth) is already there ...
178  if flags.Tracking.doTruth:
179  if flags.Tracking.ActiveConfig.doAthenaCluster or flags.Tracking.ActiveConfig.doActsToAthenaCluster:
180  from InDetConfig.InDetTruthAlgsConfig import ITkPRD_MultiTruthMakerSiCfg
181  acc.merge(ITkPRD_MultiTruthMakerSiCfg(flags))
182 
183  if flags.Tracking.ActiveConfig.doActsCluster or flags.Tracking.ActiveConfig.doAthenaToActsCluster:
184  from ActsConfig.ActsTruthConfig import ActsTruthAssociationAlgCfg, ActsTruthParticleHitCountAlgCfg
185  acc.merge(ActsTruthAssociationAlgCfg(flags))
186  acc.merge(ActsTruthParticleHitCountAlgCfg(flags))
187 
188 
189  return acc
190 
191 
192 if __name__ == "__main__":
193  from AthenaConfiguration.AllConfigFlags import initConfigFlags
194  flags = initConfigFlags()
195 
196  from AthenaConfiguration.TestDefaults import defaultTestFiles
197  flags.Input.Files = defaultTestFiles.RDO_RUN2
198 
199  flags.Tracking.doPixelClusterSplitting = True
200 
201  numThreads = 1
202  flags.Concurrency.NumThreads = numThreads
203  flags.Concurrency.NumConcurrentEvents = numThreads
204 
205  flags.lock()
206  flags.dump()
207 
208  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
209  top_acc = MainServicesCfg(flags)
210 
211  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
212  top_acc.merge(PoolReadCfg(flags))
213 
214  top_acc.merge(InDetRecPreProcessingSiliconCfg(flags))
215 
216  iovsvc = top_acc.getService('IOVDbSvc')
217  iovsvc.OutputLevel = 5
218 
219  top_acc.printConfig()
220  top_acc.run(25)
221  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:62
python.SiliconPreProcessing.InDetRecPreProcessingSiliconCfg
def InDetRecPreProcessingSiliconCfg(flags)
Definition: SiliconPreProcessing.py:6
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:69
python.SiSpacePointFormationConfig.ITkFastSiTrackerSpacePointFinderCfg
def ITkFastSiTrackerSpacePointFinderCfg(flags)
Definition: SiSpacePointFormationConfig.py:174
python.SiliconPreProcessing.ITkRecPreProcessingSiliconCfg
def ITkRecPreProcessingSiliconCfg(flags, *str previousActsExtension=None)
Definition: SiliconPreProcessing.py:91
ActsSpacePointFormationConfig.ActsSpacePointFormationCfg
ComponentAccumulator ActsSpacePointFormationCfg(flags, *previousActsExtension=None)
Definition: ActsSpacePointFormationConfig.py:241
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
BCM_RawDataByteStreamCnvConfig.BCM_RawDataProviderAlgCfg
def BCM_RawDataProviderAlgCfg(flags)
Definition: BCM_RawDataByteStreamCnvConfig.py:7
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
python.InDetPrepRawDataFormationConfig.PixelClusterizationCfg
def PixelClusterizationCfg(flags, name="InDetPixelClusterization", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:38
python.InDetPrepRawDataFormationConfig.PixelClusterizationPUCfg
def PixelClusterizationPUCfg(flags, name="InDetPixelClusterizationPU", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:62
python.InDetPrepRawDataFormationConfig.ITkInDetToXAODClusterConversionCfg
def ITkInDetToXAODClusterConversionCfg(flags, name="ITkInDetToXAODClusterConversion", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:19
python.InDetPrepRawDataFormationConfig.ITkXAODToInDetClusterConversionCfg
def ITkXAODToInDetClusterConversionCfg(flags, name="ITkXAODToInDetClusterConversion", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:26
ActsClusterizationConfig.ActsClusterizationCfg
ComponentAccumulator ActsClusterizationCfg(flags, *str previousActsExtension=None)
Definition: ActsClusterizationConfig.py:280
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:305
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:124
ActsTruthConfig.ActsTruthAssociationAlgCfg
ComponentAccumulator ActsTruthAssociationAlgCfg(flags, **dict kwargs)
Definition: ActsTruthConfig.py:89
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:161
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.InDetPrepRawDataFormationConfig.SCTClusterizationCfg
def SCTClusterizationCfg(flags, name="InDetSCT_Clusterization", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:132