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 flags, name=
"CTPResultBSDecoderTool", writeBS=
False))
180 decoderTools += [ctpResultTool]
185 if flags.Trigger.L1.doMuon
and flags.Trigger.enableL1MuonPhase1
and flags.Trigger.doHLT :
187 flags, name=
"L1MuonBSDecoderTool", writeBS=
False))
188 decoderTools += [muonRoiTool]
193 if flags.Trigger.L1.doCalo
and flags.Trigger.enableL1CaloPhase1:
197 if flags.Trigger.L1.doeFex:
199 if flags.Trigger.doHLT:
200 eFexByteStreamTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(
210 eFexByteStreamTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(
217 decodeInputs=flags.Trigger.L1.doCaloInputs
219 decoderTools += [eFexByteStreamTool]
222 if not flags.Trigger.doHLT:
223 maybeMissingRobs += eFexByteStreamTool.ROBIDs
228 if flags.Trigger.L1.dojFex:
230 if flags.Trigger.doHLT:
231 jFexRoiByteStreamTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
238 jFexRoiByteStreamTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
244 decoderTools += [jFexRoiByteStreamTool]
245 maybeMissingRobs += jFexRoiByteStreamTool.ROBIDs
248 if flags.Trigger.L1.doCaloInputs:
249 jFexInputByteStreamTool = acc.popToolsAndMerge(jFexInputByteStreamToolCfg(
251 'jFexInputBSDecoderTool',
254 decoderTools += [jFexInputByteStreamTool]
255 maybeMissingRobs += jFexInputByteStreamTool.ROBIDs
261 if flags.Trigger.L1.dogFex:
263 if flags.Trigger.doHLT:
264 gFexByteStreamTool = acc.popToolsAndMerge(gFexByteStreamToolCfg(
269 decoderTools += [gFexByteStreamTool]
270 maybeMissingRobs += gFexByteStreamTool.ROBIDs
273 if flags.Trigger.L1.doCaloInputs:
274 gFexInputByteStreamTool = acc.popToolsAndMerge(gFexInputByteStreamToolCfg(
276 'gFexInputBSDecoderTool',
279 decoderTools += [gFexInputByteStreamTool]
280 maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
285 if flags.Trigger.L1.doTopo
and flags.Trigger.enableL1CaloPhase1
and flags.Trigger.L1.doTopoPhase1:
286 topoByteStreamTool = acc.popToolsAndMerge(L1TopoPhase1ByteStreamToolCfg(
288 "L1TopoBSDecoderTool",
291 decoderTools += [topoByteStreamTool]
292 maybeMissingRobs += topoByteStreamTool.ROBIDs
294 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name=
"L1TriggerByteStreamDecoder",
295 DecoderTools=decoderTools,
296 MaybeMissingROBs=list(
set(maybeMissingRobs)))
298 if flags.Trigger.doHLT
or flags.DQ.Steering.doHLTMon:
299 from TrigT1ResultByteStream.TrigT1ResultByteStreamMonitoringConfig
import L1TriggerByteStreamDecoderMonitoringCfg
300 decoderAlg.MonTool = acc.popToolsAndMerge(L1TriggerByteStreamDecoderMonitoringCfg(flags, decoderAlg.getName(), decoderTools))
302 acc.addEventAlgo(decoderAlg, primary=
True)
305 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
306 readBSAcc = ByteStreamReadCfg(flags)
307 readBSAcc.getEventAlgo(
'SGInputLoader').Load.add(
308 (
'ByteStreamMetadataContainer',
'InputMetaDataStore+ByteStreamMetadata'))
312 if not flags.Trigger.doHLT:
313 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD, addToAOD
314 outputEDM = getEDMListFromWriteHandles([tool
for tool
in decoderAlg.DecoderTools
if (
'RoIBResult' not in tool.getName()
and 'CTPResult' not in tool.getName())])
315 _log.info(
'Adding the following output EDM to ItemList: %s', outputEDM)
316 acc.merge(addToESD(flags, outputEDM))
317 acc.merge(addToAOD(flags, outputEDM))
323 return acc, outputEDM