ATLAS Offline Software
L1TopoSimulationConfig.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 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
6 
8 
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 
46 def 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 
175 def 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 
267 if __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.L1.doMuon = True
324  flags.Trigger.enableL1MuonPhase1 = True
325  flags.Trigger.L1.doMuonTopoInputs = True
326  flags.Trigger.enableL1TopoBWSimulation = args.useBW
327  flags.PerfMon.doFullMonMT = args.perfmon
328  flags.PerfMon.OutputJSON = 'perfmonmt_test.json'
329  flags.Trigger.enableL1TopoDump = args.enableL1TopoDump
330  from IOVDbSvc.IOVDbAutoCfgFlags import getLastGlobalTag
331  flags.IOVDb.GlobalTag = getLastGlobalTag(flags)
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  print("Espresso Path: ", gFexTool.gEspressoOutputContainerWriteKey.Path)
443  outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsJwojOutputContainerWriteKey.Path)
444  outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMHTComponentsJwojOutputContainerWriteKey.Path)
445  outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMSTComponentsJwojOutputContainerWriteKey.Path)
446  outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsNoiseCutOutputContainerWriteKey.Path)
447  outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gMETComponentsRmsOutputContainerWriteKey.Path)
448  outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarENoiseCutOutputContainerWriteKey.Path)
449  outputEDM += addEDM('xAOD::gFexGlobalRoIContainer', gFexTool.gScalarERmsOutputContainerWriteKey.Path)
450  maybeMissingRobs += gFexTool.ROBIDs
451  if args.doCaloInput:
452  gFexInputByteStreamTool = acc.popToolsAndMerge(gFexInputByteStreamToolCfg(flags, 'gFexInputByteStreamTool', writeBS=False))
453  decoderTools += [gFexInputByteStreamTool]
454  outputEDM += addEDM('xAOD::gFexTowerContainer', gFexInputByteStreamTool.gTowersWriteKey.Path)
455  maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
456 
457  if 'Topo' in subsystem:
458  from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoPhase1ByteStreamToolCfg
459  l1topoBSTool = acc.popToolsAndMerge(L1TopoPhase1ByteStreamToolCfg(flags, "L1TopoBSDecoderTool"))
460  decoderTools += [l1topoBSTool]
461  outputEDM += addEDM('xAOD::L1TopoRawDataContainer', l1topoBSTool.L1TopoPhase1RAWDataWriteContainer.Path)
462  maybeMissingRobs += l1topoBSTool.ROBIDs
463 
464  decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name="L1TriggerByteStreamDecoder",
465  DecoderTools=decoderTools,
466  MaybeMissingROBs=maybeMissingRobs,
467  OutputLevel=algLogLevel)
468 
469  acc.addEventAlgo(decoderAlg, sequenceName='AthAlgSeq')
470 
471  roib2topo = CompFactory.LVL1.RoiB2TopoInputDataCnv(name='RoiB2TopoInputDataCnv')
472  roib2topo.OutputLevel = algLogLevel
473  acc.addEventAlgo(roib2topo, sequenceName="AthAlgSeq")
474  from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoByteStreamCfg
475  acc.merge(L1TopoByteStreamCfg(flags), sequenceName='AthAlgSeq')
476  outputEDM += addEDM('xAOD::L1TopoRawDataContainer', 'L1TopoRawData')
477 
478  acc.merge(L1TopoSimulationStandaloneCfg(flags,outputEDM,doMuons=('Muons' in subsystem)), sequenceName='AthAlgSeq')
479  if args.algoHdwMon:
480  acc.getEventAlgo('L1TopoSimulation').FillHistoBasedOnHardware = True
481  acc.getEventAlgo('L1TopoSimulation').PrescaleDAQROBAccess = 1
482  outputEDM += addEDM('xAOD::L1TopoSimResultsContainer','L1_TopoSimResults')
483 
484  # phase1 mon
485  from L1TopoOnlineMonitoring import L1TopoOnlineMonitoringConfig as TopoMonConfig
486  acc.addEventAlgo(
487  TopoMonConfig.getL1TopoPhase1OnlineMonitor(flags,'L1/L1TopoOffline',True,True,True,True,True,args.forceCtp,algLogLevel),
488  sequenceName="AthAlgSeq"
489  )
490 
491  from GaudiSvc.GaudiSvcConf import THistSvc # noqa: F401
492  histSvc = CompFactory.THistSvc(Output = ["EXPERT DATAFILE='expert-monitoring-l1topo.root', OPT='RECREATE'"])
493  acc.addService(histSvc)
494 
495  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
496  log.debug('Adding the following output EDM to ItemList: %s', outputEDM)
497  acc.merge(OutputStreamCfg(flags, 'AOD', ItemList=outputEDM))
498  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
499  acc.merge(SetupMetaDataForStreamCfg(flags, 'AOD'))
500 
501  if args.log == 'verbose' or args.perfmon:
502  acc.printConfig(withDetails=True, summariseProps=True, printDefaults=True)
503 
504  if acc.run().isFailure():
505  sys.exit(1)
L1TopoByteStreamConfig.L1TopoPhase1ByteStreamToolCfg
def L1TopoPhase1ByteStreamToolCfg(flags, name, writeBS=False)
Definition: L1TopoByteStreamConfig.py:9
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=None, MetadataItemList=None, disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, keepProvenanceTagsRegEx=None, AcceptAlgs=None, HelperTools=None)
Definition: OutputStreamConfig.py:13
TrigT1MuonRecRoiToolConfig.RPCRecRoiToolCfg
def RPCRecRoiToolCfg(flags, name="RPCRecRoiTool", useRun3Config=True)
Definition: TrigT1MuonRecRoiToolConfig.py:8
L1TopoByteStreamConfig.L1TopoByteStreamCfg
def L1TopoByteStreamCfg(flags)
Definition: L1TopoByteStreamConfig.py:40
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:342
MuonBytestreamDecodeConfig.RpcBytestreamDecodeCfg
def RpcBytestreamDecodeCfg(flags, name="RpcRawDataProvider", **kwargs)
This configuration function sets up everything for decoding RPC bytestream data into RDOs.
Definition: MuonBytestreamDecodeConfig.py:34
L1TopoInputHistograms.configureeFexInputProviderHistograms
def configureeFexInputProviderHistograms(alg, flags)
Definition: L1TopoInputHistograms.py:65
L1TopoInputHistograms.configureEMTauInputProviderHistograms
def configureEMTauInputProviderHistograms(alg, flags)
Definition: L1TopoInputHistograms.py:226
python.TrigConfigSvcCfg.generateL1Menu
def generateL1Menu(flags)
Definition: TrigConfigSvcCfg.py:225
L1TopoInputHistograms.configurejFexInputProviderHistograms
def configurejFexInputProviderHistograms(alg, flags)
Definition: L1TopoInputHistograms.py:114
L1TopoInputHistograms.configureMuonInputProviderHistograms
def configureMuonInputProviderHistograms(alg, flags)
Definition: L1TopoInputHistograms.py:3
AnalysisTriggerAlgsConfig.RoIBResultToxAODCfg
def RoIBResultToxAODCfg(flags)
Definition: AnalysisTriggerAlgsConfig.py:9
L1CaloFEXByteStreamConfig.jFexInputByteStreamToolCfg
def jFexInputByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:236
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
L1TopoInputHistograms.configureJetInputProviderHistograms
def configureJetInputProviderHistograms(alg, flags)
Definition: L1TopoInputHistograms.py:250
L1TopoInputHistograms.configuregFexInputProviderHistograms
def configuregFexInputProviderHistograms(alg, flags)
Definition: L1TopoInputHistograms.py:187
python.IOVDbAutoCfgFlags.getLastGlobalTag
def getLastGlobalTag(prevFlags)
Definition: IOVDbAutoCfgFlags.py:6
L1TopoSimulationConfig.L1TopoSimulationCfg
def L1TopoSimulationCfg(flags, doMonitoring=True, readMuCTPI=False, name="L1TopoSimulation", deactivateL1TopoMuons=False, useMuonRoIs=False, useMuonDecoder=False, writeMuonRoIs=True)
Definition: L1TopoSimulationConfig.py:46
TrigT1ResultByteStreamConfig.RoIBResultByteStreamToolCfg
def RoIBResultByteStreamToolCfg(flags, name, writeBS=False)
Definition: TrigT1ResultByteStreamConfig.py:18
L1TopoSimulationConfig.L1TopoSimulationStandaloneCfg
def L1TopoSimulationStandaloneCfg(flags, outputEDM=[], doMuons=False, doMonitoring=True)
Definition: L1TopoSimulationConfig.py:175
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:310
L1CaloFEXByteStreamConfig.gFexByteStreamToolCfg
def gFexByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:148
Constants
some useful constants -------------------------------------------------—
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26
GenericMonitoringTool
Definition: GenericMonitoringTool.py:1
L1CaloFEXByteStreamConfig.gFexInputByteStreamToolCfg
def gFexInputByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:279
L1TopoSimulationConfig.addEDM
def addEDM(edmType, edmName)
Definition: L1TopoSimulationConfig.py:377
python.TrigConfigSvcCfg.L1ConfigSvcCfg
def L1ConfigSvcCfg(flags)
Definition: TrigConfigSvcCfg.py:239
TrigT1ResultByteStreamConfig.MuonRoIByteStreamToolCfg
def MuonRoIByteStreamToolCfg(flags, name, writeBS=False, writeDecodedMuonRoIs=True)
Definition: TrigT1ResultByteStreamConfig.py:69
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
L1CaloFEXByteStreamConfig.jFexRoiByteStreamToolCfg
def jFexRoiByteStreamToolCfg(flags, name, *writeBS=False, xTOBs=False)
Definition: L1CaloFEXByteStreamConfig.py:87
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
TrigT1MuonRecRoiToolConfig.TGCRecRoiToolCfg
def TGCRecRoiToolCfg(flags, name="TGCRecRoiTool", useRun3Config=True)
Definition: TrigT1MuonRecRoiToolConfig.py:18
L1CaloFEXByteStreamConfig.eFexByteStreamToolCfg
def eFexByteStreamToolCfg(flags, name, *writeBS=False, TOBs=True, xTOBs=False, multiSlice=False, decodeInputs=False)
Definition: L1CaloFEXByteStreamConfig.py:8
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
L1TopoInputHistograms.configureEnergyInputProviderHistograms
def configureEnergyInputProviderHistograms(alg, flags)
Definition: L1TopoInputHistograms.py:220
L1TopoSimulationConfig.L1LegacyTopoSimulationCfg
def L1LegacyTopoSimulationCfg(flags)
Definition: L1TopoSimulationConfig.py:7
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
L1TopoSimulationConfig.int
int
Definition: L1TopoSimulationConfig.py:290
MuonBytestreamDecodeConfig.TgcBytestreamDecodeCfg
def TgcBytestreamDecodeCfg(flags, name="TgcRawDataProvider", **kwargs)
Definition: MuonBytestreamDecodeConfig.py:97