19 acc = ComponentAccumulator()
20 tool = CompFactory.RoIBResultByteStreamTool(name)
22 if not flags.Trigger.L1.doCTP
or flags.Trigger.CTP.UseEDMxAOD:
24 tool.CTPModuleId = 0xFF
26 if flags.Trigger.enableL1MuonPhase1
or not flags.Trigger.L1.doMuon:
28 tool.MUCTPIModuleId = 0xFF
30 if not flags.Trigger.enableL1CaloLegacy
or not flags.Trigger.L1.doCalo:
32 tool.JetModuleIds = []
35 if flags.Trigger.EDMVersion == 1
or not flags.Trigger.L1.doTopo:
37 tool.L1TopoModuleIds = []
41 tool.RoIBResultReadKey=
"RoIBResult"
42 tool.RoIBResultWriteKey=
""
45 tool.RoIBResultReadKey=
""
46 tool.RoIBResultWriteKey=
"RoIBResult"
48 acc.setPrivateTools(tool)
70 acc = ComponentAccumulator()
71 tool = CompFactory.ExampleL1TriggerByteStreamTool(name)
73 muctpi_robid = int(SourceIdentifier(SubDetector.TDAQ_MUON_CTP_INTERFACE, muctpi_moduleid))
74 tool.ROBIDs = [muctpi_robid]
77 tool.MuonRoIContainerReadKey=
"LVL1MuonRoIs"
78 tool.MuonRoIContainerWriteKey=
""
79 tool.L1TopoOutputLocID=
""
82 tool.MuonRoIContainerReadKey=
""
83 tool.MuonRoIContainerWriteKey=recordable(
"LVL1MuonRoIs")
84 acc.setPrivateTools(tool)
88 acc = ComponentAccumulator()
89 tool = CompFactory.MuonRoIByteStreamTool(name)
91 muctpi_robid = int(SourceIdentifier(SubDetector.TDAQ_MUON_CTP_INTERFACE, muctpi_moduleid))
92 tool.ROBIDs = [muctpi_robid]
93 tool.DoTopo = flags.Trigger.L1.doMuonTopoInputs
94 tool.WriteDecodedMuonRoIs = writeDecodedMuonRoIs
96 from TrigT1ResultByteStream.TrigT1ResultByteStreamMonitoringConfig
import L1MuonBSConverterMonitoringCfg
97 tool.MonTool = acc.popToolsAndMerge(L1MuonBSConverterMonitoringCfg(flags, name, writeBS))
100 containerBaseName =
"LVL1MuonRoIs"
102 containerBaseName +
"BCm2",
103 containerBaseName +
"BCm1",
105 containerBaseName +
"BCp1",
106 containerBaseName +
"BCp2",
108 topocontainerBaseName =
"L1MuCTPItoL1TopoLocationFromMuonRoI"
109 topocontainerNames = [
110 topocontainerBaseName +
"-2",
111 topocontainerBaseName +
"-1",
112 topocontainerBaseName,
113 topocontainerBaseName +
"1",
114 topocontainerBaseName +
"2",
118 tool.MuonRoIContainerReadKeys += containerNames
121 tool.MuonRoIContainerWriteKeys += [recordable(c)
for c
in containerNames]
122 tool.L1TopoOutputLocID += topocontainerNames
124 tool.RPCRecRoiTool = acc.popToolsAndMerge(RPCRecRoiToolCfg(flags))
125 tool.TGCRecRoiTool = acc.popToolsAndMerge(TGCRecRoiToolCfg(flags))
126 tool.TrigThresholdDecisionTool = acc.popToolsAndMerge(TrigThresholdDecisionToolCfg(flags))
128 acc.setPrivateTools(tool)
152 acc = ComponentAccumulator()
154 maybeMissingRobs = []
159 if not flags.Trigger.doLVL1:
162 flags, name=
"RoIBResultBSDecoderTool", writeBS=
False))
163 decoderTools += [roibResultTool]
165 for module_id
in roibResultTool.L1TopoModuleIds:
166 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id)))
167 if flags.Trigger.EDMVersion == 2
and not flags.Trigger.doHLT:
169 for module_id
in roibResultTool.JetModuleIds:
170 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_JET_PROC_ROI, module_id)))
171 for module_id
in roibResultTool.EMModuleIds:
172 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, module_id)))
177 if not flags.Trigger.doLVL1
and flags.Trigger.CTP.UseEDMxAOD:
179 if flags.Trigger.CTP.UseRoibROB:
182 flags, name=
"CTPResultBSDecoderTool", robID=rob, writeBS=
False))
183 decoderTools += [ctpResultTool]
188 if flags.Trigger.L1.doMuon
and flags.Trigger.enableL1MuonPhase1
and flags.Trigger.doHLT :
190 flags, name=
"L1MuonBSDecoderTool", writeBS=
False))
191 decoderTools += [muonRoiTool]
196 if flags.Trigger.L1.doCalo
and flags.Trigger.enableL1CaloPhase1:
200 if flags.Trigger.L1.doeFex:
202 if flags.Trigger.doHLT:
203 eFexByteStreamTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(
213 eFexByteStreamTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(
220 decodeInputs=flags.Trigger.L1.doCaloInputs
222 decoderTools += [eFexByteStreamTool]
225 if not flags.Trigger.doHLT:
226 maybeMissingRobs += eFexByteStreamTool.ROBIDs
231 if flags.Trigger.L1.dojFex:
233 if flags.Trigger.doHLT:
234 jFexRoiByteStreamTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
241 jFexRoiByteStreamTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
247 decoderTools += [jFexRoiByteStreamTool]
248 maybeMissingRobs += jFexRoiByteStreamTool.ROBIDs
251 if flags.Trigger.L1.doCaloInputs:
252 jFexInputByteStreamTool = acc.popToolsAndMerge(jFexInputByteStreamToolCfg(
254 'jFexInputBSDecoderTool',
257 decoderTools += [jFexInputByteStreamTool]
258 maybeMissingRobs += jFexInputByteStreamTool.ROBIDs
264 if flags.Trigger.L1.dogFex:
266 if flags.Trigger.doHLT:
267 gFexByteStreamTool = acc.popToolsAndMerge(gFexByteStreamToolCfg(
272 decoderTools += [gFexByteStreamTool]
273 maybeMissingRobs += gFexByteStreamTool.ROBIDs
276 gFexByteStreamTool = acc.popToolsAndMerge(gFexByteStreamToolCfg(
283 decoderTools += [gFexByteStreamTool]
284 maybeMissingRobs += gFexByteStreamTool.ROBIDs
287 if flags.Trigger.L1.doCaloInputs:
288 gFexInputByteStreamTool = acc.popToolsAndMerge(gFexInputByteStreamToolCfg(
290 'gFexInputBSDecoderTool',
293 decoderTools += [gFexInputByteStreamTool]
294 maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
299 if flags.Trigger.L1.doTopo
and flags.Trigger.enableL1CaloPhase1
and flags.Trigger.L1.doTopoPhase1:
300 topoByteStreamTool = acc.popToolsAndMerge(L1TopoPhase1ByteStreamToolCfg(
302 "L1TopoBSDecoderTool",
305 decoderTools += [topoByteStreamTool]
306 maybeMissingRobs += topoByteStreamTool.ROBIDs
308 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name=
"L1TriggerByteStreamDecoder",
309 DecoderTools=decoderTools,
310 MaybeMissingROBs=list(
set(maybeMissingRobs)))
312 if flags.Trigger.doHLT
or flags.DQ.Steering.doHLTMon:
313 from TrigT1ResultByteStream.TrigT1ResultByteStreamMonitoringConfig
import L1TriggerByteStreamDecoderMonitoringCfg
314 decoderAlg.MonTool = acc.popToolsAndMerge(L1TriggerByteStreamDecoderMonitoringCfg(flags, decoderAlg.getName(), decoderTools))
316 acc.addEventAlgo(decoderAlg, primary=
True)
319 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
320 readBSAcc = ByteStreamReadCfg(flags)
321 readBSAcc.getEventAlgo(
'SGInputLoader').Load.add(
322 (
'ByteStreamMetadataContainer',
'InputMetaDataStore+ByteStreamMetadata'))
326 if not flags.Trigger.doHLT:
327 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD, addToAOD
328 outputEDM = getEDMListFromWriteHandles([tool
for tool
in decoderAlg.DecoderTools
if (
'RoIBResult' not in tool.getName()
and 'CTPResult' not in tool.getName())])
331 if (any(
'CTPResult' in tool.getName()
for tool
in decoderAlg.DecoderTools)
and (
not flags.Trigger.CTP.UseRoibROB)):
332 for item
in (
'xAOD::CTPResult#CTPResult',
'xAOD::CTPResultAuxInfo#CTPResultAux.-'):
333 outputEDM.append(item)
335 _log.info(
'Adding the following output EDM to ItemList: %s', outputEDM)
336 acc.merge(addToESD(flags, outputEDM))
337 acc.merge(addToAOD(flags, outputEDM))
342 acc = ComponentAccumulator()
347 flags, name=
"RoIBResultBSEncoderTool", writeBS=
True))
348 acc.addPublicTool(roibResultTool)
351 if flags.Trigger.L1.doMuon
and flags.Trigger.enableL1MuonPhase1:
353 flags, name=
"L1MuonBSEncoderTool", writeBS=
True))
354 acc.addPublicTool(muonRoiTool)
357 if flags.Trigger.CTP.UseEDMxAOD:
359 flags, name=
"CTPResultBSEncoderTool", writeBS=
True))
360 acc.addPublicTool(ctpResultTool)
363 if flags.Trigger.L1.doeFex:
364 eFexTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(
371 decodeInputs=flags.Trigger.L1.doCaloInputs
373 acc.addPublicTool(eFexTool)
376 if flags.Trigger.L1.dojFex:
377 jFexTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
382 acc.addPublicTool(jFexTool)