ATLAS Offline Software
Loading...
Searching...
No Matches
L1TopoSimulationConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
6
8
9 acc = ComponentAccumulator()
10
11 from L1TopoSimulation.L1TopoInputHistograms import configureEMTauInputProviderHistograms, configureEnergyInputProviderHistograms, configureJetInputProviderHistograms
12 emtauProvider = CompFactory.LVL1.EMTauInputProvider("EMTauInputProvider")
13 emtauProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
14 emtauProvider.MonTool.HistPath = 'L1LegacyTopoSimulation/EMTauInputProvider'
15 configureEMTauInputProviderHistograms(emtauProvider, flags)
16 energyProvider = CompFactory.LVL1.EnergyInputProvider("EnergyInputProvider")
17 energyProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
18 energyProvider.MonTool.HistPath = 'L1LegacyTopoSimulation/EnergyInputProvider'
19 configureEnergyInputProviderHistograms(energyProvider, flags)
20 jetProvider = CompFactory.LVL1.JetInputProvider("JetInputProvider")
21 jetProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
22 jetProvider.MonTool.HistPath = 'L1LegacyTopoSimulation/JetInputProvider'
23 configureJetInputProviderHistograms(jetProvider, flags)
24
25 topoSimAlg = CompFactory.LVL1.L1TopoSimulation("L1LegacyTopoSimulation",
26 EMTAUInputProvider = emtauProvider,
27 JetInputProvider = jetProvider,
28 EnergyInputProvider = energyProvider,
29 IsLegacyTopo = True,
30 InputDumpFile = "inputdump_legacy.txt",
31 EnableInputDump = flags.Trigger.enableL1TopoDump,
32 UseBitwise = flags.Trigger.enableL1TopoBWSimulation,
33 MonHistBaseDir = "L1/L1LegacyTopoAlgorithms"
34 )
35
36 # No muon inputs to legacy Topo
37 topoSimAlg.MuonInputProvider.locationMuCTPItoL1Topo = ""
38 topoSimAlg.MuonInputProvider.locationMuCTPItoL1Topo1 = ""
39 topoSimAlg.MuonInputProvider.locationMuonRoI = ""
40 topoSimAlg.MuonInputProvider.locationMuonRoI1 = ""
41 topoSimAlg.MuonInputProvider.ROIBResultLocation = ""
42
43 acc.addEventAlgo(topoSimAlg)
44 return acc
45
46def L1TopoSimulationCfg(flags, doMonitoring=True, readMuCTPI=False, name="L1TopoSimulation", deactivateL1TopoMuons=False, useMuonRoIs=False, useMuonDecoder=False, writeMuonRoIs = True):
47
48 acc = ComponentAccumulator()
49
50 decoderTools = []
51 maybeMissingRobs = []
52
53 #Configure the MuonInputProvider
54 muProvider=""
55
56 if flags.Trigger.L1.doMuon and not deactivateL1TopoMuons:
57 muProvider = CompFactory.LVL1.MuonInputProvider("MuonInputProvider")
58
59 """
60 If muons coming from the decoding, we use MuonRoI, otherwise MuCTPIL1Topo
61 So here we should be adding proper flag for P1, and when input file is RAW
62 Simply, if muons are simulated, we will use MuCTPIL1Topo, if decoded MuonRoI
63 """
64
65 if readMuCTPI:
66 muProvider.locationMuCTPItoL1Topo = ""
67 muProvider.locationMuCTPItoL1Topo1 = ""
68 muProvider.locationMuonRoI = "L1MuCTPItoL1TopoLocationFromMuonRoI"
69 muProvider.locationMuonRoI1 = "L1MuCTPItoL1TopoLocationFromMuonRoI1"
70 if useMuonRoIs:
71 muProvider.locationMuonRoI = "LVL1MuonRoIs"
72 muProvider.locationMuonRoI1 = "LVL1MuonRoIsBCp1"
73 else:
74 muProvider.locationMuonRoI = ""
75 muProvider.locationMuonRoI1 = ""
76
77 #Configure the MuonRoiTools for the MIP
78 from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import RPCRecRoiToolCfg, TGCRecRoiToolCfg
79 muProvider.RecRpcRoiTool = acc.popToolsAndMerge(RPCRecRoiToolCfg(flags))
80 muProvider.RecTgcRoiTool = acc.popToolsAndMerge(TGCRecRoiToolCfg(flags))
81
82 if useMuonDecoder:
83 from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg,TgcBytestreamDecodeCfg
84 acc.merge(RpcBytestreamDecodeCfg(flags))
85 acc.merge(TgcBytestreamDecodeCfg(flags))
86 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import MuonRoIByteStreamToolCfg
87 muonRoiTool = acc.popToolsAndMerge(MuonRoIByteStreamToolCfg(flags, name="L1MuonBSDecoderToolInL1Topo", writeBS=False, writeDecodedMuonRoIs = writeMuonRoIs))
88 decoderTools += [muonRoiTool]
89 #maybeMissingRobs += muonRoiTool.ROBIDs
90
91 emtauProvider = ""
92 jetProvider = ""
93 energyProvider = ""
94
95 if flags.Trigger.L1.doeFex:
96 emtauProvider = CompFactory.LVL1.eFexInputProvider("eFexInputProvider")
97 if flags.Trigger.L1.dojFex:
98 jetProvider = CompFactory.LVL1.jFexInputProvider("jFexInputProvider")
99 if flags.Trigger.L1.dogFex:
100 energyProvider = CompFactory.LVL1.gFexInputProvider("gFexInputProvider")
101
102 controlHistSvc = CompFactory.LVL1.ControlHistSvc("ControlHistSvc")
103
104 IsData = True
105 if flags.Input.isMC:
106 IsData = False
107
108 from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoPhase1ByteStreamToolCfg
109 l1topoBSTool = acc.popToolsAndMerge(L1TopoPhase1ByteStreamToolCfg(flags, "L1TopoBSDecoderTool"))
110 decoderTools += [l1topoBSTool]
111 maybeMissingRobs += l1topoBSTool.ROBIDs
112
113 if IsData:
114 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name="L1TriggerByteStreamDecoder",
115 DecoderTools=decoderTools,
116 MaybeMissingROBs=maybeMissingRobs)
117
118 acc.addEventAlgo(decoderAlg, sequenceName='AthAlgSeq')
119
120 if not flags.Trigger.enableL1CaloPhase1:
121 if (emtauProvider != ""):
122 emtauProvider.eFexEMRoIKey = ""
123 emtauProvider.eFexTauRoIKey = ""
124 if (jetProvider != ""):
125 jetProvider.jFexSRJetRoIKey = ""
126 jetProvider.jFexLRJetRoIKey = ""
127 jetProvider.jFexFwdElRoIKey = ""
128 jetProvider.jFexTauRoIKey = ""
129 jetProvider.jFexMETRoIKey = ""
130 jetProvider.jFexSumETRoIKey = ""
131 jetProvider.gMETComponentsJwojKey = "" #used for cXE, would not be valid without both, jFEX+gFEX inputs
132 if (energyProvider != ""):
133 energyProvider.gFexSRJetRoIKey = ""
134 energyProvider.gFexLRJetRoIKey = ""
135 energyProvider.gMETComponentsJwojKey = ""
136 energyProvider.gMHTComponentsJwojKey = ""
137 energyProvider.gMETComponentsNoiseCutKey = ""
138 energyProvider.gMETComponentsRmsKey = ""
139 energyProvider.gScalarEJwojKey = ""
140 energyProvider.gEspressoKey = ""
141 energyProvider.gRistrettoKey = ""
142
143 if (jetProvider != "") and (energyProvider != ""):
144 #both, j+gFEX are available, ensure they use consistent keys for gFEX JwoJ MET
145 jetProvider.gMETComponentsJwojKey = energyProvider.gMETComponentsJwojKey
146
147 topoSimAlg = CompFactory.LVL1.L1TopoSimulation(name,
148 MuonInputProvider = muProvider,
149 EMTAUInputProvider = emtauProvider,
150 JetInputProvider = jetProvider,
151 EnergyInputProvider = energyProvider,
152 ControlHistSvc = controlHistSvc, # if doMonitoring else "",
153 IsLegacyTopo = False,
154 doMonitoring = doMonitoring,
155 EnableInputDump = flags.Trigger.enableL1TopoDump,
156 UseBitwise = flags.Trigger.enableL1TopoBWSimulation
157 )
158 if name!="L1TopoSimulation":
159 topoSimAlg.MonHistBaseDir = "L1/OnlineL1TopoAlgorithms"
160
161 acc.addEventAlgo(topoSimAlg)
162
163
164 if doMonitoring:
165 from L1TopoOnlineMonitoring import L1TopoOnlineMonitoringConfig as TopoMonConfig
166 if name=="L1TopoSimulation":
167 acc.addEventAlgo(TopoMonConfig.getL1TopoPhase1OnlineMonitor(flags,'L1/L1TopoSimDecisions',
168 doHwMon=IsData,doComp=IsData, doMultComp=IsData))
169 else:
170 acc.addEventAlgo(TopoMonConfig.getL1TopoPhase1OnlineMonitor(flags,'L1/OnlineL1TopoSimDecisions',
171 toolName=name+"_Monitor",
172 doHwMon=IsData,doComp=IsData, doMultComp=IsData))
173
174 return acc
175
176def L1TopoSimulationStandaloneCfg(flags, outputEDM=[], doMuons = False, doMonitoring=True):
177
178 acc = ComponentAccumulator()
179
180 efex_provider_attr = ['eFexEMRoI','eFexTauRoI']
181 jfex_provider_attr = ['jFexSRJetRoI','jFexLRJetRoI','jFexFwdElRoI','jFexTauRoI','jFexMETRoI','jFexSumETRoI', 'gMETComponentsJwoj']
182 gfex_provider_attr = ['gFexSRJetRoI','gFexLRJetRoI', 'gScalarEJwoj','gMETComponentsJwoj','gMHTComponentsJwoj', 'gMETComponentsNoiseCut', 'gMETComponentsRms', 'gEspresso', 'gRistretto']
183 #Note: Unused container outputs from gFEX are:
184 #'gFexRhoRoI', 'gMSTComponentsJwoj', 'gScalarENoiseCut', 'gScalarERms'
185 #as compared with: https://gitlab.cern.ch/atlas/athena/-/blob/main/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h#L128-136
186
187
188 from L1TopoSimulation.L1TopoInputHistograms import configureMuonInputProviderHistograms, configureeFexInputProviderHistograms, configurejFexInputProviderHistograms, configuregFexInputProviderHistograms
189
190 #Configure the MuonInputProvider
191 muProvider=""
192 if doMuons:
193 muProvider = CompFactory.LVL1.MuonInputProvider("MuonInputProvider")
194
195 if flags.Trigger.L1.doMuonTopoInputs:
196 muProvider.locationMuCTPItoL1Topo = ""
197 muProvider.locationMuCTPItoL1Topo1 = ""
198 muProvider.locationMuonRoI = "L1MuCTPItoL1TopoLocationFromMuonRoI"
199 muProvider.locationMuonRoI1 = "L1MuCTPItoL1TopoLocationFromMuonRoI1"
200 else:
201 muProvider.locationMuonRoI = ""
202 muProvider.locationMuonRoI1 = ""
203
204 #Configure the MuonRoiTools for the MIP
205 from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import RPCRecRoiToolCfg, TGCRecRoiToolCfg
206 muProvider.RecRpcRoiTool = acc.popToolsAndMerge(RPCRecRoiToolCfg(flags))
207 muProvider.RecTgcRoiTool = acc.popToolsAndMerge(TGCRecRoiToolCfg(flags))
208 muProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
209 muProvider.MonTool.HistPath = 'L1TopoSimulation/MuonInputProvider'
210 configureMuonInputProviderHistograms(muProvider, flags)
211
212
213 efexProvider = CompFactory.LVL1.eFexInputProvider("eFexInputProvider")
214 efexProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
215 efexProvider.MonTool.HistPath = 'L1TopoSimulation/eFexInputProvider'
216 configureeFexInputProviderHistograms(efexProvider, flags)
217 jfexProvider = CompFactory.LVL1.jFexInputProvider("jFexInputProvider")
218 jfexProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
219 jfexProvider.MonTool.HistPath = 'L1TopoSimulation/jFexInputProvider'
220 configurejFexInputProviderHistograms(jfexProvider, flags)
221 gfexProvider = CompFactory.LVL1.gFexInputProvider("gFexInputProvider")
222 gfexProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
223 gfexProvider.MonTool.HistPath = 'L1TopoSimulation/gFexInputProvider'
224 configuregFexInputProviderHistograms(gfexProvider, flags)
225
226 for attr in efex_provider_attr:
227 res = [x for x in outputEDM if attr in x]
228 if len(res)>0:
229 key = res[0].split('#')[1]
230 print (f'Key found for eFEX: {key}')
231 setattr(efexProvider,attr+'Key',key)
232 else:
233 setattr(efexProvider,attr+'Key','')
234
235 for attr in jfex_provider_attr:
236 res = [x for x in outputEDM if attr in x]
237 if len(res)>0:
238 key = res[0].split('#')[1]
239 print (f'Key found for jFEX: {key}')
240 setattr(jfexProvider,attr+'Key',key)
241 else:
242 setattr(jfexProvider,attr+'Key','')
243
244 for attr in gfex_provider_attr:
245 res = [x for x in outputEDM if attr in x]
246 if len(res)>0:
247 key = res[0].split('#')[1]
248 print (f'Key found for gFEX: {key}')
249 setattr(gfexProvider,attr+'Key',key)
250 else:
251 setattr(gfexProvider,attr+'Key','')
252
253 topoSimAlg = CompFactory.LVL1.L1TopoSimulation("L1TopoSimulation",
254 MuonInputProvider = muProvider,
255 EMTAUInputProvider = efexProvider,
256 JetInputProvider = jfexProvider,
257 EnergyInputProvider = gfexProvider,
258 IsLegacyTopo = False,
259 doMonitoring = doMonitoring,
260 EnableInputDump = flags.Trigger.enableL1TopoDump,
261 UseBitwise = flags.Trigger.enableL1TopoBWSimulation
262 )
263
264 acc.addEventAlgo(topoSimAlg)
265
266 return acc
267
268if __name__ == '__main__':
269 from AthenaConfiguration.AllConfigFlags import initConfigFlags
270 from AthenaCommon.Logging import logging
271 from AthenaCommon.Constants import VERBOSE,DEBUG,WARNING,INFO
272 import argparse
273 from argparse import RawTextHelpFormatter
274 import sys
275 from libpyeformat_helper import SourceIdentifier, SubDetector
276
277 log = logging.getLogger('runL1TopoSim')
278 log.setLevel(DEBUG)
279 algLogLevel = DEBUG
280
281 parser = argparse.ArgumentParser("Running L1TopoSimulation standalone for the BS input", formatter_class=RawTextHelpFormatter)
282 parser.add_argument("-i","--inputs",nargs='*',action="store", dest="inputs", help="Inputs will be used in commands", required=True)
283 parser.add_argument("-m","--module",action="store", dest="module", help="Input modules wants to be simulated.",default="", required=False)
284 parser.add_argument("-bw","--useBitWise",action="store_true", dest="useBW", help="Run with L1Topo Bitwise simulation?",default=True, required=False)
285 parser.add_argument("-ifex","--doCaloInput",action="store_true", dest="doCaloInput", help="Decoding L1Calo inputs",default=False, required=False)
286 parser.add_argument("-fCtp","--forceCtp",action="store_true", dest="forceCtp", help="Force to CTP monitoring as primary in Sim/Hdw comparison.",default=False, required=False)
287 parser.add_argument("-hdwMon","--algoHdwMon",action="store_true", dest="algoHdwMon", help="Fill algorithm histograms based on hardware decision.",default=False, required=False)
288 parser.add_argument("-perfMon","--perfMonitoring",action="store_true", dest="perfmon", help="Enable performance monitoring",default=False, required=False)
289 parser.add_argument("-redoMenu","--rederiveMenu",action="store_true", dest="redoMenu", help="Will rederive the menu based in local code",default=False, required=False)
290 parser.add_argument("-l","--logLevel",action="store", dest="log", help="Log level.",default="warning", required=False)
291 parser.add_argument("-n","--nevent", type=int, action="store", dest="nevent", help="Maximum number of events will be executed.",default=0, required=False)
292 parser.add_argument("-s","--skipEvents", type=int, action="store", dest="skipEvents", help="How many events will be skipped.",default=0, required=False)
293 parser.add_argument("-d","--enableL1TopoDump", type=bool, action="store", dest="enableL1TopoDump", help="Whether to output events into inputdump.txt",default=False, required=False)
294 args = parser.parse_args()
295
296 supportedSubsystems = ['Muons','jFex','eFex','gFex','Topo']
297 args_subsystem = args.module.split(',')
298 subsystem = list( set(args_subsystem) & set(supportedSubsystems) )
299 filename = args.inputs
300
301 if len(subsystem)==0:
302 log.warning(f'subsystem not given or the given subsystem not supported with one of the: {supportedSubsystems}')
303
304 if args.log == 'info': algLogLevel = INFO
305 if args.log == 'warning': algLogLevel = WARNING
306 if args.log == 'debug': algLogLevel = DEBUG
307 if args.log == 'verbose': algLogLevel = VERBOSE
308
309 flags = initConfigFlags()
310
311 flags.Exec.OutputLevel = algLogLevel
312 if(args.nevent > 0):
313 flags.Exec.MaxEvents = args.nevent
314 flags.Trigger.triggerMenuSetup = 'PhysicsP1_pp_run3_v1'
315 if args.redoMenu:
316 flags.Trigger.triggerConfig = 'FILE'
317 else:
318 flags.Trigger.triggerConfig = 'DB'
319 flags.Input.Files = args.inputs
320 flags.Concurrency.NumThreads = 1
321 flags.Concurrency.NumConcurrentEvents = 1
322 flags.Exec.SkipEvents = args.skipEvents
323 flags.Output.AODFileName = 'AOD.pool.root'
324 flags.Trigger.doLVL1 = True
325 flags.Trigger.L1.doMuon = True
326 flags.Trigger.enableL1MuonPhase1 = True
327 flags.Trigger.L1.doMuonTopoInputs = True
328 flags.Trigger.enableL1TopoBWSimulation = args.useBW
329 flags.PerfMon.doFullMonMT = args.perfmon
330 flags.PerfMon.OutputJSON = 'perfmonmt_test.json'
331 flags.Trigger.enableL1TopoDump = args.enableL1TopoDump
332
333 if not flags.Input.isMC:
334 from AthenaConfiguration.TestDefaults import defaultGeometryTags
335 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
336 flags.lock()
337
338 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
339 acc = MainServicesCfg(flags)
340
341 if args.perfmon:
342 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
343 acc.merge(PerfMonMTSvcCfg(flags))
344
345 from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
346 acc.merge(ByteStreamReadCfg(flags, type_names=['CTP_RDO/CTP_RDO']))
347
348 # Generate run3 L1 menu
349 from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg,generateL1Menu
350 acc.merge(L1ConfigSvcCfg(flags))
351 if "data22" not in filename:
352 generateL1Menu(flags)
353
354 # Produce xAOD L1 RoIs from RoIBResult
355 from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig import RoIBResultToxAODCfg
356 xRoIBResultAcc, xRoIBResultOutputs = RoIBResultToxAODCfg(flags)
357 acc.merge(xRoIBResultAcc)
358
359 decoderTools = []
360 outputEDM = []
361 maybeMissingRobs = []
362
363 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import RoIBResultByteStreamToolCfg
364 roibResultTool = acc.popToolsAndMerge(RoIBResultByteStreamToolCfg(flags, name="RoIBResultBSDecoderTool", writeBS=False))
365 decoderTools += [roibResultTool]
366
367 for module_id in roibResultTool.L1TopoModuleIds:
368 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id)))
369
370 for module_id in roibResultTool.JetModuleIds:
371 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_JET_PROC_ROI, module_id)))
372
373 for module_id in roibResultTool.EMModuleIds:
374 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, module_id)))
375
376
377 def addEDM(edmType, edmName):
378 auxType = edmType.replace('Container','AuxContainer')
379 return [f'{edmType}#{edmName}',
380 f'{auxType}#{edmName}Aux.']
381
382 outputEDM += ['CTP_RDO#*']
383 outputEDM += ['ROIB::RoIBResult#*']
384
385 outputEDM += addEDM('xAOD::JetEtRoI' , 'LVL1JetEtRoI')
386 outputEDM += addEDM('xAOD::JetRoIContainer' , 'LVL1JetRoIs')
387 outputEDM += addEDM('xAOD::EmTauRoIContainer', 'LVL1EmTauRoIs')
388 #different naming scheme of Aux branches and types for legacy EnergySumRoI (MET,sumET)
389 outputEDM += ["xAOD::EnergySumRoI#LVL1EnergySumRoI", "xAOD::EnergySumRoIAuxInfo#LVL1EnergySumRoIAux."]
390
391 if 'Muons' in subsystem:
392 from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg,TgcBytestreamDecodeCfg
393 rpcdecodingAcc = RpcBytestreamDecodeCfg(flags)
394 acc.merge(rpcdecodingAcc)
395 tgcdecodingAcc = TgcBytestreamDecodeCfg(flags)
396 acc.merge(tgcdecodingAcc)
397
398 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import MuonRoIByteStreamToolCfg
399 muonRoiTool = acc.popToolsAndMerge(MuonRoIByteStreamToolCfg(flags, name="L1MuonBSDecoderTool", writeBS=False))
400 decoderTools += [muonRoiTool]
401 outputEDM += addEDM('xAOD::MuonRoIContainer' , '*')
402 maybeMissingRobs += muonRoiTool.ROBIDs
403
404 if 'jFex' in subsystem:
405 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import jFexRoiByteStreamToolCfg,jFexInputByteStreamToolCfg
406 jFexTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(flags, 'jFexBSDecoder', writeBS=False))
407 decoderTools += [jFexTool]
408 outputEDM += addEDM('xAOD::jFexSRJetRoIContainer', jFexTool.jJRoIContainerWriteKey.Path)
409 outputEDM += addEDM('xAOD::jFexLRJetRoIContainer', jFexTool.jLJRoIContainerWriteKey.Path)
410 outputEDM += addEDM('xAOD::jFexTauRoIContainer' , jFexTool.jTauRoIContainerWriteKey.Path)
411 outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', jFexTool.jEMRoIContainerWriteKey.Path)
412 outputEDM += addEDM('xAOD::jFexSumETRoIContainer', jFexTool.jTERoIContainerWriteKey.Path)
413 outputEDM += addEDM('xAOD::jFexMETRoIContainer' , jFexTool.jXERoIContainerWriteKey.Path)
414 maybeMissingRobs += jFexTool.ROBIDs
415 if args.doCaloInput:
416 jFexInputByteStreamTool = acc.popToolsAndMerge(jFexInputByteStreamToolCfg(flags, 'jFexInputBSDecoderTool', writeBS=False))
417 decoderTools += [jFexInputByteStreamTool]
418 outputEDM += addEDM('xAOD::jFexTowerContainer', jFexInputByteStreamTool.jTowersWriteKey.Path)
419 maybeMissingRobs += jFexInputByteStreamTool.ROBIDs
420
421
422 if 'eFex' in subsystem:
423 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import eFexByteStreamToolCfg
424 eFexTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(flags, 'eFexBSDecoder', writeBS=False, decodeInputs=args.doCaloInput))
425 decoderTools += [eFexTool]
426 outputEDM += addEDM('xAOD::eFexEMRoIContainer', eFexTool.eEMContainerWriteKey.Path)
427 outputEDM += addEDM('xAOD::eFexTauRoIContainer', eFexTool.eTAUContainerWriteKey.Path)
428 if args.doCaloInput:
429 outputEDM += addEDM('xAOD::eFexTowerContainer', eFexTool.eTowerContainerWriteKey.Path)
430 maybeMissingRobs += eFexTool.ROBIDs
431
432
433 if 'gFex' in subsystem:
434 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import gFexByteStreamToolCfg,gFexInputByteStreamToolCfg
435 gFexTool = acc.popToolsAndMerge(gFexByteStreamToolCfg(flags, 'gFexBSDecoder', writeBS=False))
436 decoderTools += [gFexTool]
437 outputEDM += addEDM('xAOD::gFexJetRoIContainer', gFexTool.gFexRhoOutputContainerWriteKey.Path)
438 outputEDM += addEDM('xAOD::gFexJetRoIContainer', gFexTool.gFexSRJetOutputContainerWriteKey.Path)
439 outputEDM += addEDM('xAOD::gFexJetRoIContainer', gFexTool.gFexLRJetOutputContainerWriteKey.Path)
440 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarEJwojOutputContainerWriteKey.Path)
441 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gEspressoOutputContainerWriteKey.Path)
442 #safeguard until gFEX implements this on their side
443 if hasattr(gFexTool, 'gRistrettoOutputContainerWriteKey'):
444 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gRistrettoOutputContainerWriteKey.Path)
445 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsJwojOutputContainerWriteKey.Path)
446 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMHTComponentsJwojOutputContainerWriteKey.Path)
447 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMSTComponentsJwojOutputContainerWriteKey.Path)
448 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsNoiseCutOutputContainerWriteKey.Path)
449 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsRmsOutputContainerWriteKey.Path)
450 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarENoiseCutOutputContainerWriteKey.Path)
451 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarERmsOutputContainerWriteKey.Path)
452 maybeMissingRobs += gFexTool.ROBIDs
453 if args.doCaloInput:
454 gFexInputByteStreamTool = acc.popToolsAndMerge(gFexInputByteStreamToolCfg(flags, 'gFexInputByteStreamTool', writeBS=False))
455 decoderTools += [gFexInputByteStreamTool]
456 outputEDM += addEDM('xAOD::gFexTowerContainer', gFexInputByteStreamTool.gTowersWriteKey.Path)
457 maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
458
459 if 'Topo' in subsystem:
460 from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoPhase1ByteStreamToolCfg
461 l1topoBSTool = acc.popToolsAndMerge(L1TopoPhase1ByteStreamToolCfg(flags, "L1TopoBSDecoderTool"))
462 decoderTools += [l1topoBSTool]
463 outputEDM += addEDM('xAOD::L1TopoRawDataContainer', l1topoBSTool.L1TopoPhase1RAWDataWriteContainer.Path)
464 maybeMissingRobs += l1topoBSTool.ROBIDs
465
466 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name="L1TriggerByteStreamDecoder",
467 DecoderTools=decoderTools,
468 MaybeMissingROBs=maybeMissingRobs,
469 OutputLevel=algLogLevel)
470
471 acc.addEventAlgo(decoderAlg, sequenceName='AthAlgSeq')
472
473 roib2topo = CompFactory.LVL1.RoiB2TopoInputDataCnv(name='RoiB2TopoInputDataCnv')
474 roib2topo.OutputLevel = algLogLevel
475 acc.addEventAlgo(roib2topo, sequenceName="AthAlgSeq")
476 from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoByteStreamCfg
477 acc.merge(L1TopoByteStreamCfg(flags), sequenceName='AthAlgSeq')
478 outputEDM += addEDM('xAOD::L1TopoRawDataContainer', 'L1TopoRawData')
479
480 acc.merge(L1TopoSimulationStandaloneCfg(flags,outputEDM,doMuons=('Muons' in subsystem)), sequenceName='AthAlgSeq')
481 if args.algoHdwMon:
482 acc.getEventAlgo('L1TopoSimulation').FillHistoBasedOnHardware = True
483 acc.getEventAlgo('L1TopoSimulation').PrescaleDAQROBAccess = 1
484 outputEDM += addEDM('xAOD::L1TopoSimResultsContainer','L1_TopoSimResults')
485
486 # phase1 mon
487 from L1TopoOnlineMonitoring import L1TopoOnlineMonitoringConfig as TopoMonConfig
488 acc.addEventAlgo(
489 TopoMonConfig.getL1TopoPhase1OnlineMonitor(flags,'L1/L1TopoOffline',True,True,True,True,True,args.forceCtp,algLogLevel),
490 sequenceName="AthAlgSeq"
491 )
492
493 histSvc = CompFactory.THistSvc(Output = ["EXPERT DATAFILE='expert-monitoring-l1topo.root', OPT='RECREATE'"])
494 acc.addService(histSvc)
495
496 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
497 log.debug('Adding the following output EDM to ItemList: %s', outputEDM)
498 acc.merge(OutputStreamCfg(flags, 'AOD', ItemList=outputEDM))
499 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
500 acc.merge(SetupMetaDataForStreamCfg(flags, 'AOD'))
501
502 if args.log == 'verbose' or args.perfmon:
503 acc.printConfig(withDetails=True, summariseProps=True, printDefaults=True)
504
505 if acc.run().isFailure():
506 sys.exit(1)
if(pathvar)
STL class.
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
L1TopoSimulationCfg(flags, doMonitoring=True, readMuCTPI=False, name="L1TopoSimulation", deactivateL1TopoMuons=False, useMuonRoIs=False, useMuonDecoder=False, writeMuonRoIs=True)
L1TopoSimulationStandaloneCfg(flags, outputEDM=[], doMuons=False, doMonitoring=True)