3 from __future__
import print_function
5 from CLIDComps.clidGenerator
import clidGenerator
7 clidg = clidGenerator(
"")
9 stringSerializer = cppyy.gbl.StringSerializer()
14 self.
as_int_v = cppyy.gbl.std.vector(
'unsigned int')()
19 data =
list(rob.rod_data())
22 [ self.
as_int_v.push_back(i)
for i
in data ]
25 raise Exception(
'deserialization of the HLT result failed')
31 if len(nav_data) <= 1:
41 lwords = blob[3:3+slabel]
42 sdata = len(blob)-slabel-3
45 self.
nav_payload.
append( (clidg.getNameFromClid(clid), label, fsize*4, sdata*4, clid, stidx) )
57 if index == len(data):
68 return data[begin:end]
74 """Wrapper for the C++ StringSerializer"""
76 v = cppyy.gbl.std.vector(
'unsigned int')()
77 s = cppyy.gbl.std.string()
78 v.reserve(len(lwords))
81 stringSerializer.deserialize(v, s)
90 for i
in range(len(l)):
91 print(
"%-16d%16d" % ( (i+1)*32, i*32))
94 ch = cppyy.makeClass(
'HLT::Chain')(s)
96 print(
".... chain %-3d Counter:%-4d Passed: %d (Raw:%d Prescaled: %d PassThrough:%d) Rerun: %d LastStep: %d Err: %s"\
97 % ( counter, ch.getChainCounter(), ch.chainPassed(), ch.chainPassedRaw(), ch.isPrescaled(), ch.isPassedThrough(),\
98 ch.isResurrected(), ch.getChainStep(), ch.getErrorCode().
str()))
102 for i
in range(len(blob)):
107 print(
"... features")
108 for f
in result.nav_payload:
109 print(
".... %-52s %6d B " % (
str(f[0])+
'#'+
str(f[1]), f[2]))
115 print(
"... Payload size: ", result.as_int_v.size(),
" ", (4.0*result.as_int_v.size())/(1024),
"kB")
117 if result.as_int_v.size() == 0:
118 print(
"... Payload size is 0")
122 version = result.getHLTResultClassVersion()
123 l1id = result.getLvl1Id()
124 acc = result.isAccepted()
125 pt = result.isPassThrough()
126 status = result.getHLTStatus()
127 cnvstatus = result.getLvlConverterStatus()
128 level = result.getHLTLevel()
129 nosigs = result.getNumOfSatisfiedSigs()
130 bad = result.isCreatedOutsideHLT()
131 trunc = result.isHLTResultTruncated()
132 print(
'... Version:', version ,
' Lvl1Id:',l1id ,
' Decision:',acc ,
133 ' PassThrough:',pt,
' Status:',status.str(),
134 ' ConverterStatus:', cnvstatus.str(),
' LVL:',level,
' Signatures:',nosigs,
' Bad:',bad,
' Truncated:', trunc,
135 ' App:', result.appName())
138 chains_data =
list(result.getChainResult())
139 nchains = chains_data[0]
if chains_data
else 0
140 nav_data =
list(result.getNavigationResult())
142 nver = nav_data[0]
if nav_data
else 0
145 print(
'... tot:', result.as_int_v.size(),
' chains:', nchains,
' chains (expected):', len(chains_data)-1,
146 ' navigation:', nnav,
' navigation (expected):',result.getNavigationResult()[1]
if nnav > 1
else "0 or 1")
150 print(
"... SMkey: ", result.getConfigSuperMasterKey(),
" Prescalers key ", result.getConfigPrescalesKey())
152 print(
"... No config info ")
158 print(
"... Navigation version: ", nver)
161 tessize = result.getNavigationResult()[2]
162 tescount = result.getNavigationResult()[3]
163 print(
"... Number of TEs: ", tescount,
" and size: ", tessize,
" ", 4.0*tessize/(1024),
"kB")
165 print(
"... Cannot print TriggerElement details (not enough navigation data)")
174 for f
in result.nav_payload:
186 if 'Total' not in dest:
188 dest[
'Total'] += 4*result.as_int_v.size()