ATLAS Offline Software
Functions | Variables
trigbs_dumpHltDsData Namespace Reference

Functions

def ds_dump (bsfile)
 

Variables

 __doc__
 
 parser
 
 description
 
 metavar
 
 nargs
 
 help
 
 action
 
 type
 
 default
 
 int
 
 choices
 
 args
 
 res
 

Function Documentation

◆ ds_dump()

def trigbs_dumpHltDsData.ds_dump (   bsfile)
Runs the dumping routines

Definition at line 34 of file trigbs_dumpHltDsData.py.

34 def ds_dump(bsfile):
35  """Runs the dumping routines"""
36 
37  # open a file
38  if (args.verbosity > 0):
39  print("="*100)
40  print("Opening", bsfile)
41 
42  input = eformat.istream(bsfile)
43 
44  if args.interactive:
45  import code
46  code.interact(local=locals())
47 
48  event_count = 0
49  ds_ROB_counts = {}
50  offset = args.skip if args.skip else 0
51  for event in input:
52  if offset>0:
53  offset -= 1
54  continue
55 
56  event_count += 1
57  if args.events is not None and event_count>args.events:
58  event_count -=1
59  break
60 
61  # Extract the DS module IDs and set the flag for finding the corresponding ROB
62  ds_module_ids={}
63  for stag in event.stream_tag():
64  if (stag.type == 'calibration') and ((stag.name).startswith('DataScouting_')):
65  ds_module_ids[int((stag.name).split('_')[1])] = (False, stag.name)
66  if stag.name not in ds_ROB_counts:
67  ds_ROB_counts[stag.name] = {'ROBfound':0, 'ROBnotFound':0, 'noContainers':0, 'emptyContainers':0}
68 
69  # loop over the SubDetFragments and find DS ROBs
70  for f in event.children():
71  if (f.source_id().subdetector_id() == eformat.helper.SubDetector.TDAQ_HLT) and (f.source_id().module_id() in ds_module_ids):
72  if (args.verbosity >= 1):
73  print("======================= RunNumber : %d , Event: %d, LB: %d, LVL1_ID: %d, Global_ID: %d bunch-x: %d TT: x%x =========================="
74  % ( event.run_no(), event_count, event.lumi_block(), event.lvl1_id(), event.global_id(), event.bc_id(), event.lvl1_trigger_type()))
75  # Print the stream tags
76  if (args.verbosity >= 1):
77  print(".. Stream Tags:", [(s.name, s.type) for s in event.stream_tag()])
78 
79  featureSizes={}
80  if (args.verbosity >= 1):
81  print('.. %s %s %s bytes' % (f.__class__.__name__, f.source_id(), f.fragment_size_word()*4))
82  try:
83  res.load(f)
84  ds_module_ids[f.source_id().module_id()] = (True, ds_module_ids[f.source_id().module_id()][1]) # The expected ROB was found
85  if (args.verbosity >= 2):
87  for feature in res.nav_payload:
88  key = feature[0]+'#'+feature[1]
89  if key not in featureSizes:
90  featureSizes[key] = 0
91  featureSizes[key] += feature[2]
92  except Exception as ex:
93  print('... **** problems in analyzing payload', ex)
94  print('... **** raw data[:10]', list(f.rod_data())[:10])
95  # check that feature containers are there and that they are not empty
96  if (featureSizes == {}):
97  if (args.verbosity >= 1):
98  print(" FATAL : No containers are available for Data Scouting HLTResult with module ID = ",f.source_id().module_id(),", Stream name = ",ds_module_ids[f.source_id().module_id()][1])
99  ds_ROB_counts[ ds_module_ids[f.source_id().module_id()][1] ]['noContainers'] += 1
100  for item in featureSizes.items():
101  if (item[1] == 0):
102  if (args.verbosity >= 1):
103  print(" ERROR : Empty container for feature = ",item[0])
104  ds_ROB_counts[ ds_module_ids[f.source_id().module_id()][1] ]['emptyContainers'] += 1
105 
106  if (args.verbosity >= 2):
107  print(".. EOF DS HLTResult with module ID = ", f.source_id().module_id())
108 
109  # check if all expected DS ROBs from the StreamTags were found
110  for item in ds_module_ids.items():
111  if (item[1][0] is False):
112  if (args.verbosity >= 1):
113  print(" FATAL : No Data Scouting HLTResult found for expected module ID = ",item[0],", Stream name = ",item[1][1])
114  ds_ROB_counts[ item[1][1] ]['ROBnotFound'] += 1
115  else:
116  ds_ROB_counts[ item[1][1] ]['ROBfound'] += 1
117 
118  if (args.verbosity >= 0):
119  print("\n Events read: ", event_count)
120  print("\n Summary of Data Scouting information:\n"," -------------------------------------\n", ds_ROB_counts)
121 

Variable Documentation

◆ __doc__

trigbs_dumpHltDsData.__doc__
private

Definition at line 9 of file trigbs_dumpHltDsData.py.

◆ action

trigbs_dumpHltDsData.action

Definition at line 17 of file trigbs_dumpHltDsData.py.

◆ args

trigbs_dumpHltDsData.args

Definition at line 29 of file trigbs_dumpHltDsData.py.

◆ choices

trigbs_dumpHltDsData.choices

Definition at line 26 of file trigbs_dumpHltDsData.py.

◆ default

trigbs_dumpHltDsData.default

Definition at line 23 of file trigbs_dumpHltDsData.py.

◆ description

trigbs_dumpHltDsData.description

Definition at line 12 of file trigbs_dumpHltDsData.py.

◆ help

trigbs_dumpHltDsData.help

Definition at line 15 of file trigbs_dumpHltDsData.py.

◆ int

trigbs_dumpHltDsData.int

Definition at line 26 of file trigbs_dumpHltDsData.py.

◆ metavar

trigbs_dumpHltDsData.metavar

Definition at line 14 of file trigbs_dumpHltDsData.py.

◆ nargs

trigbs_dumpHltDsData.nargs

Definition at line 14 of file trigbs_dumpHltDsData.py.

◆ parser

trigbs_dumpHltDsData.parser

Definition at line 12 of file trigbs_dumpHltDsData.py.

◆ res

trigbs_dumpHltDsData.res

Definition at line 32 of file trigbs_dumpHltDsData.py.

◆ type

trigbs_dumpHltDsData.type

Definition at line 17 of file trigbs_dumpHltDsData.py.

python.hltResult.print_all_navigation
def print_all_navigation(result)
Definition: hltResult.py:106
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
trigbs_dumpHltDsData.ds_dump
def ds_dump(bsfile)
Definition: trigbs_dumpHltDsData.py:34
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
trigbs_dumpHltDsData.int
int
Definition: trigbs_dumpHltDsData.py:26