ATLAS Offline Software
Loading...
Searching...
No Matches
python.hltResultMT Namespace Reference

Classes

class  EDMCollection

Functions

 get_collection_name (raw_data_words)
 get_collection_payload (raw_data_words)
 get_collections (rob, skip_payload=False)

Variables

 log = logging.getLogger('hltResultMT')
 _string_serialiser = StringSerializer()
int SizeWord = 0
int CLIDOffset = 1
int NameLengthOffset = 2
int NameOffset = 3

Detailed Description

Methods to deserialise HLTResultMT using Python bindings of C++ classes
and reimplementing some logic from TriggerEDMDeserialiserAlg

Function Documentation

◆ get_collection_name()

python.hltResultMT.get_collection_name ( raw_data_words)
Extract type+name words from the full collection raw data and convert to string

Definition at line 85 of file hltResultMT.py.

85def get_collection_name(raw_data_words):
86 '''Extract type+name words from the full collection raw data and convert to string'''
87
88 # Use Python bindings of C++ StringSerialiser to deserialise collection type and name.
89 # Doing the tuple-conversion here has a big performance impact. Probably this could be
90 # further improved if the eformat had better support for u32slice iterators.
91
92 nw = raw_data_words[NameLengthOffset]
93 name_words = tuple(raw_data_words[NameOffset:NameOffset+nw])
94 return _string_serialiser.deserialize(name_words)
95
96

◆ get_collection_payload()

python.hltResultMT.get_collection_payload ( raw_data_words)
Extract the serialised collection payload from the full collection raw data

Definition at line 97 of file hltResultMT.py.

97def get_collection_payload(raw_data_words):
98 '''Extract the serialised collection payload from the full collection raw data'''
99
100 name_size = raw_data_words[NameLengthOffset]
101 payload_start = NameOffset + name_size + 1
102 return raw_data_words[payload_start:]
103
104

◆ get_collections()

python.hltResultMT.get_collections ( rob,
skip_payload = False )
Extract a list of EDMCollection objects from the HLT ROBFragment.
If skip_payload=True, only the information about type, name and size
are kept but the payload is discarded to improve performance.

Definition at line 105 of file hltResultMT.py.

105def get_collections(rob, skip_payload=False):
106 '''
107 Extract a list of EDMCollection objects from the HLT ROBFragment.
108 If skip_payload=True, only the information about type, name and size
109 are kept but the payload is discarded to improve performance.
110 '''
111
112 start = SizeWord
113 collections = []
114 last_aux_cont = None
115 rod_size = len(rob.rod_data())
116 while start < rod_size:
117 size = rob.rod_data()[start+SizeWord]
118 coll_name = get_collection_name(rob.rod_data()[start:start+size])
119 words = None if skip_payload else get_collection_payload(rob.rod_data()[start:start+size])
120 coll = EDMCollection(coll_name, size, words)
121 if coll.is_xAOD_aux_container():
122 last_aux_cont = coll
123 if coll.is_xAOD_decoration():
124 coll.parent = last_aux_cont
125 collections.append(coll)
126 start += size
127 return collections

Variable Documentation

◆ _string_serialiser

python.hltResultMT._string_serialiser = StringSerializer()
protected

Definition at line 16 of file hltResultMT.py.

◆ CLIDOffset

int python.hltResultMT.CLIDOffset = 1

Definition at line 20 of file hltResultMT.py.

◆ log

python.hltResultMT.log = logging.getLogger('hltResultMT')

Definition at line 13 of file hltResultMT.py.

◆ NameLengthOffset

int python.hltResultMT.NameLengthOffset = 2

Definition at line 21 of file hltResultMT.py.

◆ NameOffset

int python.hltResultMT.NameOffset = 3

Definition at line 22 of file hltResultMT.py.

◆ SizeWord

int python.hltResultMT.SizeWord = 0

Definition at line 19 of file hltResultMT.py.