203 def hlt_result(event, print_sizes=False, deserialize=False, conf_keys=False, runtime_metadata=False):
206 for rob
in event.children():
207 if rob.source_id().subdetector_id() != eformat.helper.SubDetector.TDAQ_HLT:
211 info_str +=
'\n-- {:s} SourceID: {:s}, Version: {:s}, Size: {:d} bytes, Status: {:s}'.
format(
212 rob.__class__.__name__,
213 rob.source_id().human(),
214 f
'{version[0]:d}.{version[1]:d}',
215 rob.fragment_size_word()*4,
218 if print_sizes
or deserialize
or conf_keys
or runtime_metadata:
220 raise RuntimeError(
'Cannot decode data from before Run 3, HLT ROD minor version needs to be >= 1.0')
221 skip_payload =
not conf_keys
and not runtime_metadata
and not deserialize
222 collections = hltResultMT.get_collections(rob, skip_payload=skip_payload)
224 conf_list = [c
for c
in collections
if 'xAOD::TrigConfKeys_v' in c.name_persistent]
225 conf_available =
False
226 for conf
in conf_list:
227 conf_obj = conf.deserialise()
230 conf_available =
True
231 info_str +=
'\n---- {:s}#{:s} SMK: {:d}, L1PSK: {:d}, HLTPSK: {:d}'.
format(
232 conf.name_persistent, conf.name_key,
233 conf_obj.smk(), conf_obj.l1psk(), conf_obj.hltpsk())
234 if not conf_available:
235 info_str +=
'\n---- TrigConfKeys unavailable in this ROB'
237 decorations = [
'hostname']
238 meta_list = [c
for c
in collections
if any([f
'RuntimeMetadataAux.{decor}' in c.name()
for decor
in decorations])]
239 meta_available =
False
240 for meta
in meta_list:
241 meta_obj = meta.deserialise()
244 meta_available =
True
245 info_str +=
'\n---- RuntimeMetadata {:s}: {:s}'.
format(
246 meta.name_key, meta_obj.at(0))
247 if not meta_available:
248 info_str +=
'\n---- RuntimeMetadata unavailable in this ROB'
249 if print_sizes
or deserialize:
250 for coll
in collections:
251 indent = 4
if not coll.is_xAOD_decoration()
else 6
252 info_str +=
'\n{:s} {:s}'.
format(
'-'*indent,
str(coll))
253 if deserialize
and (coll_obj := coll.deserialise())
is not None:
255 length = coll_obj.size()
258 if length
is not None:
259 info_str += f
' ({length} element' + (
's)' if length!=1
else ')')
260 info_str +=
'\n{:s} {:s}'.
format(
' '*indent,
str(coll_obj))
263 info_str =
'Found {:d} HLT ROBs'.
format(num_hlt_robs) + info_str