21def getL1TopoLabels(flags,connectors = {0:
'LegacyTopo0', 1:
'LegacyTopo1'}, bmax = 128):
22 topo_trigline_labels = [
"" for i
in range(bmax)]
23 lvl1access = getL1MenuAccess(flags)
24 for connector_id, connectorKey
in connectors.items():
25 topo_triglines_dict = lvl1access.connector(connectorKey)[
'triggerlines']
26 if not isinstance(topo_triglines_dict, list):
28 topo_fpga = topo_triglines_dict[
'fpga{:d}'.format(fpga_id)]
29 for clock_id
in [0,1]:
30 topo_clock = topo_fpga[
'clock{:d}'.format(clock_id)]
31 for topo_trigline
in topo_clock:
32 topo_trigline_name = topo_trigline[
'name']
33 bit_id = topo_trigline[
'startbit']
34 topo_trigline_index = 64*connector_id + 32*fpga_id + 2*bit_id + clock_id
35 topo_trigline_labels[topo_trigline_index] = topo_trigline_name
37 for topo_trigline
in topo_triglines_dict:
38 topo_trigline_name = topo_trigline[
'name']
39 topo_trigline_name= topo_trigline_name.replace(
"TOPO_",
"")
40 bit_id = topo_trigline[
'startbit']
41 fpga_id = topo_trigline[
'fpga']
42 clock_id = topo_trigline[
'clock']
43 topo_trigline_index = 64*connector_id + 32*fpga_id + 2*bit_id + clock_id
44 topo_trigline_labels[topo_trigline_index] = topo_trigline_name
46 for i
in range(len(topo_trigline_labels)):
47 if ( topo_trigline_labels[i] ==
""):
48 topo_trigline_labels[i] =
"-- Unassigned Item --"
50 return topo_trigline_labels
109 toolName="L1TopoMonitoringTool"):
112 AlgoVetoList = [
"jXE40delay",
"TeATIME"]
113 MultVetoList = [
"ZeroBiasA",
"ZeroBiasB"]
115 AlgoIgnoreList = [
"*:ADBDT*",
"*:ADVAE*",
"*:ARTEMIS*"]
118 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
119 helper = L1CaloMonitorCfgHelper(flags,CompFactory.L1TopoOnlineMonitor,toolName,
121 doHwErrorMon =
False,
123 doHwMonCTP = doHwMonCtp,
125 doMultComp = doMultComp,
126 AlgorithmVetoList = AlgoVetoList,
127 MultiplicityVetoList = MultVetoList,
128 forceCTPasHdw=forceCtp)
131 helper.defineDQAlgorithm(
"L1TopoAlgMismatchRate",
132 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_GreaterThan_Threshold",
"BinThreshold":
"0.002",
"PublishBins":
"1",
133 "IgnoreBins":
"\""+
",".join(AlgoIgnoreList)+
"\""},
134 thresholdConfig={
"NBins":[0,1]},
137 helper.defineDQAlgorithm(
"L1TopoMultMismatchRate",
138 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_GreaterThan_Threshold",
"BinThreshold":
"0.002",
"PublishBins":
"1",
139 "IgnoreBins":
"\""+
",".join(MultIgnoreList)+
"\""},
140 thresholdConfig={
"NBins":[0,1]},
143 helper.defineDQAlgorithm(
"L1TopoMismatchCountVerticalRange",
144 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_GreaterThan_Threshold",
"BinThreshold":
"0.001",
"PublishBins":
"1",
"yMax":
"2"},
145 thresholdConfig={
"NBins":[0,1]},
149 ylabels = [
'#splitline{Sim counts <}{Hdw counts}',
'#splitline{Sim counts >}{Hdw counts}',
'#splitline{Sim counts =}{Hdw counts}']
150 name =
'LBN,MultiplicityAllBoards,L1TopoMultiplicityMissMatchVsLumi;L1TopoMultiplicityMismatchRateVsLumi'
152 for cable
in range(4):
153 topoName =
'Topo1Opt'+str(cable)
156 AllLabels = [x
for x
in AllLabels
if x]
158 helper.defineHistogram(name,
159 fillGroup=
"L1TopoDQ_mismatches",
160 paths=[
'Expert/Sim',
'Shifter/Sim'],
161 hanConfig={
"algorithm":
"L1TopoMultMismatchRate",
"description":
"Drag the y-axis to make the text bigger",
"display":
"SetPalette(87),Draw=COLZ"},
163 title=
"L1Topo Multiplicities Sim/Hdw mismatch rate;LB", xbins=32, ybins=len(AllLabels),
165 ymin=0, ymax=len(AllLabels),
167 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
169 for cable
in range(4):
171 topoName =
'Topo1Opt'+str(cable)
172 name =
'MultiplicityTopo1Opt'+str(cable)+
',MultiplicityMatchTopo1Opt'+str(cable)
173 name += f
';{topoName}_mismatch'
174 title = f
'Topo Optical Cable {cable} Miss/Matches Summary'
176 xlabels = [x
for x
in labels
if x]
178 helper.defineHistogram(name,
179 fillGroup=
"L1TopoDQ_mismatches",
180 paths=[
'Developer/Sim/detail/L1Topo/Multiplicities'],
181 hanConfig={
"algorithm":
"L1TopoMismatchCountVerticalRange",
"description":
"Agreements and Mismatches between L1Topo Simulation and Hdw per L1Topo Item (x-axis). The upper row should be filled (Sim and Hdw agrees), while the lower two rows shouldn't have any entry",
"display":
"SetPalette(55)"},
183 title=title, xbins=len(xlabels), ybins=3,
184 xlabels=xlabels,ylabels=ylabels,
185 xmin=0, xmax=len(xlabels),
186 ymin=0, ymax=len(ylabels),
187 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
190 for cable
in range(2):
191 name =
'CableElec_'+str(cable+2)
192 name +=
';Topo'+str(cable+2)+
'El'
193 title = f
'Topo Electric Cable {cable+2}'
195 label_topo_all += labels
199 ylabels = [
'#splitline{Sim counts <}{Hdw counts}',
'#splitline{Sim counts >}{Hdw counts}',
'#splitline{Sim counts =}{Hdw counts}']
200 nameLB =
'LBN,L1TopoAlgorithmAllBoards,L1TopoAlgorithmMissMatchVsLumi;L1TopoAlgoMismatchRateVsLB'
202 helper.defineHistogram(nameLB,
203 fillGroup=
"L1TopoDQ_mismatches",
204 paths=[
'Expert/Sim',
'Shifter/Sim'],
205 hanConfig={
"algorithm":
"L1TopoAlgMismatchRate",
"description":
"Drag the y-axis to make the text bigger",
"display":
"SetPalette(87),Draw=COLZ"},
207 title=
"L1Topo Algorithms Sim/Hdw mismatch rate;LB",xbins=32,ybins=128,
209 ylabels=label_topo_all,
212 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
214 for topo
in [(0,
'2a'),(1,
'2b'),(2,
'3a'),(3,
'3b')]:
215 name = f
'Phase1TopoTrigger_{topo[0]},L1TopoAlgorithmMissMatch_{topo[0]};L1TopoAlgo_{topo[1]}'
216 title = f
'L1Topo_Algo_{topo[1]} Miss/Matches Summary'
217 helper.defineHistogram(name,
218 fillGroup=
"L1TopoDQ_mismatches",
219 paths=[
'Developer/Sim/detail/L1Topo/Algos'],
220 hanConfig={
"algorithm":
"L1TopoMismatchCountVerticalRange",
"description":
"Agreements and Mismatches between L1Topo Simulation and Hardware per L1Topo Item (x-axis). The upper row should be filled (Sim and Hdw agrees), while the lower two rows shouldn't have any entry",
"display":
"SetPalette(55)"},
222 title=title,xbins=32,ybins=3,
224 xlabels=label_topo_all[topo[0]*32:(topo[0]+1)*32],
227 ymin=0, ymax=len(ylabels),
228 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
231 #Not Including Overflow plots for now
232 #L1Topo Algorithms Overflow mismatches
233 #ylabelsOF = ['#frac{HdwOFnotSimOF}{HdwOF}','#frac{SimOFnotHdwOF}{SimOF}','#frac{HdwOFandSimOF}{HdwOForSimOF}','#frac{HdwOF}{SimOF}']
234 ylabelsOF = ['#splitline{Sim counts <}{Hdw counts}','#splitline{Sim counts >}{Hdw counts}','#splitline{Sim counts =}{Hdw counts}']
235 for topo in [(0,'2a'),(1,'2b'),(2,'3a'),(3,'3b')]:
236 #name_OF = f'Phase1TopoTrigger_{topo[0]},Phase1TopoMissMatch_{topo[0]};Ph1Topo{topo[1]}_overflows'
237 name_OF = f'Phase1TopoTrigger_{topo[0]},L1TopoAlgorithmOverflowMissMatch_{topo[0]};L1TopoAlgo_OF{topo[1]}'
238 title_OF = f' L1Topo_Algo_{topo[1]} Overflow Miss/Matches Summary'
239 helper.defineHistogram(name_OF,
240 fillGroup="L1TopoDQ_mismatches",
241 paths=['Expert/Sim/detail/L1Topo/Algos/Overflows'],
242 hanConfig={"description":"Agreements and Mismatches between L1Topo Simulation and Hardware per L1Topo Item (x-axis). The upper row should be filled (Sim and Hdw agrees), while the lower two rows shouldn't have any entry","display":"SetPalette(55)"}, type='TH2F',
243 title=title_OF,xbins=32,ybins=3,
244 #weight=f'Phase1TopoOFWeight_{topo[0]}',
245 xlabels=label_topo_all[topo[0]*32:(topo[0]+1)*32],
248 ymin=0, ymax=len(ylabelsOF),
249 opt=['kAddBinsDynamically','kCanRebin','kAlwaysCreate'],merge='merge')
252 helper.alg.MonTool = helper.fillGroups[
"L1TopoDQ_mismatches"]
253 return helper.result()
259 for cable
in range(2):
260 name =
'CableElec_'+str(cable+2)
261 name +=
';Topo'+str(cable+2)+
'El'
262 title = f
'Topo Electric Cable {cable+2}'
264 label_topo_all += labels
265 alg.MonTool.defineHistogram(name, path=
'EXPERT', type=
'TH1I',
266 title=title, xbins=64, xlabels=labels,
269 for cable
in range(4):
270 topoName =
'Topo1Opt'+str(cable)
271 name =
'CableOpti_'+str(cable)
272 weight = name+
'_weight'
273 name += f
';{topoName}'
274 title = f
'Topo Optical Cable {cable}'
276 xlabels = [x
for x
in labels
if x]
277 alg.MonTool.defineHistogram(name, path=
'EXPERT', type=
'TH1I',
278 title=title, xbins=len(xlabels), xlabels=xlabels,
280 xmin=0, xmax=len(xlabels))
281 for cable
in range(4):
282 topoName =
'Topo1Opt'+str(cable)
283 name =
'HdwTopo1Opt'+str(cable)
284 weight = name+
'_weight'
285 name += f
';{topoName}_data'
286 title = f
'Topo Optical Cable {cable} (Data)'
288 xlabels = [x
for x
in labels
if x]
289 alg.MonTool.defineHistogram(name, path=
'EXPERT', type=
'TH1I',
290 title=title, xbins=len(xlabels), xlabels=xlabels,
292 xmin=0, xmax=len(xlabels))
294 for cable
in range(4):
295 ylabels = [
'#splitline{Sim counts <}{Hdw counts}',
'#splitline{Sim counts >}{Hdw counts}',
'#splitline{Sim counts =}{Hdw counts}']
296 topoName =
'Topo1Opt'+str(cable)
297 name =
'MultiplicityTopo1Opt'+str(cable)+
',MultiplicityMatchTopo1Opt'+str(cable)
298 name += f
';{topoName}_mismatch'
299 title = f
'Topo Optical Cable {cable} Miss/Matches Summary'
301 xlabels = [x
for x
in labels
if x]
302 alg.MonTool.defineHistogram(name, path=
'EXPERT', type=
'TH2F',
303 title=title, xbins=len(xlabels), ybins=3,
304 xlabels=xlabels,ylabels=ylabels,
305 xmin=0, xmax=len(xlabels),
306 ymin=0, ymax=len(ylabels))
308 for cable
in range(4):
309 topoName =
'Topo1Opt'+str(cable)
311 labels = [x
for x
in labels
if x]
312 for i,label
in enumerate(labels):
313 name = f
'Topo1Opt{cable}_{i}_Sim,Topo1Opt{cable}_{i}_Hdw;Topo1Opt{cable}_{label}'
314 title = f
'Topo1Opt{cable}_{label};Simulation Counts;Hardware Counts'
315 alg.MonTool.defineHistogram(name, path=
'EXPERT', type=
'TH2F',
316 title=title,xbins=10,ybins=10,
320 alg.MonTool.defineHistogram(
'TopoSim', path=
'EXPERT', type=
'TH1I',
321 title=
'Simulation Results for L1Topo', xbins=128, xlabels=label_topo_all,
323 alg.MonTool.defineHistogram(
'TopoSim_overflows', path=
'EXPERT', type=
'TH1I',
324 title=
'Overflow Simulation Results for L1Topo', xbins=128, xlabels=label_topo_all,
326 alg.MonTool.defineHistogram(
'TopoSim_ambiguity', path=
'EXPERT', type=
'TH1I',
327 title=
'Ambiguity Results for L1Topo', xbins=128, xlabels=label_topo_all,
331 alg.MonTool.defineHistogram(
'TopoCTP', path=
'EXPERT', type=
'TH1I',
332 title=
'CTP Results for L1Topo', xbins=128, xlabels=label_topo_all,
336 alg.MonTool.defineHistogram(
'SimNotHdwL1TopoResult', path=
'EXPERT', type=
'TH1I',
337 title=
'L1Topo events with simulation accept and hardware fail',
338 xbins=128, xlabels=label_topo_all,
340 alg.MonTool.defineHistogram(
'HdwNotSimL1TopoResult', path=
'EXPERT', type=
'TH1I',
341 title=
'L1Topo events with hardware accept and simulation fail',
342 xbins=128, xlabels=label_topo_all,
344 alg.MonTool.defineHistogram(
'Ambiguity_SimANDHdwDecisions', path=
'EXPERT', type=
'TH1I',
345 title=
'L1Topo ambiguity events with simulation accept and hardware accept',
346 xbins=128, xlabels=label_topo_all,
348 alg.MonTool.defineHistogram(
'Ambiguity_DecisionMismatches', path=
'EXPERT', type=
'TH1I',
349 title=
'L1Topo ambiguity events with mismatches between simulation and hardware',
350 xbins=128, xlabels=label_topo_all,
354 ylabels = [
'#frac{HdwNotSim}{Hdw}',
'#frac{SimNotHdw}{Sim}',
'#frac{HdwAndSim}{HdwOrSim}',
'#frac{Hdw}{Sim}']
355 for topo
in [(0,
'2a'),(1,
'2b'),(2,
'3a'),(3,
'3b')]:
356 name = f
'Phase1TopoTrigger_{topo[0]},Phase1TopoMissMatch_{topo[0]};Ph1Topo{topo[1]}'
357 title = f
'Phase1 Topo{topo[1]} Miss/Matches Summary'
358 alg.MonTool.defineHistogram(name, path=
'EXPERT', type=
'TH2F',
359 title=title,xbins=32,ybins=4,
360 weight=f
'Phase1TopoWeight_{topo[0]}',
361 xlabels=label_topo_all[topo[0]*32:(topo[0]+1)*32],
364 ymin=0, ymax=len(ylabels))
365 ylabelsOF = [
'#frac{HdwOFnotSimOF}{HdwOF}',
'#frac{SimOFnotHdwOF}{SimOF}',
'#frac{HdwOFandSimOF}{HdwOForSimOF}',
'#frac{HdwOF}{SimOF}']
366 for topo
in [(0,
'2a'),(1,
'2b'),(2,
'3a'),(3,
'3b')]:
367 name_OF = f
'Phase1TopoTrigger_{topo[0]},Phase1TopoMissMatch_{topo[0]};Ph1Topo{topo[1]}_overflows'
368 title_OF = f
'Phase1 Topo{topo[1]} Overflow Miss/Matches Summary'
369 alg.MonTool.defineHistogram(name_OF, path=
'EXPERT', type=
'TH2F',
370 title=title_OF,xbins=32,ybins=4,
371 weight=f
'Phase1TopoOFWeight_{topo[0]}',
372 xlabels=label_topo_all[topo[0]*32:(topo[0]+1)*32],
375 ymin=0, ymax=len(ylabelsOF))
378 alg.MonTool.defineHistogram(
'HdwResults', path=
'EXPERT', type=
'TH1I',
379 title=
'Hardware Results for L1Topo', xbins=128, xlabels=label_topo_all,
381 alg.MonTool.defineHistogram(
'OverflowResults', path=
'EXPERT', type=
'TH1I',
382 title=
'Overflow Results for L1Topo', xbins=128, xlabels=label_topo_all,
384 rod_errors_labels = [
"CT",
"pc",
"hc",
"pe",
"lm",
"hm",
"pt"]
385 alg.MonTool.defineHistogram(
'ROD_Errors', path=
'EXPERT', type=
'TH1I',
386 title=
'Counts of ROD errors', xbins=len(rod_errors_labels), xlabels=rod_errors_labels,
387 xmin=0, xmax=len(rod_errors_labels))
388 fpga_errors_labels = [
"CT",
"sm",
"pe",
"lm",
"hm",
"pt"]
389 fpga_indexes = [
"topo1fpga1",
"topo1fpga0",
"topo2fpga1",
"topo2fpga0",
"topo3fpga1",
"topo3fpga0"]
390 alg.MonTool.defineHistogram(
'FPGA_Errors, FPGA_Labels; FPGA_Errors', path=
'EXPERT', type=
'TH2I',
391 title=
'Counts of FPGA errors',xbins=len(fpga_errors_labels),ybins=len(fpga_indexes),
392 xlabels=fpga_errors_labels,
393 ylabels=fpga_indexes,
394 xmin=0, xmax=len(fpga_errors_labels),
395 ymin=0, ymax=len(fpga_indexes))
398 mon_failure_labels = [
'doHwMon',
'doSimMon',
'doHwMonCTP',
'doComp',
'doMultComp']
399 alg.MonTool.defineHistogram(
'MonitoringFailures', path=
'EXPERT', type=
'TH1F',
400 title=
'Counts of mon functions returning failure;;Entries',
401 xlabels=mon_failure_labels, xbins=len(mon_failure_labels),
402 xmin=0, xmax=len(mon_failure_labels))