ATLAS Offline Software
Global_HLT_TableConstructor.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 #
5 
6 from TrigCostAnalysis.TableConstructorBase import TableConstructorBase, Column
7 
8 '''
9 @file Global_HLT_TableConstructor.py
10 @brief Contains TableConstructor classes per Global_HLT table. Defines what
11  should be saved in table and fills them
12 '''
13 
14 
15 class Global_HLT_TableConstructor(TableConstructorBase):
16  ''' @brief Class representing Global_HLT table
17  '''
18  def __init__(self, tableObj, underflowThreshold, overflowThreshold):
19  super(). __init__(tableObj, underflowThreshold, overflowThreshold)
20  self.expectedHistograms = ["AlgTime_perEvent",
21  "AlgTime_perCall",
22  "AlgCalls_perEvent",
23  "SteeringTime_perEvent",
24  "LbLength"]
25 
26  self.lbLength = 0
27 
28 
29  def defineColumns(self):
30  self.columns['name'] = Column("Name", "Algorithms name")
31  self.columns['lbLength'] = Column("Lumi Block Length [s]", "Length of this luminosity block or blocks")
32  self.columns['events'] = Column("Raw Active Events", "Raw underlying statistics on number of events processed")
33  self.columns['eventsWeighted'] = Column("Active Events", "Total weighted number of events processed")
34  self.columns['callsPerEvent'] = Column("Alg Calls/Event", "Mean number of alg calls")
35  self.columns['eventRate'] = Column("Event Rate [Hz]", "LB normalised rate of events in the HLT")
36  self.columns['callRate'] = Column("Alg Call Rate [Hz]", "LB normalised rate of alg calls in events in the HLT")
37  self.columns['steeringTime'] = Column("Total Steering Time [s]", "Total weighted integrated steering time")
38  self.columns['steeringTimePerEvent'] = Column("Steering Time/Event [ms]", "Mean integrated steering time per event")
39  self.columns['totalTimeSec'] = Column("Alg Total Time [s]", "Total weighted integrated walltime of all algs")
40  self.columns['timePerCall'] = Column("Alg Time/Call [ms]", "Mean weighted alg time normalised to all alg calls")
41  self.columns['timePerEvent'] = Column("Alg Time/Event [ms]", "Mean weighted alg time normalised to all events")
42  self.columns['nPU'] = Column("Number of PU", "Estimated number of needed CPU with 100 kHz input rate based on algorithm time per event")
43  self.columns['nPUErr'] = Column("Error on number of CPUs", "Error on number of CPUs based on Algorithm tome per event error")
44 
45 
46  def fillColumns(self, itemName):
47  rateDenominator = self.lbLength if itemName == "All" else self.getHistogram("LbLength").GetBinContent(1)
48  weightedEvents = self.getHistogram("SteeringTime_perEvent").Integral()
49  weightedCalls = self.getXWeightedIntegral("AlgCalls_perEvent", isLog=False)
50 
51  self.columns['name'].addValue(itemName)
52  self.columns['lbLength'].addValue(self.getHistogram("LbLength").GetBinContent(1))
53  self.columns['events'].addValue(self.getHistogram("SteeringTime_perEvent").GetEntries())
54  self.columns['eventsWeighted'].addValue(weightedEvents)
55  self.columns['callsPerEvent'].addValue(self.getHistogram("AlgCalls_perEvent").GetMean())
56  self.columns['eventRate'].addValue(weightedEvents / rateDenominator)
57  self.columns['callRate'].addValue(weightedCalls / rateDenominator)
58  self.columns['steeringTime'].addValue(self.getXWeightedIntegral("SteeringTime_perEvent", isLog=True) * 1e-3)
59  self.columns['steeringTimePerEvent'].addValue(self.getHistogram("SteeringTime_perEvent").GetMean())
60  self.columns['totalTimeSec'].addValue(self.getXWeightedIntegral("AlgTime_perEvent", isLog=True) * 1e-3)
61  self.columns['timePerCall'].addValue(self.getHistogram("AlgTime_perCall").GetMean())
62  self.columns['timePerEvent'].addValue(self.getHistogram("AlgTime_perEvent").GetMean())
63  self.columns['nPU'].addValue(self.getHistogram("AlgTime_perEvent").GetMean() * 100) # 100 kHz L1 input rate
64  self.columns['nPUErr'].addValue(self.getHistogram("AlgTime_perEvent").GetMeanError() * 100)
65 
GetMean
TGraphErrors * GetMean(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:3907
GetEntries
TGraphErrors * GetEntries(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4019
Global_HLT_TableConstructor.Global_HLT_TableConstructor.expectedHistograms
expectedHistograms
Definition: Global_HLT_TableConstructor.py:20
Global_HLT_TableConstructor.Global_HLT_TableConstructor.lbLength
lbLength
Definition: Global_HLT_TableConstructor.py:26
Global_HLT_TableConstructor.Global_HLT_TableConstructor.defineColumns
def defineColumns(self)
Definition: Global_HLT_TableConstructor.py:29
Global_HLT_TableConstructor.Global_HLT_TableConstructor.fillColumns
def fillColumns(self, itemName)
Definition: Global_HLT_TableConstructor.py:46
Global_HLT_TableConstructor.Global_HLT_TableConstructor
Definition: Global_HLT_TableConstructor.py:15
Global_HLT_TableConstructor.Global_HLT_TableConstructor.__init__
def __init__(self, tableObj, underflowThreshold, overflowThreshold)
Definition: Global_HLT_TableConstructor.py:18