6 '''Function to configure LVL1 Ppr algorithm in the monitoring system.'''
10 from AthenaConfiguration.ComponentFactory
import CompFactory
11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
15 from AthenaMonitoring
import AthMonitorCfgHelper
16 helper = AthMonitorCfgHelper(inputFlags,
'PprMonitoringCfg')
19 PprMonAlg = helper.addAlgorithm(CompFactory.PprMonitorAlgorithm,
'PprMonAlg')
22 groupName =
'PprMonitor'
23 PprMonAlg.PackageName = groupName
27 PprMonAlg.TT_ADC_HitMap_Thresh = threshADC
30 PprMonAlg.SliceNo = sliceNo
32 threshVec = [0, 1, 3, 5, 10, 20, 30, 50]
33 PprMonAlg.LUTHitMap_ThreshVec = threshVec
36 isOnline = inputFlags.Trigger.Online.isPartition
43 groupLUTCP = helper.addGroup(PprMonAlg,
'groupLUTCP', mainDir)
44 groupLUTCP_EM = helper.addGroup(PprMonAlg,
'groupLUTCP_EM', mainDir)
45 groupLUTCP_HAD = helper.addGroup(PprMonAlg,
'groupLUTCP_HAD', mainDir)
46 groupLUTJEP = helper.addGroup(PprMonAlg,
'groupLUTJEP', mainDir)
47 groupLUTJEP_EM = helper.addGroup(PprMonAlg,
'groupLUTJEP_EM', mainDir)
48 groupLUTJEP_HAD = helper.addGroup(PprMonAlg,
'groupLUTJEP_HAD', mainDir)
49 groupADC_EM = helper.addGroup(PprMonAlg,
'groupADC_EM', mainDir)
50 groupADC_HAD = helper.addGroup(PprMonAlg,
'groupADC_HAD', mainDir)
51 groupTimeslice_EM = helper.addGroup(PprMonAlg,
'groupTimeslice_EM', mainDir)
52 groupTimeslice_HAD = helper.addGroup(PprMonAlg,
'groupTimeslice_HAD', mainDir)
53 groupTimeslice = helper.addGroup(PprMonAlg,
'groupTimeslice', mainDir)
54 groupErrors_EM = helper.addGroup(PprMonAlg,
'groupErrors_EM', mainDir)
55 groupErrors_HAD = helper.addGroup(PprMonAlg,
'groupErrors_HAD', mainDir)
58 etabins = [-4.9,-4.475,-4.050,-3.625,-3.2,-3.1,-2.9,
59 -2.7,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,
60 -1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,
61 -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,
62 -0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,
63 0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
64 1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.7,2.9,
65 3.1,3.2,3.625,4.050,4.475,4.9]
67 etabins_HAD_1D = [-4.9,-4.050,-3.2,-3.1,-2.9,
68 -2.7,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,
69 -1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,
70 -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,
71 -0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,
72 0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
73 1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.7,2.9,
79 phimax_1d = 2.*math.pi
87 histPath = trigPath+
'/LUT-CP/Distributions'
90 groupLUTCP.defineHistogram(
'BCID;ppm_1d_tt_lutcp_LutPerBCN',
91 title=
'Number of LUT-CP > 5 GeV/2 per BC; Bunch crossing; # of LUT above limit',
92 type=
'TH1F', path=histPath, xbins=bcn, xmin=0, xmax=bcn,
93 cutmask=
'mask_cpET_5')
96 groupLUTCP_EM.defineHistogram(
'eta_TT;ppm_em_1d_tt_lutcp_Eta',
97 title=
'EM LUT-CP: Distribution of peak in #eta; #eta',
98 type=
'TH1F', path=histPath, xbins=etabins,
99 cutmask=
'mask_cpET_0')
101 groupLUTCP_EM.defineHistogram(
'phiTT_1D;ppm_em_1d_tt_lutcp_Phi',
102 title=
'EM LUT-CP: Distribution of peak in #phi; #phi',
103 type=
'TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d)
105 groupLUTCP_EM.defineHistogram(
'cpET_TT;ppm_em_1d_tt_lutcp_Et',
106 title=
'EM LUT-CP: Distribution of peak; EM LUT peak [GeV/2]',
107 type=
'TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange,
108 cutmask=
'mask_cpET_0')
111 groupLUTCP_HAD.defineHistogram(
'eta_TT;ppm_had_1d_tt_lutcp_Eta',
112 title=
'HAD LUT-CP: Distribution of peak in #eta; #eta',
113 type=
'TH1F', path=histPath, xbins=etabins_HAD_1D,
114 cutmask=
'mask_cpET_0')
116 groupLUTCP_HAD.defineHistogram(
'phiTT_1D;ppm_had_1d_tt_lutcp_Phi',
117 title=
'HAD LUT-CP: Distribution of peak in #phi; #phi',
118 type=
'TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d)
120 groupLUTCP_HAD.defineHistogram(
'cpET_TT;ppm_had_1d_tt_lutcp_Et',
121 title=
'HAD LUT-CP: Distribution of peak; HAD LUT peak [GeV/2]',
122 type=
'TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange,
123 cutmask=
'mask_cpET_0')
126 histPath = trigPath+
'/LUT-CP/EtaPhiMaps'
128 groupLUTCP_EM.defineHistogram(
'etaTT_2D,phiTT_2D,cpET_TT_2D;ppm_em_2d_etaPhi_tt_lutcp_AverageEt',
129 title=
'EM Average LUT-CP Et for Et > 5 GeV/2',
130 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
132 groupLUTCP_HAD.defineHistogram(
'etaTT_2D,phiTT_2D,cpET_TT_2D;ppm_had_2d_etaPhi_tt_lutcp_AverageEt',
133 title=
'HAD Average LUT-CP Et for Et > 5 GeV/2',
134 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
140 layers = [
'EM',
'HAD']
145 groupLUTCP_LB = helper.addGroup(PprMonAlg,
'groupLUTCP_{0}_{1}_LB'.
format(layer, threshVec[i]), mainDir)
146 groupLUTCP_LB.defineHistogram(
'etaTT_2D,phiTT_2D;ppm_{0}_2d_etaPhi_tt_lutcp_Threshold0{1}'.
format(layer.lower(), i),
147 title=
'#eta - #phi map of {0} LUT-CP > {1} GeV/2'.
format(layer, threshVec[i]),
148 type=
'TH2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d,
150 duration=
'' if isOnline
else 'lb')
156 histPath = trigPath+
'/LUT-JEP/Distributions'
159 groupLUTJEP.defineHistogram(
'BCID;ppm_1d_tt_lutjep_LutPerBCN',
160 title=
'Number of LUT-JEP > 5 GeV per BC; Bunch crossing; # of LUT above limit',
161 type=
'TH1F', path=histPath, xbins=bcn, xmin=0, xmax=bcn,
162 cutmask=
'mask_jepET_5')
165 groupLUTJEP_EM.defineHistogram(
'eta_TT;ppm_em_1d_tt_lutjep_Eta',
166 title=
'EM LUT-JEP: Distribution of peak in #eta',
167 type=
'TH1F', path=histPath, xbins=etabins,
168 cutmask=
'mask_jepET_0')
170 groupLUTJEP_EM.defineHistogram(
'phiTT_1D;ppm_em_1d_tt_lutjep_Phi',
171 title=
'EM LUT-JEP: Distribution of peak in #phi; #phi',
172 type=
'TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d)
174 groupLUTJEP_EM.defineHistogram(
'jepET_TT;ppm_em_1d_tt_lutjep_Et',
175 title=
'EM LUT-JEP: Distribution of peak; EM LUT peak [GeV]',
176 type=
'TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange,
177 cutmask=
'mask_jepET_0')
180 groupLUTJEP_HAD.defineHistogram(
'eta_TT;ppm_had_1d_tt_lutjep_Eta',
181 title=
'HAD LUT-JEP: Distribution of peak in #eta',
182 type=
'TH1F', path=histPath, xbins=etabins_HAD_1D,
183 cutmask=
'mask_jepET_0')
185 groupLUTJEP_HAD.defineHistogram(
'phiTT_1D;ppm_had_1d_tt_lutjep_Phi',
186 title=
'HAD LUT-JEP: Distribution of peak in #phi; #phi',
187 type=
'TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d)
189 groupLUTJEP_HAD.defineHistogram(
'jepET_TT;ppm_had_1d_tt_lutjep_Et',
190 title=
'HAD LUT-JEP: Distribution of peak; HAD LUT peak [GeV]',
191 type=
'TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange,
192 cutmask=
'mask_jepET_0')
195 histPath = trigPath+
'/LUT-JEP/EtaPhiMaps'
197 groupLUTJEP_EM.defineHistogram(
'etaTT_2D,phiTT_2D,jepET_TT_2D;ppm_em_2d_etaPhi_tt_lutjep_AverageEt',
198 title=
'EM Average LUT-JEP Et for Et > 5 GeV',
199 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
201 groupLUTJEP_HAD.defineHistogram(
'etaTT_2D,phiTT_2D,jepET_TT_2D;ppm_had_2d_etaPhi_tt_lutjep_AverageEt',
202 title=
'HAD Average LUT-JEP Et for Et > 5 GeV',
203 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
207 groupLUTJEP_LB = helper.addGroup(PprMonAlg,
'groupLUTJEP_{0}_{1}_LB'.
format(layer, threshVec[i]), mainDir)
208 groupLUTJEP_LB.defineHistogram(
'etaTT_2D,phiTT_2D;ppm_{0}_2d_etaPhi_tt_lutjep_Threshold0{1}'.
format(layer.lower(), i),
209 title=
'#eta - #phi map of {0} LUT-JEP > {1} GeV'.
format(layer, threshVec[i]),
210 type=
'TH2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d,
212 duration=
'' if isOnline
else 'lb')
218 histPath = trigPath+
'/ADC/EtaPhiMaps'
221 groupADC_EM.defineHistogram(
'etaTT_2D,phiTT_2D;ppm_em_2d_etaPhi_tt_adc_HitMap',
222 title=
'#eta - #phi map of EM FADC > {0} for triggered timeslice; Tower #eta; Tower #phi'.
format(threshADC),
223 type=
'TH2F', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
225 groupADC_EM.defineHistogram(
'etaTT_2D,phiTT_2D,adcTT;ppm_em_2d_etaPhi_tt_adc_ProfileHitMap',
226 title=
'#eta - #phi profile map of EM FADC > {0} for triggered timeslice; Tower #eta; Tower #phi'.
format(threshADC),
227 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
230 groupADC_HAD.defineHistogram(
'etaTT_2D,phiTT_2D;ppm_had_2d_etaPhi_tt_adc_HitMap',
231 title=
'#eta - #phi map of HAD FADC > {0} for triggered timeslice; Tower #eta; Tower #phi'.
format(threshADC),
232 type=
'TH2F', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
234 groupADC_HAD.defineHistogram(
'etaTT_2D,phiTT_2D,adcTT;ppm_had_2d_etaPhi_tt_adc_ProfileHitMap',
235 title=
'#eta - #phi profile map of HAD FADC > {0} for triggered timeslice; Tower #eta; Tower #phi'.
format(threshADC),
236 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
239 histPath = trigPath+
'/ADC/Timeslices'
241 groupTimeslice_EM.defineHistogram(
'adcPeak;ppm_em_1d_tt_adc_TriggeredSlice',
242 title=
'Number of the EM triggered slice; # Slice',
243 type=
'TH1F', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo)
245 groupTimeslice_HAD.defineHistogram(
'adcPeak;ppm_had_1d_tt_adc_TriggeredSlice',
246 title=
'Number of the HAD triggered slice; # Slice',
247 type=
'TH1F', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo)
249 groupTimeslice_EM.defineHistogram(
'maxADC;ppm_em_1d_tt_adc_MaxTimeslice',
250 title=
'EM distribution of maximum timeslice; slice',
251 type=
'TH1D', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo)
253 groupTimeslice_HAD.defineHistogram(
'maxADC;ppm_had_1d_tt_adc_MaxTimeslice',
254 title=
'HAD distribution of maximum timeslice; slice',
255 type=
'TH1D', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo)
257 groupTimeslice_EM.defineHistogram(
'etaTT_2D,phiTT_2D,maxADCPlus1;ppm_em_2d_etaPhi_tt_adc_MaxTimeslice',
258 title=
'Average maximum timeslice for EM signal (TS:1-15); Tower #eta; Tower #phi',
259 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
261 groupTimeslice_HAD.defineHistogram(
'etaTT_2D,phiTT_2D,maxADCPlus1;ppm_had_2d_etaPhi_tt_adc_MaxTimeslice',
262 title=
'Average maximum timeslice for HAD signal (TS:1-15); Tower #eta; Tower #phi',
263 type=
'TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d)
266 bcidBitsLabels = [
'none (40 MHz)',
'satBC only',
'peakF only',
'satBC & peakF',
'sat80BC & peakF',
'sat80BC & sat40BC',
'sat80BC only']
267 groupTimeslice.defineHistogram(
'bcidBits,adcBCID;ppm_2d_tt_adc_BcidBits',
268 title=
'PPM: PeakADC Vs. Bits of BCID Logic Word',
269 type=
'TH2I', path=histPath, xbins=7, xmin=0, xmax=7, xlabels=bcidBitsLabels, ybins=1024, ymin=0, ymax=1024)
272 sat80Labels = [
'no saturated ADC',
'none/none',
'none/low',
'none/high',
'low/low',
'low/high',
'high/high',
'else']
273 groupTimeslice.defineHistogram(
'sat80Word;ppm_1d_tt_adc_HLCase',
274 title=
'PPM: Sat80 thresholds passed by ADC[n-2.5] / ADC[n-1.5]',
275 type=
'TH1I', path=histPath, xbins=8, xmin=0, xmax=8, xlabels=sat80Labels)
278 partitionsEM = [
'LArFCAL1C',
'LArEMECC',
'LArOverlapC',
'LArEMBC',
'LArEMBA',
'LArOverlapA',
'LArEMECA',
'LArFCAL1A']
279 partitionsHAD = [
'LArFCAL23C',
'LArHECC',
'TileEBC',
'TileLBC',
'TileLBA',
'TileEBA',
'LArHECA',
'LArFCAL23A']
281 signalsEM = helper.addArray([partitionsEM], PprMonAlg,
'groupTimeslice_EM', topPath=mainDir)
282 signalsEM.defineHistogram(
'slice,wADC;ppm_em_1d_tt_adc_SignalProfile{0}',
283 title=
'Signal Shape Profile for {0}; Timeslice',
284 type=
'TProfile', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo)
286 signalsHAD = helper.addArray([partitionsHAD], PprMonAlg,
'groupTimeslice_HAD', topPath=mainDir)
287 signalsHAD.defineHistogram(
'slice,wADC;ppm_had_1d_tt_adc_SignalProfile{0}',
288 title=
'Signal Shape Profile for {0}; Timeslice',
289 type=
'TProfile', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo)
297 histPath = trigPath+
'Errors'
300 groupErrors_EM.defineHistogram(
'etaTT;ppm_em_1d_pedOverflow_Eta',
301 title=
'EM : Overflow of pedestal correction;#eta',
302 type=
'TH1F', path=histPath, xbins=etabins,
303 cutmask=
'mask_PedCorrOverflow',
306 groupErrors_EM.defineHistogram(
'etaTT;ppm_em_1d_pedUnderflow_Eta',
307 title=
'EM : Underflow of pedestal correction;#eta',
308 type=
'TH1F', path=histPath, xbins=etabins,
309 cutmask=
'mask_PedCorrUnderflow',
313 groupErrors_HAD.defineHistogram(
'etaTT;ppm_had_1d_pedOverflow_Eta',
314 title=
'HAD : Overflow of pedestal correction;#eta',
315 type=
'TH1F', path=histPath, xbins=etabins_HAD_1D,
316 cutmask=
'mask_PedCorrOverflow',
319 groupErrors_HAD.defineHistogram(
'etaTT;ppm_had_1d_pedUnderflow_Eta',
320 title=
'HAD : Underflow of pedestal correction;#eta',
321 type=
'TH1F', path=histPath, xbins=etabins_HAD_1D,
322 cutmask=
'mask_PedCorrUnderflow',
325 globalError_xlabels = [
336 globalError_xlabels_link = [
349 group_Error_1DSummary= helper.addGroup(PprMonAlg,
'group1DErrorSummary', mainDir)
350 group_Error_1DSummary.defineHistogram(
'bit_2D;ppm_1d_ErrorSummary', title=
'Summary of SubStatus Errors', type=
'TH1F', path=histPath,xbins=8,xmin=0, xmax=8, xlabels=globalError_xlabels_link,opt=
'kAlwaysCreate')
353 group_Error_ASICErrorEventNumbers= helper.addGroup(PprMonAlg,
'groupASICErrorEventNumbers', mainDir)
354 group_Error_ASICErrorEventNumbers.defineHistogram(
'eventMonitor,bit_2D;ppm_2d_ASICErrorEventNumbers', title=
'ASIC Error Field Event Numbers;Events with Error/Mismatch;;', type=
'TH2I', path=histPath,xbins=10,xmin=0, xmax=10, ybins=8, ymin=0, ymax=8, ylabels=globalError_xlabels,opt=
'kAlwaysCreate')
357 group_Error_ErrorEventNumbers= helper.addGroup(PprMonAlg,
'groupErrorEventNumbers', mainDir)
358 group_Error_ErrorEventNumbers.defineHistogram(
'eventMonitor,bit_2D;ppm_2d_ErrorEventNumbers', title=
'SubStatus Error Event Numbers;Events with Error/Mismatch;;', type=
'TH2I', path=histPath,xbins=10,xmin=0, xmax=10, ybins=8, ymin=0, ymax=8, ylabels=globalError_xlabels_link,opt=
'kAlwaysCreate')
361 group_Error_ErrorField03= helper.addGroup(PprMonAlg,
'groupErrorField03', mainDir)
362 group_Error_ErrorField03.defineHistogram(
'bit_2D,y_2D;ppm_2d_ErrorField03', title=
'Errors from TT SubStatus Word (crates 0-3)', type=
'TH2I', path=histPath,xbins=8,xmin=0, xmax=8, ybins=64, ymin=0, ymax=64, xlabels=globalError_xlabels, ylabels=
BinErrors(
'cr0cr1cr2cr3'),opt=
'kAlwaysCreate')
364 group_Error_ErrorField47= helper.addGroup(PprMonAlg,
'groupErrorField47', mainDir)
365 group_Error_ErrorField47.defineHistogram(
'bit_2D,y_2D;ppm_2d_ErrorField47', title=
'Errors from TT SubStatus Word (crates 4-7)', type=
'TH2I', path=histPath,xbins=8,xmin=0, xmax=8, ybins=64, ymin=0, ymax=64, xlabels=globalError_xlabels, ylabels=
BinErrors(
'cr4cr5cr6cr7'),opt=
'kAlwaysCreate')
368 group_Error_Status03= helper.addGroup(PprMonAlg,
'groupStatus03', mainDir)
369 group_Error_Status03.defineHistogram(
'bit_2D,y_2D;ppm_2d_Status03', title=
'Errors from TT SubStatus Word (crates 0-3)', type=
'TH2I', path=histPath,xbins=8,xmin=0, xmax=8, ybins=64, ymin=0, ymax=64, xlabels=globalError_xlabels_link, ylabels=
BinErrors(
'cr0cr1cr2cr3'),opt=
'kAlwaysCreate')
372 group_Error_Status47= helper.addGroup(PprMonAlg,
'groupStatus47', mainDir)
373 group_Error_Status47.defineHistogram(
'bit_2D,y_2D;ppm_2d_Status47', title=
'Errors from TT SubStatus Word (crates 4-7)', type=
'TH2I', path=histPath,xbins=8,xmin=0, xmax=8, ybins=64, ymin=0, ymax=64, xlabels=globalError_xlabels_link, ylabels=
BinErrors(
'cr4cr5cr6cr7'),opt=
'kAlwaysCreate')
380 acc = helper.result()