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

Classes

class  hltResult

Functions

 get_feature_data_blob (data, index)
 deserialize_string (lwords)
 print_ranges (l)
 printing utils
 print_chain (counter, s)
 print_all_chains (blob)
 print_all_navigation (result)
 print_HLTResult (result, opt)
 collect_feature_sizes (dest, result)
 collect the sizes

Variables

 clidg = clidGenerator("")
 stringSerializer = cppyy.gbl.StringSerializer()

Function Documentation

◆ collect_feature_sizes()

python.hltResult.collect_feature_sizes ( dest,
result )

collect the sizes

Definition at line 172 of file hltResult.py.

172def collect_feature_sizes(dest, result):
173 for f in result.nav_payload:
174 key = f[0]+'#'+f[1]
175 if key not in dest:
176 dest[key] = 0
177 dest[key] += f[2]
178
179 # keyed by type
180 key = f[0]
181 if key not in dest:
182 dest[key] = 0
183 dest[key] += f[2]
184
185 if 'Total' not in dest:
186 dest['Total'] = 0
187 dest['Total'] += 4*result.as_int_v.size()

◆ deserialize_string()

python.hltResult.deserialize_string ( lwords)
Wrapper for the C++ StringSerializer

Definition at line 72 of file hltResult.py.

72def deserialize_string(lwords):
73 """Wrapper for the C++ StringSerializer"""
74
75 v = cppyy.gbl.std.vector('unsigned int')()
76 s = cppyy.gbl.std.string()
77 v.reserve(len(lwords))
78 for w in lwords:
79 v.push_back(w)
80 stringSerializer.deserialize(v, s)
81 return str(s)
82
83

◆ get_feature_data_blob()

python.hltResult.get_feature_data_blob ( data,
index )

Definition at line 55 of file hltResult.py.

55def get_feature_data_blob(data, index):
56 if index == len(data):
57 return []
58 size = data[index]
59 begin = index
60 begin += 1
61 end = index
62 end +=1
63 end += size
64 if end <= len(data):
65 index = end
66 #print "getting blob of data from: ", begin, " to ", end
67 return data[begin:end]
68 else:
69 return []
70
71

◆ print_all_chains()

python.hltResult.print_all_chains ( blob)

Definition at line 99 of file hltResult.py.

99def print_all_chains(blob):
100 print("... chains:")
101 for i in range(len(blob)):
102 print_chain(i, blob[i])
103
104
void print(char *figname, TCanvas *c1)

◆ print_all_navigation()

python.hltResult.print_all_navigation ( result)

Definition at line 105 of file hltResult.py.

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]))
109 return
110
111

◆ print_chain()

python.hltResult.print_chain ( counter,
s )

Definition at line 92 of file hltResult.py.

92def print_chain(counter, s):
93 ch = cppyy.makeClass('HLT::Chain')(s)
94 #ch.deserialize(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()))
98

◆ print_HLTResult()

python.hltResult.print_HLTResult ( result,
opt )

Definition at line 112 of file hltResult.py.

112def print_HLTResult(result, opt):
113 if opt.sizes:
114 print("... Payload size: ", result.as_int_v.size(), " ", (4.0*result.as_int_v.size())/(1024), "kB")
115
116 if result.as_int_v.size() == 0:
117 print("... Payload size is 0")
118
119 # header info
120
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())
135 print()
136
137 chains_data = list(result.getChainResult())
138 nchains = chains_data[0] if chains_data else 0
139 nav_data = list(result.getNavigationResult())
140 nnav = len(nav_data)
141 nver = nav_data[0] if nav_data else 0
142
143 if opt.sizes:
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")
146
147 if opt.conf:
148 try:
149 print("... SMkey: ", result.getConfigSuperMasterKey(), " Prescalers key ", result.getConfigPrescalesKey())
150 except Exception:
151 print("... No config info ")
152
153 if opt.chains:
154 print_all_chains(chains_data[1:])
155
156
157 print("... Navigation version: ", nver)
158 if opt.tes:
159 if nnav > 3:
160 tessize = result.getNavigationResult()[2]
161 tescount = result.getNavigationResult()[3]
162 print("... Number of TEs: ", tescount, " and size: ", tessize, " ", 4.0*tessize/(1024), "kB")
163 else:
164 print("... Cannot print TriggerElement details (not enough navigation data)")
165
166 if opt.features:
167 print_all_navigation(result)
168
169

◆ print_ranges()

python.hltResult.print_ranges ( l)

printing utils

Definition at line 88 of file hltResult.py.

88def print_ranges(l):
89 for i in range(len(l)):
90 print("%-16d%16d" % ( (i+1)*32, i*32))
91

Variable Documentation

◆ clidg

python.hltResult.clidg = clidGenerator("")

Definition at line 6 of file hltResult.py.

◆ stringSerializer

python.hltResult.stringSerializer = cppyy.gbl.StringSerializer()

Definition at line 8 of file hltResult.py.