54def plotter_GeV(histname, title, xlabel, xmin, xmax, ylabel):
55
56 c1 = R.TCanvas()
57 pad1 = R.TPad("pad1", "pad1", 0, 0, 1, 1)
58 pad1.SetRightMargin
59 rfile = R.TFile(infilename)
60
61 bins = get_bins(histname)
62
63 hist1 = rfile.Get(run_folder+"/GLOBAL/DQTGlobalWZFinder/" + histname)
64 hist2 = R.TH1F(histname, title, len(bins)-1, bins)
65 for i in range(0, hist1.GetNbinsX()):
66 hist2.SetBinContent(i, hist1.GetBinContent(i))
67 hist2.Draw("E0")
68
69 hist2.GetXaxis().SetTitle(xlabel)
70 hist2.GetXaxis().SetRangeUser(xmin, xmax)
71 hist2.GetYaxis().SetTitle(ylabel)
72
73 if "pt" in histname:
74 R.gPad.SetLogx()
75 hist2.GetXaxis().SetMoreLogLabels()
76 R.gPad.SetLogy()
77 pt.drawAtlasLabel(0.2, 0.56, "Internal")
78 pt.drawText(0.2, 0.50, "Data 2022")
79 pt.drawText(0.2, 0.44, "#sqrt{s} = 13.6 TeV")
80 pt.drawText(0.2, 0.38, "run "+run_number)
81 if "mu" in histname:
82 pt.drawText(0.2, 0.32, "p^{#mu}_{T} > 27 GeV")
83 pt.drawText(0.2, 0.26, "|#eta^{#mu}| < 2.4")
84 pt.drawText(0.2, 0.20, "66 < m_{#mu#mu} < 116 GeV")
85 else:
86 pt.drawText(0.2, 0.32, "p^{e}_{T} > 27 GeV")
87 pt.drawText(0.2, 0.26, "|#eta^{e}| < 1.37 or 1.52 < |#eta^{e}| < 2.4")
88 pt.drawText(0.2, 0.20, "66 < m_{ee} < 116 GeV")
89
90 else:
91 hist2.GetYaxis().SetRangeUser(0, hist2.GetMaximum()*1.2)
92 pt.drawAtlasLabel(0.2, 0.86, "Internal")
93 pt.drawText(0.2, 0.80, "Data 2022")
94 pt.drawText(0.2, 0.74, "#sqrt{s} = 13.6 TeV")
95 pt.drawText(0.2, 0.68, "run "+run_number)
96 if "mu" in histname:
97 pt.drawText(0.6, 0.86, "p^{#mu}_{T} > 27 GeV")
98 pt.drawText(0.6, 0.80, "|#eta^{#mu}| < 2.4")
99 pt.drawText(0.6, 0.74, "66 < m_{#mu#mu} < 116 GeV")
100 else:
101 pt.drawText(0.6, 0.86, "p^{e}_{T} > 27 GeV")
102 pt.drawText(0.6, 0.80, "|#eta^{e}| < 1.37 OR")
103 pt.drawText(0.6, 0.74, "1.52 < |#eta^{e}| < 2.4")
104 pt.drawText(0.6, 0.68, "66 < m_{ee} < 116 GeV")
105
106 c1.SaveAs(os.path.join(args.outdir, histname + ".pdf"))
107