37def conf(inputs, label, thr):
38 import ROOT
39 rh = ROOT.TH1F('SCTConfNew', 'Num of Problematic Modules in All Region', 5, -0.5, 4.5)
40 for l in range(len(label)):
41 rh.GetXaxis().SetBinLabel(l+1,label[l])
42 for i in range(len(inputs[0][1])):
43 plots = [_[1][i] for _ in inputs]
44 if i < 3:
45
46 plots = sorted(plots, key=_bec_layer_link)
47 for m in range(int(len(plots)/2)):
48 plot0 = plots[2*m]
49 plot1 = plots[2*m+1]
50 for xbin in range(plot0.GetNbinsX()):
51 for ybin in range(plot0.GetNbinsY()):
52 if (plot0.GetBinContent(xbin+1,ybin+1) > thr[i] or plot1.GetBinContent(xbin+1,ybin+1) > thr[i]):
53 rh.Fill(i)
54 else:
55
56 rh.Fill(i,plots[0].GetBinContent(4))
57 return [rh]