ATLAS Offline Software
Functions | Variables
TrigT1ResultByteStreamConfig Namespace Reference

Functions

def RoIBResultByteStreamToolCfg (flags, name, writeBS=False)
 
def ExampleL1TriggerByteStreamToolCfg (flags, name, writeBS=False)
 
def MuonRoIByteStreamToolCfg (flags, name, writeBS=False, writeDecodedMuonRoIs=True)
 
def doRoIBResult (flags)
 
def L1TriggerByteStreamDecoderCfg (flags, returnEDM=False)
 
def L1TriggerByteStreamEncoderCfg (flags)
 
def MuCTPIPhase1ByteStreamAlgoCfg (flags)
 

Variables

 _log
 

Function Documentation

◆ doRoIBResult()

def TrigT1ResultByteStreamConfig.doRoIBResult (   flags)
Helper function returning a logic combination of flags deciding
whether the RoIBResult decoding/encoding is required in the job

Definition at line 113 of file TrigT1ResultByteStreamConfig.py.

113 def doRoIBResult(flags):
114  '''
115  Helper function returning a logic combination of flags deciding
116  whether the RoIBResult decoding/encoding is required in the job
117  '''
118  if flags.Trigger.L1.doCalo and flags.Trigger.enableL1CaloLegacy:
119  # Only needed for legacy (Run-2) L1Calo system
120  return True
121  if flags.Trigger.L1.doMuon and not flags.Trigger.enableL1MuonPhase1:
122  # Only needed for legacy (Run-2) MUCTPI data
123  return True
124  if flags.Trigger.L1.doTopo:
125  # Currently only RoIBResult path implemented for L1Topo
126  return True
127  if flags.Trigger.L1.doCTP:
128  # Currently only RoIBResult path implemented for CTP
129  return True
130  # Otherwise don't need RoIBResult
131  return False
132 

◆ ExampleL1TriggerByteStreamToolCfg()

def TrigT1ResultByteStreamConfig.ExampleL1TriggerByteStreamToolCfg (   flags,
  name,
  writeBS = False 
)

Definition at line 51 of file TrigT1ResultByteStreamConfig.py.

51 def ExampleL1TriggerByteStreamToolCfg(flags, name, writeBS=False):
52  acc = ComponentAccumulator()
53  tool = CompFactory.ExampleL1TriggerByteStreamTool(name)
54  muctpi_moduleid = 0
55  muctpi_robid = int(SourceIdentifier(SubDetector.TDAQ_MUON_CTP_INTERFACE, muctpi_moduleid))
56  tool.ROBIDs = [muctpi_robid]
57  if writeBS:
58  # write BS == read xAOD
59  tool.MuonRoIContainerReadKey="LVL1MuonRoIs"
60  tool.MuonRoIContainerWriteKey=""
61  tool.L1TopoOutputLocID=""
62  else:
63  # read BS == write xAOD
64  tool.MuonRoIContainerReadKey=""
65  tool.MuonRoIContainerWriteKey=recordable("LVL1MuonRoIs")
66  acc.setPrivateTools(tool)
67  return acc
68 

◆ L1TriggerByteStreamDecoderCfg()

def TrigT1ResultByteStreamConfig.L1TriggerByteStreamDecoderCfg (   flags,
  returnEDM = False 
)

Definition at line 133 of file TrigT1ResultByteStreamConfig.py.

133 def L1TriggerByteStreamDecoderCfg(flags, returnEDM=False):
134  acc = ComponentAccumulator()
135  decoderTools = []
136  maybeMissingRobs = []
137 
138 
141  if not flags.Trigger.doLVL1: #if we rerun L1, don't decode the original RoIBResult
142  if doRoIBResult(flags):
143  roibResultTool = acc.popToolsAndMerge(RoIBResultByteStreamToolCfg(
144  flags, name="RoIBResultBSDecoderTool", writeBS=False))
145  decoderTools += [roibResultTool]
146  # Always treat L1Topo as "maybe missing" as it was under commissioning in Run 2 and had readout issues in Run 3
147  for module_id in roibResultTool.L1TopoModuleIds:
148  maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_TOPO_PROC, module_id)))
149  if flags.Trigger.EDMVersion == 2 and not flags.Trigger.doHLT:
150  # L1Calo occasional readout errors weren't caught by HLT in 2015 - ignore these in offline reco, see ATR-24493
151  for module_id in roibResultTool.JetModuleIds:
152  maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_JET_PROC_ROI, module_id)))
153  for module_id in roibResultTool.EMModuleIds:
154  maybeMissingRobs.append(int(SourceIdentifier(SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, module_id)))
155 
156 
159  if flags.Trigger.L1.doMuon and flags.Trigger.enableL1MuonPhase1 and flags.Trigger.doHLT :
160  muonRoiTool = acc.popToolsAndMerge(MuonRoIByteStreamToolCfg(
161  flags, name="L1MuonBSDecoderTool", writeBS=False))
162  decoderTools += [muonRoiTool]
163 
164 
167  if flags.Trigger.L1.doCalo and flags.Trigger.enableL1CaloPhase1:
168  #--------------------
169  # eFex
170  #--------------------
171  if flags.Trigger.L1.doeFex:
172  # Online case in HLT with TOB decoding only
173  if flags.Trigger.doHLT:
174  eFexByteStreamTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(
175  flags,
176  'eFexBSDecoderTool',
177  writeBS=False,
178  TOBs=True,
179  xTOBs=False,
180  multiSlice=False
181  ))
182  # Reco/monitoring case (either online but downstream from HLT, or at Tier-0) with xTOB, input tower and multi-slice decoding
183  else:
184  eFexByteStreamTool = acc.popToolsAndMerge(eFexByteStreamToolCfg(
185  flags,
186  'eFexBSDecoderTool',
187  writeBS=False,
188  TOBs=False,
189  xTOBs=True,
190  multiSlice=True,
191  decodeInputs=flags.Trigger.L1.doCaloInputs
192  ))
193  decoderTools += [eFexByteStreamTool]
194  # Allow the data to be missing at T0, due to the commissioning of the phase-1 L1Calo in RAW data from 2022
195  # Forbit the data to be missing at Point 1 (2023+)
196  if not flags.Trigger.doHLT:
197  maybeMissingRobs += eFexByteStreamTool.ROBIDs
198 
199  #--------------------
200  # jFex
201  #--------------------
202  if flags.Trigger.L1.dojFex:
203  # Online case in HLT with TOB decoding only
204  if flags.Trigger.doHLT:
205  jFexRoiByteStreamTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
206  flags,
207  'jFexBSDecoderTool',
208  writeBS=False
209  ))
210  # Reco/monitoring case (either online but downstream from HLT, or at Tier-0) with xTOB decoding only
211  else:
212  jFexRoiByteStreamTool = acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(
213  flags,
214  'jFexBSDecoderTool',
215  writeBS=False,
216  xTOBs=True
217  ))
218  decoderTools += [jFexRoiByteStreamTool]
219  maybeMissingRobs += jFexRoiByteStreamTool.ROBIDs # Allow the data to be missing during commissioning of the phase-1 L1Calo (2022)
220 
221  # Input towers decoding
222  if flags.Trigger.L1.doCaloInputs:
223  jFexInputByteStreamTool = acc.popToolsAndMerge(jFexInputByteStreamToolCfg(
224  flags,
225  'jFexInputBSDecoderTool',
226  writeBS=False
227  ))
228  decoderTools += [jFexInputByteStreamTool]
229  maybeMissingRobs += jFexInputByteStreamTool.ROBIDs # Allow the data to be missing during commissioning of the phase-1 L1Calo (2022)
230 
231 
232  #--------------------
233  # gFex
234  #--------------------
235  if flags.Trigger.L1.dogFex:
236  # Online case in HLT with TOB decoding (no 'else' case because gFex doesn't have xTOBs to decode offline)
237  if flags.Trigger.doHLT:
238  gFexByteStreamTool = acc.popToolsAndMerge(gFexByteStreamToolCfg(
239  flags,
240  'gFexBSDecoderTool',
241  writeBS=False
242  ))
243  decoderTools += [gFexByteStreamTool]
244  maybeMissingRobs += gFexByteStreamTool.ROBIDs # Allow the data to be missing during commissioning of the phase-1 L1Calo (2022)
245 
246  # Input towers decoding
247  if flags.Trigger.L1.doCaloInputs:
248  gFexInputByteStreamTool = acc.popToolsAndMerge(gFexInputByteStreamToolCfg(
249  flags,
250  'gFexInputBSDecoderTool',
251  writeBS=False
252  ))
253  decoderTools += [gFexInputByteStreamTool]
254  maybeMissingRobs += gFexInputByteStreamTool.ROBIDs # Allow the data to be missing during commissioning of the phase-1 L1Calo (2022)
255 
256 
259  if flags.Trigger.L1.doTopo and flags.Trigger.enableL1CaloPhase1 and flags.Trigger.L1.doTopoPhase1:
260  topoByteStreamTool = acc.popToolsAndMerge(L1TopoPhase1ByteStreamToolCfg(
261  flags,
262  "L1TopoBSDecoderTool",
263  writeBS=False
264  ))
265  decoderTools += [topoByteStreamTool]
266  maybeMissingRobs += topoByteStreamTool.ROBIDs # Allow the data to be missing during commissioning of the phase-1 L1Topo (2022)
267 
268  decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg(name="L1TriggerByteStreamDecoder",
269  DecoderTools=decoderTools,
270  MaybeMissingROBs=list(set(maybeMissingRobs)))
271 
272  if flags.Trigger.doHLT or flags.DQ.Steering.doHLTMon:
273  from TrigT1ResultByteStream.TrigT1ResultByteStreamMonitoringConfig import L1TriggerByteStreamDecoderMonitoringCfg
274  decoderAlg.MonTool = acc.popToolsAndMerge(L1TriggerByteStreamDecoderMonitoringCfg(flags, decoderAlg.getName(), decoderTools))
275 
276  acc.addEventAlgo(decoderAlg, primary=True)
277 
278  # The decoderAlg needs to load ByteStreamMetadata for the detector mask
279  from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
280  readBSAcc = ByteStreamReadCfg(flags)
281  readBSAcc.getEventAlgo('SGInputLoader').Load.add(
282  ('ByteStreamMetadataContainer', 'InputMetaDataStore+ByteStreamMetadata'))
283  acc.merge(readBSAcc)
284 
285  # In reconstruction/monitoring jobs add the decoders' output EDM to the output file
286  if not flags.Trigger.doHLT:
287  from OutputStreamAthenaPool.OutputStreamConfig import addToESD, addToAOD
288  outputEDM = getEDMListFromWriteHandles([tool for tool in decoderAlg.DecoderTools if 'RoIBResult' not in tool.getName()])
289  _log.info('Adding the following output EDM to ItemList: %s', outputEDM)
290  acc.merge(addToESD(flags, outputEDM))
291  acc.merge(addToAOD(flags, outputEDM))
292 
293  # Return outputEDM as a second object to be used for compatibility with RecExCommon output configuration,
294  # because the above calls to addToESD/addtoAOD are no-op when this fragment is wrapped in RecExCommon.
295  # See discussions in https://gitlab.cern.ch/atlas/athena/-/merge_requests/55891#note_5912844
296  if returnEDM:
297  return acc, outputEDM
298  return acc
299 

◆ L1TriggerByteStreamEncoderCfg()

def TrigT1ResultByteStreamConfig.L1TriggerByteStreamEncoderCfg (   flags)

Definition at line 300 of file TrigT1ResultByteStreamConfig.py.

301  acc = ComponentAccumulator()
302 
303  # Legacy encoding via RoIBResult
304  if doRoIBResult(flags):
305  roibResultTool = acc.popToolsAndMerge(RoIBResultByteStreamToolCfg(
306  flags, name="RoIBResultBSEncoderTool", writeBS=True))
307  acc.addPublicTool(roibResultTool)
308 
309  # Run-3 L1Muon encoding
310  if flags.Trigger.L1.doMuon and flags.Trigger.enableL1MuonPhase1:
311  muonRoiTool = acc.popToolsAndMerge(MuonRoIByteStreamToolCfg(
312  flags, name="L1MuonBSEncoderTool", writeBS=True))
313  acc.addPublicTool(muonRoiTool)
314 
315  # TODO: Run-3 L1Calo, L1Topo, CTP
316 
317  return acc
318 

◆ MuCTPIPhase1ByteStreamAlgoCfg()

def TrigT1ResultByteStreamConfig.MuCTPIPhase1ByteStreamAlgoCfg (   flags)

Definition at line 319 of file TrigT1ResultByteStreamConfig.py.

320  #print("MUCTPI DQ DEBUG python include algo")
321  acc = ComponentAccumulator()
322  alg = CompFactory.MuCTPIPhase1ByteStreamAlgo()
323  acc.addEventAlgo(alg)
324  return acc
325 

◆ MuonRoIByteStreamToolCfg()

def TrigT1ResultByteStreamConfig.MuonRoIByteStreamToolCfg (   flags,
  name,
  writeBS = False,
  writeDecodedMuonRoIs = True 
)

Definition at line 69 of file TrigT1ResultByteStreamConfig.py.

69 def MuonRoIByteStreamToolCfg(flags, name, writeBS=False, writeDecodedMuonRoIs=True):
70  acc = ComponentAccumulator()
71  tool = CompFactory.MuonRoIByteStreamTool(name)
72  muctpi_moduleid = 0 # No RoIB in Run 3, we always read the DAQ ROB
73  muctpi_robid = int(SourceIdentifier(SubDetector.TDAQ_MUON_CTP_INTERFACE, muctpi_moduleid)) # 0x760000
74  tool.ROBIDs = [muctpi_robid]
75  tool.DoTopo = flags.Trigger.L1.doMuonTopoInputs
76  tool.WriteDecodedMuonRoIs = writeDecodedMuonRoIs
77 
78  from TrigT1ResultByteStream.TrigT1ResultByteStreamMonitoringConfig import L1MuonBSConverterMonitoringCfg
79  tool.MonTool = acc.popToolsAndMerge(L1MuonBSConverterMonitoringCfg(flags, name, writeBS))
80 
81  # Build container names for each bunch crossing in the maximum readout window (size 5)
82  containerBaseName = "LVL1MuonRoIs"
83  containerNames = [
84  containerBaseName + "BCm2",
85  containerBaseName + "BCm1",
86  containerBaseName,
87  containerBaseName + "BCp1",
88  containerBaseName + "BCp2",
89  ]
90  topocontainerBaseName = "L1MuCTPItoL1TopoLocationFromMuonRoI"
91  topocontainerNames = [
92  topocontainerBaseName + "-2",
93  topocontainerBaseName + "-1",
94  topocontainerBaseName,
95  topocontainerBaseName + "1",
96  topocontainerBaseName + "2",
97  ]
98  if writeBS:
99  # write BS == read xAOD
100  tool.MuonRoIContainerReadKeys += containerNames
101  else:
102  # read BS == write xAOD
103  tool.MuonRoIContainerWriteKeys += [recordable(c) for c in containerNames]
104  tool.L1TopoOutputLocID += topocontainerNames
105 
106  tool.RPCRecRoiTool = acc.popToolsAndMerge(RPCRecRoiToolCfg(flags))
107  tool.TGCRecRoiTool = acc.popToolsAndMerge(TGCRecRoiToolCfg(flags))
108  tool.TrigThresholdDecisionTool = acc.popToolsAndMerge(TrigThresholdDecisionToolCfg(flags))
109 
110  acc.setPrivateTools(tool)
111  return acc
112 

◆ RoIBResultByteStreamToolCfg()

def TrigT1ResultByteStreamConfig.RoIBResultByteStreamToolCfg (   flags,
  name,
  writeBS = False 
)

Definition at line 18 of file TrigT1ResultByteStreamConfig.py.

18 def RoIBResultByteStreamToolCfg(flags, name, writeBS=False):
19  acc = ComponentAccumulator()
20  tool = CompFactory.RoIBResultByteStreamTool(name)
21 
22  if not flags.Trigger.L1.doCTP:
23  # disable CTP ByteStream decoding/encoding as part of RoIBResult
24  tool.CTPModuleId = 0xFF
25 
26  if flags.Trigger.enableL1MuonPhase1 or not flags.Trigger.L1.doMuon:
27  # disable legacy MUCTPI ByteStream decoding/encoding as part of RoIBResult
28  tool.MUCTPIModuleId = 0xFF
29 
30  if not flags.Trigger.enableL1CaloLegacy or not flags.Trigger.L1.doCalo:
31  # disable legacy L1Calo ByteStream decoding/encoding as part of RoIBResult
32  tool.JetModuleIds = []
33  tool.EMModuleIds = []
34 
35  if flags.Trigger.EDMVersion == 1 or not flags.Trigger.L1.doTopo:
36  # disable legacy L1Topo ByteStream decoding/encoding as part of RoIBResult
37  tool.L1TopoModuleIds = []
38 
39  if writeBS:
40  # write BS == read RDO
41  tool.RoIBResultReadKey="RoIBResult"
42  tool.RoIBResultWriteKey=""
43  else:
44  # read BS == write RDO
45  tool.RoIBResultReadKey=""
46  tool.RoIBResultWriteKey="RoIBResult"
47 
48  acc.setPrivateTools(tool)
49  return acc
50 

Variable Documentation

◆ _log

TrigT1ResultByteStreamConfig._log
private

Definition at line 16 of file TrigT1ResultByteStreamConfig.py.

L1TopoByteStreamConfig.L1TopoPhase1ByteStreamToolCfg
def L1TopoPhase1ByteStreamToolCfg(flags, name, writeBS=False)
Definition: L1TopoByteStreamConfig.py:9
TrigT1MuonRecRoiToolConfig.RPCRecRoiToolCfg
def RPCRecRoiToolCfg(flags, name="RPCRecRoiTool", useRun3Config=True)
Definition: TrigT1MuonRecRoiToolConfig.py:8
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TrigT1ResultByteStreamConfig.ExampleL1TriggerByteStreamToolCfg
def ExampleL1TriggerByteStreamToolCfg(flags, name, writeBS=False)
Definition: TrigT1ResultByteStreamConfig.py:51
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
TrigT1ResultByteStreamConfig.doRoIBResult
def doRoIBResult(flags)
Definition: TrigT1ResultByteStreamConfig.py:113
L1CaloFEXByteStreamConfig.jFexInputByteStreamToolCfg
def jFexInputByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:232
python.TrigT1MuctpiPhase1Config.TrigThresholdDecisionToolCfg
def TrigThresholdDecisionToolCfg(flags, name="TrigThresholdDecisionTool", AODinput=False)
Definition: TrigT1MuctpiPhase1Config.py:9
python.Utils.getEDMListFromWriteHandles
def getEDMListFromWriteHandles(configurables)
Definition: Trigger/TriggerCommon/TrigEDMConfig/python/Utils.py:92
TrigT1ResultByteStreamConfig.RoIBResultByteStreamToolCfg
def RoIBResultByteStreamToolCfg(flags, name, writeBS=False)
Definition: TrigT1ResultByteStreamConfig.py:18
TrigT1ResultByteStreamConfig.MuCTPIPhase1ByteStreamAlgoCfg
def MuCTPIPhase1ByteStreamAlgoCfg(flags)
Definition: TrigT1ResultByteStreamConfig.py:319
L1CaloFEXByteStreamConfig.gFexByteStreamToolCfg
def gFexByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:148
TrigT1ResultByteStreamMonitoringConfig.L1TriggerByteStreamDecoderMonitoringCfg
def L1TriggerByteStreamDecoderMonitoringCfg(flags, name, decoderTools)
Definition: TrigT1ResultByteStreamMonitoringConfig.py:75
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
TrigT1ResultByteStreamConfig.L1TriggerByteStreamEncoderCfg
def L1TriggerByteStreamEncoderCfg(flags)
Definition: TrigT1ResultByteStreamConfig.py:300
TrigT1ResultByteStreamMonitoringConfig.L1MuonBSConverterMonitoringCfg
def L1MuonBSConverterMonitoringCfg(flags, name, encoder=False)
Definition: TrigT1ResultByteStreamMonitoringConfig.py:8
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.OutputStreamConfig.addToESD
def addToESD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:135
L1CaloFEXByteStreamConfig.gFexInputByteStreamToolCfg
def gFexInputByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:275
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
TrigT1ResultByteStreamConfig.MuonRoIByteStreamToolCfg
def MuonRoIByteStreamToolCfg(flags, name, writeBS=False, writeDecodedMuonRoIs=True)
Definition: TrigT1ResultByteStreamConfig.py:69
L1CaloFEXByteStreamConfig.jFexRoiByteStreamToolCfg
def jFexRoiByteStreamToolCfg(flags, name, *writeBS=False, xTOBs=False)
Definition: L1CaloFEXByteStreamConfig.py:87
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:150
python.TriggerEDM.recordable
def recordable(arg, runVersion=3)
Definition: TriggerEDM.py:37
TrigT1MuonRecRoiToolConfig.TGCRecRoiToolCfg
def TGCRecRoiToolCfg(flags, name="TGCRecRoiTool", useRun3Config=True)
Definition: TrigT1MuonRecRoiToolConfig.py:18
L1CaloFEXByteStreamConfig.eFexByteStreamToolCfg
def eFexByteStreamToolCfg(flags, name, *writeBS=False, TOBs=True, xTOBs=False, multiSlice=False, decodeInputs=False)
Definition: L1CaloFEXByteStreamConfig.py:8
TrigT1ResultByteStreamConfig.L1TriggerByteStreamDecoderCfg
def L1TriggerByteStreamDecoderCfg(flags, returnEDM=False)
Definition: TrigT1ResultByteStreamConfig.py:133