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:
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
142
143 desynchistoname = 'AvgSyncErrPerBCID'
144 for layer in layers:
145 title = 'Average syncrohisation error per BCID, {0}'.format(layer) + runtext + ';BCID;# hits/pixel/event'
146 layerGroup = getLayerGroup(helper, alg, layer)
147 fullvarstr = 'pixdesyncmontool_bcid'
148 fullvarstr+= ',{0}_{1}'.format(desynchistoname, 'val')
149 fullvarstr+= ';' + desynchistoname + '_{0}'.format(layer)
150 layerGroup.defineHistogram(fullvarstr,
151 type='TProfile', path='/Pixel/Errors', title=title,
152 xbins=bcidbinsx, xmin=-0.5, xmax=-0.5+bcidbinsx)