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 33 of file trigbs_dumpHltDsData.py.

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

Variable Documentation

◆ __doc__

trigbs_dumpHltDsData.__doc__
private

Definition at line 8 of file trigbs_dumpHltDsData.py.

◆ action

trigbs_dumpHltDsData.action

Definition at line 16 of file trigbs_dumpHltDsData.py.

◆ args

trigbs_dumpHltDsData.args

Definition at line 28 of file trigbs_dumpHltDsData.py.

◆ choices

trigbs_dumpHltDsData.choices

Definition at line 25 of file trigbs_dumpHltDsData.py.

◆ default

trigbs_dumpHltDsData.default

Definition at line 22 of file trigbs_dumpHltDsData.py.

◆ description

trigbs_dumpHltDsData.description

Definition at line 11 of file trigbs_dumpHltDsData.py.

◆ help

trigbs_dumpHltDsData.help

Definition at line 14 of file trigbs_dumpHltDsData.py.

◆ int

trigbs_dumpHltDsData.int

Definition at line 25 of file trigbs_dumpHltDsData.py.

◆ metavar

trigbs_dumpHltDsData.metavar

Definition at line 13 of file trigbs_dumpHltDsData.py.

◆ nargs

trigbs_dumpHltDsData.nargs

Definition at line 13 of file trigbs_dumpHltDsData.py.

◆ parser

trigbs_dumpHltDsData.parser

Definition at line 11 of file trigbs_dumpHltDsData.py.

◆ res

trigbs_dumpHltDsData.res

Definition at line 31 of file trigbs_dumpHltDsData.py.

◆ type

trigbs_dumpHltDsData.type

Definition at line 16 of file trigbs_dumpHltDsData.py.

python.hltResult.print_all_navigation
def print_all_navigation(result)
Definition: hltResult.py:105
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:33
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
trigbs_dumpHltDsData.int
int
Definition: trigbs_dumpHltDsData.py:25