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