ATLAS Offline Software
HitAnalysisConfig.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 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 
7 def HitAnalysisOutputCfg(flags, output_name='SiHitAnalysis'):
9 
10  histsvc = CompFactory.THistSvc(name="THistSvc",
11  Output=[ f"{output_name} DATAFILE='{flags.Output.HISTFileName}' OPT='RECREATE'" ])
12  acc.addService(histsvc)
13 
14  return acc
15 
16 
17 def BLMHitAnalysisCfg(flags, name='BLMHitAnalysis', **kwargs):
18  from PixelGeoModel.PixelGeoModelConfig import PixelSimulationGeometryCfg
19  acc = PixelSimulationGeometryCfg(flags)
20 
21  kwargs.setdefault('CollectionName', 'BLM_Hits')
22  kwargs.setdefault('HistPath', '/SiHitAnalysis/')
23  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
24 
25  acc.merge(HitAnalysisOutputCfg(flags))
26 
27  return acc
28 
29 
30 def BCMHitAnalysisCfg(flags, name='BCMHitAnalysis', **kwargs):
31  from PixelGeoModel.PixelGeoModelConfig import PixelSimulationGeometryCfg
32  acc = PixelSimulationGeometryCfg(flags)
33 
34  kwargs.setdefault('CollectionName', 'BCM_Hits')
35  kwargs.setdefault('HistPath', '/SiHitAnalysis/')
36  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
37 
38  acc.merge(HitAnalysisOutputCfg(flags))
39 
40  return acc
41 
42 
43 def PixelHitAnalysisCfg(flags, name='PixelHitAnalysis', **kwargs):
44  from PixelGeoModel.PixelGeoModelConfig import PixelSimulationGeometryCfg
45  acc = PixelSimulationGeometryCfg(flags)
46 
47  kwargs.setdefault('CollectionName', 'PixelHits')
48  kwargs.setdefault('HistPath', '/SiHitAnalysis/')
49  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
50 
51  acc.merge(HitAnalysisOutputCfg(flags))
52 
53  return acc
54 
55 
56 def SCTHitAnalysisCfg(flags, name='SCTHitAnalysis', **kwargs):
57  from SCT_GeoModel.SCT_GeoModelConfig import SCT_SimulationGeometryCfg
58  acc = SCT_SimulationGeometryCfg(flags)
59 
60  kwargs.setdefault('CollectionName', 'SCT_Hits')
61  kwargs.setdefault('HistPath', '/SiHitAnalysis/')
62  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
63 
64  acc.merge(HitAnalysisOutputCfg(flags))
65 
66  return acc
67 
68 
69 def TRTHitAnalysisCfg(flags, name='TRTHitAnalysis', **kwargs):
70  from TRT_GeoModel.TRT_GeoModelConfig import TRT_SimulationGeometryCfg
71  acc = TRT_SimulationGeometryCfg(flags)
72 
73  kwargs.setdefault('HistPath', '/TRTHitAnalysis/')
74  acc.addEventAlgo(CompFactory.TRTHitAnalysis(name, **kwargs))
75 
76  acc.merge(HitAnalysisOutputCfg(flags, output_name="TRTHitAnalysis"))
77 
78  return acc
79 
80 
81 def ITkPixelHitAnalysisCfg(flags, name='ITkPixelHitAnalysis', **kwargs):
82  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelSimulationGeometryCfg
84 
85  kwargs.setdefault('CollectionName', 'ITkPixelHits')
86  kwargs.setdefault('HistPath', '/SiHitAnalysis/histos/')
87  kwargs.setdefault('NtuplePath', '/SiHitAnalysis/ntuples/')
88  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
89 
90  acc.merge(HitAnalysisOutputCfg(flags))
91 
92  return acc
93 
94 
95 def ITkStripHitAnalysisCfg(flags, name='ITkStripHitAnalysis', **kwargs):
96  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripSimulationGeometryCfg
98 
99  kwargs.setdefault('CollectionName', 'ITkStripHits')
100  kwargs.setdefault('HistPath', '/SiHitAnalysis/histos/')
101  kwargs.setdefault('NtuplePath', '/SiHitAnalysis/ntuples/')
102  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
103 
104  acc.merge(HitAnalysisOutputCfg(flags))
105 
106  return acc
107 
108 
109 def HGTD_HitAnalysisCfg(flags, name='HGTD_HitAnalysis', **kwargs):
110  if flags.HGTD.Geometry.useGeoModelXml:
111  from HGTD_GeoModelXml.HGTD_GeoModelConfig import HGTD_SimulationGeometryCfg
112  else:
113  from HGTD_GeoModel.HGTD_GeoModelConfig import HGTD_SimulationGeometryCfg
114  acc = HGTD_SimulationGeometryCfg(flags)
115 
116  kwargs.setdefault('CollectionName', 'HGTD_Hits')
117  kwargs.setdefault('HistPath', '/SiHitAnalysis/histos/')
118  kwargs.setdefault('NtuplePath', '/SiHitAnalysis/ntuples/')
119  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
120 
121  acc.merge(HitAnalysisOutputCfg(flags))
122 
123  return acc
124 
125 
126 def PLR_HitAnalysisCfg(flags, name='PLR_HitAnalysis', **kwargs):
127  from PLRGeoModelXml.PLR_GeoModelConfig import PLR_GeometryCfg
128  acc = PLR_GeometryCfg(flags)
129 
130  kwargs.setdefault('CollectionName', 'PLR_Hits')
131  kwargs.setdefault('HistPath', '/SiHitAnalysis/histos/')
132  kwargs.setdefault('NtuplePath', '/SiHitAnalysis/ntuples/')
133  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
134 
135  acc.merge(HitAnalysisOutputCfg(flags))
136 
137  return acc
138 
139 
140 def BCMPrimeHitAnalysisCfg(flags, name='BCMPrimeHitAnalysis', **kwargs):
141  from BCMPrimeGeoModelXml.BCMPrimeGeoModelConfig import BCMPrimeGeometryCfg
142  acc = BCMPrimeGeometryCfg(flags)
143 
144  kwargs.setdefault('CollectionName', 'BCMPrimeHits')
145  kwargs.setdefault('HistPath', '/SiHitAnalysis/histos/')
146  kwargs.setdefault('NtuplePath', '/SiHitAnalysis/ntuples/')
147  acc.addEventAlgo(CompFactory.SiHitAnalysis(name, **kwargs))
148 
149  acc.merge(HitAnalysisOutputCfg(flags))
150 
151  return acc
152 
153 
154 def SiHitAnalysisCfg(flags):
155  acc = ComponentAccumulator()
156 
157  if flags.Detector.EnableITkPixel:
158  acc.merge(ITkPixelHitAnalysisCfg(flags))
159 
160  if flags.Detector.EnableITkStrip:
161  acc.merge(ITkStripHitAnalysisCfg(flags))
162 
163  if flags.Detector.EnableHGTD:
164  acc.merge(HGTD_HitAnalysisCfg(flags))
165 
166  if flags.Detector.EnablePLR:
167  acc.merge(PLR_HitAnalysisCfg(flags))
168 
169  if flags.Detector.EnableBCMPrime:
170  acc.merge(BCMPrimeHitAnalysisCfg(flags))
171 
172  return acc
173 
174 
175 # Calorimeter
176 def CaloHitAnalysisCfg(flags, name='CaloHitAnalysis', **kwargs):
177  acc = ComponentAccumulator()
178 
179  if flags.Detector.GeometryLAr:
180  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
181  acc.merge(LArGMCfg(flags))
182  kwargs.setdefault("UseLAr", flags.Detector.GeometryLAr)
183 
184  if flags.Detector.GeometryTile:
185  from TileGeoModel.TileGMConfig import TileGMCfg
186  acc.merge(TileGMCfg(flags))
187  kwargs.setdefault("UseTile", flags.Detector.GeometryTile)
188 
189  kwargs.setdefault('HistPath', f'/{name}/')
190  acc.addEventAlgo(CompFactory.CaloHitAnalysis(name, **kwargs))
191  acc.merge(HitAnalysisOutputCfg(flags, output_name=name))
192  return acc
193 
194 
195 # Muon System
196 def RPCHitAnalysisCfg(flags, name='RPCHitAnalysis', **kwargs):
197  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
198  acc = MuonGeoModelCfg(flags)
199 
200  kwargs.setdefault('HistPath', f'/{name}/')
201  acc.addEventAlgo(CompFactory.RPCHitAnalysis(name, **kwargs))
202  acc.merge(HitAnalysisOutputCfg(flags, output_name="RPCHitAnalysis"))
203 
204  return acc
205 
206 
207 def MDTHitAnalysisCfg(flags, name='MDTHitAnalysis', **kwargs):
208  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
209  acc = MuonGeoModelCfg(flags)
210 
211  kwargs.setdefault('HistPath', f'/{name}/')
212  acc.addEventAlgo(CompFactory.MDTHitAnalysis(name, **kwargs))
213  acc.merge(HitAnalysisOutputCfg(flags, output_name="MDTHitAnalysis"))
214 
215  return acc
216 
217 
218 def CSCHitAnalysisCfg(flags, name='CSCHitAnalysis', **kwargs):
219  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
220  acc = MuonGeoModelCfg(flags)
221 
222  kwargs.setdefault('HistPath', f'/{name}/')
223  acc.addEventAlgo(CompFactory.CSCHitAnalysis(name, **kwargs))
224  acc.merge(HitAnalysisOutputCfg(flags, output_name="CSCHitAnalysis"))
225 
226  return acc
227 
228 
229 def TGCHitAnalysisCfg(flags, name='TGCHitAnalysis', **kwargs):
230  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
231  acc = MuonGeoModelCfg(flags)
232 
233  kwargs.setdefault('HistPath', f'/{name}/')
234  acc.addEventAlgo(CompFactory.TGCHitAnalysis(name, **kwargs))
235  acc.merge(HitAnalysisOutputCfg(flags, output_name="TGCHitAnalysis"))
236 
237  return acc
238 
239 
240 def MMHitAnalysisCfg(flags, name='MMHitAnalysis', **kwargs):
241  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
242  acc = MuonGeoModelCfg(flags)
243 
244  kwargs.setdefault('HistPath', f'/{name}/')
245  acc.addEventAlgo(CompFactory.MMHitAnalysis(name, **kwargs))
246  acc.merge(HitAnalysisOutputCfg(flags, output_name="MMHitAnalysis"))
247 
248  return acc
249 
250 
251 def sTGCHitAnalysisCfg(flags, name='sTGCHitAnalysis', **kwargs):
252  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
253  acc = MuonGeoModelCfg(flags)
254 
255  kwargs.setdefault('HistPath', f'/{name}/')
256  acc.addEventAlgo(CompFactory.sTGCHitAnalysis(name, **kwargs))
257  acc.merge(HitAnalysisOutputCfg(flags, output_name="sTGCHitAnalysis"))
258 
259  return acc
260 
261 
262 # Forward
263 def ALFAHitAnalysisCfg(flags, name='ALFAHitAnalysis', **kwargs):
264  acc = ComponentAccumulator()
265 
266  kwargs.setdefault('HistPath', f'/{name}/')
267  acc.addEventAlgo(CompFactory.ALFAHitAnalysis(name, **kwargs))
268  acc.merge(HitAnalysisOutputCfg(flags, output_name="ALFAHitAnalysis"))
269 
270  return acc
271 
272 
273 def AFPHitAnalysisCfg(flags, name='AFPHitAnalysis', **kwargs):
274  acc = ComponentAccumulator()
275 
276  kwargs.setdefault('HistPath', f'/{name}/')
277  acc.addEventAlgo(CompFactory.AFPHitAnalysis(name, **kwargs))
278  acc.merge(HitAnalysisOutputCfg(flags, output_name="AFPHitAnalysis"))
279 
280  return acc
281 
282 
283 def LucidHitAnalysisCfg(flags, name='LucidHitAnalysis', **kwargs):
284  acc = ComponentAccumulator()
285 
286  kwargs.setdefault('HistPath', f'/{name}/')
287  acc.addEventAlgo(CompFactory.LucidHitAnalysis(name, **kwargs))
288  acc.merge(HitAnalysisOutputCfg(flags, output_name="LucidHitAnalysis"))
289 
290  return acc
291 
292 
293 def ZDCHitAnalysisCfg(flags, name='ZDCHitAnalysis', **kwargs):
294  acc = ComponentAccumulator()
295 
296  kwargs.setdefault('HistPath', f'/{name}/')
297  acc.addEventAlgo(CompFactory.ZDCHitAnalysis(name, **kwargs))
298  acc.merge(HitAnalysisOutputCfg(flags, output_name="ZDCHitAnalysis"))
299 
300  return acc
301 
302 
303 #Truth
304 def TrackRecordAnalysisCfg(flags, name='TrackRecordAnalysis', **kwargs):
305  acc = ComponentAccumulator()
306 
307  kwargs.setdefault('HistPath', f'/{name}/')
308  acc.addEventAlgo(CompFactory.TrackRecordAnalysis(name, **kwargs))
309  acc.merge(HitAnalysisOutputCfg(flags, output_name="TrackRecordAnalysis"))
310 
311  return acc
312 
313 
314 def TruthHitAnalysisCfg(flags, name='TruthHitAnalysis', **kwargs):
315  acc = ComponentAccumulator()
316 
317  kwargs.setdefault('HistPath', f'/{name}/')
318  acc.addEventAlgo(CompFactory.TruthHitAnalysis(name, **kwargs))
319  acc.merge(HitAnalysisOutputCfg(flags, output_name="TruthHitAnalysis"))
320 
321  return acc
python.HitAnalysisConfig.AFPHitAnalysisCfg
def AFPHitAnalysisCfg(flags, name='AFPHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:273
PLR_GeoModelConfig.PLR_GeometryCfg
def PLR_GeometryCfg(flags)
Definition: PLR_GeoModelConfig.py:3
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.HitAnalysisConfig.SCTHitAnalysisCfg
def SCTHitAnalysisCfg(flags, name='SCTHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:56
python.HitAnalysisConfig.MMHitAnalysisCfg
def MMHitAnalysisCfg(flags, name='MMHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:240
python.HitAnalysisConfig.BLMHitAnalysisCfg
def BLMHitAnalysisCfg(flags, name='BLMHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:17
python.HitAnalysisConfig.TRTHitAnalysisCfg
def TRTHitAnalysisCfg(flags, name='TRTHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:69
python.HitAnalysisConfig.BCMHitAnalysisCfg
def BCMHitAnalysisCfg(flags, name='BCMHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:30
python.HitAnalysisConfig.TGCHitAnalysisCfg
def TGCHitAnalysisCfg(flags, name='TGCHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:229
python.HitAnalysisConfig.ALFAHitAnalysisCfg
def ALFAHitAnalysisCfg(flags, name='ALFAHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:263
python.HitAnalysisConfig.TruthHitAnalysisCfg
def TruthHitAnalysisCfg(flags, name='TruthHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:314
ITkPixelGeoModelConfig.ITkPixelSimulationGeometryCfg
def ITkPixelSimulationGeometryCfg(flags)
Definition: ITkPixelGeoModelConfig.py:32
PixelGeoModelConfig.PixelSimulationGeometryCfg
def PixelSimulationGeometryCfg(flags)
Definition: PixelGeoModelConfig.py:44
python.HitAnalysisConfig.PixelHitAnalysisCfg
def PixelHitAnalysisCfg(flags, name='PixelHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:43
python.HitAnalysisConfig.LucidHitAnalysisCfg
def LucidHitAnalysisCfg(flags, name='LucidHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:283
python.HitAnalysisConfig.ITkStripHitAnalysisCfg
def ITkStripHitAnalysisCfg(flags, name='ITkStripHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:95
python.HitAnalysisConfig.HGTD_HitAnalysisCfg
def HGTD_HitAnalysisCfg(flags, name='HGTD_HitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:109
python.HitAnalysisConfig.MDTHitAnalysisCfg
def MDTHitAnalysisCfg(flags, name='MDTHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:207
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.HitAnalysisConfig.sTGCHitAnalysisCfg
def sTGCHitAnalysisCfg(flags, name='sTGCHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:251
python.HitAnalysisConfig.PLR_HitAnalysisCfg
def PLR_HitAnalysisCfg(flags, name='PLR_HitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:126
python.HitAnalysisConfig.HitAnalysisOutputCfg
def HitAnalysisOutputCfg(flags, output_name='SiHitAnalysis')
Definition: HitAnalysisConfig.py:7
BCMPrimeGeoModelConfig.BCMPrimeGeometryCfg
def BCMPrimeGeometryCfg(flags)
Definition: BCMPrimeGeoModelConfig.py:6
SCT_GeoModelConfig.SCT_SimulationGeometryCfg
def SCT_SimulationGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:43
python.HitAnalysisConfig.TrackRecordAnalysisCfg
def TrackRecordAnalysisCfg(flags, name='TrackRecordAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:304
python.HitAnalysisConfig.BCMPrimeHitAnalysisCfg
def BCMPrimeHitAnalysisCfg(flags, name='BCMPrimeHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:140
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
python.HitAnalysisConfig.SiHitAnalysisCfg
def SiHitAnalysisCfg(flags)
Definition: HitAnalysisConfig.py:154
python.HitAnalysisConfig.CaloHitAnalysisCfg
def CaloHitAnalysisCfg(flags, name='CaloHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:176
TRT_GeoModelConfig.TRT_SimulationGeometryCfg
def TRT_SimulationGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:51
python.HitAnalysisConfig.RPCHitAnalysisCfg
def RPCHitAnalysisCfg(flags, name='RPCHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:196
python.HitAnalysisConfig.ITkPixelHitAnalysisCfg
def ITkPixelHitAnalysisCfg(flags, name='ITkPixelHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:81
ITkStripGeoModelConfig.ITkStripSimulationGeometryCfg
def ITkStripSimulationGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:32
HGTD_GeoModelConfig.HGTD_SimulationGeometryCfg
def HGTD_SimulationGeometryCfg(flags)
Definition: python/HGTD_GeoModelConfig.py:17
python.HitAnalysisConfig.CSCHitAnalysisCfg
def CSCHitAnalysisCfg(flags, name='CSCHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:218
python.HitAnalysisConfig.ZDCHitAnalysisCfg
def ZDCHitAnalysisCfg(flags, name='ZDCHitAnalysis', **kwargs)
Definition: HitAnalysisConfig.py:293
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7