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
142 if (jetProvider != "") and (energyProvider != ""):
143 #both, j+gFEX are available, ensure they use consistent keys for gFEX JwoJ MET
144 jetProvider.gMETComponentsJwojKey = energyProvider.gMETComponentsJwojKey
145
146 topoSimAlg = CompFactory.LVL1.L1TopoSimulation(name,
147 MuonInputProvider = muProvider,
148 EMTAUInputProvider = emtauProvider,
149 JetInputProvider = jetProvider,
150 EnergyInputProvider = energyProvider,
151 ControlHistSvc = controlHistSvc, # if doMonitoring else "",
152 IsLegacyTopo = False,
153 doMonitoring = doMonitoring,
154 EnableInputDump = flags.Trigger.enableL1TopoDump,
155 UseBitwise = flags.Trigger.enableL1TopoBWSimulation
156 )
157 if name!="L1TopoSimulation":
158 topoSimAlg.MonHistBaseDir = "L1/OnlineL1TopoAlgorithms"
159
160 acc.addEventAlgo(topoSimAlg)
161
162
163 if doMonitoring:
164 from L1TopoOnlineMonitoring import L1TopoOnlineMonitoringConfig as TopoMonConfig
165 if name=="L1TopoSimulation":
166 acc.addEventAlgo(TopoMonConfig.getL1TopoPhase1OnlineMonitor(flags,'L1/L1TopoSimDecisions',
167 doHwMon=IsData,doComp=IsData, doMultComp=IsData))
168 else:
169 acc.addEventAlgo(TopoMonConfig.getL1TopoPhase1OnlineMonitor(flags,'L1/OnlineL1TopoSimDecisions',
170 toolName=name+"_Monitor",
171 doHwMon=IsData,doComp=IsData, doMultComp=IsData))
172
173 return acc
174
175def L1TopoSimulationStandaloneCfg(flags, outputEDM=[], doMuons = False, doMonitoring=True):
176
177 acc = ComponentAccumulator()
178
179 efex_provider_attr = ['eFexEMRoI','eFexTauRoI']
180 jfex_provider_attr = ['jFexSRJetRoI','jFexLRJetRoI','jFexFwdElRoI','jFexTauRoI','jFexMETRoI','jFexSumETRoI', 'gMETComponentsJwoj']
181 gfex_provider_attr = ['gFexSRJetRoI','gFexLRJetRoI', 'gScalarEJwoj','gMETComponentsJwoj','gMHTComponentsJwoj', 'gMETComponentsNoiseCut', 'gMETComponentsRms', 'gEspresso']
182 #Note: Unused container outputs from gFEX are:
183 #'gFexRhoRoI', 'gMSTComponentsJwoj', 'gScalarENoiseCut', 'gScalarERms'
184 #as compared with: https://gitlab.cern.ch/atlas/athena/-/blob/main/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h#L128-136
185
186
187 from L1TopoSimulation.L1TopoInputHistograms import configureMuonInputProviderHistograms, configureeFexInputProviderHistograms, configurejFexInputProviderHistograms, configuregFexInputProviderHistograms
188
189 #Configure the MuonInputProvider
190 muProvider=""
191 if doMuons:
192 muProvider = CompFactory.LVL1.MuonInputProvider("MuonInputProvider")
193
194 if flags.Trigger.L1.doMuonTopoInputs:
195 muProvider.locationMuCTPItoL1Topo = ""
196 muProvider.locationMuCTPItoL1Topo1 = ""
197 muProvider.locationMuonRoI = "L1MuCTPItoL1TopoLocationFromMuonRoI"
198 muProvider.locationMuonRoI1 = "L1MuCTPItoL1TopoLocationFromMuonRoI1"
199 else:
200 muProvider.locationMuonRoI = ""
201 muProvider.locationMuonRoI1 = ""
202
203 #Configure the MuonRoiTools for the MIP
204 from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import RPCRecRoiToolCfg, TGCRecRoiToolCfg
205 muProvider.RecRpcRoiTool = acc.popToolsAndMerge(RPCRecRoiToolCfg(flags))
206 muProvider.RecTgcRoiTool = acc.popToolsAndMerge(TGCRecRoiToolCfg(flags))
207 muProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
208 muProvider.MonTool.HistPath = 'L1TopoSimulation/MuonInputProvider'
209 configureMuonInputProviderHistograms(muProvider, flags)
210
211
212 efexProvider = CompFactory.LVL1.eFexInputProvider("eFexInputProvider")
213 efexProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
214 efexProvider.MonTool.HistPath = 'L1TopoSimulation/eFexInputProvider'
215 configureeFexInputProviderHistograms(efexProvider, flags)
216 jfexProvider = CompFactory.LVL1.jFexInputProvider("jFexInputProvider")
217 jfexProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
218 jfexProvider.MonTool.HistPath = 'L1TopoSimulation/jFexInputProvider'
219 configurejFexInputProviderHistograms(jfexProvider, flags)
220 gfexProvider = CompFactory.LVL1.gFexInputProvider("gFexInputProvider")
221 gfexProvider.MonTool = GenericMonitoringTool(flags, 'MonTool')
222 gfexProvider.MonTool.HistPath = 'L1TopoSimulation/gFexInputProvider'
223 configuregFexInputProviderHistograms(gfexProvider, flags)
224
225 for attr in efex_provider_attr:
226 res = [x for x in outputEDM if attr in x]
227 if len(res)>0:
228 key = res[0].split('#')[1]
229 print (f'Key found for eFEX: {key}')
230 setattr(efexProvider,attr+'Key',key)
231 else:
232 setattr(efexProvider,attr+'Key','')
233
234 for attr in jfex_provider_attr:
235 res = [x for x in outputEDM if attr in x]
236 if len(res)>0:
237 key = res[0].split('#')[1]
238 print (f'Key found for jFEX: {key}')
239 setattr(jfexProvider,attr+'Key',key)
240 else:
241 setattr(jfexProvider,attr+'Key','')
242
243 for attr in gfex_provider_attr:
244 res = [x for x in outputEDM if attr in x]
245 if len(res)>0:
246 key = res[0].split('#')[1]
247 print (f'Key found for gFEX: {key}')
248 setattr(gfexProvider,attr+'Key',key)
249 else:
250 setattr(gfexProvider,attr+'Key','')
251
252 topoSimAlg = CompFactory.LVL1.L1TopoSimulation("L1TopoSimulation",
253 MuonInputProvider = muProvider,
254 EMTAUInputProvider = efexProvider,
255 JetInputProvider = jfexProvider,
256 EnergyInputProvider = gfexProvider,
257 IsLegacyTopo = False,
258 doMonitoring = doMonitoring,
259 EnableInputDump = flags.Trigger.enableL1TopoDump,
260 UseBitwise = flags.Trigger.enableL1TopoBWSimulation
261 )
262
263 acc.addEventAlgo(topoSimAlg)
264
265 return acc
266
267if __name__ == '__main__':
268 from AthenaConfiguration.AllConfigFlags import initConfigFlags
269 from AthenaCommon.Logging import logging
270 from AthenaCommon.Constants import VERBOSE,DEBUG,WARNING,INFO
271 import argparse
272 from argparse import RawTextHelpFormatter
273 import sys
274 from libpyeformat_helper import SourceIdentifier, SubDetector
275
276 log = logging.getLogger('runL1TopoSim')
277 log.setLevel(DEBUG)
278 algLogLevel = DEBUG
279
280 parser = argparse.ArgumentParser("Running L1TopoSimulation standalone for the BS input", formatter_class=RawTextHelpFormatter)
281 parser.add_argument("-i","--inputs",nargs='*',action="store", dest="inputs", help="Inputs will be used in commands", required=True)
282 parser.add_argument("-m","--module",action="store", dest="module", help="Input modules wants to be simulated.",default="", required=False)
283 parser.add_argument("-bw","--useBitWise",action="store_true", dest="useBW", help="Run with L1Topo Bitwise simulation?",default=True, required=False)
284 parser.add_argument("-ifex","--doCaloInput",action="store_true", dest="doCaloInput", help="Decoding L1Calo inputs",default=False, required=False)
285 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)
286 parser.add_argument("-hdwMon","--algoHdwMon",action="store_true", dest="algoHdwMon", help="Fill algorithm histograms based on hardware decision.",default=False, required=False)
287 parser.add_argument("-perfMon","--perfMonitoring",action="store_true", dest="perfmon", help="Enable performance monitoring",default=False, required=False)
288 parser.add_argument("-redoMenu","--rederiveMenu",action="store_true", dest="redoMenu", help="Will rederive the menu based in local code",default=False, required=False)
289 parser.add_argument("-l","--logLevel",action="store", dest="log", help="Log level.",default="warning", required=False)
290 parser.add_argument("-n","--nevent", type=int, action="store", dest="nevent", help="Maximum number of events will be executed.",default=0, required=False)
291 parser.add_argument("-s","--skipEvents", type=int, action="store", dest="skipEvents", help="How many events will be skipped.",default=0, required=False)
292 parser.add_argument("-d","--enableL1TopoDump", type=bool, action="store", dest="enableL1TopoDump", help="Whether to output events into inputdump.txt",default=False, required=False)
293 args = parser.parse_args()
294
295 supportedSubsystems = ['Muons','jFex','eFex','gFex','Topo']
296 args_subsystem = args.module.split(',')
297 subsystem = list( set(args_subsystem) & set(supportedSubsystems) )
298 filename = args.inputs
299
300 if len(subsystem)==0:
301 log.warning(f'subsystem not given or the given subsystem not supported with one of the: {supportedSubsystems}')
302
303 if args.log == 'info': algLogLevel = INFO
304 if args.log == 'warning': algLogLevel = WARNING
305 if args.log == 'debug': algLogLevel = DEBUG
306 if args.log == 'verbose': algLogLevel = VERBOSE
307
308 flags = initConfigFlags()
309
310 flags.Exec.OutputLevel = algLogLevel
311 if(args.nevent > 0):
312 flags.Exec.MaxEvents = args.nevent
313 flags.Trigger.triggerMenuSetup = 'PhysicsP1_pp_run3_v1'
314 if args.redoMenu:
315 flags.Trigger.triggerConfig = 'FILE'
316 else:
317 flags.Trigger.triggerConfig = 'DB'
318 flags.Input.Files = args.inputs
319 flags.Concurrency.NumThreads = 1
320 flags.Concurrency.NumConcurrentEvents = 1
321 flags.Exec.SkipEvents = args.skipEvents
322 flags.Output.AODFileName = 'AOD.pool.root'
323 flags.Trigger.doLVL1 = True
324 flags.Trigger.L1.doMuon = True
325 flags.Trigger.enableL1MuonPhase1 = True
326 flags.Trigger.L1.doMuonTopoInputs = True
327 flags.Trigger.enableL1TopoBWSimulation = args.useBW
328 flags.PerfMon.doFullMonMT = args.perfmon
329 flags.PerfMon.OutputJSON = 'perfmonmt_test.json'
330 flags.Trigger.enableL1TopoDump = args.enableL1TopoDump
331
332 if not flags.Input.isMC:
333 from AthenaConfiguration.TestDefaults import defaultGeometryTags
334 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
335 flags.lock()
336
337 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
338 acc = MainServicesCfg(flags)
339
340 if args.perfmon:
341 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
342 acc.merge(PerfMonMTSvcCfg(flags))
343
344 from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
345 acc.merge(ByteStreamReadCfg(flags, type_names=['CTP_RDO/CTP_RDO']))
346
347 # Generate run3 L1 menu
348 from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg,generateL1Menu
349 acc.merge(L1ConfigSvcCfg(flags))
350 if "data22" not in filename:
351 generateL1Menu(flags)
352
353 # Produce xAOD L1 RoIs from RoIBResult
354 from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig import RoIBResultToxAODCfg
355 xRoIBResultAcc, xRoIBResultOutputs = RoIBResultToxAODCfg(flags)
356 acc.merge(xRoIBResultAcc)
357
358 decoderTools = []
359 outputEDM = []
360 maybeMissingRobs = []
361
362 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import RoIBResultByteStreamToolCfg
363 roibResultTool = acc.popToolsAndMerge(RoIBResultByteStreamToolCfg(flags, name="RoIBResultBSDecoderTool", writeBS=False))
364 decoderTools += [roibResultTool]
365
366 for module_id in roibResultTool.L1TopoModuleIds:
367 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id)))
368
369 for module_id in roibResultTool.JetModuleIds:
370 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_JET_PROC_ROI, module_id)))
371
372 for module_id in roibResultTool.EMModuleIds:
373 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, module_id)))
374
375
376 def addEDM(edmType, edmName):
377 auxType = edmType.replace('Container','AuxContainer')
378 return [f'{edmType}#{edmName}',
379 f'{auxType}#{edmName}Aux.']
380
381 outputEDM += ['CTP_RDO#*']
382 outputEDM += ['ROIB::RoIBResult#*']
383
384 outputEDM += addEDM('xAOD::JetEtRoI' , 'LVL1JetEtRoI')
385 outputEDM += addEDM('xAOD::JetRoIContainer' , 'LVL1JetRoIs')
386 outputEDM += addEDM('xAOD::EmTauRoIContainer', 'LVL1EmTauRoIs')
387 #different naming scheme of Aux branches and types for legacy EnergySumRoI (MET,sumET)
388 outputEDM += ["xAOD::EnergySumRoI#LVL1EnergySumRoI", "xAOD::EnergySumRoIAuxInfo#LVL1EnergySumRoIAux."]
389
390 if 'Muons' in subsystem:
391 from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg,TgcBytestreamDecodeCfg
392 rpcdecodingAcc = RpcBytestreamDecodeCfg(flags)
393 acc.merge(rpcdecodingAcc)
394 tgcdecodingAcc = TgcBytestreamDecodeCfg(flags)
395 acc.merge(tgcdecodingAcc)
396
397 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import MuonRoIByteStreamToolCfg
398 muonRoiTool = acc.popToolsAndMerge(MuonRoIByteStreamToolCfg(flags, name="L1MuonBSDecoderTool", writeBS=False))
399 decoderTools += [muonRoiTool]
400 outputEDM += addEDM('xAOD::MuonRoIContainer' , '*')
401 maybeMissingRobs += muonRoiTool.ROBIDs
402
403 if 'jFex' in subsystem:
404 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import jFexRoiByteStreamToolCfg,jFexInputByteStreamToolCfg
405 jFexTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(flags, 'jFexBSDecoder', writeBS=False))
406 decoderTools += [jFexTool]
407 outputEDM += addEDM('xAOD::jFexSRJetRoIContainer', jFexTool.jJRoIContainerWriteKey.Path)
408 outputEDM += addEDM('xAOD::jFexLRJetRoIContainer', jFexTool.jLJRoIContainerWriteKey.Path)
409 outputEDM += addEDM('xAOD::jFexTauRoIContainer' , jFexTool.jTauRoIContainerWriteKey.Path)
410 outputEDM += addEDM('xAOD::jFexFwdElRoIContainer', jFexTool.jEMRoIContainerWriteKey.Path)
411 outputEDM += addEDM('xAOD::jFexSumETRoIContainer', jFexTool.jTERoIContainerWriteKey.Path)
412 outputEDM += addEDM('xAOD::jFexMETRoIContainer' , jFexTool.jXERoIContainerWriteKey.Path)
413 maybeMissingRobs += jFexTool.ROBIDs
414 if args.doCaloInput:
415 jFexInputByteStreamTool = acc.popToolsAndMerge(jFexInputByteStreamToolCfg(flags, 'jFexInputBSDecoderTool', writeBS=False))
416 decoderTools += [jFexInputByteStreamTool]
417 outputEDM += addEDM('xAOD::jFexTowerContainer', jFexInputByteStreamTool.jTowersWriteKey.Path)
418 maybeMissingRobs += jFexInputByteStreamTool.ROBIDs
419
420
421 if 'eFex' in subsystem:
422 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import eFexByteStreamToolCfg
423 eFexTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(flags, 'eFexBSDecoder', writeBS=False, decodeInputs=args.doCaloInput))
424 decoderTools += [eFexTool]
425 outputEDM += addEDM('xAOD::eFexEMRoIContainer', eFexTool.eEMContainerWriteKey.Path)
426 outputEDM += addEDM('xAOD::eFexTauRoIContainer', eFexTool.eTAUContainerWriteKey.Path)
427 if args.doCaloInput:
428 outputEDM += addEDM('xAOD::eFexTowerContainer', eFexTool.eTowerContainerWriteKey.Path)
429 maybeMissingRobs += eFexTool.ROBIDs
430
431
432 if 'gFex' in subsystem:
433 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import gFexByteStreamToolCfg,gFexInputByteStreamToolCfg
434 gFexTool = acc.popToolsAndMerge(gFexByteStreamToolCfg(flags, 'gFexBSDecoder', writeBS=False))
435 decoderTools += [gFexTool]
436 outputEDM += addEDM('xAOD::gFexJetRoIContainer', gFexTool.gFexRhoOutputContainerWriteKey.Path)
437 outputEDM += addEDM('xAOD::gFexJetRoIContainer', gFexTool.gFexSRJetOutputContainerWriteKey.Path)
438 outputEDM += addEDM('xAOD::gFexJetRoIContainer', gFexTool.gFexLRJetOutputContainerWriteKey.Path)
439 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarEJwojOutputContainerWriteKey.Path)
440 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gEspressoOutputContainerWriteKey.Path)
441 print("Espresso Path: ", gFexTool.gEspressoOutputContainerWriteKey.Path)
442 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsJwojOutputContainerWriteKey.Path)
443 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMHTComponentsJwojOutputContainerWriteKey.Path)
444 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMSTComponentsJwojOutputContainerWriteKey.Path)
445 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsNoiseCutOutputContainerWriteKey.Path)
446 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsRmsOutputContainerWriteKey.Path)
447 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarENoiseCutOutputContainerWriteKey.Path)
448 outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarERmsOutputContainerWriteKey.Path)
449 maybeMissingRobs += gFexTool.ROBIDs
450 if args.doCaloInput:
451 gFexInputByteStreamTool = acc.popToolsAndMerge(gFexInputByteStreamToolCfg(flags, 'gFexInputByteStreamTool', writeBS=False))
452 decoderTools += [gFexInputByteStreamTool]
453 outputEDM += addEDM('xAOD::gFexTowerContainer', gFexInputByteStreamTool.gTowersWriteKey.Path)
454 maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
455
456 if 'Topo' in subsystem:
457 from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoPhase1ByteStreamToolCfg
458 l1topoBSTool = acc.popToolsAndMerge(L1TopoPhase1ByteStreamToolCfg(flags, "L1TopoBSDecoderTool"))
459 decoderTools += [l1topoBSTool]
460 outputEDM += addEDM('xAOD::L1TopoRawDataContainer', l1topoBSTool.L1TopoPhase1RAWDataWriteContainer.Path)
461 maybeMissingRobs += l1topoBSTool.ROBIDs
462
463 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name="L1TriggerByteStreamDecoder",
464 DecoderTools=decoderTools,
465 MaybeMissingROBs=maybeMissingRobs,
466 OutputLevel=algLogLevel)
467
468 acc.addEventAlgo(decoderAlg, sequenceName='AthAlgSeq')
469
470 roib2topo = CompFactory.LVL1.RoiB2TopoInputDataCnv(name='RoiB2TopoInputDataCnv')
471 roib2topo.OutputLevel = algLogLevel
472 acc.addEventAlgo(roib2topo, sequenceName="AthAlgSeq")
473 from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoByteStreamCfg
474 acc.merge(L1TopoByteStreamCfg(flags), sequenceName='AthAlgSeq')
475 outputEDM += addEDM('xAOD::L1TopoRawDataContainer', 'L1TopoRawData')
476
477 acc.merge(L1TopoSimulationStandaloneCfg(flags,outputEDM,doMuons=('Muons' in subsystem)), sequenceName='AthAlgSeq')
478 if args.algoHdwMon:
479 acc.getEventAlgo('L1TopoSimulation').FillHistoBasedOnHardware = True
480 acc.getEventAlgo('L1TopoSimulation').PrescaleDAQROBAccess = 1
481 outputEDM += addEDM('xAOD::L1TopoSimResultsContainer','L1_TopoSimResults')
482
483 # phase1 mon
484 from L1TopoOnlineMonitoring import L1TopoOnlineMonitoringConfig as TopoMonConfig
485 acc.addEventAlgo(
486 TopoMonConfig.getL1TopoPhase1OnlineMonitor(flags,'L1/L1TopoOffline',True,True,True,True,True,args.forceCtp,algLogLevel),
487 sequenceName="AthAlgSeq"
488 )
489
490 histSvc = CompFactory.THistSvc(Output = ["EXPERT DATAFILE='expert-monitoring-l1topo.root', OPT='RECREATE'"])
491 acc.addService(histSvc)
492
493 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
494 log.debug('Adding the following output EDM to ItemList: %s', outputEDM)
495 acc.merge(OutputStreamCfg(flags, 'AOD', ItemList=outputEDM))
496 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
497 acc.merge(SetupMetaDataForStreamCfg(flags, 'AOD'))
498
499 if args.log == 'verbose' or args.perfmon:
500 acc.printConfig(withDetails=True, summariseProps=True, printDefaults=True)
501
502 if acc.run().isFailure():
503 sys.exit(1)
if(febId1==febId2)
void print(char *figname, TCanvas *c1)
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)