ATLAS Offline Software
PixelAthErrorMonAlgCfg.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 '''
6 @file PixelAthErrorMonAlgCfg.py
7 @brief Configuration of Pixel Error Monitoring Histograms for Run 3
8 @author Iskander Ibragimov
9 '''
10 from PixelMonitoring.PixelAthMonitoringBase import define2DProfHist, define2DProfPerFEHist
11 from PixelMonitoring.PixelAthMonitoringBase import defineMapVsLumiLayers
12 from PixelMonitoring.PixelAthMonitoringBase import define1DProfLumiLayers
13 from PixelMonitoring.PixelAthMonitoringBase import layers, fei3layers, fei4layers
14 from PixelMonitoring.PixelAthMonitoringBase import fullDressTitle
15 from PixelMonitoring.PixelAthMonitoringBase import errbbinsy, errbminsy, errbbsizy, errtbinsy
16 from PixelMonitoring.PixelAthMonitoringBase import ErrCatRODModLabels, ErrCatLabels, ErrCatRODModLabelsNorm, ErrCatLabelsNorm
17 from PixelMonitoring.PixelAthMonitoringBase import ErrStateLabelsFEI3, ErrStateLabelsFEI4
18 
19 def PixelAthErrorMonAlgCfg(helper, alg, **kwargs):
20  '''
21  Arguments:
22  helper -- AthMonitorCfgHelper(Old) instance
23  alg -- algorithm Configurable object returned from addAlgorithm
24  kwargs -- jo agruments
25  '''
26  doOnline = kwargs.get('doOnline', False)
27  doLumiBlock = kwargs.get('doLumiBlock', False)
28  path = '/Pixel/Errors/'
29  pathExpert = '/Pixel/ErrorsExpert/'
30  pathLowStat = '/Pixel/LumiBlock/'
31 
32  errorGroup = helper.addGroup(alg, 'Error')
33 
34  histoGroupName = 'ErrorsPerLumi'
35  title = 'Average Total Errors'
36  yaxistext = ';# errors/event'
37  define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
38 
39  histoGroupName = 'ErrorStatePerLumi'
40  title = 'Average Errors by Error States'
41  ylabels = [[i[1] for i in ErrStateLabelsFEI3]]*len(layers)
42  defineMapVsLumiLayers(helper, alg, histoGroupName, title, path, ';lumi block', ';error state', ybins=errbbinsy, ymins=errbminsy, binsizes=errbbsizy, ylabels=ylabels, type='TProfile2D', onlylayers=fei3layers)
43  ylabels = [[i[1] for i in ErrStateLabelsFEI4]]*len(layers)
44  defineMapVsLumiLayers(helper, alg, histoGroupName, title, path, ';lumi block', ';error state', ybins=errbbinsy, ymins=errbminsy, binsizes=errbbsizy, ylabels=ylabels, type='TProfile2D', onlylayers=fei4layers)
45 
46  histoGroupName = 'ErrorCatRODModPerLumi'
47  title = 'Average Errors by Error Types'
48  ylabels = [[i[1] for i in ErrCatRODModLabels]]*len(layers)
49  defineMapVsLumiLayers(helper, alg, histoGroupName, title, path, ';lumi block', ';error type', ybins=errtbinsy, ymins=errbminsy, binsizes=errbbsizy, ylabels=ylabels, type='TProfile2D')
50 
51  if not doOnline:
52  for i, cat in enumerate(ErrCatRODModLabels):
53  if i==4: #other histograms are covered by ErrCatLabels below
54  break
55  histoGroupName = cat[0]
56  title = "Total "+cat[1]
57  define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F')
58 
59  for cat in ErrCatLabels:
60  histoGroupName = cat[0]
61  title = "Total "+cat[1]
62  define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F')
63 
64  yaxistext = ';# errors/module/event'
65  for i, cat in enumerate(ErrCatRODModLabelsNorm):
66  histoGroupName = cat
67  title = "Average "+ErrCatRODModLabels[i][1]+" per Module"
68  define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
69 
70  for i, cat in enumerate(ErrCatLabelsNorm):
71  histoGroupName = cat
72  title = "Average "+ErrCatLabels[i][1]+" per Module"
73  define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
74 
75  histoGroupName = "FEMCCErrorwords"
76  title = "Average FE/MCC Error Words"
77  define2DProfHist(helper, alg, histoGroupName, title, path, type='TProfile2D', onlylayers=fei3layers)
78 
79  histoGroupName = "TruncatedROBErrors"
80  title = "Truncated ROB Errors"
81  define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F')
82 
83  histoGroupName = "MaskedROBErrors"
84  title = "Masked ROB Errors"
85  define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F')
86 
87  if doLumiBlock:
88  histoGroupName = "ErrorsLB"
89  title = "Errors"
90  define2DProfHist(helper, alg, histoGroupName, title, pathLowStat, type='TH2F', doWeight=True, lifecycle='lowStat')
91 
92  histoGroupName = "ErrorsModSyncLB"
93  title = "Errors_ModSync"
94  define2DProfHist(helper, alg, histoGroupName, title, pathLowStat, type='TH2F', lifecycle='lowStat')
95 
96  histoGroupName = "ErrorsRODSyncLB"
97  title = "Errors_RODSync"
98  define2DProfHist(helper, alg, histoGroupName, title, pathLowStat, type='TH2F', lifecycle='lowStat')
99 
100  matches = ["SEU", "EOC", "Warning"]
101  for state in ErrStateLabelsFEI3:
102  title = state[1]+" Errors"
103  if any(st in state[0] for st in matches):
104  histoGroupName = state[0]+"FEMap"
105  define2DProfPerFEHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F', doWeight=True)
106  if doOnline:
107  title += ' reset every 15 LBs'
108  define2DProfPerFEHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F', doWeight=True, opt='kLBNHistoryDepth=15', histname=state[0]+"FEMapMon")
109  else:
110  histoGroupName = state[0]+"Map"
111  define2DProfHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F', doWeight=True)
112  if doOnline:
113  title += ' reset every 15 LBs'
114  define2DProfHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F', doWeight=True, opt='kLBNHistoryDepth=15', histname=state[0]+"MapMon")
115  histoGroupName = state[0]+"PerLumi"
116  title = 'Average '+state[1]+" Errors per module per event"
117  yaxistext = ';# errors/module/event'
118  define1DProfLumiLayers(helper, alg, histoGroupName, title, pathExpert, yaxistext, type='TProfile', onlylayers=fei3layers)
119 
120  for state in ErrStateLabelsFEI4:
121  histoGroupName = state[0]+"Map"
122  title = state[1]+" Errors"
123  define2DProfHist(helper, alg, histoGroupName, title, pathExpert, type='TH2F', doWeight=True)
124  histoGroupName = state[0]+"PerLumi"
125  title = 'Average '+state[1]+" Errors per module per event"
126  yaxistext = ';# errors/module/event'
127  define1DProfLumiLayers(helper, alg, histoGroupName, title, pathExpert, yaxistext, type='TProfile', onlylayers=fei4layers)
128 
129  varName = 'ServiceRecord_val'
130  title = fullDressTitle('IBL ServiceRecord Unweighted', False, ';SR',';# errors')
131  varName += ';ServiceRecordUnweighted_IBL'
132  errorGroup.defineHistogram(varName,
133  type='TH1F', path=pathExpert, title=title,
134  xbins=32, xmin=-0.5, xmax=31.5)
135  varName = 'ServiceRecord_val'
136  title = fullDressTitle('IBL ServiceRecord Weighted with Payload', False, ';SR',';# errors')
137  varName += ';ServiceRecordWeighted_IBL'
138  errorGroup.defineHistogram(varName, weight='ServiceRecord_wgt',
139  type='TH1F', path=pathExpert, title=title,
140  xbins=32, xmin=-0.5, xmax=31.5)
141 
PixelAthErrorMonAlgCfg.PixelAthErrorMonAlgCfg
def PixelAthErrorMonAlgCfg(helper, alg, **kwargs)
Definition: PixelAthErrorMonAlgCfg.py:19
PixelAthMonitoringBase.define1DProfLumiLayers
def define1DProfLumiLayers(helper, alg, name, title, path, yaxistext, type='TProfile', opt='', histname=None, onlylayers=layers)
Definition: PixelAthMonitoringBase.py:396
PixelAthMonitoringBase.defineMapVsLumiLayers
def defineMapVsLumiLayers(helper, alg, name, title, path, xaxistext, yaxistext, ybins, ymins, binsizes=[1.0], ylabels=None, opt='', type='TH2F', histname=None, onlylayers=layers)
Definition: PixelAthMonitoringBase.py:431
PixelAthMonitoringBase.define2DProfHist
def define2DProfHist(helper, alg, name, title, path, type='TProfile2D', doWeight=False, lifecycle='run', zmin=None, zmax=None, opt='', histname=None, onlylayers=baselayers)
Definition: PixelAthMonitoringBase.py:276
PixelAthMonitoringBase.define2DProfPerFEHist
def define2DProfPerFEHist(helper, alg, name, title, path, type='TProfile2D', doWeight=False, lifecycle='run', zmin=None, zmax=None, opt='', histname=None, onlylayers=baselayers)
Definition: PixelAthMonitoringBase.py:318
PixelAthMonitoringBase.fullDressTitle
def fullDressTitle(name, ontrack, xaxistext, yaxistext)
Definition: PixelAthMonitoringBase.py:531