5 '''Function to configure LVL1 Cpm 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,
'CpmMonitoringCfg')
19 from AthenaConfiguration.AutoConfigFlags
import GetFileMD
20 from AthenaConfiguration.Enums
import Format
22 inputContainsRun3FormatConfigMetadata = (
"metadata_items" in md
and any((
'TriggerMenuJson' in key)
for key
in md[
"metadata_items"].
keys()))
23 if inputFlags.Input.Format
is Format.POOL
and not inputContainsRun3FormatConfigMetadata:
25 return helper.result()
28 CpmMonAlg = helper.addAlgorithm(CompFactory.CpmMonitorAlgorithm,
'CpmMonAlg')
31 groupName =
'CpmMonitor'
32 CpmMonAlg.PackageName = groupName
34 CpmMonAlg.s_crates = crates
36 CpmMonAlg.s_maxSlices = maxSlices
38 CpmMonAlg.s_isolBits = isolBits
40 CpmMonAlg.s_tobsPerCPM = tobsPerCPM
42 CpmMonAlg.MaxTOBsPerCMX = maxTobsPerCmx
47 errorPath=trigPath+
"/Errors/Hardware"
48 monShiftPath=errorPath
49 monExpertPath=errorPath
50 monDetailPath=errorPath+
"/Detail/"
51 monCPMinputPath=trigPath+
"/Input/"
52 monRoIPath=trigPath+
"/Output/"
53 monCMXPath=trigPath+
"_CMX/Errors/Hardware/"
54 monCMXinPath=trigPath+
"_CMX/Input/"
55 monCMXoutPath=trigPath+
"_CMX/Output/"
57 monEventsPath=errorPath+
"/Detail/"
60 myGroup = helper.addGroup(CpmMonAlg, groupName , mainDir)
74 for i
in range(-25,25,4):
75 chan = i
if i < -1
else i+1
77 etalabels[chan+33] = f
"{chan}/{eta:.2f}"
82 for chan
in range(0,64,4):
83 rad = (chan+.5)*math.pi/32
84 philabels[chan] = f
"{chan}/{rad:.2f}"
85 philabels[63] =
"etaVphi"
87 myGroup.defineHistogram(
'etaTT,phiTT;ppm_em_2d_etaPhi_tt_Hitmap',title=
'PPM Trigger Tower EM eta/phi;Tower #eta; Tower #phi',type=
'TH2F',
88 cutmask=
'mask_em_TT',path=monCPMinputPath,
89 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d)
90 myGroup.defineHistogram(
'etaTT,phiTT;ppm_had_2d_etaPhi_tt_Hitmap',title=
'PPM Trigger Tower HAD eta/phi;Tower #eta; Tower #phi',type=
'TH2F',
91 cutmask=
'mask_had_TT',path=monCPMinputPath,
92 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d)
97 myGroup.defineHistogram(
'etCpmTT_em;cpm_em_1d_tt_Et', title=
'CPM Tower EM Et;CPM Tower EM Energy;',
98 cutmask=
'',path=monCPMinputPath,xbins=maxEnergyRange,xmin=0,xmax=maxEnergyRange)
99 myGroup.defineHistogram(
'etaCpmTT_em;cpm_em_1d_tt_Eta', title=
'CPM Tower EM eta;CPM Tower EM #eta;',
100 cutmask=
'',path=monCPMinputPath,xbins=50,xmin=-2.5,xmax=2.5)
101 myGroup.defineHistogram(
'phiCpmTT_em;cpm_em_1d_tt_Phi', title=
'CPM Tower EM phi;CPM Tower EM #phi;',
102 cutmask=
'',path=monCPMinputPath,xbins=64,xmin=0,xmax=2*math.pi)
104 myGroup.defineHistogram(
'etaCpmTT_em,phiScaledCpmTT_em;cpm_em_2d_etaPhi_tt_Hitmap',
105 title=
'CPM Tower EM eta/phi;Tower #eta; Tower #phi',type=
'TH2F',
106 cutmask=
'',path=monCPMinputPath,
107 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d,
108 xlabels=etalabels,ylabels=philabels,
109 opt=
'kAlwaysCreate' if labelDebug
else '')
110 myGroup.defineHistogram(
'etaCpmTT_em,phiScaledCpmTT_em;cpm_em_2d_etaPhi_tt_EtWeighted',
111 title=
'CPM Tower EM eta/phi weighted;Tower #eta; Tower #phi',type=
'TH2F',
112 cutmask=
'',path=monCPMinputPath,
113 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d, weight=
"etCpmTT_em")
115 myGroup.defineHistogram(
'GLinkParityError,cpmLoc;cpm_2d_Status',
116 title=
'CPM Sub-status bits;;',type=
'TH2F',
117 cutmask=
'',path=monDetailPath,
118 xbins=8,xmin=0.,xmax=8.0,ybins=56,ymin=0.,ymax=56.0)
122 myGroup.defineHistogram(
'etCpmTT_had;cpm_had_1d_tt_Et', title=
'CPM Tower HAD Et;CPM Tower HAD Energy;',
123 cutmask=
'',path=monCPMinputPath,xbins=maxEnergyRange,xmin=0,xmax=maxEnergyRange)
124 myGroup.defineHistogram(
'etaCpmTT_had;cpm_had_1d_tt_Eta', title=
'CPM Tower HAD eta;CPM Tower HAD #eta;',
125 cutmask=
'',path=monCPMinputPath,xbins=50,xmin=-2.5,xmax=2.5)
126 myGroup.defineHistogram(
'phiCpmTT_had;cpm_had_1d_tt_Phi', title=
'CPM Tower HAD phi;CPM Tower HAD #phi;',
127 cutmask=
'',path=monCPMinputPath,xbins=64,xmin=0,xmax=2*math.pi)
129 myGroup.defineHistogram(
'etaCpmTT_had,phiScaledCpmTT_had;cpm_had_2d_etaPhi_tt_Hitmap',
130 title=
'CPM Tower HAD eta/phi;Tower #eta; Tower #phi',type=
'TH2F',
131 cutmask=
'',path=monCPMinputPath,
132 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d,
133 xlabels=etalabels,ylabels=philabels,
134 opt=
'kAlwaysCreate' if labelDebug
else '')
135 myGroup.defineHistogram(
'etaCpmTT_had,phiScaledCpmTT_had;cpm_had_2d_etaPhi_tt_EtWeighted'
136 ,title=
'CPM Tower HAD eta/phi weighted;Tower #eta; Tower #phi',type=
'TH2F',
137 cutmask=
'',path=monCPMinputPath,
138 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d, weight=
"etCpmTT_had")
140 xbinshist =
int(crates * maxSlices)
141 myGroup.defineHistogram(
'sliceCpmTT_tot,peakCpmTT_tot;cpm_2d_tt_Slices'
142 ,title=
'CPM Slices and Triggered Slice;Crate/Number of Slices;Triggered Slice',type=
'TH2F',
143 cutmask=
'',path=monCPMinputPath,
144 xbins=xbinshist,xmin=0,xmax=xbinshist,ybins=maxSlices,ymin=0,ymax=maxSlices)
151 myGroup.defineHistogram(
'etaCpmTT_em_tot,phiScaledCpmTT_em_tot;cpm_em_2d_etaPhi_tt_Parity'
152 ,title=
'CPM Tower EM Parity Errors;Tower #eta; Tower #phi',type=
'TH2F',
153 cutmask=
'parityErrorCpmTT_em',path=monDetailPath,
154 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d)
155 myGroup.defineHistogram(
'etaCpmTT_em_tot,phiScaledCpmTT_em_tot;cpm_em_2d_etaPhi_tt_LinkDown',
156 title=
'CPM Tower EM Link Down Errors;Tower #eta; Tower #phi',type=
'TH2F',
157 cutmask=
'linkDownErrorCpmTT_em',path=monDetailPath,
158 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d)
161 myGroup.defineHistogram(
'etaCpmTT_had_tot,phiScaledCpmTT_had_tot;cpm_had_2d_etaPhi_tt_Parity',
162 title=
'CPM Tower HAD Parity Errors;Tower #eta; Tower #phi',type=
'TH2F',
163 cutmask=
'parityErrorCpmTT_had',path=monDetailPath,
164 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d)
165 myGroup.defineHistogram(
'etaCpmTT_had_tot,phiScaledCpmTT_had_tot;cpm_had_2d_etaPhi_tt_LinkDown',
166 title=
'CPM Tower HAD Link Down Errors;Tower #eta; Tower #phi',type=
'TH2F',
167 cutmask=
'linkDownErrorCpmTT_had',path=monDetailPath,
168 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d)
175 etalabels_roi=[
""]*66
176 for chan
in range(-24,26,4):
178 etalabels_roi[chan+32] = f
"{chan}/{eta:.2f}"
180 etalabels_roi[i] =
"+"
181 etalabels_roi[i+58] =
"+"
182 philabels_roi=[
""]*64
183 for chan
in range(0,64,4):
184 rad = (chan+1)*math.pi/32
185 philabels_roi[chan] = f
"{chan}/{rad:.2f}"
186 philabels_roi[63] =
"etaVphi"
188 myGroup.defineHistogram(
'energyTobRoIsEner;cpm_1d_roi_EnergyEm', title=
'CPM TOB RoI Cluster Energy EM;Cluster Energy;',
189 cutmask=
'mask_tobroi_ener_em',path=monRoIPath,
190 xbins=maxEnergyRange,xmin=0,xmax=maxEnergyRange,
191 opt=
'kAlwaysCreate' if labelDebug
else '')
192 myGroup.defineHistogram(
'energyTobRoIsEner;cpm_1d_roi_EnergyTau', title=
'CPM TOB RoI Cluster Energy Tau;Cluster Energy;',
193 cutmask=
'mask_tobroi_ener_tau',path=monRoIPath,
194 xbins=maxEnergyRange,xmin=0,xmax=maxEnergyRange,
195 opt=
'kAlwaysCreate' if labelDebug
else '')
197 myGroup.defineHistogram(
'energyTobRoIsIsol;cpm_1d_roi_IsolationEm', title=
'CPM TOB RoI Encoded Isolation Value EM;;',
198 cutmask=
'mask_tobroi_isol_em',path=monRoIPath,
199 xbins=isolRange,xmin=0,xmax=isolRange)
200 myGroup.defineHistogram(
'energyTobRoIsIsol;cpm_1d_roi_IsolationTau', title=
'CPM TOB RoI Encoded Isolation Value Tau;;',
201 cutmask=
'mask_tobroi_isol_tau',path=monRoIPath,
202 xbins=isolRange,xmin=0,xmax=isolRange)
206 myGroup.defineHistogram(
'bitsTobRoIsIsolEm;cpm_1d_roi_IsolationBitsEm', title=
'CPM TOB RoI Encoded Isolation Bits EM;Bit;',
207 cutmask=
'',path=monRoIPath,
208 xbins=isolBits,xmin=0,xmax=isolBits, weight=
"bitsTobRoIsIsolEmWeight")
211 myGroup.defineHistogram(
'bitsTobRoIsIsolTau;cpm_1d_roi_IsolationBitsTau', title=
'CPM TOB RoI Encoded Isolation Bits Tau;Bit;',
212 cutmask=
'',path=monRoIPath,
213 xbins=isolBits,xmin=0,xmax=isolBits, weight=
"bitsTobRoIsIsolTauWeight")
217 myGroup.defineHistogram(
'etaTobRoIsIsol,phiTobRoIsIsol;cpm_2d_etaPhi_roi_HitmapIsolEm',
218 title=
'CPM TOB RoIs EM Non-zero Isolation Hit Map;Tower #eta; Tower #phi',type=
'TH2F',
219 cutmask=
'mask_tobroi_isol_em',path=monRoIPath,
220 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d,
221 xlabels=etalabels_roi,ylabels=philabels_roi,
222 opt=
'kAlwaysCreate' if labelDebug
else '')
223 myGroup.defineHistogram(
'etaTobRoIsIsol,phiTobRoIsIsol;cpm_2d_etaPhi_roi_HitmapIsolTau',
224 title=
'CPM TOB RoIs Tau Non-zero Isolation Hit Map;Tower #eta; Tower #phi',type=
'TH2F',
225 cutmask=
'mask_tobroi_isol_tau',path=monRoIPath,
226 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d,
227 xlabels=etalabels_roi,ylabels=philabels_roi,
228 opt=
'kAlwaysCreate' if labelDebug
else '')
231 myGroup.defineHistogram(
'etaTobRoIsEner,phiTobRoIsEner;cpm_2d_etaPhi_roi_HitmapEm',
232 title=
'CPM TOB RoIs EM Hit Map;Tower #eta; Tower #phi',type=
'TH2F',
233 cutmask=
'mask_tobroi_ener_em',path=monRoIPath,
234 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d,
235 xlabels=etalabels_roi,ylabels=philabels_roi,
236 opt=
'kAlwaysCreate' if labelDebug
else '')
237 myGroup.defineHistogram(
'etaTobRoIsEner,phiTobRoIsEner;cpm_2d_etaPhi_roi_EtWeightedEm',
238 title=
'CPM TOB RoIs EM Weighted by Energy;Tower #eta; Tower #phi',type=
'TH2F',
239 cutmask=
'mask_tobroi_ener_em',path=monRoIPath,
240 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d, weight=
"energyTobRoIsEner",
241 xlabels=etalabels_roi,ylabels=philabels_roi,
242 opt=
'kAlwaysCreate' if labelDebug
else '')
244 myGroup.defineHistogram(
'etaTobRoIsEner,phiTobRoIsEner;cpm_2d_etaPhi_roi_HitmapTau',
245 title=
'CPM TOB RoIs Tau Hit Map;Tower #eta; Tower #phi',type=
'TH2F',
246 cutmask=
'mask_tobroi_ener_tau',path=monRoIPath,
247 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d,
248 xlabels=etalabels_roi,ylabels=philabels_roi,
249 opt=
'kAlwaysCreate' if labelDebug
else '')
250 myGroup.defineHistogram(
'etaTobRoIsEner,phiTobRoIsEner;cpm_2d_etaPhi_roi_EtWeightedTau',
251 title=
'CPM TOB RoIs Tau Weighted by Energy;Tower #eta; Tower #phi',type=
'TH2F',
252 cutmask=
'mask_tobroi_ener_tau',path=monRoIPath,
253 xbins=etabins_2d,xmin=etamin_2d,xmax=etamax_2d,ybins=phibins_2d,ymin=phimin_2d,ymax=phimax_2d, weight=
"energyTobRoIsEner",
254 xlabels=etalabels_roi,ylabels=philabels_roi,
255 opt=
'kAlwaysCreate' if labelDebug
else '')
258 myGroup.defineHistogram(
'tobPerCPMEm;cpm_1d_roi_TOBsPerCPMEm', title=
'CPM TOB RoI TOBs per CPM EM;Number of TOBs;',
259 cutmask=
'',path=monRoIPath,
260 xbins=tobsPerCPM+1,xmin=1,xmax=tobsPerCPM+2)
261 myGroup.defineHistogram(
'tobPerCPMTau;cpm_1d_roi_TOBsPerCPMTau', title=
'CPM TOB RoI TOBs per CPM Tau;Number of TOBs;',
262 cutmask=
'',path=monRoIPath,
263 xbins=tobsPerCPM+1,xmin=1,xmax=tobsPerCPM+2)
268 myGroup.defineHistogram(
'cmxCpmTobsEnerLeft;cmx_1d_tob_EnergyLeft', title=
'CMX-CP TOBs Cluster Energy Left CMX',
269 cutmask=
'',path=monCMXinPath,
270 xbins=maxEnergyRange,xmin=0,xmax=maxEnergyRange)
271 myGroup.defineHistogram(
'cmxCpmTobsEnerRight;cmx_1d_tob_EnergyRight', title=
'CMX-CP TOBs Cluster Energy Right CMX',
272 cutmask=
'',path=monCMXinPath,
273 xbins=maxEnergyRange,xmin=0,xmax=maxEnergyRange)
274 myGroup.defineHistogram(
'cmxCpmTobsLeft;cmx_1d_tob_TOBsPerCPMLeft', title=
'CMX-CP TOBs per CPM Left CMX;Number of TOBs;',
275 cutmask=
'',path=monCMXinPath,
276 xbins=tobsPerCPM+1,xmin=1,xmax=tobsPerCPM+2,
277 opt=
'kAlwaysCreate' if labelDebug
else '')
278 myGroup.defineHistogram(
'cmxCpmTobsRight;cmx_1d_tob_TOBsPerCPMRight', title=
'CMX-CP TOBs per CPM Right CMX;Number of TOBs;',
279 cutmask=
'',path=monCMXinPath,
280 xbins=tobsPerCPM+1,xmin=1,xmax=tobsPerCPM+2,
281 opt=
'kAlwaysCreate' if labelDebug
else '')
284 myGroup.defineHistogram(
'cmxCpmTobsIsolLeft;cmx_1d_tob_IsolationLeft', title=
'CMX-CP TOBs Encoded Isolation Value Left CMX;;',
285 cutmask=
'', path=monCMXinPath,
286 xbins=isolRange,xmin=0,xmax=isolRange)
287 myGroup.defineHistogram(
'cmxCpmTobsIsolRight;cmx_1d_tob_IsolationRight', title=
'CMX-CP TOBs Encoded Isolation Value Right CMX;;',
288 cutmask=
'', path=monCMXinPath,
289 xbins=isolRange,xmin=0,xmax=isolRange)
291 myGroup.defineHistogram(
'cmxCpmTobsIsolBitsLeft;cmx_1d_tob_IsolationBitsLeft',
292 title=
'CMX-CP TOBs Encoded Isolation Bits Left CMX;Bit;',
293 cutmask=
'', path=monCMXinPath, xbins=isolBits,xmin=0,xmax=isolBits,weight=
'cmxCpmTobsIsolBitsLeftWeight')
294 myGroup.defineHistogram(
'cmxCpmTobsIsolBitsRight;cmx_1d_tob_IsolationBitsRight',
295 title=
'CMX-CP TOBs Encoded Isolation Bits Right CMX;Bit;',
296 cutmask=
'', path=monCMXinPath, xbins=isolBits,xmin=0,xmax=isolBits,weight=
'cmxCpmTobsIsolBitsRightWeight')
299 myGroup.defineHistogram(
'cmxCpmTobsEnerXLeft,cmxCpmTobsEnerYLeft;cmx_2d_tob_HitmapLeft',
300 title=
'CMX-CP TOBs Left CMX Hit Map',type=
'TH2F',
301 cutmask=
'',path=monCMXinPath,
302 xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.)
303 myGroup.defineHistogram(
'cmxCpmTobsEnerXRight,cmxCpmTobsEnerYRight;cmx_2d_tob_HitmapRight',
304 title=
'CMX-CP TOBs Right CMX Hit Map',type=
'TH2F',
305 cutmask=
'',path=monCMXinPath,
306 xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.)
309 myGroup.defineHistogram(
'cmxCpmTobsIsolXLeft,cmxCpmTobsIsolYLeft;cmx_2d_tob_HitmapIsolLeft',
310 title=
'CMX-CP TOBs Left CMX Non-zero Isolation Hit Map',type=
'TH2F',
311 cutmask=
'',path=monCMXinPath,
312 xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.)
313 myGroup.defineHistogram(
'cmxCpmTobsIsolXRight,cmxCpmTobsIsolYRight;cmx_2d_tob_HitmapIsolRight',
314 title=
'CMX-CP TOBs Right CMX Non-zero Isolation Hit Map',type=
'TH2F',
315 cutmask=
'',path=monCMXinPath,
316 xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.)
319 myGroup.defineHistogram(
'cmxCpmTobsErrorX,cmxCpmTobsErrorCmx;cmx_2d_tob_Overflow',
320 title=
'CMX-CP TOBs Overflow',type=
'TH2F',
321 cutmask=
'',path=monCMXinPath,
322 xbins=56,xmin=0.,xmax=56.0,ybins=2,ymin=0.,ymax=2.)
326 myGroup.defineHistogram(
'cmxTobsCmxLeft;cmx_1d_tob_TOBsPerCMXLeft', title=
'CMX-CP TOBs per CMX Left;Number of TOBs;',
327 cutmask=
'',path=monCMXinPath,
328 xbins=maxTobsPerCmx,xmin=0,xmax=maxTobsPerCmx)
329 myGroup.defineHistogram(
'cmxTobsCmxRight;cmx_1d_tob_TOBsPerCMXRight', title=
'CMX-CP TOBs per CMX Right;Number of TOBs;',
330 cutmask=
'',path=monCMXinPath,
331 xbins=maxTobsPerCmx,xmin=0,xmax=maxTobsPerCmx)
335 myGroup.defineHistogram(
'cmxCpmTobsErrorX,cmxCpmTobsErrorYbase;cmx_2d_tob_Parity',
336 title=
'CMX-CP TOB Parity Errors;;CMX/Phase',type=
'TH2F',
337 cutmask=
'cmxCpmTobsErrorParity',path=monCMXPath,
338 xbins=56,xmin=0.,xmax=56.0,ybins=10,ymin=0.,ymax=10.)
343 xbinsThresh = crates * maxSlices
344 myGroup.defineHistogram(
'cmxCpHitsCrateSlices,cmxCpHitsPeak;cmx_2d_thresh_Slices',
345 title=
'CMX Slices and Triggered Slice;Crate/Number of Slices;Triggered Slice',type=
'TH2F',
346 cutmask=
'',path=monCMXoutPath,
347 xbins=xbinsThresh,xmin=0.,xmax=xbinsThresh,ybins=maxSlices,ymin=0.,ymax=maxSlices)
350 myGroup.defineHistogram(
'cmxCpHitsCrateCmx;cmx_1d_topo_OutputChecksum', title=
'CMX-CP Topo Output Checksum Non-zero',
351 cutmask=
'cmxCpHits0TopoCheckSum',path=monCMXoutPath,
352 xbins=8,xmin=0,xmax=8)
354 myGroup.defineHistogram(
'cmxCpMapX,cmxCpMapY;cmx_2d_topo_CPMOccupancyMap',
355 title=
"CMX-CP Topo CPM Occupancy Maps;;",type=
'TH2F',
356 cutmask=
'',path=monCMXoutPath,
357 xbins=14,xmin=1.,xmax=15.0,ybins=8,ymin=0.,ymax=8.0,weight=
'cmxCpMapHit')
359 myGroup.defineHistogram(
'cmxCpCountsX,cmxCpCountsY;cmx_2d_topo_CPMOccupancyCounts',
360 title=
"CMX-CP Topo CPM Occupancy Counts Weighted;;",type=
'TH2F',
361 cutmask=
'',path=monCMXoutPath,
362 xbins=14,xmin=1.,xmax=15.0,ybins=8,ymin=0.,ymax=8.0,weight=
'cmxCpCountsHit')
365 number_labels=[f
'{i+1}' if i < tobsPerCPM
else '' for i
in range(7)]
367 myGroup.defineHistogram(
'cmxTopoTobsCpmRight;cmx_1d_topo_TOBsPerCPMRight', title=
'CMX-CP Topo TOBs per CPM Right CMX;Number of TOBs',
368 cutmask=
'',path=monCMXoutPath,
369 xbins=7,xmin=1,xmax=8,
370 xlabels=number_labels,
371 opt=
'kAlwaysCreate' if labelDebug
else '')
372 myGroup.defineHistogram(
'cmxTopoTobsCpmLeft;cmx_1d_topo_TOBsPerCPMLeft', title=
'CMX-CP Topo TOBs per CPM Left CMX;Number of TOBs',
373 cutmask=
'',path=monCMXoutPath,
374 xbins=7,xmin=1,xmax=8,
375 xlabels=number_labels,
376 opt=
'kAlwaysCreate' if labelDebug
else '')
380 sumvsthreshold_labels = [
"L0",
"L1",
"L2",
"L3",
"R0",
"R1",
"R2",
"T"]
382 from TrigConfigSvc.TriggerConfigAccess
import getL1MenuAccess
384 emThresholdNames =
list(l1menu.thresholdNames(
'EM'))
386 myGroup.defineHistogram(
'cmxCpThresBinLeftX,cmxCpThresBinLeftY;cmx_2d_thresh_SumsWeightedLeft',
387 title=
"CMX-CP Hit Sums Thresholds Weighted Left CMX;Sum (Local/Remote/Total);",type=
'TH2F',
388 cutmask=
'',path=monCMXoutPath,
389 xbins=8,xmin=0.,xmax=8.0,ybins=16,ymin=0.,ymax=16.0,weight=
'cmxCpThresBinLeftHit',
390 xlabels=sumvsthreshold_labels, ylabels=emThresholdNames,
391 opt=
'kAlwaysCreate' if labelDebug
else '')
392 myGroup.defineHistogram(
'cmxCpThresBinRightX,cmxCpThresBinRightY;cmx_2d_thresh_SumsWeightedRight',
393 title=
"CMX-CP Hit Sums Thresholds Weighted Right CMX;Sum (Local/Remote/Total);",type=
'TH2F',
394 cutmask=
'',path=monCMXoutPath,
395 xbins=8,xmin=0.,xmax=8.0,ybins=16,ymin=0.,ymax=16.0,weight=
'cmxCpThresBinRightHit',
396 xlabels=sumvsthreshold_labels, ylabels=emThresholdNames,
397 opt=
'kAlwaysCreate' if labelDebug
else '')
400 myGroup.defineHistogram(
'cmxCpTopoTobsCmxLeft;cmx_1d_topo_TOBsPerCMXLeft', title=
'CMX-CP Topo TOBs per CMX Left;Number of TOBs;',
401 cutmask=
'',path=monCMXoutPath,
402 xbins=maxTobsPerCmx,xmin=0,xmax=maxTobsPerCmx,
403 opt=
'kAlwaysCreate' if labelDebug
else '')
404 myGroup.defineHistogram(
'cmxCpTopoTobsCmxRight;cmx_1d_topo_TOBsPerCMXRight', title=
'CMX-CP Topo TOBs per CMX Right;Number of TOBs;',
405 cutmask=
'',path=monCMXoutPath,
406 xbins=maxTobsPerCmx,xmin=0,xmax=maxTobsPerCmx,
407 opt=
'kAlwaysCreate' if labelDebug
else '')
413 NumberOfSummaryBins=8
414 errorOverview_labels = [
"EM parity",
"EM link""Had parity",
"Had link",
"CPM status",
"TOB parity",
"Sum parity",
"CMX status"]
417 myGroup.defineHistogram(
'cpmErrorX,cpmErrorY;cpm_2d_ErrorOverview',
418 title=
"CP Error Overview;;",type=
'TH2F',
420 xbins=64,xmin=0.,xmax=64.0,ybins=NumberOfSummaryBins,ymin=0.,ymax=NumberOfSummaryBins,ylabels=errorOverview_labels)
423 myGroup.defineHistogram(
'cpmErrorSummary;cpm_1d_ErrorSummary', title=
'CP Error Summary;;Events',
425 xbins=NumberOfSummaryBins,xmin=0,xmax=NumberOfSummaryBins,xlabels=errorOverview_labels)
428 myGroup.defineHistogram(
'evtstr,cpmErrorSummary_Events;cpm_2d_ErrorEventNumbers',
429 title=
"CP Error Event Numbers;Events with Error/Mismatch;",type=
'TH2I',
430 path=monEventsPath,merge=
'merge',
431 xbins=1,ymin=0,ymax=NumberOfSummaryBins,ylabels=errorOverview_labels)
433 acc = helper.result()
438 if __name__==
'__main__':
440 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
443 inputs = glob.glob(
'/eos/atlas/atlastier0/rucio/data18_13TeV/physics_Main/00354311/data18_13TeV.00354311.physics_Main.recon.ESD.f1129/data18_13TeV.00354311.physics_Main.recon.ESD.f1129._lb0013._SFO-8._0001.1')
446 flags.Input.Files = inputs
447 flags.Output.HISTFileName =
'ExampleMonitorOutput_LVL1.root'
452 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
453 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
458 cfg.merge(CpmMonitorCfg)
461 CpmMonitorCfg.getEventAlgo(
'CpmMonAlg').OutputLevel = 2
463 cfg.printConfig(withDetails=
False, summariseProps =
True)