36def dump_nav(collections):
37
38 xaod_map = {}
39
40
41 for col in collections:
42 if 'HLTNav_' not in col.name():
43 continue
44
45 if col.is_xAOD_interface_container():
46 xaod_map[col.name_key] = {
47 'interface': col,
48 'aux_cont': None,
49 'decorations': []
50 }
51 elif col.is_xAOD_aux_container():
52 strip_name = col.name_key[0:-4]
53 if strip_name not in xaod_map:
54 log.warning('%s not in xaod_map', strip_name)
55 continue
56 xaod_map[strip_name]['aux_cont'] = col
57 elif col.is_xAOD_decoration():
58 if not col.parent:
59 log.warning('{%s} has no parent', col.name())
60 strip_name = col.parent.name_key[0:-4]
61 if strip_name not in xaod_map:
62 log.warning('%s not in xaod_map', strip_name)
63 continue
64 xaod_map[strip_name]['decorations'].append(col)
65
66
67 for key, col_dict in xaod_map.items():
68 if not col_dict['interface']:
69 log.warning('%s interface collection missing', key)
70 continue
71 if not col_dict['aux_cont']:
72 log.warning('%s aux_cont collection missing', key)
73 continue
74 cont_if = col_dict['interface'].deserialise()
75 cont_aux = col_dict['aux_cont'].deserialise()
76 cont_deco = [c.deserialise() for c in col_dict['decorations']]
77
78 if not cont_if:
79
80
81 continue
82 if not cont_aux:
83 log.warning('%s aux_cont deserialisation failed', key)
84 continue
85
86 cont_if.setStore(cont_aux)
87
88 print(
' - %s' % key, flush=
True)
89 for i in range(cont_if.size()):
90 obj = cont_if.at(i)
91 print(
' - Element #%d' % i)
92 print(
' - name: %s' % obj.name())
93 print(
' - decisions: %s' % obj.decisions())
94 if cont_deco:
95 print(
' - decorations:')
96 for i_deco, deco_vec in enumerate(cont_deco):
97 try:
98 print(
' - %s = %s' % (col_dict[
'decorations'][i_deco].name_key, deco_vec.at(i)))
99 except Exception as ex:
100 log.warning(ex)
101 log.warning('i: %d', i)
102 log.warning('len(deco_vec): %d', len(deco_vec))
103 log.warning('i_deco: %d', i_deco)
104 log.warning('len(col_dict["decorations"]): %d', len(col_dict['decorations']))
105
106