20 acc = ComponentAccumulator()
22 if algLogLevel
is None:
23 algLogLevel = flags.Exec.OutputLevel
25 globalSimAlg = CompFactory.GlobalSim.GlobalSimulationAlg(
"GlobalL1TopoSim")
26 globalSimAlg.OutputLevel = algLogLevel
28 if 'GSDEBUG' in os.environ:
29 globalSimAlg.enableDumps =
True
34 'SC111-CjJ40abpETA26',
35 '0DR03-eEM9ab-CjJ40ab',
42 alg_data_list = algdata_from_menu(flags, root_names=root_names, do_dot=
True)
43 logger.info(
"number of alg_data " + str(len(alg_data_list)))
48 acc.addEventAlgo(globalSimAlg)
50 from TriggerJobOpts.TriggerHistSvcConfig
import TriggerHistSvcConfig
51 acc.merge(TriggerHistSvcConfig(flags))
61 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig
import RoIBResultByteStreamToolCfg
62 roibResultTool = acc.popToolsAndMerge(RoIBResultByteStreamToolCfg(flags, name=
"RoIBResultBSDecoderTool", writeBS=
False))
63 decoderTools += [roibResultTool]
66 for module_id
in roibResultTool.L1TopoModuleIds:
67 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id)))
69 for module_id
in roibResultTool.JetModuleIds:
70 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_JET_PROC_ROI, module_id)))
72 for module_id
in roibResultTool.EMModuleIds:
73 maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, module_id)))
76 def addEDM(edmType, edmName):
77 auxType = edmType.replace(
'Container',
'AuxContainer')
78 return [f
'{edmType}#{edmName}', f
'{auxType}#{edmName}Aux.']
80 if 'jFex' in subsystems:
81 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
82 jFexRoiByteStreamToolCfg,jFexInputByteStreamToolCfg)
85 jFexTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
86 flags,
'jFexBSDecoder', writeBS=
False))
88 decoderTools += [jFexTool]
89 outputEDM += addEDM(
'xAOD::jFexSRJetRoIContainer',
90 jFexTool.jJRoIContainerWriteKey.Path)
92 outputEDM += addEDM(
'xAOD::jFexLRJetRoIContainer',
93 jFexTool.jLJRoIContainerWriteKey.Path)
95 outputEDM += addEDM(
'xAOD::jFexTauRoIContainer' ,
96 jFexTool.jTauRoIContainerWriteKey.Path)
98 outputEDM += addEDM(
'xAOD::jFexFwdElRoIContainer',
99 jFexTool.jEMRoIContainerWriteKey.Path)
101 outputEDM += addEDM(
'xAOD::jFexSumETRoIContainer',
102 jFexTool.jTERoIContainerWriteKey.Path)
103 outputEDM += addEDM(
'xAOD::jFexMETRoIContainer' ,
104 jFexTool.jXERoIContainerWriteKey.Path)
105 maybeMissingRobs += jFexTool.ROBIDs
109 jFexInputByteStreamTool = acc.popToolsAndMerge(
110 jFexInputByteStreamToolCfg(flags,
111 'jFexInputBSDecoderTool',
114 decoderTools += [jFexInputByteStreamTool]
115 outputEDM += addEDM(
'xAOD::jFexTowerContainer',
116 jFexInputByteStreamTool.jTowersWriteKey.Path)
117 maybeMissingRobs += jFexInputByteStreamTool.ROBIDs
119 if 'eFex' in subsystems:
120 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
121 eFexByteStreamToolCfg,)
123 eFexTool = acc.popToolsAndMerge(
124 eFexByteStreamToolCfg(flags,
127 decodeInputs=args.doCaloInput))
129 decoderTools += [eFexTool]
130 outputEDM += addEDM(
'xAOD::eFexEMRoIContainer',
131 eFexTool.eEMContainerWriteKey.Path)
132 outputEDM += addEDM(
'xAOD::eFexTauRoIContainer',
133 eFexTool.eTAUContainerWriteKey.Path)
136 outputEDM += addEDM(
'xAOD::eFexTowerContainer',
137 eFexTool.eTowerContainerWriteKey.Path)
139 maybeMissingRobs += eFexTool.ROBIDs
141 if 'gFex' in subsystems:
142 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
143 gFexByteStreamToolCfg,gFexInputByteStreamToolCfg,)
145 gFexTool = acc.popToolsAndMerge(gFexByteStreamToolCfg(
146 flags,
'gFexBSDecoder', writeBS=
False))
148 decoderTools += [gFexTool]
150 'xAOD::gFexJetRoIContainer',
151 gFexTool.gFexRhoOutputContainerWriteKey.Path)
154 'xAOD::gFexJetRoIContainer',
155 gFexTool.gFexSRJetOutputContainerWriteKey.Path)
158 'xAOD::gFexJetRoIContainer',
159 gFexTool.gFexLRJetOutputContainerWriteKey.Path)
162 'xAOD::gFexGlobalRoIContainer',
163 gFexTool.gScalarEJwojOutputContainerWriteKey.Path)
166 'xAOD::gFexGlobalRoIContainer',
167 gFexTool.gMETComponentsJwojOutputContainerWriteKey.Path)
170 'xAOD::gFexGlobalRoIContainer',
171 gFexTool.gMHTComponentsJwojOutputContainerWriteKey.Path)
174 'xAOD::gFexGlobalRoIContainer',
175 gFexTool.gMSTComponentsJwojOutputContainerWriteKey.Path)
178 'xAOD::gFexGlobalRoIContainer',
179 gFexTool.gMETComponentsNoiseCutOutputContainerWriteKey.Path)
182 'xAOD::gFexGlobalRoIContainer',
183 gFexTool.gMETComponentsRmsOutputContainerWriteKey.Path)
186 'xAOD::gFexGlobalRoIContainer',
187 gFexTool.gScalarENoiseCutOutputContainerWriteKey.Path)
190 'xAOD::gFexGlobalRoIContainer',
191 gFexTool.gScalarERmsOutputContainerWriteKey.Path)
193 maybeMissingRobs += gFexTool.ROBIDs
196 gFexInputByteStreamTool = acc.popToolsAndMerge(
197 gFexInputByteStreamToolCfg(
198 flags,
'gFexInputByteStreamTool', writeBS=
False))
200 decoderTools += [gFexInputByteStreamTool]
201 outputEDM += addEDM(
'xAOD::gFexTowerContainer',
202 gFexInputByteStreamTool.gTowersWriteKey.Path)
204 maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
206 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(
207 name=
"L1TriggerByteStreamDecoder",
208 DecoderTools=decoderTools,
209 MaybeMissingROBs=maybeMissingRobs,
210 OutputLevel=algLogLevel)
212 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
213 log.debug(
'Adding the following output EDM to ItemList: %s', outputEDM)
215 acc.addEventAlgo(decoderAlg, sequenceName=
'AthAlgSeq')
217 acc.merge(OutputStreamCfg(flags,
'AOD', ItemList=outputEDM))