3 from libpyeformat_helper
import SourceIdentifier, SubDetector
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaCommon.Logging
import logging
10 logger = logging.getLogger(
'add_subsystems')
11 logger.setLevel(DEBUG)
21 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig
import (
22 RoIBResultByteStreamToolCfg,)
24 roibResultTool = acc.popToolsAndMerge(
26 name=
"RoIBResultBSDecoderTool",
29 decoderTools += [roibResultTool]
32 for module_id
in roibResultTool.L1TopoModuleIds:
33 maybeMissingRobs.append(
34 int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id)))
36 for module_id
in roibResultTool.JetModuleIds:
37 maybeMissingRobs.append(
38 int(SourceIdentifier(SubDetector.TDAQ_CALO_JET_PROC_ROI,
41 for module_id
in roibResultTool.EMModuleIds:
42 maybeMissingRobs.append(
int(SourceIdentifier(
43 SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, module_id)))
46 def addEDM(edmType, edmName):
47 auxType = edmType.replace(
'Container',
'AuxContainer')
48 return [f
'{edmType}#{edmName}', f
'{auxType}#{edmName}Aux.']
50 if 'jFex' in subsystems:
51 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
52 jFexRoiByteStreamToolCfg,jFexInputByteStreamToolCfg)
56 flags,
'jFexBSDecoder', writeBS=
False))
58 decoderTools += [jFexTool]
59 outputEDM +=
addEDM(
'xAOD::jFexSRJetRoIContainer',
60 jFexTool.jJRoIContainerWriteKey.Path)
62 outputEDM +=
addEDM(
'xAOD::jFexLRJetRoIContainer',
63 jFexTool.jLJRoIContainerWriteKey.Path)
65 outputEDM +=
addEDM(
'xAOD::jFexTauRoIContainer' ,
66 jFexTool.jTauRoIContainerWriteKey.Path)
68 outputEDM +=
addEDM(
'xAOD::jFexFwdElRoIContainer',
69 jFexTool.jEMRoIContainerWriteKey.Path)
71 outputEDM +=
addEDM(
'xAOD::jFexSumETRoIContainer',
72 jFexTool.jTERoIContainerWriteKey.Path)
73 outputEDM +=
addEDM(
'xAOD::jFexMETRoIContainer' ,
74 jFexTool.jXERoIContainerWriteKey.Path)
75 maybeMissingRobs += jFexTool.ROBIDs
79 jFexInputByteStreamTool = acc.popToolsAndMerge(
81 'jFexInputBSDecoderTool',
84 decoderTools += [jFexInputByteStreamTool]
85 outputEDM +=
addEDM(
'xAOD::jFexTowerContainer',
86 jFexInputByteStreamTool.jTowersWriteKey.Path)
87 maybeMissingRobs += jFexInputByteStreamTool.ROBIDs
89 if 'eFex' in subsystems:
90 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
91 eFexByteStreamToolCfg,)
93 eFexTool = acc.popToolsAndMerge(
97 decodeInputs=args.doCaloInput))
99 decoderTools += [eFexTool]
100 outputEDM +=
addEDM(
'xAOD::eFexEMRoIContainer',
101 eFexTool.eEMContainerWriteKey.Path)
102 outputEDM +=
addEDM(
'xAOD::eFexTauRoIContainer',
103 eFexTool.eTAUContainerWriteKey.Path)
106 outputEDM +=
addEDM(
'xAOD::eFexTowerContainer',
107 eFexTool.eTowerContainerWriteKey.Path)
109 maybeMissingRobs += eFexTool.ROBIDs
111 if 'gFex' in subsystems:
112 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
113 gFexByteStreamToolCfg,gFexInputByteStreamToolCfg,)
116 flags,
'gFexBSDecoder', writeBS=
False))
118 decoderTools += [gFexTool]
120 'xAOD::gFexJetRoIContainer',
121 gFexTool.gFexRhoOutputContainerWriteKey.Path)
124 'xAOD::gFexJetRoIContainer',
125 gFexTool.gFexSRJetOutputContainerWriteKey.Path)
128 'xAOD::gFexJetRoIContainer',
129 gFexTool.gFexLRJetOutputContainerWriteKey.Path)
132 'xAOD::gFexGlobalRoIContainer',
133 gFexTool.gScalarEJwojOutputContainerWriteKey.Path)
136 'xAOD::gFexGlobalRoIContainer',
137 gFexTool.gMETComponentsJwojOutputContainerWriteKey.Path)
140 'xAOD::gFexGlobalRoIContainer',
141 gFexTool.gMHTComponentsJwojOutputContainerWriteKey.Path)
144 'xAOD::gFexGlobalRoIContainer',
145 gFexTool.gMSTComponentsJwojOutputContainerWriteKey.Path)
148 'xAOD::gFexGlobalRoIContainer',
149 gFexTool.gMETComponentsNoiseCutOutputContainerWriteKey.Path)
152 'xAOD::gFexGlobalRoIContainer',
153 gFexTool.gMETComponentsRmsOutputContainerWriteKey.Path)
156 'xAOD::gFexGlobalRoIContainer',
157 gFexTool.gScalarENoiseCutOutputContainerWriteKey.Path)
160 'xAOD::gFexGlobalRoIContainer',
161 gFexTool.gScalarERmsOutputContainerWriteKey.Path)
163 maybeMissingRobs += gFexTool.ROBIDs
166 gFexInputByteStreamTool = acc.popToolsAndMerge(
168 flags,
'gFexInputByteStreamTool', writeBS=
False))
170 decoderTools += [gFexInputByteStreamTool]
171 outputEDM +=
addEDM(
'xAOD::gFexTowerContainer',
172 gFexInputByteStreamTool.gTowersWriteKey.Path)
174 maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
176 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(
177 name=
"L1TriggerByteStreamDecoder",
178 DecoderTools=decoderTools,
179 MaybeMissingROBs=maybeMissingRobs,
180 OutputLevel=OutputLevel)
182 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
183 logger.debug(
'Adding the following output EDM to ItemList: %s', outputEDM)
185 acc.addEventAlgo(decoderAlg, sequenceName=
'AthAlgSeq')