4from CLIDComps.clidGenerator
import clidGenerator
6clidg = clidGenerator(
"")
8stringSerializer = cppyy.gbl.StringSerializer()
13 self.
as_int_v = cppyy.gbl.std.vector(
'unsigned int')()
18 data = list(rob.rod_data())
21 [ self.
as_int_v.push_back(i)
for i
in data ]
24 raise Exception(
'deserialization of the HLT result failed')
30 if len(nav_data) <= 1:
40 lwords = blob[3:3+slabel]
41 sdata = len(blob)-slabel-3
44 self.
nav_payload.append( (clidg.getNameFromClid(clid), label, fsize*4, sdata*4, clid, stidx) )
56 if index == len(data):
67 return data[begin:end]
73 """Wrapper for the C++ StringSerializer"""
75 v = cppyy.gbl.std.vector('unsigned int')()
76 s = cppyy.gbl.std.string()
77 v.reserve(len(lwords))
80 stringSerializer.deserialize(v, s)
84#############################################################################
89 for i in range(len(l)):
90 print("%-16d%16d" % ( (i+1)*32, i*32))
92def print_chain(counter, s):
93 ch = cppyy.makeClass('HLT::Chain')(s)
95 print(".... chain %-3d Counter:%-4d Passed: %d (Raw:%d Prescaled: %d PassThrough:%d) Rerun: %d LastStep: %d Err: %s"\
96 % ( counter, ch.getChainCounter(), ch.chainPassed(), ch.chainPassedRaw(), ch.isPrescaled(), ch.isPassedThrough(),\
97 ch.isResurrected(), ch.getChainStep(), ch.getErrorCode().str()))
99def print_all_chains(blob):
101 for i in range(len(blob)):
102 print_chain(i, blob[i])
105def print_all_navigation(result):
106 print("... features")
107 for f in result.nav_payload:
108 print(".... %-52s %6d B " % (str(f[0])+'#'+str(f[1]), f[2]))
112def print_HLTResult(result, opt):
114 print("... Payload size: ", result.as_int_v.size(), " ", (4.0*result.as_int_v.size())/(1024), "kB")
116 if result.as_int_v.size() == 0:
117 print("... Payload size is 0")
121 version = result.getHLTResultClassVersion()
122 l1id = result.getLvl1Id()
123 acc = result.isAccepted()
124 pt = result.isPassThrough()
125 status = result.getHLTStatus()
126 cnvstatus = result.getLvlConverterStatus()
127 level = result.getHLTLevel()
128 nosigs = result.getNumOfSatisfiedSigs()
129 bad = result.isCreatedOutsideHLT()
130 trunc = result.isHLTResultTruncated()
131 print('... Version:', version ,' Lvl1Id:',l1id ,' Decision:',acc ,
132 ' PassThrough:',pt,' Status:',status.str(),
133 ' ConverterStatus:', cnvstatus.str(),' LVL:',level,' Signatures:',nosigs,' Bad:',bad,' Truncated:', trunc,
134 ' App:', result.appName())
137 chains_data = list(result.getChainResult())
138 nchains = chains_data[0] if chains_data else 0
139 nav_data = list(result.getNavigationResult())
141 nver = nav_data[0] if nav_data else 0
144 print('... tot:', result.as_int_v.size(), ' chains:', nchains, ' chains (expected):', len(chains_data)-1,
145 ' navigation:', nnav, ' navigation (expected):',result.getNavigationResult()[1] if nnav > 1 else "0 or 1")
149 print("... SMkey: ", result.getConfigSuperMasterKey(), " Prescalers key ", result.getConfigPrescalesKey())
151 print("... No config info ")
154 print_all_chains(chains_data[1:])
157 print("... Navigation version: ", nver)
160 tessize = result.getNavigationResult()[2]
161 tescount = result.getNavigationResult()[3]
162 print("... Number of TEs: ", tescount, " and size: ", tessize, " ", 4.0*tessize/(1024), "kB")
164 print("... Cannot print TriggerElement details (not enough navigation data)")
167 print_all_navigation(result)
170##############################################################################
172def collect_feature_sizes(dest, result):
173 for f in result.nav_payload:
185 if 'Total' not in dest:
187 dest['Total'] += 4*result.as_int_v.size()
virtual bool deserialize(const std::vector< uint32_t > &source)=0
unpacking raw result into the usable high level object
HLT::HLTResult is sumarising result of trigger decision evaluation (online/offline) It contains basic...
const std::vector< uint32_t > & getNavigationResult() const
retrieve the sub-payloads (can be used to retrieve/write data)
unsigned int size() const
const std::vector< uint32_t > & getExtras() const
__unpack_navigation(self)
get_feature_data_blob(data, index)
deserialize_string(lwords)