ATLAS Offline Software
ROS_HLT_TableConstructor.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 #
5 from TrigCostAnalysis.ROSToROB import ROSToROBMap
6 from TrigCostAnalysis.TableConstructorBase import TableConstructorBase, Column
7 ROSToROBMap = ROSToROBMap().get_mapping()
8 
9 from AthenaCommon.Logging import logging
10 log = logging.getLogger('ROS_HLT')
11 
12 '''
13 @file ROS_HLT_TableConstructor.py
14 @brief Contains TableConstructor classes per ROS_HLT table. Defines what
15  should be saved in table and fills them
16 '''
17 
18 
19 class ROS_HLT_TableConstructor(TableConstructorBase):
20  ''' @brief Class representing ROS_HLT table
21  '''
22 
23  def __init__(self, tableObj, underflowThreshold, overflowThreshold):
24  super(). __init__(tableObj, underflowThreshold, overflowThreshold)
25  self.expectedHistograms = ["Request_perEvent",
26  "NetworkRequest_perEvent",
27  "CachedROBSize_perEvent",
28  "NetworkROBSize_perEvent",
29  "Time_perEvent",
30  "ROBStatus_perCall",
31  "NROBsPerRequest_perCall"]
32 
33 
34  def defineColumns(self):
35  self.columns['name'] = Column("Name", "ROS name")
36  self.columns['events'] = Column("Raw Active Events", "Raw underlying statistics on the number of events in which this ROS was accessed.")
37  self.columns['eventsWeighted'] = Column("Active Events", "How many events in which this sequence was executed.")
38  self.columns['requestRate'] = Column("Data Requests Rate [Hz]", "Rate of ROS access requests each may contain many ROB reads.", True)
39  self.columns['networkRequestRate'] = Column("Retrieved Data Requests Rate [Hz]", "Rate of ROS access requests that fetch data from the ROBs.", True)
40  self.columns['retrievedSizeRate'] = Column("Retrieved ROB Data Rate [kB/s]", "Amount of data fetched from the ROBs in kB/s.", True)
41  self.columns['cachedSizeRate'] = Column("Cached ROB Data Rate [kB/s]", "Amount of cached data requested from the ROBs in kB/s.", True)
42  self.columns['time'] = Column("Time Per Event [ms]", "Average time for all requests and retrievals per event.")
43  self.columns['fullRequests'] = Column("Full ROS requests [%]", "How many of requests to the ROS requested all ROBs")
44  self.columns['robsUnclassified'] = Column("Unclassified ROBs Rate [Hz]", "Rate of ROB calls which were flagged unclassified.", True)
45  self.columns['robsRetrieved'] = Column("Retrieved ROBs Rate [Hz]","Total rate of fetched ROB calls.", True)
46  self.columns['robsHLTCached'] = Column("Cached HLT ROBs Rate [Hz]","Total rate of HLT cached ROB calls.", True)
47  self.columns['robsDCMCached'] = Column("Cached DCM ROBs Rate [Hz]","Total rate of DCM cached ROB calls.", True)
48  self.columns['robsIgnored'] = Column("Ignored ROBs Rate [Hz]", "Rate of ROB calls which were flagged as ignored.", True)
49  self.columns['robsDisabled'] = Column("Disabled ROBs Rate [Hz]", "Rate of ROB calls which were flagged as disabled.", True)
50  self.columns['robsNotOk'] = Column("Not OK ROBs Rate [Hz]", "Rate of ROB calls in which the is OK bit was false.", True)
51 
52 
53  def fillColumns(self, itemName):
54  self.columns['name'].addValue(itemName)
55  self.columns['events'].addValue(self.getHistogram("Request_perEvent").GetEntries())
56  self.columns['eventsWeighted'].addValue(self.getHistogram("Request_perEvent").Integral())
57  self.columns['requestRate'].addValue(self.getXWeightedIntegral("Request_perEvent", isLog=False))
58  self.columns['networkRequestRate'].addValue(self.getXWeightedIntegral("NetworkRequest_perEvent", isLog=False))
59  self.columns['retrievedSizeRate'].addValue(self.getXWeightedIntegral("NetworkROBSize_perEvent", isLog=False))
60  self.columns['cachedSizeRate'].addValue(self.getXWeightedIntegral("CachedROBSize_perEvent", isLog=False))
61  self.columns['time'].addValue(self.getHistogram("Time_perEvent").GetMean())
62  self.columns['robsUnclassified'].addValue(self.getHistogram("ROBStatus_perCall").GetBinContent(1))
63  self.columns['robsRetrieved'].addValue(self.getHistogram("ROBStatus_perCall").GetBinContent(2))
64  self.columns['robsHLTCached'].addValue(self.getHistogram("ROBStatus_perCall").GetBinContent(3))
65  self.columns['robsDCMCached'].addValue(self.getHistogram("ROBStatus_perCall").GetBinContent(4))
66  self.columns['robsIgnored'].addValue(self.getHistogram("ROBStatus_perCall").GetBinContent(5))
67  self.columns['robsDisabled'].addValue(self.getHistogram("ROBStatus_perCall").GetBinContent(6))
68  self.columns['robsNotOk'].addValue(self.getHistogram("ROBStatus_perCall").GetBinContent(7))
69 
70  # Read maximum number of ROBs from ROS to ROB mapping
71  maxRobs = len(ROSToROBMap[itemName])
72  nMaxRobsRequests = self.getHistogram("NROBsPerRequest_perCall").GetBinContent(maxRobs)
73 
74  allRobsRequests = self.getHistogram("NROBsPerRequest_perCall").Integral()
75  if (allRobsRequests == 0):
76  log.error("No histograms for the ROS HLT summary were found")
77  raise ValueError
78 
79  self.columns['fullRequests'].addValue(nMaxRobsRequests/allRobsRequests*100)
GetMean
TGraphErrors * GetMean(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3907
ROS_HLT_TableConstructor.ROS_HLT_TableConstructor.fillColumns
def fillColumns(self, itemName)
Definition: ROS_HLT_TableConstructor.py:53
GetEntries
TGraphErrors * GetEntries(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4019
ROS_HLT_TableConstructor.ROS_HLT_TableConstructor
Definition: ROS_HLT_TableConstructor.py:19
ROS_HLT_TableConstructor.ROSToROBMap
ROSToROBMap
Definition: ROS_HLT_TableConstructor.py:7
ROS_HLT_TableConstructor.ROS_HLT_TableConstructor.expectedHistograms
expectedHistograms
Definition: ROS_HLT_TableConstructor.py:25
ROS_HLT_TableConstructor.ROS_HLT_TableConstructor.__init__
def __init__(self, tableObj, underflowThreshold, overflowThreshold)
Definition: ROS_HLT_TableConstructor.py:23
ROS_HLT_TableConstructor.ROS_HLT_TableConstructor.defineColumns
def defineColumns(self)
Definition: ROS_HLT_TableConstructor.py:34