mod compare

This commit is contained in:
cetin 2024-03-27 12:24:01 +01:00
parent 1aeb8873c1
commit 9b52e31109

View File

@ -120,7 +120,7 @@ def getTrackNames():
def get_colors(): def get_colors():
return [kBlack, kAzure, kGreen + 2, kMagenta + 2, kRed, kCyan + 2, kGray + 3] return [kBlack, kAzure, kGreen + 2, kMagenta + 2, kRed, kCyan + 2, kGray + 1]
def get_elec_colors(): def get_elec_colors():
@ -129,10 +129,10 @@ def get_elec_colors():
kBlue - 3, kBlue - 3,
kRed + 1, kRed + 1,
kGreen + 1, kGreen + 1,
kGray + 3, # kTeal - 1,
kBlue - 7, kBlue - 7,
kTeal - 1,
kOrange + 8, kOrange + 8,
kGray + 3, kGray + 1,
] ]
@ -261,11 +261,14 @@ def get_eff(eff, hist, tf, histoName, label, var):
for i, lab in enumerate(label): for i, lab in enumerate(label):
numeratorName = histoName + "_reconstructed" numeratorName = histoName + "_reconstructed"
denominatorName = histoName + "_reconstructible" denominatorName = histoName + "_reconstructible"
denominator = findRootObjByName(tf[lab], denominatorName)
try: try:
numerator = findRootObjByName(tf[lab], numeratorName) denominator = findRootObjByName(tf[lab], denominatorName)
try:
numerator = findRootObjByName(tf[lab], numeratorName)
except:
numerator = denominator
except: except:
numerator = denominator continue
if numerator.GetEntries() == 0 or denominator.GetEntries() == 0: if numerator.GetEntries() == 0 or denominator.GetEntries() == 0:
continue continue
@ -297,9 +300,9 @@ def get_eff(eff, hist, tf, histoName, label, var):
eff[lab].SetTitle(lab + " Match") eff[lab].SetTitle(lab + " Match")
if histoName.find("Seed") != -1: if histoName.find("Seed") != -1:
if histoName.find("electron") != -1: if histoName.find("electron") != -1:
eff[lab].SetTitle(lab + " Seed, e^{-}") eff[lab].SetTitle("particle Seed, e^{-}")
else: else:
eff[lab].SetTitle(lab + " Seed") eff[lab].SetTitle("particle Seed")
if histoName.find("BestLong") != -1: if histoName.find("BestLong") != -1:
if histoName.find("electron") != -1: if histoName.find("electron") != -1:
eff[lab].SetTitle(lab + " BestLong, e^{-}") eff[lab].SetTitle(lab + " BestLong, e^{-}")
@ -326,8 +329,11 @@ def get_ghost(eff, hist, tf, histoName, label):
for i, lab in enumerate(label): for i, lab in enumerate(label):
numeratorName = histoName + "_Ghosts" numeratorName = histoName + "_Ghosts"
denominatorName = histoName + "_Total" denominatorName = histoName + "_Total"
numerator = findRootObjByName(tf[lab], numeratorName) try:
denominator = findRootObjByName(tf[lab], denominatorName) numerator = findRootObjByName(tf[lab], numeratorName)
denominator = findRootObjByName(tf[lab], denominatorName)
except:
continue
print("Numerator = " + numeratorName.replace(unique_name_ext_re(), "")) print("Numerator = " + numeratorName.replace(unique_name_ext_re(), ""))
print("Denominator = " + denominatorName.replace(unique_name_ext_re(), "")) print("Denominator = " + denominatorName.replace(unique_name_ext_re(), ""))
teff = TEfficiency(numerator, denominator) teff = TEfficiency(numerator, denominator)
@ -395,303 +401,304 @@ def PrCheckerEfficiency(
for f in checks_files: for f in checks_files:
os.remove(f) os.remove(f)
for tracker in trackers: # for tracker in trackers:
outputfile.cd() # outputfile.cd()
trackerDir = outputfile.mkdir(tracker) # trackerDir = outputfile.mkdir(tracker)
trackerDir.cd() # trackerDir.cd()
for cut in cuts[tracker]: # for cut in cuts[tracker]:
cutDir = trackerDir.mkdir(cut) # cutDir = trackerDir.mkdir(cut)
cutDir.cd() # cutDir.cd()
folder = folders[tracker]["folder"] # folder = folders[tracker]["folder"]
print("folder: " + folder.replace(unique_name_ext_re(), "")) # print("folder: " + folder.replace(unique_name_ext_re(), ""))
histoBaseName = "Track/" + folder + tracker + "/" + cut + "_" # histoBaseName = "Track/" + folder + tracker + "/" + cut + "_"
# calculate efficiency # # calculate efficiency
for histo in efficiencyHistos: # for histo in efficiencyHistos:
canvastitle = ( # canvastitle = (
"efficiency_" + histo + ", " + categories[tracker][cut]["title"] # "efficiency_" + histo + ", " + categories[tracker][cut]["title"]
) # )
# get efficiency for not electrons category # # get efficiency for not electrons category
histoName = histoBaseName + "" + efficiencyHistoDict[histo]["variable"] # histoName = histoBaseName + "" + efficiencyHistoDict[histo]["variable"]
print("not electrons: " + histoName.replace(unique_name_ext_re(), "")) # print("not electrons: " + histoName.replace(unique_name_ext_re(), ""))
eff = {} # eff = {}
hist_den = {} # hist_den = {}
eff, hist_den = get_eff(eff, hist_den, tf, histoName, label, histo) # eff, hist_den = get_eff(eff, hist_den, tf, histoName, label, histo)
if categories[tracker][cut]["plotElectrons"] and plot_electrons: # if categories[tracker][cut]["plotElectrons"] and plot_electrons:
histoNameElec = ( # histoNameElec = (
"Track/" # "Track/"
+ folder # + folder
+ tracker # + tracker
+ "/" # + "/"
+ categories[tracker][cut]["Electrons"] # + categories[tracker][cut]["Electrons"]
) # )
histoName_e = ( # histoName_e = (
histoNameElec + "_" + efficiencyHistoDict[histo]["variable"] # histoNameElec + "_" + efficiencyHistoDict[histo]["variable"]
) # )
print("electrons: " + histoName_e.replace(unique_name_ext_re(), "")) # print("electrons: " + histoName_e.replace(unique_name_ext_re(), ""))
eff_elec = {} # eff_elec = {}
hist_elec = {} # hist_elec = {}
eff_elec, hist_elec = get_eff( # eff_elec, hist_elec = get_eff(
eff_elec, # eff_elec,
hist_elec, # hist_elec,
tf, # tf,
histoName_e, # histoName_e,
label, # label,
histo, # histo,
) # )
if ( # if (
categories[tracker][cut]["plotEndVelo"] # categories[tracker][cut]["plotEndVelo"]
and plot_velo # and plot_velo
and (histo == "p" or histo == "pt") # and (histo == "p" or histo == "pt")
): # ):
histoNameEndVelo = ( # histoNameEndVelo = (
"Track/" # "Track/"
+ folder # + folder
+ tracker # + tracker
+ "/" # + "/"
+ categories[tracker][cut]["EndVelo"] # + categories[tracker][cut]["EndVelo"]
) # )
histoName_v = ( # histoName_v = (
histoNameEndVelo # histoNameEndVelo
+ "_" # + "_"
+ efficiencyHistoDict[histo]["variable"] # + efficiencyHistoDict[histo]["variable"]
) # )
print( # print(
"EndVelo: " + histoName_v.replace(unique_name_ext_re(), "") # "EndVelo: " + histoName_v.replace(unique_name_ext_re(), "")
) # )
eff_velo = {} # eff_velo = {}
hist_velo = {} # hist_velo = {}
eff_velo, hist_velo = get_eff( # eff_velo, hist_velo = get_eff(
eff_velo, # eff_velo,
hist_velo, # hist_velo,
tf, # tf,
histoName_v, # histoName_v,
label, # label,
histo, # histo,
) # )
name = "efficiency_" + histo # name = "efficiency_" + histo
canvas = TCanvas(name, canvastitle) # canvas = TCanvas(name, canvastitle)
canvas.SetRightMargin(0.1) # canvas.SetRightMargin(0.1)
mg = TMultiGraph() # mg = TMultiGraph()
for i, lab in enumerate(label): # for i, lab in enumerate(label):
if not plot_electrons_only: # and not plot_velo_only: # if not plot_electrons_only: # and not plot_velo_only:
mg.Add(eff[lab]) # mg.Add(eff[lab])
set_style(eff[lab], colors[i], markers[i], styles[i]) # set_style(eff[lab], colors[i], markers[i], styles[i])
if categories[tracker][cut]["plotElectrons"] and plot_electrons: # if categories[tracker][cut]["plotElectrons"] and plot_electrons:
if not plot_velo_only or ( # if not plot_velo_only or (
histo == "phi" or histo == "eta" or histo == "nPV" # histo == "phi" or histo == "eta" or histo == "nPV"
): # ):
mg.Add(eff_elec[lab]) # mg.Add(eff_elec[lab])
set_style( # set_style(
eff_elec[lab], elec_colors[i], markers[i], styles[i] # eff_elec[lab], elec_colors[i], markers[i], styles[i]
) # )
if ( # if (
categories[tracker][cut]["plotEndVelo"] # categories[tracker][cut]["plotEndVelo"]
and plot_velo # and plot_velo
and (histo == "p" or histo == "pt") # and (histo == "p" or histo == "pt")
): # ):
mg.Add(eff_velo[lab]) # mg.Add(eff_velo[lab])
set_style(eff_velo[lab], kBlue - 7, markers[i], styles[i]) # set_style(eff_velo[lab], kBlue - 7, markers[i], styles[i])
mg.Draw("AP") # mg.Draw("AP")
mg.GetYaxis().SetRangeUser(0, 1.05) # mg.GetYaxis().SetRangeUser(0, 1.05)
xtitle = efficiencyHistoDict[histo]["xTitle"] # xtitle = efficiencyHistoDict[histo]["xTitle"]
unit_l = xtitle.split("[") # unit_l = xtitle.split("[")
if "]" in unit_l[-1]: # if "]" in unit_l[-1]:
unit = unit_l[-1].replace("]", "") # unit = unit_l[-1].replace("]", "")
else: # else:
unit = "a.u." # unit = "a.u."
print(unit) # print(unit)
mg.GetXaxis().SetTitle(xtitle) # mg.GetXaxis().SetTitle(xtitle)
mg.GetXaxis().SetTitleSize(0.06) # mg.GetXaxis().SetTitleSize(0.06)
mg.GetYaxis().SetTitle( # mg.GetYaxis().SetTitle(
"Efficiency of Long Tracks", # "Efficiency of Long Tracks",
) # (" + str(round(hist_den[label[0]].GetBinWidth(1), 2)) + f"{unit})"+"^{-1}") # ) # (" + str(round(hist_den[label[0]].GetBinWidth(1), 2)) + f"{unit})"+"^{-1}")
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)
mygray = 18 # mygray = 18
myblue = kBlue - 10 # myblue = kBlue - 10
mypurple = kMagenta - 10 # mypurple = kMagenta - 10
for i, lab in enumerate(label): # for i, lab in enumerate(label):
rightmax = 1.05 * hist_den[lab].GetMaximum() # rightmax = 1.05 * hist_den[lab].GetMaximum()
scale = gPad.GetUymax() / rightmax # scale = gPad.GetUymax() / rightmax
hist_den[lab].Scale(scale) # hist_den[lab].Scale(scale)
if categories[tracker][cut]["plotElectrons"] and plot_electrons: # if categories[tracker][cut]["plotElectrons"] and plot_electrons:
rightmax = 1.05 * hist_elec[lab].GetMaximum() # rightmax = 1.05 * hist_elec[lab].GetMaximum()
scale = gPad.GetUymax() / rightmax # scale = gPad.GetUymax() / rightmax
hist_elec[lab].Scale(scale) # hist_elec[lab].Scale(scale)
if ( # if (
categories[tracker][cut]["plotEndVelo"] # categories[tracker][cut]["plotEndVelo"]
and plot_velo # and plot_velo
and (histo == "p" or histo == "pt") # and (histo == "p" or histo == "pt")
): # ):
rightmax = 1.05 * hist_velo[lab].GetMaximum() # rightmax = 1.05 * hist_velo[lab].GetMaximum()
scale = gPad.GetUymax() / rightmax # scale = gPad.GetUymax() / rightmax
hist_velo[lab].Scale(scale) # hist_velo[lab].Scale(scale)
if i == 0: # if i == 0:
if not plot_electrons_only: # and not plot_velo_only: # if not plot_electrons_only: # and not plot_velo_only:
set_style(hist_den[lab], mygray, markers[i], styles[i]) # set_style(hist_den[lab], mygray, markers[i], styles[i])
gStyle.SetPalette(2, array("i", [mygray - 1, myblue + 1])) # gStyle.SetPalette(2, array("i", [mygray - 1, myblue + 1]))
hist_den[lab].Draw("HIST PLC SAME") # hist_den[lab].Draw("HIST PLC SAME")
if categories[tracker][cut]["plotElectrons"] and plot_electrons: # if categories[tracker][cut]["plotElectrons"] and plot_electrons:
if not plot_velo_only or ( # if not plot_velo_only or (
histo == "phi" or histo == "eta" or histo == "nPV" # histo == "phi" or histo == "eta" or histo == "nPV"
): # ):
set_style(hist_elec[lab], myblue, markers[i], styles[i]) # set_style(hist_elec[lab], myblue, markers[i], styles[i])
hist_elec[lab].SetFillColorAlpha(myblue, 0.5) # hist_elec[lab].SetFillColorAlpha(myblue, 0.5)
hist_elec[lab].Draw("HIST PLC SAME") # hist_elec[lab].Draw("HIST PLC SAME")
if ( # if (
categories[tracker][cut]["plotEndVelo"] # categories[tracker][cut]["plotEndVelo"]
and plot_velo # and plot_velo
and (histo == "p" or histo == "pt") # and (histo == "p" or histo == "pt")
): # ):
set_style(hist_velo[lab], myblue, markers[i], styles[i]) # set_style(hist_velo[lab], myblue, markers[i], styles[i])
hist_velo[lab].SetFillColorAlpha(myblue, 0.5) # hist_velo[lab].SetFillColorAlpha(myblue, 0.5)
hist_velo[lab].Draw("HIST PLC SAME") # hist_velo[lab].Draw("HIST PLC SAME")
# else: # # else:
# print( # # print(
# "No distribution plotted for other labels.", # # "No distribution plotted for other labels.",
# "Can be added by uncommenting the code below this print statement.", # # "Can be added by uncommenting the code below this print statement.",
# ) # # )
# set_style(hist_den[lab], mygray, markers[i], styles[i]) # # set_style(hist_den[lab], mygray, markers[i], styles[i])
# gStyle.SetPalette(2, array("i", [mygray - 1, myblue + 1])) # # gStyle.SetPalette(2, array("i", [mygray - 1, myblue + 1]))
# hist_den[lab].Draw("HIST PLC SAME") # # hist_den[lab].Draw("HIST PLC SAME")
if histo == "p": # if histo == "p":
pos = [0.5, 0.3, 1.0, 0.5] # [0.53, 0.4, 1.01, 0.71] # pos = [0.5, 0.3, 1.0, 0.5] # [0.53, 0.4, 1.01, 0.71]
elif histo == "pt": # elif histo == "pt":
pos = [0.5, 0.3, 0.99, 0.5] # [0.5, 0.4, 0.98, 0.71] # pos = [0.5, 0.3, 0.99, 0.5] # [0.5, 0.4, 0.98, 0.71]
elif histo == "phi": # elif histo == "phi":
pos = [0.4, 0.3, 0.9, 0.5] # pos = [0.4, 0.3, 0.9, 0.5]
elif histo == "eta": # elif histo == "eta":
pos = [0.5, 0.25, 1.0, 0.45] # pos = [0.5, 0.25, 1.0, 0.45]
else: # else:
pos = [0.35, 0.25, 0.85, 0.45] # pos = [0.35, 0.25, 0.85, 0.45]
legend = place_legend( # legend = place_legend(
canvas, *pos, header="LHCb Simulation", option="LPE" # canvas, *pos, header="LHCb Simulation", option="LPE"
) # )
for le in legend.GetListOfPrimitives(): # for le in legend.GetListOfPrimitives():
if "distribution" in le.GetLabel(): # if "distribution" in le.GetLabel():
le.SetOption("LF") # le.SetOption("LF")
legend.SetTextFont(132) # legend.SetTextFont(132)
legend.SetTextSize(0.04) # legend.SetTextSize(0.04)
legend.Draw() # legend.Draw()
for lab in label: # for lab in label:
if not plot_electrons_only: # and not plot_velo_only: # if not plot_electrons_only: # and not plot_velo_only:
eff[lab].Draw("P SAME") # eff[lab].Draw("P SAME")
if categories[tracker][cut]["plotElectrons"] and plot_electrons: # if categories[tracker][cut]["plotElectrons"] and plot_electrons:
if not plot_velo_only or ( # if not plot_velo_only or (
histo == "phi" or histo == "eta" or histo == "nPV" # histo == "phi" or histo == "eta" or histo == "nPV"
): # ):
eff_elec[lab].Draw("P SAME") # eff_elec[lab].Draw("P SAME")
if ( # if (
categories[tracker][cut]["plotEndVelo"] # categories[tracker][cut]["plotEndVelo"]
and plot_velo # and plot_velo
and (histo == "p" or histo == "pt") # and (histo == "p" or histo == "pt")
): # ):
eff_velo[lab].Draw("P SAME") # eff_velo[lab].Draw("P SAME")
cutName = categories[tracker][cut]["title"] # cutName = categories[tracker][cut]["title"]
latex.DrawLatex(legend.GetX1() + 0.01, legend.GetY1() - 0.05, cutName) # latex.DrawLatex(legend.GetX1() + 0.01, legend.GetY1() - 0.05, cutName)
low = 0 # low = 0
high = 1.05 # high = 1.05
gPad.Update() # gPad.Update()
axis = TGaxis( # axis = TGaxis(
gPad.GetUxmax(), # gPad.GetUxmax(),
gPad.GetUymin(), # gPad.GetUymin(),
gPad.GetUxmax(), # gPad.GetUxmax(),
gPad.GetUymax(), # gPad.GetUymax(),
low, # low,
high, # high,
510, # 510,
"+U", # "+U",
) # )
axis.SetTitleFont(132) # axis.SetTitleFont(132)
axis.SetTitleSize(0.06) # axis.SetTitleSize(0.06)
axis.SetTitleOffset(0.55) # axis.SetTitleOffset(0.55)
axis.SetTitle( # axis.SetTitle(
"# Tracks " + get_nicer_var_string(histo) + " distribution [a.u.]", # "# Tracks " + get_nicer_var_string(histo) + " distribution [a.u.]",
) # )
axis.SetLabelSize(0) # axis.SetLabelSize(0)
axis.Draw() # axis.Draw()
canvas.RedrawAxis() # canvas.RedrawAxis()
if savepdf and False: # if savepdf and False:
filestypes = ["pdf"] # , "png", "eps", "C", "ps", "tex"] # filestypes = ["pdf"] # , "png", "eps", "C", "ps", "tex"]
for ftype in filestypes: # for ftype in filestypes:
if not plot_electrons_only: # if not plot_electrons_only:
canvasName = tracker + "_" + cut + "_" + histo + "." + ftype # canvasName = tracker + "_" + cut + "_" + histo + "." + ftype
else: # else:
canvasName = ( # canvasName = (
tracker + "Electrons_" + cut + "_" + histo + "." + ftype # tracker + "Electrons_" + cut + "_" + histo + "." + ftype
) # )
canvas.SaveAs("checks/" + canvasName) # canvas.SaveAs("checks/" + canvasName)
# 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: ")
histoBaseName = "Track/" + folder + tracker + "/" # histoBaseName = "Track/" + folder + tracker + "/"
for histo in ghostHistos[tracker]: # for histo in ghostHistos[tracker]:
trackerDir.cd() # trackerDir.cd()
title = "ghost_rate_vs_" + histo # title = "ghost_rate_vs_" + histo
gPad.SetTicks() # gPad.SetTicks()
histoName = histoBaseName + ghostHistoDict[histo]["variable"] # histoName = histoBaseName + ghostHistoDict[histo]["variable"]
ghost = {} # ghost = {}
hist_den = {} # hist_den = {}
ghost = get_ghost(ghost, hist_den, tf, histoName, label) # ghost = get_ghost(ghost, hist_den, tf, histoName, label)
canvas = TCanvas(title, title) # canvas = TCanvas(title, title)
mg = TMultiGraph() # mg = TMultiGraph()
for i, lab in enumerate(label): # for i, lab in enumerate(label):
mg.Add(ghost[lab]) # mg.Add(ghost[lab])
set_style(ghost[lab], colors[i], markers[2 * i], styles[i]) # set_style(ghost[lab], colors[i], markers[2 * i], styles[i])
# xtitle = ghostHistoDict[histo]["xTitle"]
# mg.GetXaxis().SetTitle(xtitle)
# mg.GetYaxis().SetTitle("Fraction of fake tracks")
# mg.Draw("ap")
# mg.GetXaxis().SetTitleSize(0.06)
# mg.GetYaxis().SetTitleSize(0.06)
# mg.GetYaxis().SetTitleOffset(1.1)
# mg.GetXaxis().SetRangeUser(*efficiencyHistoDict[histo]["range"])
# mg.GetXaxis().SetNdivisions(10, 5, 0)
# # for lab in label:
# # ghost[lab].Draw("P SAME")
# if histo == "p":
# pos = [0.53, 0.4, 1.00, 0.71]
# elif histo == "pt":
# pos = [0.5, 0.4, 0.98, 0.71]
# elif histo == "eta":
# pos = [0.35, 0.6, 0.85, 0.9]
# elif histo == "phi":
# pos = [0.3, 0.3, 0.9, 0.6]
# else:
# pos = [0.4, 0.37, 0.80, 0.68]
# legend = place_legend(canvas, *pos, header="LHCb Simulation", option="LPE")
# legend.SetTextFont(132)
# legend.SetTextSize(0.04)
# legend.Draw()
# # if histo != "nPV":
# # latex.DrawLatex(0.7, 0.85, "LHCb simulation")
# # else:
# # latex.DrawLatex(0.2, 0.85, "LHCb simulation")
# # mg.GetYaxis().SetRangeUser(0, 0.4)
# if histo == "eta":
# mg.GetYaxis().SetRangeUser(0, 0.4)
# # track_name = names[tracker] + " tracks"
# # latex.DrawLatex(0.7, 0.75, track_name)
# # canvas.PlaceLegend()
# if savepdf:
# filestypes = ["pdf"] # , "png", "eps", "C", "ps", "tex"]
# for ftype in filestypes:
# canvas.SaveAs(
# "checks/" + tracker + "ghost_rate_" + histo + "." + ftype,
# )
# canvas.Write()
xtitle = ghostHistoDict[histo]["xTitle"]
mg.GetXaxis().SetTitle(xtitle)
mg.GetYaxis().SetTitle("Fraction of fake tracks")
mg.Draw("ap")
mg.GetXaxis().SetTitleSize(0.06)
mg.GetYaxis().SetTitleSize(0.06)
mg.GetYaxis().SetTitleOffset(1.1)
mg.GetXaxis().SetRangeUser(*efficiencyHistoDict[histo]["range"])
mg.GetXaxis().SetNdivisions(10, 5, 0)
# for lab in label:
# ghost[lab].Draw("P SAME")
if histo == "p":
pos = [0.53, 0.4, 1.00, 0.71]
elif histo == "pt":
pos = [0.5, 0.4, 0.98, 0.71]
elif histo == "eta":
pos = [0.35, 0.6, 0.85, 0.9]
elif histo == "phi":
pos = [0.3, 0.3, 0.9, 0.6]
else:
pos = [0.4, 0.37, 0.80, 0.68]
legend = place_legend(canvas, *pos, header="LHCb Simulation", option="LPE")
legend.SetTextFont(132)
legend.SetTextSize(0.04)
legend.Draw()
# if histo != "nPV":
# latex.DrawLatex(0.7, 0.85, "LHCb simulation")
# else:
# latex.DrawLatex(0.2, 0.85, "LHCb simulation")
# mg.GetYaxis().SetRangeUser(0, 0.4)
if histo == "eta":
mg.GetYaxis().SetRangeUser(0, 0.4)
# track_name = names[tracker] + " tracks"
# latex.DrawLatex(0.7, 0.75, track_name)
# canvas.PlaceLegend()
if savepdf:
filestypes = ["pdf"] # , "png", "eps", "C", "ps", "tex"]
for ftype in filestypes:
canvas.SaveAs(
"checks/" + tracker + "ghost_rate_" + histo + "." + ftype,
)
canvas.Write()
# #
# Compare electron efficiencies of different trackers # Compare electron efficiencies of different trackers
# #
@ -832,7 +839,7 @@ def PrCheckerEfficiency(
set_style( set_style(
eff_elec[lab], eff_elec[lab],
colors[jcolor], colors[jcolor],
markers[i + markeritr], 22, # markers[i + markeritr],
styles[i], styles[i],
) )
else: else:
@ -857,7 +864,7 @@ def PrCheckerEfficiency(
set_style( set_style(
eff_elec[lab], eff_elec[lab],
colors[jcolor], colors[jcolor],
markers[i + markeritr], 22, # markers[i + markeritr],
styles[i], styles[i],
) )
else: else: