ATLAS Offline Software
Classes | Functions | Variables
python.hltResult Namespace Reference

Classes

class  hltResult
 

Functions

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

Variables

 clidg
 
 stringSerializer
 

Function Documentation

◆ collect_feature_sizes()

def python.hltResult.collect_feature_sizes (   dest,
  result 
)

collect the sizes

Definition at line 173 of file hltResult.py.

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

◆ deserialize_string()

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

Definition at line 73 of file hltResult.py.

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

◆ get_feature_data_blob()

def python.hltResult.get_feature_data_blob (   data,
  index 
)

Definition at line 56 of file hltResult.py.

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

◆ print_all_chains()

def python.hltResult.print_all_chains (   blob)

Definition at line 100 of file hltResult.py.

100 def print_all_chains(blob):
101  print("... chains:")
102  for i in range(len(blob)):
103  print_chain(i, blob[i])
104 
105 

◆ print_all_navigation()

def python.hltResult.print_all_navigation (   result)

Definition at line 106 of file hltResult.py.

106 def print_all_navigation(result):
107  print("... features")
108  for f in result.nav_payload:
109  print(".... %-52s %6d B " % (str(f[0])+'#'+str(f[1]), f[2]))
110  return
111 
112 

◆ print_chain()

def python.hltResult.print_chain (   counter,
  s 
)

Definition at line 93 of file hltResult.py.

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

◆ print_HLTResult()

def python.hltResult.print_HLTResult (   result,
  opt 
)

Definition at line 113 of file hltResult.py.

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

◆ print_ranges()

def python.hltResult.print_ranges (   l)

printing utils

Definition at line 89 of file hltResult.py.

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

Variable Documentation

◆ clidg

python.hltResult.clidg

Definition at line 7 of file hltResult.py.

◆ stringSerializer

python.hltResult.stringSerializer

Definition at line 9 of file hltResult.py.

python.hltResult.print_all_navigation
def print_all_navigation(result)
Definition: hltResult.py:106
python.hltResult.get_feature_data_blob
def get_feature_data_blob(data, index)
Definition: hltResult.py:56
python.hltResult.print_ranges
def print_ranges(l)
printing utils
Definition: hltResult.py:89
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.hltResult.deserialize_string
def deserialize_string(lwords)
Definition: hltResult.py:73
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.hltResult.collect_feature_sizes
def collect_feature_sizes(dest, result)
collect the sizes
Definition: hltResult.py:173
python.hltResult.print_HLTResult
def print_HLTResult(result, opt)
Definition: hltResult.py:113
python.hltResult.print_chain
def print_chain(counter, s)
Definition: hltResult.py:93
str
Definition: BTagTrackIpAccessor.cxx:11
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
python.hltResult.print_all_chains
def print_all_chains(blob)
Definition: hltResult.py:100