ResidualMatch rework
This commit is contained in:
parent
6a286bfec7
commit
9ccedee74a
Binary file not shown.
@ -130,8 +130,8 @@ def get_elec_colors():
|
|||||||
kRed + 1,
|
kRed + 1,
|
||||||
kGreen + 1,
|
kGreen + 1,
|
||||||
kViolet,
|
kViolet,
|
||||||
kOrange - 8,
|
|
||||||
kTeal - 1,
|
kTeal - 1,
|
||||||
|
kOrange + 8,
|
||||||
kGray + 1,
|
kGray + 1,
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -879,84 +879,84 @@ def PrCheckerEfficiency(
|
|||||||
# canvas.SetRightMargin(0.05)
|
# canvas.SetRightMargin(0.05)
|
||||||
canvas.Write()
|
canvas.Write()
|
||||||
|
|
||||||
# calculate ghost rate
|
# # calculate ghost rate
|
||||||
print("\ncalculate ghost rate: ")
|
# print("\ncalculate ghost rate: ")
|
||||||
for histo in compareGhostHisto: # [Match, Seed, ...]
|
# for histo in compareGhostHisto: # [Match, Seed, ...]
|
||||||
cut = compareDict[jcut][tracker]
|
# cut = compareDict[jcut][tracker]
|
||||||
|
|
||||||
canvastitle = "ghost_rate_vs_" + histo + "_" + jcut
|
# canvastitle = "ghost_rate_vs_" + histo + "_" + jcut
|
||||||
name = "ghost_rate_vs_" + histo + "_" + jcut
|
# name = "ghost_rate_vs_" + histo + "_" + jcut
|
||||||
canvas = TCanvas(name, canvastitle)
|
# canvas = TCanvas(name, canvastitle)
|
||||||
canvas.SetRightMargin(0.1)
|
# canvas.SetRightMargin(0.1)
|
||||||
mg = TMultiGraph()
|
# mg = TMultiGraph()
|
||||||
jitr = 0
|
# jitr = 0
|
||||||
for tracker in trackers:
|
# for tracker in trackers:
|
||||||
if tracker == "Seed":
|
# if tracker == "Seed":
|
||||||
continue
|
# continue
|
||||||
folder = folders[tracker]["folder"]
|
# folder = folders[tracker]["folder"]
|
||||||
jcolor = compareColors[tracker]
|
# jcolor = compareColors[tracker]
|
||||||
gPad.SetTicks()
|
# gPad.SetTicks()
|
||||||
histoName = (
|
# histoName = (
|
||||||
"Track/"
|
# "Track/"
|
||||||
+ folder
|
# + folder
|
||||||
+ tracker
|
# + tracker
|
||||||
+ "/"
|
# + "/"
|
||||||
+ ghostHistoDict[histo]["variable"]
|
# + ghostHistoDict[histo]["variable"]
|
||||||
)
|
# )
|
||||||
ghost = {}
|
# ghost = {}
|
||||||
hist_den = {}
|
# hist_den = {}
|
||||||
ghost = get_compare_ghost(ghost, hist_den, tf, histoName, label)
|
# ghost = get_compare_ghost(ghost, hist_den, tf, histoName, label)
|
||||||
for i, lab in enumerate(label):
|
# for i, lab in enumerate(label):
|
||||||
mg.Add(ghost[lab])
|
# mg.Add(ghost[lab])
|
||||||
set_style(
|
# set_style(
|
||||||
ghost[lab], colors[jcolor + jitr], markers[2 * i], styles[i]
|
# ghost[lab], colors[jcolor + jitr], markers[2 * i], styles[i]
|
||||||
)
|
# )
|
||||||
jitr += 1
|
# jitr += 1
|
||||||
|
|
||||||
xtitle = ghostHistoDict[histo]["xTitle"]
|
# xtitle = ghostHistoDict[histo]["xTitle"]
|
||||||
mg.GetXaxis().SetTitle(xtitle)
|
# mg.GetXaxis().SetTitle(xtitle)
|
||||||
mg.GetYaxis().SetTitle("Fraction of fake tracks")
|
# mg.GetYaxis().SetTitle("Fraction of fake tracks")
|
||||||
mg.Draw("ap")
|
# mg.Draw("ap")
|
||||||
mg.GetXaxis().SetTitleSize(0.06)
|
# mg.GetXaxis().SetTitleSize(0.06)
|
||||||
mg.GetYaxis().SetTitleSize(0.06)
|
# mg.GetYaxis().SetTitleSize(0.06)
|
||||||
mg.GetYaxis().SetTitleOffset(1.1)
|
# mg.GetYaxis().SetTitleOffset(1.1)
|
||||||
mg.GetXaxis().SetRangeUser(*efficiencyHistoDict[histo]["range"])
|
# mg.GetXaxis().SetRangeUser(*efficiencyHistoDict[histo]["range"])
|
||||||
mg.GetXaxis().SetNdivisions(10, 5, 0)
|
# mg.GetXaxis().SetNdivisions(10, 5, 0)
|
||||||
# for lab in label:
|
# # for lab in label:
|
||||||
# ghost[lab].Draw("P SAME")
|
# # ghost[lab].Draw("P SAME")
|
||||||
if histo == "p":
|
# if histo == "p":
|
||||||
pos = [0.53, 0.4, 1.00, 0.71]
|
# pos = [0.53, 0.4, 1.00, 0.71]
|
||||||
elif histo == "pt":
|
# elif histo == "pt":
|
||||||
pos = [0.5, 0.4, 0.98, 0.71]
|
# pos = [0.5, 0.4, 0.98, 0.71]
|
||||||
elif histo == "eta":
|
# elif histo == "eta":
|
||||||
pos = [0.35, 0.6, 0.85, 0.9]
|
# pos = [0.35, 0.6, 0.85, 0.9]
|
||||||
elif histo == "phi":
|
# elif histo == "phi":
|
||||||
pos = [0.3, 0.3, 0.9, 0.6]
|
# pos = [0.3, 0.3, 0.9, 0.6]
|
||||||
else:
|
# else:
|
||||||
pos = [0.4, 0.37, 0.80, 0.68]
|
# pos = [0.4, 0.37, 0.80, 0.68]
|
||||||
legend = place_legend(
|
# legend = place_legend(
|
||||||
canvas, *pos, header="LHCb Simulation", option="LPE"
|
# canvas, *pos, header="LHCb Simulation", option="LPE"
|
||||||
)
|
# )
|
||||||
legend.SetTextFont(132)
|
# legend.SetTextFont(132)
|
||||||
legend.SetTextSize(0.04)
|
# legend.SetTextSize(0.04)
|
||||||
legend.Draw()
|
# legend.Draw()
|
||||||
# if histo != "nPV":
|
# # if histo != "nPV":
|
||||||
# latex.DrawLatex(0.7, 0.85, "LHCb simulation")
|
# # latex.DrawLatex(0.7, 0.85, "LHCb simulation")
|
||||||
# else:
|
# # else:
|
||||||
# latex.DrawLatex(0.2, 0.85, "LHCb simulation")
|
# # latex.DrawLatex(0.2, 0.85, "LHCb simulation")
|
||||||
# mg.GetYaxis().SetRangeUser(0, 0.4)
|
# # mg.GetYaxis().SetRangeUser(0, 0.4)
|
||||||
if histo == "eta":
|
# if histo == "eta":
|
||||||
mg.GetYaxis().SetRangeUser(0, 0.4)
|
# mg.GetYaxis().SetRangeUser(0, 0.4)
|
||||||
# track_name = names[tracker] + " tracks"
|
# # track_name = names[tracker] + " tracks"
|
||||||
# latex.DrawLatex(0.7, 0.75, track_name)
|
# # latex.DrawLatex(0.7, 0.75, track_name)
|
||||||
# canvas.PlaceLegend()
|
# # canvas.PlaceLegend()
|
||||||
if savepdf:
|
# if savepdf:
|
||||||
filestypes = ["pdf"] # , "png", "eps", "C", "ps", "tex"]
|
# filestypes = ["pdf"] # , "png", "eps", "C", "ps", "tex"]
|
||||||
for ftype in filestypes:
|
# for ftype in filestypes:
|
||||||
canvas.SaveAs(
|
# canvas.SaveAs(
|
||||||
"checks/" + name + "." + ftype,
|
# "checks/" + name + "." + ftype,
|
||||||
)
|
# )
|
||||||
canvas.Write()
|
# canvas.Write()
|
||||||
|
|
||||||
outputfile.cd()
|
outputfile.cd()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user