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 172 of file hltResult.py.

172 def 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()

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

Definition at line 72 of file hltResult.py.

72 def 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()

def python.hltResult.get_feature_data_blob (   data,
  index 
)

Definition at line 55 of file hltResult.py.

55 def 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()

def python.hltResult.print_all_chains (   blob)

Definition at line 99 of file hltResult.py.

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

◆ print_all_navigation()

def python.hltResult.print_all_navigation (   result)

Definition at line 105 of file hltResult.py.

105 def 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()

def python.hltResult.print_chain (   counter,
  s 
)

Definition at line 92 of file hltResult.py.

92 def 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()

def python.hltResult.print_HLTResult (   result,
  opt 
)

Definition at line 112 of file hltResult.py.

112 def 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()

def python.hltResult.print_ranges (   l)

printing utils

Definition at line 88 of file hltResult.py.

88 def 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

Definition at line 6 of file hltResult.py.

◆ stringSerializer

python.hltResult.stringSerializer

Definition at line 8 of file hltResult.py.

python.hltResult.print_all_navigation
def print_all_navigation(result)
Definition: hltResult.py:105
python.hltResult.get_feature_data_blob
def get_feature_data_blob(data, index)
Definition: hltResult.py:55
python.hltResult.print_ranges
def print_ranges(l)
printing utils
Definition: hltResult.py:88
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.hltResult.deserialize_string
def deserialize_string(lwords)
Definition: hltResult.py:72
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26
python.hltResult.collect_feature_sizes
def collect_feature_sizes(dest, result)
collect the sizes
Definition: hltResult.py:172
python.hltResult.print_HLTResult
def print_HLTResult(result, opt)
Definition: hltResult.py:112
python.hltResult.print_chain
def print_chain(counter, s)
Definition: hltResult.py:92
str
Definition: BTagTrackIpAccessor.cxx:11
python.hltResult.print_all_chains
def print_all_chains(blob)
Definition: hltResult.py:99