4 from AthenaConfiguration.ComponentAccumulator
import (ComponentAccumulator,)
5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from libpyeformat_helper
import SourceIdentifier, SubDetector
8 from getAlgData
import algdata_from_menu
9 from toolFromAlgData
import toolFromAlgData
11 from AthenaCommon.Logging
import logging
12 logger = logging.getLogger(__name__)
14 logger.setLevel(VERBOSE)
22 globalSimAlg = CompFactory.GlobalSim.GlobalL1TopoSimulation(
"GlobalSimTest")
23 globalSimAlg.OutputLevel = algLogLevel
25 if 'GSDEBUG' in os.environ:
26 globalSimAlg.enableDumps =
True
31 'SC111-CjJ40abpETA26',
32 '0DR03-eEM9ab-CjJ40ab',
40 logger.info(
"number of alg_data " +
str(len(alg_data_list)))
45 acc.addEventAlgo(globalSimAlg)
47 histSvc = CompFactory.THistSvc(Output =[
"EXPERT DATAFILE='expert-monitoring.root', OPT='RECREATE'"])
48 acc.addService(histSvc)
57 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig
import RoIBResultByteStreamToolCfg
59 decoderTools += [roibResultTool]
62 for module_id
in roibResultTool.L1TopoModuleIds:
63 maybeMissingRobs.append(
int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id)))
65 for module_id
in roibResultTool.JetModuleIds:
66 maybeMissingRobs.append(
int(SourceIdentifier(SubDetector.TDAQ_CALO_JET_PROC_ROI, module_id)))
68 for module_id
in roibResultTool.EMModuleIds:
69 maybeMissingRobs.append(
int(SourceIdentifier(SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, module_id)))
72 def addEDM(edmType, edmName):
73 auxType = edmType.replace(
'Container',
'AuxContainer')
74 return [f
'{edmType}#{edmName}', f
'{auxType}#{edmName}Aux.']
76 if 'jFex' in subsystems:
77 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
78 jFexRoiByteStreamToolCfg,jFexInputByteStreamToolCfg)
82 flags,
'jFexBSDecoder', writeBS=
False))
84 decoderTools += [jFexTool]
85 outputEDM +=
addEDM(
'xAOD::jFexSRJetRoIContainer',
86 jFexTool.jJRoIContainerWriteKey.Path)
88 outputEDM +=
addEDM(
'xAOD::jFexLRJetRoIContainer',
89 jFexTool.jLJRoIContainerWriteKey.Path)
91 outputEDM +=
addEDM(
'xAOD::jFexTauRoIContainer' ,
92 jFexTool.jTauRoIContainerWriteKey.Path)
94 outputEDM +=
addEDM(
'xAOD::jFexFwdElRoIContainer',
95 jFexTool.jEMRoIContainerWriteKey.Path)
97 outputEDM +=
addEDM(
'xAOD::jFexSumETRoIContainer',
98 jFexTool.jTERoIContainerWriteKey.Path)
99 outputEDM +=
addEDM(
'xAOD::jFexMETRoIContainer' ,
100 jFexTool.jXERoIContainerWriteKey.Path)
101 maybeMissingRobs += jFexTool.ROBIDs
105 jFexInputByteStreamTool = acc.popToolsAndMerge(
107 'jFexInputBSDecoderTool',
110 decoderTools += [jFexInputByteStreamTool]
111 outputEDM +=
addEDM(
'xAOD::jFexTowerContainer',
112 jFexInputByteStreamTool.jTowersWriteKey.Path)
113 maybeMissingRobs += jFexInputByteStreamTool.ROBIDs
115 if 'eFex' in subsystems:
116 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
117 eFexByteStreamToolCfg,)
119 eFexTool = acc.popToolsAndMerge(
123 decodeInputs=args.doCaloInput))
125 decoderTools += [eFexTool]
126 outputEDM +=
addEDM(
'xAOD::eFexEMRoIContainer',
127 eFexTool.eEMContainerWriteKey.Path)
128 outputEDM +=
addEDM(
'xAOD::eFexTauRoIContainer',
129 eFexTool.eTAUContainerWriteKey.Path)
132 outputEDM +=
addEDM(
'xAOD::eFexTowerContainer',
133 eFexTool.eTowerContainerWriteKey.Path)
135 maybeMissingRobs += eFexTool.ROBIDs
137 if 'gFex' in subsystems:
138 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig
import (
139 gFexByteStreamToolCfg,gFexInputByteStreamToolCfg,)
142 flags,
'gFexBSDecoder', writeBS=
False))
144 decoderTools += [gFexTool]
146 'xAOD::gFexJetRoIContainer',
147 gFexTool.gFexRhoOutputContainerWriteKey.Path)
150 'xAOD::gFexJetRoIContainer',
151 gFexTool.gFexSRJetOutputContainerWriteKey.Path)
154 'xAOD::gFexJetRoIContainer',
155 gFexTool.gFexLRJetOutputContainerWriteKey.Path)
158 'xAOD::gFexGlobalRoIContainer',
159 gFexTool.gScalarEJwojOutputContainerWriteKey.Path)
162 'xAOD::gFexGlobalRoIContainer',
163 gFexTool.gMETComponentsJwojOutputContainerWriteKey.Path)
166 'xAOD::gFexGlobalRoIContainer',
167 gFexTool.gMHTComponentsJwojOutputContainerWriteKey.Path)
170 'xAOD::gFexGlobalRoIContainer',
171 gFexTool.gMSTComponentsJwojOutputContainerWriteKey.Path)
174 'xAOD::gFexGlobalRoIContainer',
175 gFexTool.gMETComponentsNoiseCutOutputContainerWriteKey.Path)
178 'xAOD::gFexGlobalRoIContainer',
179 gFexTool.gMETComponentsRmsOutputContainerWriteKey.Path)
182 'xAOD::gFexGlobalRoIContainer',
183 gFexTool.gScalarENoiseCutOutputContainerWriteKey.Path)
186 'xAOD::gFexGlobalRoIContainer',
187 gFexTool.gScalarERmsOutputContainerWriteKey.Path)
189 maybeMissingRobs += gFexTool.ROBIDs
192 gFexInputByteStreamTool = acc.popToolsAndMerge(
194 flags,
'gFexInputByteStreamTool', writeBS=
False))
196 decoderTools += [gFexInputByteStreamTool]
197 outputEDM +=
addEDM(
'xAOD::gFexTowerContainer',
198 gFexInputByteStreamTool.gTowersWriteKey.Path)
200 maybeMissingRobs += gFexInputByteStreamTool.ROBIDs
202 decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(
203 name=
"L1TriggerByteStreamDecoder",
204 DecoderTools=decoderTools,
205 MaybeMissingROBs=maybeMissingRobs,
206 OutputLevel=algLogLevel)
208 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
209 log.debug(
'Adding the following output EDM to ItemList: %s', outputEDM)
211 acc.addEventAlgo(decoderAlg, sequenceName=
'AthAlgSeq')
216 if __name__ ==
'__main__':
217 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
218 from AthenaCommon.Logging
import logging
222 log = logging.getLogger(
'globalSim')
227 from argparse
import RawTextHelpFormatter
229 parser = argparse.ArgumentParser(
230 "Running L1TopoSimulation standalone for the BS input",
231 formatter_class=RawTextHelpFormatter)
239 help=
"files to process",
248 help=
"Decoding L1Calo inputs",
258 help=
"Maximum number of events will be executed.",
268 help=
"Number of events to skip.",
272 args = parser.parse_args()
274 logger.debug(
'args:')
281 flags.Exec.MaxEvents = args.nevent
284 flags.Input.Files = args.inputFiles
286 flags.Input.Files = [
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CampaignInputs/data23/RAW/data23_13p6TeV.00452463.physics_Main.daq.RAW/540events.data23_13p6TeV.00452463.physics_Main.daq.RAW._lb0514._SFO-16._0004.data']
289 flags.Concurrency.NumThreads = 1
290 flags.Concurrency.NumConcurrentEvents = 1
291 flags.Exec.SkipEvents = args.skipEvents
293 flags.Output.AODFileName =
'AOD.pool.root'
294 flags.Trigger.triggerMenuSetup =
'PhysicsP1_pp_run3_v1'
296 flags.GeoModel.AtlasVersion=
"ATLAS-R3S-2021-03-01-00"
304 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
307 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
311 from TrigConfigSvc.TrigConfigSvcCfg
import L1ConfigSvcCfg, generateL1Menu
315 subsystems = (
'jFex',
'eFex')
321 roib2topo = CompFactory.LVL1.RoiB2TopoInputDataCnv(
322 name=
'RoiB2TopoInputDataCnv')
324 roib2topo.OutputLevel = algLogLevel
325 acc.addEventAlgo(roib2topo, sequenceName=
"AthAlgSeq")
327 from L1TopoByteStream.L1TopoByteStreamConfig
import L1TopoByteStreamCfg
330 if acc.run().isFailure():