ATLAS Offline Software
DeMoLib.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 # Author : Benjamin Trocme (CNRS/IN2P3 - LPSC Grenoble)- 2017 - 2023
3 # Python 3 migration by Miaoran Lu (University of Iowa)- 2022
4 #
5 # Definition of system/year/tag characteristisc and functions used by DeMoUpdate, DeMoStatus
6 # and DemoScan
7 #
8 # Documentation: https://twiki.cern.ch/twiki/bin/viewauth/Atlas/DataQualityDemo
9 
10 
11 from ROOT import THStack
12 from ROOT import TCanvas,TLegend
13 from ROOT import kYellow,kOrange,kRed,kBlue,kPink,kMagenta,kGreen,kSpring,kViolet,kAzure,kCyan,kTeal,kBlack,kWhite
14 from ROOT import TProfile,TH1F
15 
16 import time,os,subprocess
17 
18 def MakeTProfile(name,xtitle,ytitle,xmin,xmax,nbins,color):
19  h = TProfile(name,name, nbins, xmin, xmax)
20  h.SetYTitle(ytitle)
21  h.SetXTitle(xtitle)
22  h.SetMarkerStyle(22)
23  h.SetMarkerColor(color)
24  h.SetLineColor(1)
25  h.SetFillColor(color)
26  h.SetStats(0)
27  h.SetTitle("")
28  return h
29 
30 def MakeTH1(name,xtitle,ytitle,xmin,xmax,nbins,color):
31  h = TH1F(name,name,nbins, xmin,xmax)
32  h.SetYTitle(ytitle)
33  h.SetXTitle(xtitle)
34  h.SetLineColor(1)
35  h.SetMarkerStyle(22)
36  h.SetMarkerColor(color)
37  h.SetFillColor(color)
38  h.Sumw2()
39  return h
40 
41 def SetXLabel(h,list):
42  for i in range(len(list)):
43  h.GetXaxis().SetBinLabel(i+1,str(list[i]))
44  return
45 
46 def MakeLegend(xmin,ymin,xmax,ymax):
47  l = TLegend(xmin,ymin,xmax,ymax)
48  l.SetFillColor(kWhite)
49  l.SetTextSize(0.03)
50  l.SetBorderSize(0)
51  return l
52 
53 
56 def returnPeriod(runNb,system,year,tag):
57  p = subprocess.Popen(["grep","%d"%runNb,"YearStats-%s/%s/%s/runs-ALL.dat"%(system,year,tag)],stdout = subprocess.PIPE)
58  (o,e) = p.communicate()
59  tmp = o.decode().split("(")
60  if len(tmp)>0:
61  tmp2 = tmp[1].split(")")[0]
62 
63  return tmp2
64 
65 
69  ytp = {"Description":"","Defect tag":"","Veto tag":"","OflLumi tag":"","OflLumiAcct tag":""}
70  DeMoConfigFile = open("YearStats-common/%s/DeMoConfig-%s-%s.dat"%(year,year,tag),"r")
71  for line in DeMoConfigFile:
72  for i_ytp in ytp.keys():
73  if ("%s: "%i_ytp in line):
74  ytp[i_ytp] = (line.split("%s: "%i_ytp)[1]).replace("\n","")
75  DeMoConfigFile.close()
76 
77  for i_ytp in ytp.keys():
78  if (ytp[i_ytp] == ""):
79  print("ERROR: Missing (%s) in YearStats-common/%s/DeMoConfig-%s-%s.dat -> Please check or define it with DeMoSetup.py"%(i_ytp,year,year,tag))
80 
81  return ytp
82 
83 
86 def strLumi(lumi,unit="ub",latex = True,floatNumber = False):
87  if (unit == "%%"):
88  string0 = "%.2f%% "%(lumi)
89  else:
90  if (unit == "pb" or unit == "pb^{-1}" or unit == "pb-1"):
91  lumi = lumi*1e6
92 
93  if lumi < 1e3:
94  if latex:
95  if (floatNumber):string0 = "%.2f #mub"%(lumi)
96  else:string0 = "%.0f #mub"%(lumi)
97  else:
98  if (floatNumber):string0 = "%.2f ub"%(lumi)
99  else:string0 = "%.0f ub"%(lumi)
100  elif lumi<1e6:
101  if (floatNumber):string0 = "%.2f nb"%(lumi/1e3)
102  else: string0 = "%.0f nb"%(lumi/1e3)
103  elif lumi<1e9:
104  if (floatNumber):string0 = "%.2f pb"%(lumi/1e6)
105  else:string0 = "%.0f pb"%(lumi/1e6)
106  else:
107  if (floatNumber):string0 = "%.3f fb"%(lumi/1e9)
108  else:string0 = "%.1f fb"%(lumi/1e9)
109  if latex:
110  string0= string0+"^{-1}"
111  else:
112  string0= string0+"-1"
113 
114  return string0
115 
116 
117 
118 def plotStack(name,histo,index,indexName,histoIntLumi,lumiBool,resStack,resCanvas,resLegend,recovBool = True,compBool = False,approvedPlots = False):
119 # name: Mainly an index of the output. Also used to define TAxis Title
120 # histo: dict of histograms or TProfile to be displayed
121 # index: list of keys of histo to be displayed
122 # indexName: dict of namesof index used for the TLegend
123 # histoIntLumi : integrated lumi with the same x binning as histo
124 # lumiBool : display results in term of lumi and not percent
125 # resStack, resCanvas, resLegend: dict of (stacks, canvas, legend) outputs
126 # recovBool: display the recoverable histograms (referenced as %%%__recov in histo
127 # compBool: this is a >=2 yearTag plots. Write all numbers in TLegend and not only last bin (that is not meaningful in yearTag)
128 
129  # unit is the main unit. unitAux is the complementary one used only the TLegend
130  if (lumiBool):
131  unit = "pb^{-1}"
132  unitAux = "%%"
133  else:
134  unit = "%%"
135  unitAux = "pb^{-1}"
136 
137  nameSplitted = name.split("--") # Assume that the name is "Veto/defect (y axis) - Year/Run (x axis)- Dataset name"
138  xAxisTitle = nameSplitted[1]
139  if unit == "%%":
140  yAxisTitle = "Lost luminosity due to %s [%%]"%(nameSplitted[0])
141  else:
142  yAxisTitle = "Lost luminosity due to %s [%s]"%(nameSplitted[0],unit)
143  legendHeader = "%s - %s"%(nameSplitted[2],time.strftime("%d %b", time.localtime()))
144 
145  resCanvas[name] = TCanvas(name,"%s - %s"%(yAxisTitle,xAxisTitle),100, 10, 1350, 500)
146  resCanvas[name].SetLeftMargin(0.08)
147  resCanvas[name].SetRightMargin(0.35)
148  resCanvas[name].SetGridy(1)
149  resStack[name] = THStack("%s_stack"%name,"")
150  resLegend[name] = MakeLegend(0.66,0.8,0.98,0.95) # Y1 will be redefined later according to the number of entries
151  resLegend[name].AddEntry(0, "", "")
152 
153  first = True
154 
155  nBinsX = histoIntLumi.GetNbinsX()
156  totalIneff = 0.
157  if (compBool):
158  totalIneff_comp = nBinsX * [0.]
159 
160  totalIntegratedLumi = histoIntLumi.GetBinContent(nBinsX)
161  if lumiBool:
162  auxScaleFactor = 100./totalIntegratedLumi
163  else:
164  auxScaleFactor = totalIntegratedLumi/100.
165 
166  tmpColor = [kBlue-4,kOrange-7,kTeal+1,kMagenta-4,kPink-3,kGreen+3,kSpring-3,kViolet+4,kAzure-8,kCyan+1]
167  tmpColorIndex = 0
168 
169  for iIndex in sorted(index,reverse=True):
170  if first: # Create a recoverable histograms just in case of
171  resStack["%s__recov"%name] = MakeTH1("h1_%s__recovTotal"%(name),"Recoverable","",-0.5,-0.5+nBinsX,nBinsX,1)
172  resStack["%s__recov"%name].SetMarkerStyle(23)
173  first = False
174  iIndexName = iIndex.split("_")[0]
175 
176  # Define a "temporary" color for the defect histogram for which it was not yet defined
177  # Mandatory for defect that are not yet known as impacting the system (i.e. with a loss-[defect].dat file
178  # Especially useful for weekly reports with a new type of defect affecting the system
179  if (histo[iIndex].GetFillColor() == kBlack and tmpColorIndex < len(tmpColor) and histo[iIndex].GetBinContent(histo[iIndex].GetNbinsX()) != 0):
180  histo[iIndex].SetFillColor(tmpColor[tmpColorIndex])
181  tmpColorIndex = tmpColorIndex + 1
182 
183  # Fill histo["%s_toStack"] the main histo
184  # and histo["%s_aux"] the complementary one used only for TLegend
185  if (histo[iIndex]).IsA().InheritsFrom("TProfile"):
186  histo['%s_toStack'%iIndex] = histo[iIndex].ProjectionX()
187  histo['%s_toStack'%iIndex].SetFillColor(histo[iIndex].GetFillColor())
188  else:
189  histo['%s_toStack'%iIndex] = histo[iIndex]
190  if lumiBool:
191  histo['%s_toStack'%iIndex].Multiply(histo['%s_toStack'%iIndex],histoIntLumi,0.01)
192  histo['%s_toStack'%iIndex].LabelsOption("v")
193  resStack[name].Add(histo['%s_toStack'%iIndex])
194 
195  entryNb = 0
196  for iIndex in sorted(index): # Reverse order to have the TLegend ordered as the stacks
197  iIndexName = iIndex.split("__")[0] # Trick needed to get the defect name for the recoverable defect histogram
198  baseEntry = "%s"%(strLumi(histo['%s_toStack'%iIndex].GetBinContent(nBinsX),unit))
199  auxEntry = "%s"%(strLumi(histo['%s_toStack'%iIndex].GetBinContent(nBinsX)*auxScaleFactor,unitAux))
200 
201  if (recovBool and "%s__recov"%iIndex in list(histo.keys()) and histo["%s__recov"%iIndex].GetBinContent(nBinsX) != 0.):
202  baseEntryRecov = "%s"%(strLumi(histo["%s__recov"%iIndex].GetBinContent(nBinsX),unit))
203  entry = "#splitline{%s}{%s(recov:%s) / %s}"%(indexName[iIndexName],baseEntry,baseEntryRecov,auxEntry) # Second part of Legend to fix
204  for iBin in range(nBinsX+1):
205  resStack["%s__recov"%name].Fill(iBin-1,histo["%s__recov"%iIndex].GetBinContent(iBin))
206  else:
207  entry = "#splitline{%s}{%s / %s}"%(indexName[iIndex],baseEntry,auxEntry)
208 
209  if (compBool): # This is a >=2 yearTag histograms
210  if histo[iIndex].GetNbinsX() >= 2 and histo[iIndex].GetNbinsX()<5:
211  if histo[iIndex].GetBinContent(1) != 0.:
212  entry = "#splitline{%s}{%s"%(indexName[iIndexName],strLumi(histo[iIndex].GetBinContent(1),unit))
213  else:
214  entry = "#splitline{%s}{ - "%(indexName[iIndexName])
215  for iTag in range(2,histo[iIndex].GetNbinsX()+1):
216  if histo[iIndex].GetBinContent(iTag) != 0.:
217  entry += " / %s "%(strLumi(histo[iIndex].GetBinContent(iTag),unit))
218  else:
219  entry += " / - "
220  entry += "}"
221  else:
222  entry = "%s"%(indexName[iIndexName])
223 
224  if (histo[iIndex].GetMaximum() != 0):
225  resLegend[name].AddEntry(histo[iIndex],entry,"f")
226  entryNb = entryNb+1
227 
228  # Extract the total inefficiency
229  allIndex = ""
230  if ("allIntol" in list(histo.keys())):
231  allIndex = "allIntol"
232  if ("allVeto" in list(histo.keys())):
233  allIndex = "allVeto"
234 
235  if allIndex != "":
236  if compBool:
237  for iBin in range(1,nBinsX+1):
238  totalIneff_comp[iBin-1] = histo[allIndex].GetBinContent(iBin)
239  else:
240  totalIneff = histo[allIndex].GetBinContent(nBinsX)
241 
242  mx = resStack[name].GetMaximum()*1.2
243  resStack[name].SetMaximum(mx)
244  resStack[name].Draw("hist")
245  resStack[name].GetXaxis().LabelsOption("v")
246  resStack[name].GetXaxis().SetLabelSize(0.04)
247  resStack[name].GetXaxis().SetTitle("%s"%xAxisTitle)
248  resStack[name].GetXaxis().SetTitleOffset(1.45)
249  resStack[name].GetYaxis().SetTitle("%s"%yAxisTitle)
250  resStack[name].GetYaxis().SetTitleOffset(0.7)
251  if resStack[name].GetMaximum()>10.:
252  resCanvas[name].SetLogy(1)
253 
254  if compBool:
255  resStack[name].GetXaxis().SetLabelSize(0.065)
256  if histo[iIndex].GetNbinsX() == 2:
257  resLegend[name].SetHeader("#splitline{%s}{Total loss: %s / %s}"%(legendHeader,strLumi(totalIneff_comp[0],unit),strLumi(totalIneff_comp[1],unit)))
258  elif histo[iIndex].GetNbinsX() == 3:
259  resLegend[name].SetHeader("#splitline{%s}{Total loss: %s / %s / %s}"%(legendHeader,strLumi(totalIneff_comp[0],unit),strLumi(totalIneff_comp[1],unit),strLumi(totalIneff_comp[2],unit)))
260  elif histo[iIndex].GetNbinsX() == 4:
261  resLegend[name].SetHeader("#splitline{%s}{Total loss: %s / %s / %s / %s}"%(legendHeader,strLumi(totalIneff_comp[0],unit),strLumi(totalIneff_comp[1],unit),strLumi(totalIneff_comp[2],unit),strLumi(totalIneff_comp[3],unit)))
262  else:
263  resLegend[name].SetHeader("%s"%(legendHeader))
264  else:
265  totalIneffAux = totalIneff*auxScaleFactor
266  if (approvedPlots):
267  resLegend[name].SetHeader("#splitline{%s}{Total loss: %s / %s}"%(legendHeader,strLumi(totalIneff,unit),strLumi(totalIneffAux,unitAux)))
268  else:
269  if (totalIneff != 0.):
270  resLegend[name].SetHeader("#splitline{%s (%s)}{Total loss: %s / %s}"%(legendHeader,strLumi(totalIntegratedLumi,"pb"),strLumi(totalIneff,unit),strLumi(totalIneffAux,unitAux)))
271  else:
272  resLegend[name].SetHeader("%s (%s)"%(legendHeader,strLumi(totalIntegratedLumi,"pb")))
273  if resStack["%s__recov"%name].GetEntries() != 0.:
274  resStack["%s__recov"%name].SetMarkerStyle(20)
275  resStack["%s__recov"%name].SetMarkerColor(kAzure+8)
276  resStack["%s__recov"%name].Draw("PSAME HIST")
277  resLegend[name].AddEntry(resStack["%s__recov"%name],"#splitline{Recoverable}{total: %.2f%%}"%(resStack["%s__recov"%name].GetBinContent(nBinsX)),"p")
278  entryNb = entryNb + 1
279 
280  if (entryNb<9):
281  resLegend[name].SetTextSize(0.035)
282  else:
283  resLegend[name].SetTextSize(0.028)
284 
285  resLegend[name].SetY1(max(0.83-entryNb*0.098,0.05))
286  resLegend[name].Draw()
287 
288  resCanvas[name].Update()
289 
290  return totalIneff # totalIneff is used only with the savePage1 option in DeMoStatus
291 
292 
294 def initializeMonitoredDefects(system,partitions,defects0,defectVeto,veto,signOff,year,tag,runlist = {}):
295 
296  runlist["filename"] = "runlist-%s-%s.dat"%(year,tag)
297 
298 
322 
323 
324 
325 
326  if system == "Pixel":
327  partitions["color"] = {'IBL':kYellow-9,'LAYER0':kYellow,'BARREL':kOrange,'ENDCAPC':kOrange-3,'ENDCAPA':kRed-3}
328  partitions["list"] = list(partitions["color"].keys())
329 
330  defects0["prefix"] = ["PIXEL"]
331  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
332  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
333  defects0["partIntol"] = ["DISABLED","GT30pct_NOTREADY","READOUT_PROBLEM","HVSCAN","TIMING","STANDBY"] # Pixel system
334  defects0["partTol"] = [] # Pixel system
335  # Global intolerable and tolerable defects
336  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
337  defects0["globIntol"] = ["UNKNOWN"] # Pixel system
338  defects0["globTol"] = [] # Pixel system
339 
340  veto["all"] = [] # Veto name as defined in the COOL database
341  veto["COOL"] = {} # Veto name as defined in the COOL database
342 
343  defectVeto["description"] = {"DISABLED":"One layer disabled",
344  "IBL_DISABLED":"IBL disabled",
345  "GT30pct_NOTREADY":">30% modules in error",
346  "READOUT_PROBLEM":"Readout problem",
347  "IBL_READOUT_PROBLEM":"IBL readout problem",
348  "HVSCAN":"HV scan",
349  "TIMING":"Timing scan",
350  "UNKNOWN":"Unknown",
351  "STANDBY":"Standby"}
352 
353  signOff["EXPR."] = ["PIXEL_UNCHECKED"]
354  signOff["BULK"] = ["PIXEL_BULK_UNCHECKED"]
355  signOff["FINAL"] = []
356 
357 
359  if system == "SCT":
360  partitions["color"] = {}
361  partitions["list"] = list(partitions["color"].keys())
362 
363  defects0["prefix"] = ["SCT"]
364  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
365  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
366  defects0["partIntol"] = []
367  defects0["partTol"] = []
368  # Global intolerable and tolerable defects
369  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
370  defects0["globIntol"] = ["GLOBAL_STANDBY","CRATE_OUT","ROD_OUT_MAJOR","PERIOD_ERR_MAJOR","GLOBAL_DESYNC","GLOBAL_RECONFIG","GLOBAL_UNKNOWN","GLOBAL_DISABLED","SIMULATION_DATA_FLAG"] # SCT system
371  defects0["globTol"] = ["MOD_OUT_GT40","MOD_ERR_GT40","MOD_NOISE_GT40","PERIOD_ERR_GT40","ROD_OUT","EFF_LT99","NOTNOMINAL_HV","NOTNOMINAL_THRESHOLD","NOTNOMINAL_TIMING","COOLINGLOOP_OUT_1","PS_TRIP"] # SCT system
372 
373  defectVeto["description"] = {"GLOBAL_STANDBY":"Standby", # Intolerable defects
374  "CRATE_OUT":">=1 crate out",
375  "ROD_OUT_MAJOR":"Large inefficency (ROD)",
376  "PERIOD_ERR_MAJOR":"Large inefficiency (Period)",
377  "GLOBAL_DESYNC":"Global desync",
378  "GLOBAL_RECONFIG":"Global reconfig",
379  "GLOBAL_UNKNOWN":"Unknown",
380  "GLOBAL_DISABLED":"Disabled",
381  "SIMULATION_DATA_FLAG":"Simulation data flag wrongly activated",
382  "MOD_OUT_GT40":"More than 40 modules excluded in DAQ in addition to the permanent disabled modules (37 modules as of June 2017)", # Tolerable defects
383  "MOD_ERR_GT40":"More than 40 modules with bytestream errors ",
384  "MOD_NOISE_GT40":"More than 40 noisy modules",
385  "PERIOD_ERR_GT40":"More than 80 links with errors in a short period of time (fine for the rest of the run), corresponding to about 40 modules",
386  "ROD_OUT":"One or more ROD(s) excluded from readout, however less than 5% region in eta-phi plane have masked link errors among more than two layers.",
387  "EFF_LT99":"Less than 99% efficiency for 1st BC and less than 98% efficiency for all bunches in one or more DQ regions",
388  "NOTNOMINAL_HV":"SCT neither at 150 V nor at 50 V",
389  "NOTNOMINAL_THRESHOLD":"SCT threshold not at 1 fC",
390  "NOTNOMINAL_TIMING":"Unusual timing settings, e.g. timing scan",
391  "COOLINGLOOP_OUT_1":"Loss of a single cooling loop",
392  "PS_TRIP":"Failed modules due to a power supply trip"}
393 
394  veto["all"] = [] # Veto name as defined in the COOL database
395  veto["COOL"] = {} # Veto name as defined in the COOL database
396 
397  signOff["EXPR."] = ["SCT_UNCHECKED"]
398  signOff["BULK"] = ["SCT_BULK_UNCHECKED"]
399  signOff["FINAL"] = []
400 
401 
403  if system == "TRT":
404  partitions["color"] = {}
405  partitions["list"] = list(partitions["color"].keys())
406 
407  defects0["prefix"] = ["TRT"]
408  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
409  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
410  defects0["partIntol"] = [] # TRT system
411  defects0["partTol"] = [] # TRT system
412  # Global intolerable and tolerable defects
413  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
414  defects0["globIntol"] = ["BADCALIBRATION","BADSTRAWLIST","BADGAS","DAQPROBLEMS_OTHER","DESYNC","NODATA_06","DISABLED","UNKNOWN"] # TRT system
415  defects0["globTol"] = ["BADCALIBRATION_MINOR","BADGAS_MINOR","BYTESTREAM_BITFLIPS","DAQPROBLEMS_OTHER_MINOR","NODATA_01","NONNOMINAL_HT","NONNOMINAL_LT"] # TRT system
416 
417  # Some defects may not exist in past years. Remove them to avoid crashes
418  # WARNING: this fix does not work with multiple year plot
419  defectVeto["description"] = {"BADCALIBRATION":"Bad calibration",
420  "BADSTRAWLIST":"Bad dead stram list",
421  "BADGAS":"Bad gas mixture",
422  "DAQPROBLEMS_OTHER":"DAQ problems",
423  "DESYNC":"Desynchronisation",
424  "NODATA_06":"Large part of TRT off",
425  "DISABLED":"Disabled",
426  "UNKNOWN":"Unknown"}
427 
428  veto["all"] = [] # Veto name as defined in the COOL database
429  veto["COOL"] = {} # Veto name as defined in the COOL database
430 
431  signOff["EXPR."] = ["TRT_UNCHECKED"]
432  signOff["BULK"] = ["TRT_BULK_UNCHECKED"]
433  signOff["FINAL"] = []
434 
435 
439  if system == "LAr":
440  partitions["color"] = { 'EMBA':kYellow-9,'EMBC':kYellow,'EMECA':kOrange,'EMECC':kOrange-3,'HECA':kRed-3,'HECC':kRed+2,'FCALA':kBlue-3,'FCALC':kBlue+2}
441  partitions["list"] = list(partitions["color"].keys())
442 
443  defects0["prefix"] = ["LAR","CALO_ONLINEDB"]
444  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
445  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
446  defects0["partIntol"] = ["HVTRIP","SEVNOISEBURST","SEVCOVERAGE","HVNONNOMINAL","SEVNOISYCHANNEL","SEVMISCALIB","SEVUNKNOWN"] # LAr system - LAR Prefix - LAR_[PART]_[NAME]
447  defects0["partTol"] = ["COVERAGE","HVNONNOM_CORRECTED"] # LAr system
448  # Global intolerable and tolerable defects
449  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
450  defects0["globIntol"] = ["DATACORRUPT","RECOCORRUPT","SPECIALSTUDIES","BADTIMING","LOWMUCONFIG_IN_HIGHMU_EmergencyMeasures"] # LAr system - LAR Prefix - LAR_[NAME] or # CALO Prefix - CALO_[NAME] (last defect)
451  defects0["globTol"] = [] # LAr system
452 
453  defectVeto["description"] = {"HVTRIP":"High voltage trip", # First per partition LAr defects
454  "NOISEBURST":"Noise bursts (before veto)",
455  "HVNONNOMINAL":"HV non nominal",
456  "SEVNOISEBURST":"Noise burst",
457  "SEVNOISYCHANNEL":"Noisy channels",
458  "SEVCOVERAGE":"Coverage",
459  "SEVMISCALIB":"Global miscalibration",
460  "SEVUNKNOWN":"Unknown reason",
461  "DATACORRUPT":"Data corruption", # Then global LAr defects
462  "RECOCORRUPT":"Corrupted reconstruction",
463  "SPECIALSTUDIES":"Special studies (on purpose)",
464  "BADTIMING":"Bad timing",
465  "COVERAGE":"Coverage (tolerable)",
466  "LOWMUCONFIG_IN_HIGHMU_EmergencyMeasures":"Trigger misconfiguration", # And the global CALO defects
467  "noiseBurst":"Noise burst", # And finally the LAr veto
468  "miniNoiseBurst":"Mini noise burst",
469  "corruption":"Data corruption"}
470 
471  veto["all"] = ["noiseBurst","miniNoiseBurst","corruption"] # Veto name as defined in the COOL database
472  veto["COOL"] = {"noiseBurst":"allNoise",
473  "miniNoiseBurst":"MNBNoise",
474  "corruption":"allCorruption"} # Veto name as defined in the COOL database
475 
476  signOff["EXPR."] = ["LAR_UNCHECKED"]
477  signOff["BULK"] = ["LAR_BULK_UNCHECKED"]
478  signOff["FINAL"] = ["LAR_UNCHECKED_FINAL"]
479 
480 
482  if system == "Tile":
483  partitions["color"] = { 'EBA':kYellow-9,'EBC':kYellow,'LBA':kOrange,'LBC':kOrange-3}
484  partitions["list"] = list(partitions["color"].keys())
485 
486  defects0["prefix"] = ["TILE"]
487  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
488  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
489  defects0["partIntol"] = ["BAD_COVER","DAQ_PRB","DB_SEVERE","TIMING_SEVERE","UNSPECIFIED_SEVERE"] # Tile system
490  defects0["partTol"] = ["DB_MINOR","TIMING_MINOR","TRIP","UNSPECIFIED_MINOR"] # Tile system
491  # Global intolerable and tolerable defects
492  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
493  defects0["globIntol"] = ["LOWSTAT"] # Tile system
494  defects0["globTol"] = ["TIMEJUMPS_UNDEFINED"] # Tile system
495 
496  # Some defects may not exist in past years. Remove them to avoid crashes
497  # WARNING: this fix does not work with multiple year plot
498  defectVeto["description"] = {"BAD_COVER":"Coverage",
499  "DAQ_PRB":"DAQ problem",
500  "DB_SEVERE":"DB issue",
501  "TIMING_SEVERE":"Timing issue",
502  "UNSPECIFIED_SEVERE":"Severe unspecified",
503  "LOWSTAT":"Low stats"}
504 
505  veto["all"] = [] # Veto name as defined in the COOL database
506  veto["COOL"] = {} # Veto name as defined in the COOL database
507 
508  signOff["EXPR."] = ["TILE_UNCHECKED"]
509  signOff["BULK"] = ["TILE_UNCHECKED"]
510  signOff["FINAL"] = []
511 
512 
515  if system == "CSC":
516  partitions["color"] = {"EA":kYellow-9,'EC':kRed-3}
517 
518  partitions["list"] = list(partitions["color"].keys())
519 
520  defects0["prefix"] = ["MS_CSC"]
521  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
522  defects0["partIntol"] = ["STANDBY_HV",
523  "PROBLEM",
524  "ROD_DISABLED",
525  "DISABLED"]
526 
527  defects0["partTol"] = ["DISCONNECTED2","LATENCY_MINOR","THRESHOLD"]
528  # Global intolerable and tolerable defects
529  defects0["globIntol"] = []
530  defects0["globTol"] = []
531 
532  veto["all"] = [] # Veto name as defined in the COOL database
533  veto["COOL"] = {} # Veto name as defined in the COOL database
534 
535  defectVeto["description"] = {"STANDBY_HV":"Standby HV",
536  "PROBLEM":"Coverage loss > 10%%",
537  "ROD_DISABLED":">=1 ROD not readout",
538  "DISABLED":"Disabled"}
539 
540  signOff["EXPR."] = ["MS_UNCHECKED"]
541  signOff["BULK"] = ["MS_BULK_UNCHECKED"]
542  signOff["FINAL"] = []
543 
544 
546  if system == "MDT":
547  partitions["color"] = {"EA":kYellow-9,'EC':kRed-3,'BA':kBlue-3,'BC':kOrange-3}
548 
549  partitions["list"] = list(partitions["color"].keys())
550 
551  defects0["prefix"] = ["MS_MDT"]
552  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
553  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
554  defects0["partIntol"] = ["STANDBY_HV","PROBLEM","ROD_PROBLEM_5orMore","DISABLED"] # MDT system
555  defects0["partTol"] = ["ROD_PROBLEM_1","ROD_PROBLEM_2to4"] # MDT system
556  # Global intolerable and tolerable defects
557  defects0["globIntol"] = [] # MDT system
558  defects0["globTol"] = [] # MDT system
559 
560  veto["all"] = [] # Veto name as defined in the COOL database
561  veto["COOL"] = {} # Veto name as defined in the COOL database
562 
563  defectVeto["description"] = {"STANDBY_HV":"Standby HV",
564  "PROBLEM":"Coverage loss > 10%%",
565  "ROD_PROBLEM_5orMore":">=5 RODs not readout",
566  "DISABLED":"Disabled"}
567 
568  signOff["EXPR."] = ["MS_UNCHECKED"]
569  signOff["BULK"] = ["MS_BULK_UNCHECKED"]
570  signOff["FINAL"] = []
571 
572 
574  if system == "RPC":
575  partitions["color"] = {'BA':kBlue-3,'BC':kOrange-3}
576 
577  partitions["list"] = list(partitions["color"].keys())
578 
579  defects0["prefix"] = ["MS_RPC"]
580  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
581  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
582  defects0["partIntol"] = ["STANDBY_HV","PROBLEM","PROBLEM_10to15percent","PROBLEM_MoreThan15percent","OutOfSync_3orMore","LowEfficiency_MoreThan10percent","DISABLED"] # RPC system
583  defects0["partTol"] = ["LowEfficiency_5to10percent","OutOfSync_2","OutOfSync_1","ROD_PROBLEM_1","PROBLEM_5to10percent"] # RPC system
584  # Global intolerable and tolerable defects
585  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
586  defects0["globIntol"] = []
587  defects0["globTol"] = []
588 
589  veto["all"] = [] # Veto name as defined in the COOL database
590  veto["COOL"] = {} # Veto name as defined in the COOL database
591 
592  defectVeto["description"] = {"STANDBY_HV":"Standby HV",
593  "PROBLEM":"Coverage loss > 10%%",
594  "PROBLEM_10to15percent":"Coverage loss > 10%%",
595  "PROBLEM_MoreThan15percent":"Coverage loss > 15%%",
596  "OutOfSync_3orMore":">3 Out of sync",
597  "LowEfficiency_MoreThan10percent":"Low efficiency > 10%%",
598  "DISABLED":"Disabled"}
599 
600  signOff["EXPR."] = ["MS_UNCHECKED"]
601  signOff["BULK"] = ["MS_BULK_UNCHECKED"]
602  signOff["FINAL"] = []
603 
604 
606  if system == "TGC":
607  partitions["color"] = {"EA":kYellow-9,'EC':kRed-3}
608 
609  partitions["list"] = list(partitions["color"].keys())
610 
611  defects0["prefix"] = ["MS_TGC"]
612  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
613  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
614  defects0["partIntol"] = ["STANDBY_HV","PROBLEM","ROD_PROBLEM-2orMore","DISABLED"] # TGC system
615  defects0["partTol"] = ["PROBLEM_1"] # TGC system
616  # Global intolerable and tolerable defects
617  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
618  defects0["globIntol"] = [] # TGC system
619  defects0["globTol"] = [] # TGC system
620 
621  veto["all"] = [] # Veto name as defined in the COOL database
622  veto["COOL"] = {} # Veto name as defined in the COOL database
623 
624  defectVeto["description"] = {"STANDBY_HV":"Standby HV",
625  "PROBLEM":"Coverage loss > 10%%",
626  "ROD_PROBLEM_2orMore":">=2 RODs not readout",
627  "DISABLED":"Disabled"}
628 
629  signOff["EXPR."] = ["MS_UNCHECKED"]
630  signOff["BULK"] = ["MS_BULK_UNCHECKED"]
631  signOff["FINAL"] = []
632 
633 
635  if system == "MuonCP":
636  defects0["prefix"] = ["MCP"]
637  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
638  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
639  defects0["partIntol"] = []
640  defects0["partTol"] = []
641  # Global intolerable and tolerable defects
642  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
643  defects0["globIntol"] = ["ALIGN_GEO","LOW_EFFICIENCY_MAJOR"] # MuonCP system
644  defects0["globTol"] = ["CHI2_PROBLEM","ID_PROBLEM","LOW_EFFICIENCY_MINOR","MS_PROBLEM"] # MuonCP system
645 
646  veto["all"] = [] # Veto name as defined in the COOL database
647  veto["COOL"] = {} # Veto name as defined in the COOL database
648 
649  defectVeto["description"] = {"ALIGN_GEO":"[MCP] Bad alignment/geometry)",
650  "LOW_EFFICIENCY_MAJOR":"[MCP] Low reconstruction efficiency" }
651 
652  signOff["EXPR."] = ["MS_UNCHECKED"]
653  signOff["BULK"] = ["MS_BULK_UNCHECKED"]
654  signOff["FINAL"] = []
655 
656 
657  if system == "IDGlobal":
658  partitions["color"] = {}
659  partitions["list"] = list(partitions["color"].keys())
660 
661  defects0["prefix"] = ["ID"]
662  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
663  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
664  defects0["partIntol"] = []
665  defects0["partTol"] = []
666  # Global intolerable and tolerable defects
667  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
668  defects0["globIntol"] = ["NOTRACKS","IBL_TRACKCOVERAGE_SEVERE","PIXEL_TRACKCOVERAGE_SEVERE","SCT_TRACKCOVERAGE_SEVERE","TRT_TRACKCOVERAGE_SEVERE","UNKNOWN","BS_RUNAVERAGE","BS_PARAMETERSTEP","BS_NOTNOMINAL"] # IDGlobal system
669  defects0["globTol"] = ["ALIGN_DEGRADED","LOWSTAT","IBL_TRACKCOVERAGE","PIXEL_TRACKCOVERAGE","SCT_TRACKCOVERAGE","TRT_TRACKCOVERAGE","VERTEXBUG"] # IDGlobal system
670 
671  veto["all"] = [] # Veto name as defined in the COOL database
672  veto["COOL"] = {} # Veto name as defined in the COOL database
673 
674  defectVeto["description"] = {"NOTRACKS":"No tracks",
675  "IBL_TRACKCOVERAGE_SEVERE":"[IBL] > 10 %% coverage loss",
676  "PIXEL_TRACKCOVERAGE_SEVERE":"[PIXEL] > 10 %% coverage loss",
677  "SCT_TRACKCOVERAGE_SEVERE":"[SCT] > 10 %% coverage loss",
678  "TRT_TRACKCOVERAGE_SEVERE":"[TRT] > 10 %% coverage loss",
679  "UNKNOWN":"Unknown",
680  "BS_RUNAVERAGE":"Problematic BS determination",
681  "BS_PARAMETERSTEP":"Large changes in BS",
682  "BS_NOTNOMINAL":"Sizable modulation in d0 vs phi",
683  "ALIGN_DEGRADED":"Degarded alignment",
684  "LOWSTAT":"Low statistics",
685  "x_TRACKCOVERAGE":"Significant change in coverage, but not severe (between 5-10% coverage loss)",
686  "VERTEXBUG":"Problems in the determination of the primary vertex"}
687 
688  signOff["EXPR."] = ["ID_UNCHECKED"]
689  signOff["BULK"] = ["ID_BULK_UNCHECKED"]
690  signOff["FINAL"] = []
691 
692 
696  if system == "CaloCP":
697  partitions["color"] = { 'BARREL':kYellow-9,'CRACK':kRed-3,'ENDCAP':kBlue-3, # EGamma partitions
698  'B':kYellow-9,'CR':kRed-3,'E':kBlue-3, # Tau partitions
699  'CALB':kYellow-9,'CALEA':kRed-3,'CALC':kBlue-3} # CaloGlobal partitions
700 
701  partitions["list"] = list(partitions["color"].keys())
702 
703  defects0["prefix"] = ["JET","EGAMMA","MET","TAU","CALO_"]
704  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
705  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
706  defects0["partIntol"] = ["LARNOISE","ENERGY","CALO","TRK","KIN","ID","TopoClusterNoiseSevere"] # CaloCP system - EGAMMA Prefix - EGAMMA_[NAME]_[PART] / TAU Prefix- TAU_[PART]_[NAME] / CaloGlobal Prefix - CALO_[PART]_[NAME]
707  defects0["partTol"] = []
708  # Global intolerable and tolerable defects
709  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
710  defects0["globIntol"] = ["NOJETSREGION","SEVERE_HOTSPOT","BEAMSPOT","Ex_largeshift","Ey_largeshift","SumEt_largeshift"] # CaloCP system - JET Prefix - JET_[NAME] / EGAMMA Prefix - EGAMMA_[NAME] / MET Prefix - MET_[NAME]
711  defects0["globTol"] = ["ETAPHI_SPIKES"] # CaloCP system
712 
713 
714  defectVeto["description"] = {"NOJETSREGION":"[Jet] Cold region",
715  "SEVERE_HOTSPOT":"[Jet] Hot region",
716  "LARNOISE":"[EGamma] Noise in LAr",
717  "ENERGY":"[EGamma] Problem in energy",
718  "BEAMSPOT":"[EGamma] Problem in beam spot",
719  "ETAPHI_SPIKES":"[Egamma] Eta/phi spikes",
720  "Ex_largeshift":"[MEt] Ex large shift",
721  "Ey_largeshift":"[MEt] EY large shift",
722  "SumEt_largeshift":"[MEt] SumEt large shift",
723  "CALO":"[Tau] Calo problem",
724  "TRK":"[Tau] Tracking problem",
725  "KIN":"[Tau] Kinetic problem",
726  "ID":"[Tau] Identification problem",
727  "TopoClusterNoiseSevere":"[TopoCluster] Hot spot"}
728 
729  veto["all"] = [] # Veto name as defined in the COOL database
730  veto["COOL"] = {} # Veto name as defined in the COOL database
731 
732  signOff["EXPR."] = ['CALO_UNCHECKED','EGAMMA_UNCHECKED','JET_UNCHECKED','MET_UNCHECKED','TAU_UNCHECKED']
733  signOff["BULK"] = ['CALO_BULK_UNCHECKED','EGAMMA_BULK_UNCHECKED','JET_BULK_UNCHECKED','MET_BULK_UNCHECKED','TAU_BULK_UNCHECKED']
734  signOff["FINAL"] = []
735 
736 
738  if system == "BTag":
739  partitions["color"] = { } # No partition needed
740 
741  partitions["list"] = list(partitions["color"].keys())
742 
743  defects0["prefix"] = ["BTAG"]
744  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
745  defects0["partIntol"] = [] # No partition defect
746  defects0["partTol"] = []
747  # Global intolerable and tolerable defects
748  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
749  defects0["globIntol"] = ["BLAYER_SERIOUS_PROBLEM","BTAG_SCT_SERIOUS_PROBLEM","BTAG_TRT_SERIOUS_PROBLEM","BTAG_JET_SEVHOTSPOT"] # BTag system
750  defects0["globTol"] = ["BEAMSPOT_SHIFT","BTAG_BLAYER_PROBLEM","BTAG_SCT_PROBLEM","BTAG_TRT_PROBLEM","NOJETS"] # BTag system
751 
752 
753  defectVeto["description"] = {"BLAYER_SERIOUS_PROBLEM":"B layer problem",
754  "BTAG_SCT_SERIOUS_PROBLEM":"SCT problem",
755  "BTAG_TRT_SERIOUS_PROBLEM":"TRT problem",
756  "BTAG_JET_SEVHOTSPOT":"Jet hot spot",
757  "BEAMSPOT_SHIFT":"Beamspot shift",
758  "BTAG_NOJETS":"No jets in monitoring"}
759 
760  veto["all"] = [] # Veto name as defined in the COOL database
761  veto["COOL"] = {} # Veto name as defined in the COOL database
762 
763  signOff["EXPR."] = ['BTAG_UNCHECKED']
764  signOff["BULK"] = ['BTAG_BULK_UNCHECKED']
765  signOff["FINAL"] = []
766 
767 
769  if system == "Trig_L1":
770  partitions["color"] = {}
771  partitions["list"] = list(partitions["color"].keys())
772 
773  defects0["prefix"] = ["TRIG_L1"]
774  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
775 
776 
777  defects0["partIntol"] = []
778  defects0["partTol"] = []
779  # Global intolerable and tolerable defects
780  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
781  defects0["globIntol"] = ["CAL_coverage","CAL_misconf_calib","CAL_misconf_electronics","CAL_misconf_satBCID","CAL_off","MUB_busy","MUB_coverage","MUB_failed_electronics","MUB_lost_sync","MUB_misconf_electronics","MUE_busy","MUE_coverage","MUE_misconf_electronics","MUE_pt15GeV","MUE_pt20GeV","CTP_CTP_MuCTPI_bcid","CTP_CTP_ROD_bcid","CTP_CTPsim","CTP_TAPnoTBP","CTP_TAVnoTAP","CTP_UNKNOWN","CTP_bcid","CTP_bcidrange","CTP_candnumber","CTP_clock","CTP_counter","CTP_lumiblockrange","CTP_lumiblocktime","CTP_multpt","CTP_nanosectime","CTP_prescale_error","CTP_roiCand","CTP_roiNum","CTP_wrong_BGK","CTP_CTPIN_MU","CTP_CTPIN_JET2","TOPO_inputs","TOPO_outputs","TOPO_misconf_calib","TOPO_misconf_electronics","TOPO_off","TOPO_readout","CAL_LOWMUCONFIG_IN_HIGHMU"] # Trig_L1 system
782  defects0["globTol"] = ["CAL_coverage_tolerable","CAL_misconf_calib_tolerable","CAL_misconf_electronics_tolerable","CAL_misconf_satBCID_tolerable","CAL_misconf_tile_drawer","CAL_readout_cpjep_tolerable","CAL_readout_pp_tolerable","CAL_mistimed_larTBB_SEU_tolerable","CTP_NONSTANDARD_CONFIG","MUB_lost_sync_tolerable","MUB_failed_electronics_tolerable","MUB_coverage_tolerable","MUB_misconf_electronics_tolerable","MUB_LOWER_EFFICIENCY_TOLERABLE","MUE_coverage_tolerable","MUE_pt15GeV_tolerable","MUE_pt20GeV_tolerable","MUE_FakeBurst","TOPO_inputs_tolerable","TOPO_outputs_tolerable","TOPO_misconf_calib_tolerable","TOPO_misconf_electronics_tolerable","TOPO_readout_tolerable","TOPO_readout_roib","TOPO_not_good_for_physics"] # Trig_L1 system
783 
784  veto["all"] = [] # Veto name as defined in the COOL database
785  veto["COOL"] = {} # Veto name as defined in the COOL database
786 
787  defectVeto["description"] = {"CAL_coverage":"",
788  "CAL_misconf_calib":"[Calo] Electronics miscalibration",
789  "CAL_misconf_electronics":"[Calo] Electronics misconfiguration",
790  "CAL_misconf_satBCID":"",
791  "CAL_off":"[Calo] L1Calo off",
792  "CAL_mistimed_larTBB_SEU_tolerable":"[LAr] TBB SEU leading to mistiming",
793  "CAL_LOWMUCONFIG_IN_HIGHMU":"[Calo] Low-mu configuration in high-mu run",
794  "MUB_busy":"[Muon] Busy",
795  "MUB_coverage":"[Muon] Barrel coverage",
796  "MUB_failed_electronics":"[Muon] Electronics failure",
797  "MUB_lost_sync":"[Muon] Lost synchr.",
798  "MUB_misconf_electronics":"[Muon] Electronics misconfig",
799  "MUE_busy":"[Muon] Busy",
800  "MUE_coverage":"[Muon] Forward coverage",
801  "MUE_misconf_electronics":"[Muon] Electronics misconfig",
802  "MUE_pt15GeV":"[Muon] Pt15GeV",
803  "MUE_pt20GeV":"[Muon] Pt20GeV",
804  "CTP_wrong_BGK":"[CTP] Wrong bunch group key",
805  "CTP_CTPIN_MU":"[CTPIN] Cable problems for jets",
806  "CTP_CTPIN_JET2":"[CTPIN] Cable problems for muons",
807  "TOPO_misconf_electronics":"[CaloTopo] Electronics misconfiguration"}
808 
809  signOff["EXPR."] = ["TRIG_L1_CAL_UNCHECKED","TRIG_L1_CTP_UNCHECKED","TRIG_L1_MUB_UNCHECKED","TRIG_L1_MUE_UNCHECKED","TRIG_L1_TOPO_UNCHECKED"]
810  signOff["BULK"] = []
811  signOff["FINAL"] = []
812 
813 
814  if system == "Trig_HLT":
815  partitions["color"] = {}
816  partitions["list"] = list(partitions["color"].keys())
817 
818  defects0["prefix"] = ["TRIG_HLT"]
819  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
820  defects0["partIntol"] = []
821  defects0["partTol"] = []
822  # Global intolerable and tolerable defects
823  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
824  defects0["globIntol"] = ["BJT_beam_spot_flag","BJT_no_secvtx","BJT_no_tracking","BJT_INACCURATE_ONLINE_BEAMSPOT","BJT_NO_MULTIBJET","BPH_no_muon","BPH_no_tracking","CAL_LAR_SourceMajor","CAL_TILE_SourceMajor","CAL_missing_data","CAL_no_primaries","ELE_no_clustering","ELE_no_tracking","ELE_primary_chain_misconfigured","ELE_unknown","ELE_tracking_issue","GAM_no_clustering","GAM_partial_clustering","GAM_primary_chain_misconfigured","GAM_unknown","GENERAL_debugstream","GENERAL_no_primaries","GENERAL_prescale_problem","GENERAL_standby","GENERAL_xpu_misconf","IDT_EF_FAIL","IDT_IDS_FAIL","IDT_SIT_FAIL","IDT_PRIVX_INEFF","JET_algo_problem","JET_menu_misconf","JET_unknown","MBI_no_tracking","MET_missing_data","MUO_Upstream_Barrel_problem","MUO_Upstream_Endcap_problem","TAU_misconf","TAU_caloIssue","TAU_nocalo","TAU_no_tracking","TRG_HLT_TAU_tracking_issue","TAU_dbIssue_BeamSpot","IDT_PIX_DATA_ERROR","MUO_chain_disabled"] # Trig_HLT system
825  defects0["globTol"] = ["BJT_partial_tracking","BJT_unknown","BJT_ONLINE_BEAMSPOT_GT1p6MM","BJT_ONLINE_BEAMSPOT_GT2MM","BPH_algcrash","BPH_misconf","BPH_partial_muon","BPH_partial_tracking","BPH_unknown","CAL_LAR_SourceMinor","CAL_ROI_EXCESS","CAL_TILE_SourceMinor","CAL_partial_missing_data","CAL_spike","CAL_incorrect_BCID_correction","CAL_unknown","ELE_chain_misconfigured","ELE_clustering_issue","ELE_lowEfficiency_all_electrons","ELE_non_primary_poor_performance_e15_HLTtighter","ELE_non_primary_poor_performance_e15_tight","ELE_nonprimary_misconfigured","ELE_partial_clustering","ELE_partial_tracking","ELE_primary_poor_performance_e20_medium1","ELE_primary_poor_performance_e22_medium1","ELE_tracking_issue_Tolerable","GAM_chain_misconfigured","GAM_clustering_issue","GAM_nonprimary_misconfigured","GENERAL_streaming","GENERAL_tolerableDebugstream","GENERAL_no_1e34_primaries","GENERAL_no_12e33_primaries","GENERAL_no_15e33_primaries","GENERAL_no_17e33_primaries","IDT_BSPOT_FAILUR","IDT_BSPOT_INVALID_STATUS","IDT_BSPOT_INVALIDATOR_PROBLEM","IDT_EFT_FAIL","IDT_LOWSTAT","IDT_SCT_OUTOFTIMEHITS","IDT_TRT_DATA_LOST","IDT_TRT_OUTOFTIMEHITS","IDT_TSF_FAIL","IDT_unknown","JET_calib_issue","JET_energy_excess","JET_GSC_BEAMSPOT_PROBLEM","JET_hotspot","JET_partialscan_issue","MBI_HI_time_shift_mbts","MBI_partial_tracking","MBI_unknown","MBI_spacepoint_noise","MET_XS_Triggers_OFF","MET_missingEt_spike","MET_partial_missing_data","MET_phi_spike","MET_sumEt_spike","MET_unknown","MUO_EFMSonly_problem","MUO_Fullscan_problem","MUO_L2Iso_problem","MUO_L2muonSA_problem","MUO_MSonly_Barrel_problem","MUO_MSonly_Endcapl_problem","MUO_MuComb_problem","MUO_MuGirl_problem","MUO_Multi_Muon_problemchains","MUO_MuonEFTrackIso_problem","MUO_MuonEF_problem","MUO_Slow_problem","MUO_unknown","MUO_chain_misconfigured","TAU_unknown","TAU_dbIssue_mu","TAU_tracking_issue_Tolerable"] # Trig_HLT system
826 
827  veto["all"] = [] # Veto name as defined in the COOL database
828  veto["COOL"] = {} # Veto name as defined in the COOL database
829 
830  defectVeto["description"] = {"CAL_LAR_SourceMajor":"[LAr] Major problem",
831  "CAL_no_primaries":"[Calo] No primaries",
832  "GENERAL_no_primaries":"No primaries",
833  "GENERAL_prescale_problem":"Prescale problem",
834  "MUO_Upstream_Barrel_problem":"[Muon] Upstream barrel problem",
835  "BJT_INACCURATE_ONLINE_BEAMSPOT":"Inaccurate online beam spot",
836  "BJT_ONLINE_BEAMSPOT_GT1p6MM":"Online beam spot > 1.6mm",
837  "BJT_ONLINE_BEAMSPOT_GT2MM":"Online beam spot > 2mm",
838  "BJT_beam_spot_flag":"Beam spot flag",
839  "BJT_NO_MULTIBJET":"No multi b-jets",
840  "GENERAL_debugstream":"Problem in debug stream",
841  "BJT_no_secvtx":"[b-jet] No Secondary vertex",
842  "IDT PIX DATA ERROR":""
843  }
844 
845  signOff["EXPR."] = ["TRIG_HLT_BJT_UNCHECKED","TRIG_HLT_BPH_UNCHECKED","TRIG_HLT_CAL_UNCHECKED","TRIG_HLT_ELE_UNCHECKED","TRIG_HLT_GAM_UNCHECKED","TRIG_HLT_IDT_UNCHECKED","TRIG_HLT_JET_UNCHECKED","TRIG_HLT_MBI_UNCHECKED","TRIG_HLT_MET_UNCHECKED","TRIG_HLT_MUO_UNCHECKED","TRIG_HLT_TAU_UNCHECKED"]
846  signOff["BULK"] = []
847  signOff["FINAL"] = []
848 
849 
851  if system == "Lumi":
852  partitions["color"] = { } # No partition needed
853 
854  partitions["list"] = list(partitions["color"].keys())
855 
856  defects0["prefix"] = ["LUMI"]
857  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
858  defects0["partIntol"] = [] # No partition defect
859  defects0["partTol"] = []
860  # Global intolerable and tolerable defects
861  defects0["globIntol"] = ["BEAMS_MOVING","CALIB_UNCERTAIN","CTP_ERROR","EMITTANCESCAN","INFR_ERROR","LCD_MISSINGCURRENT","OLC2COOL_FAILURE","ONLINEDB_ERROR","ONL_DET_ERROR_SEVERE","ONL_OLC2HLT_SEVERE","ONL_ONLINEDB_ERROR","PERBCIDINFO_ABSENT","UNKNOWN","VDM"] # Lumi system
862  defects0["globTol"] = []
863 
864 
865  defectVeto["description"] = {"BEAMS_MOVING":"Beams moving",
866  "CALIB_UNCERTAIN":"Uncertain calibration",
867  "CTP_ERROR":"CTP error",
868  "EMITTANCESCAN":"Emittance scan",
869  "INFR_ERROR":"Infr. error",
870  "LCD_MISSINGCURRENT":"Missing LCD current",
871  "OLC2COOL_FAILURE":"OLC2COOL failure",
872  "ONLINEDB_ERROR":"Online DB error",
873  "ONL_DET_ERROR_SEVERE":"Detector error",
874  "ONL_OLC2HLT_SEVERE":"OLC2HLT error",
875  "ONL_ONLINEDB_ERROR":"Online DB error",
876  "PERBCIDINFO_ABSENT":"Missing per BCID info",
877  "UNKNOWN":"Unknown",
878  "VDM":"VDM scan"}
879 
880  veto["all"] = [] # Veto name as defined in the COOL database
881  veto["COOL"] = {} # Veto name as defined in the COOL database
882 
883  signOff["EXPR."] = ['LUMI_UNCHECKED']
884  signOff["BULK"] = []
885  signOff["FINAL"] = []
886 
887 
888  if system == "LUCID":
889  partitions["color"] = {}
890  partitions["list"] = list(partitions["color"].keys())
891 
892  defects0["prefix"] = ["LCD"]
893  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
894  defects0["partIntol"] = []
895  defects0["partTol"] = []
896  # Global intolerable and tolerable defects
897  defects0["globIntol"] = ["DAQ_ERROR","DISABLED","GAS_CHANGING","HV_CHANGE","HV_RESET","LUMAT_ERROR","MAGNETS_RAMPING","MDA_FAIL"]
898  defects0["globTol"] = ["LCD_HV_OFF","LCD_LEDBOARD_ERROR","LCD_LV_OFF"]
899 
900  veto["all"] = [] # Veto name as defined in the COOL database
901  veto["COOL"] = {} # Veto name as defined in the COOL database
902 
903  defectVeto["description"] = {"DAQ_ERROR":"DAQ error",
904  "DISABLED":"Disabled",
905  "GAS_CHANGING":"Gas changing",
906  "HV_CHANGE":"HV change",
907  "HV_RESET":"HV reset",
908  "LUMAT_ERROR":"Lumat error",
909  "MAGNETS_RAMPING":"Ramping magnets",
910  "MDA_FAIL":"MDA fail"}
911 
912  signOff["EXPR."] = ["LCD_UNCHECKED"]
913  signOff["BULK"] = []
914  signOff["FINAL"] = []
915 
916 
917  if system == "ALFA":
918  partitions["color"] = {}
919  partitions["list"] = list(partitions["color"].keys())
920 
921  defects0["prefix"] = ["ALFA"]
922  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
923  defects0["partIntol"] = []
924  defects0["partTol"] = []
925  # Global intolerable and tolerable defects
926  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
927  defects0["globIntol"] = ["MISSING_TRIGGER","WRONG_POSITION","MISSING_PMF_5orMore"] # ALFA system
928  defects0["globTol"] = ["MISSING_PMF_1to4"] # ALFA system
929 
930  veto["all"] = [] # Veto name as defined in the COOL database
931  veto["COOL"] = {} # Veto name as defined in the COOL database
932 
933  defectVeto["description"] = {"MISSING_TRIGGER":"Missing trigger",
934  "WRONG_POSITION":"Wrong position",
935  "MISSING_PMF_5orMore":"Missing PMF"}
936 
937  signOff["EXPR."] = []
938  signOff["BULK"] = []
939  signOff["FINAL"] = []
940 
941 
942  if system == "AFP":
943  partitions["color"] = {'C':kYellow-9,'A':kYellow,'C_FAR':kOrange,'C_NEAR':kOrange-3,'A_FAR':kRed-3,'A_NEAR':kBlue-3}
944  partitions["list"] = partitions["color"].keys()
945 
946  defects0["prefix"] = ["AFP"]
947  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
948  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
949  defects0["partIntol"] = ["TOF_NOT_OPERATIONAL_HV","TOF_NOT_OPERATIONAL_LV","TOF_WRONG_CABLING","TOF_WRONG_TIMING","TOF_TRIGGER_PROBLEM","SIT_NOT_OPERATIONAL_HV","SIT_NOT_OPERATIONAL_LV","SIT_NOT_OPERATIONAL","SIT_WRONG_TIMING","IN_GARAGE"] # AFP system
950  defects0["partTol"] = [] # AFP system
951  # Global intolerable and tolerable defects
952  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
953  defects0["globIntol"] = ["WRONG_MAPPING","ERROR"] # AFP system
954  defects0["globTol"] = [] # AFP system
955 
956  veto["all"] = [] # Veto name as defined in the COOL database
957  veto["COOL"] = {} # Veto name as defined in the COOL database
958 
959  defectVeto["description"] = {"TOF_NOT_OPERATIONAL_HV":"[ToF] Non-nominal HV",
960  "TOF_NOT_OPERATIONAL_LV":"[ToF] Non-operational LV",
961  "TOF_WRONG_CABLING":"[ToF] Wrong cabling",
962  "TOF_WRONG_TIMING":"[ToF] Wrong timing",
963  "TOF_TRIGGER_PROBLEM":"[ToF] Trigger problem",
964  "SIT_NOT_OPERATIONAL_HV":"[SiT] < 3 planes at nominal HV",
965  "SIT_NOT_OPERATIONAL_LV":"[SiT] < 3 planes available (LV)",
966  "SIT_NOT_OPERATIONAL":"[SiT] < 3 SiT planes available",
967  "SIT_WRONG_TIMING":"[SiT] Wrong timing",
968  "IN_GARAGE":">= 1 RP in the garage or moving",
969  "WRONG_MAPPING":"[ToF] Wrong mapping",
970  "ERROR":"Unknown problem"}
971 
972  signOff["EXPR."] = ["AFP_UNCHECKED"]
973  signOff["BULK"] = ["AFP_BULK_UNCHECKED"]
974  signOff["FINAL"] = []
975 
976 
977 
978  if system == "ZDC":
979  partitions["color"] = {}
980  partitions["list"] = list(partitions["color"].keys())
981 
982  defects0["prefix"] = ["ALPHA"]
983  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
984  defects0["partIntol"] = []
985  defects0["partTol"] = []
986  # Global intolerable and tolerable defects
987  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
988  defects0["globIntol"] = ["SEVUNKNOWN"] # ZDC system
989  defects0["globTol"] = ["ZDC_NONOPTIMALHV","ZDC_NONOPTIMALTIMING","ZDC_PERBCIDINFO_ABSENT","ZDC_UNKNOWN"] # ZDC system
990 
991  veto["all"] = [] # Veto name as defined in the COOL database
992  veto["COOL"] = {} # Veto name as defined in the COOL database
993 
994  defectVeto["description"] = {}
995 
996  signOff["EXPR."] = []
997  signOff["BULK"] = []
998  signOff["FINAL"] = []
999 
1000 
1001  if system == "Global":
1002  partitions["color"] = {}
1003  partitions["list"] = list(partitions["color"].keys())
1004 
1005  defects0["prefix"] = ["GLOBAL"]
1006  # Partition intolerable and tolerable defects - Order determines what defect is proeminent
1007  defects0["partIntol"] = []
1008  defects0["partTol"] = []
1009  # Global intolerable and tolerable defects
1010  # Warning : do not remove/edit the comment specifying the system. It is used to display the defects in the webpage
1011  defects0["globIntol"] = ["BUSY_GREATER50PCT","LOWMUCONFIG_IN_HIGHMU","OFFLINE_PROCESSING_PROBLEM","SOLENOID_OFF","SOLENOID_RAMPING","SOLENOID_NOTNOMINAL","TOROID_OFF","TOROID_NOTNOMINAL","TOROID_RAMPING", "NOTCONSIDERED","LHC_HIGHBETA","NONSTANDARD_BC","LOW_N_BUNCHES"] # Global system
1012  defects0["globTol"] = [] # Global system
1013 
1014  veto["all"] = [] # Veto name as defined in the COOL database
1015  veto["COOL"] = {} # Veto name as defined in the COOL database
1016 
1017  defectVeto["description"] = {"BUSY_GREATER50PCT":"Busy",
1018  "LOWMUCONFIG_IN_HIGHMU":"Low mu config in high mu",
1019  "OFFLINE_PROCESSING_PROBLEM":"Offline processing problem",
1020  "SOLENOID_OFF":"Solenoid off",
1021  "SOLENOID_RAMPING":"Solenoid ramping",
1022  "SOLENOID_NOTNOMINAL":"Solenoid not nominal",
1023  "TOROID_OFF":"Toroid off",
1024  "TOROID_NOTNOMINAL":"Toroid not nominal",
1025  "TOROID_RAMPING":"Toroid ramping",
1026  "NOTCONSIDERED":"Not considered",
1027  "LHC_HIGHBETA":"LHC: high beta*",
1028  "NONSTANDARD_BC":"LHC: non standard BC",
1029  "LOW_N_BUNCHES":"LHC: low nbunches"
1030  }
1031 
1032  signOff["EXPR."] = []
1033  signOff["BULK"] = []
1034  signOff["FINAL"] = []
1035 
1036 
1039  defects0["globalFilterDefects"] = ["GLOBAL_LHC_50NS","GLOBAL_LHC_NONSTANDARD_BC","GLOBAL_LHC_LOW_N_BUNCHES","GLOBAL_LHC_NOBUNCHTRAIN","GLOBAL_LHC_COMMISSIONING","GLOBAL_LHC_HIGHBETA","GLOBAL_LOWMUCONFIG_IN_HIGHMU","LUMI_VDM","GLOBAL_NOTCONSIDERED"]
1040  if system == "Global": # In the case of the Global system, do not apply global filtering as they may be common intolerable defects.
1041  for iDef in defects0["globalFilterDefects"]:
1042  if iDef not in defects0["globIntol"]:
1043  defects0["globIntol"].append(iDef)
1044  defects0["globalFilterDefects"] = []
1045 
1046  defects0["part"] = defects0["partIntol"] + defects0["partTol"]
1047  defects0["glob"] = defects0["globIntol"] + defects0["globTol"]
1048 
1049  defects0["intol"] = defects0["globIntol"] + defects0["partIntol"]
1050  defects0["tol"] = defects0["globTol"] + defects0["partTol"]
1051 
1052  defects0["partIntol_recov"] = []
1053  defects0["globIntol_recov"] = []
1054  for idef in defects0["partIntol"]: # Create a duplicated list of intol defect to monitor the recoverability
1055  defects0["partIntol_recov"].append("%s__recov"%idef)
1056  for idef in defects0["globIntol"]: # Create a duplicated list of intol defect to monitor the recoverability
1057  defects0["globIntol_recov"].append("%s__recov"%idef)
1058  defects0["intol_recov"] = defects0["partIntol_recov"] + defects0["globIntol_recov"]
1059 
1060 # If the description is not available, define it with the defect name
1061  for iDef in defects0["intol"]+defects0["tol"]:
1062  if iDef not in list(defectVeto["description"].keys()):
1063  defectVeto["description"][iDef] = iDef
1064 
1065 # New dynamic way to define the color for the defect affecting the year / tag
1066  defectVeto["color"] = {}
1067  iColor=0
1068  for iDefectVeto in list(defectVeto["description"].keys()):
1069  # If more than 12 defects affecting a system, add new color in vector below - https://root.cern.ch/doc/master/pict1_TColor_002.png
1070  colorPalette = [kBlue+3,kRed+1,kGreen-2,kOrange,kBlue-4,kMagenta+2,kYellow+1,kSpring-9,kAzure+6,kViolet-4,kPink,kBlue-9,kPink-6]
1071  if (os.path.exists("YearStats-%s/%s/%s/loss-%s.dat"%(system,year,tag,iDefectVeto))) and iColor<len(colorPalette):
1072  defectVeto["color"][iDefectVeto] = colorPalette[iColor]
1073  iColor = iColor + 1
1074  else:
1075  defectVeto["color"][iDefectVeto] = kBlack
1076 
1077  if (system == "LAr"):
1078  defectVeto["color"]["noiseBurst"] = kBlue-2
1079  defectVeto["color"]["miniNoiseBurst"] = kMagenta+1
1080  defectVeto["color"]["corruption"] = kAzure+9
1081 
1082 
1083 # The definition below are there only to avoid crashed, as these summed histogram are not (yet?) displayed
1084  defectVeto["description"]["allIntol"] = "Dummy"
1085  defectVeto["description"]["allIntol_recov"] = "Dummy"
1086  defectVeto["color"]["allIntol"] = kBlack
1087  defectVeto["color"]["allIntol_recov"] = kBlack
1088  defectVeto["description"]["allVeto"] = "Dummy"
1089  defectVeto["color"]["allVeto"] = kBlack
1090 
1091  return True
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
max
#define max(a, b)
Definition: cfImp.cxx:41
IsA
#define IsA
Declare the TObject style functions.
Definition: xAODTEventBranch.h:59
DeMoLib.MakeTProfile
def MakeTProfile(name, xtitle, ytitle, xmin, xmax, nbins, color)
Definition: DeMoLib.py:18
DeMoLib.SetXLabel
def SetXLabel(h, list)
Definition: DeMoLib.py:41
DeMoLib.MakeTH1
def MakeTH1(name, xtitle, ytitle, xmin, xmax, nbins, color)
Definition: DeMoLib.py:30
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
DeMoLib.MakeLegend
def MakeLegend(xmin, ymin, xmax, ymax)
Definition: DeMoLib.py:46
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DeMoLib.retrieveYearTagProperties
def retrieveYearTagProperties(year, tag)
Return the year/tag properties (defect/veto/lumi tags...) stored in YearStats-common/DeMoConfig-[year...
Definition: DeMoLib.py:68
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
python.grid.Add
def Add(name)
Definition: grid.py:41
Trk::open
@ open
Definition: BinningType.h:40
generate::GetEntries
double GetEntries(TH1D *h, int ilow, int ihi)
Definition: rmsFrac.cxx:20
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
DeMoLib.initializeMonitoredDefects
def initializeMonitoredDefects(system, partitions, defects0, defectVeto, veto, signOff, year, tag, runlist={})
Definition: DeMoLib.py:294
DeMoLib.returnPeriod
def returnPeriod(runNb, system, year, tag)
Return the data period of a run based on the information stored in YearStats-[system]/[year]/[tag]/ru...
Definition: DeMoLib.py:56
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
DeMoLib.strLumi
def strLumi(lumi, unit="ub", latex=True, floatNumber=False)
Return a string with the luminosity in a human readable way If the unit is %%, this is a percentage.
Definition: DeMoLib.py:86
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
DeMoLib.plotStack
def plotStack(name, histo, index, indexName, histoIntLumi, lumiBool, resStack, resCanvas, resLegend, recovBool=True, compBool=False, approvedPlots=False)
Definition: DeMoLib.py:118