Skip to content
Snippets Groups Projects

fix the hash code issue of PrCheckerSummary handlers

Closed Xueting Yang requested to merge xueting_fix_eff_handlers_hashes_issue into master
2 files
+ 100
60
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -43,15 +43,15 @@ def effPlotsDict_long():
}
basedict["Pt"][
"path"] = "Track/BestLongTrackChecker_2b1808e5/BestLong/01_long_Pt"
"path"] = "/BestLong/01_long_Pt"
basedict["P"][
"path"] = "Track/BestLongTrackChecker_2b1808e5/BestLong/01_long_P"
"path"] = "/BestLong/01_long_P"
basedict["Eta"][
"path"] = "Track/BestLongTrackChecker_2b1808e5/BestLong/01_long_Eta"
"path"] = "/BestLong/01_long_Eta"
basedict["nPV"][
"path"] = "Track/BestLongTrackChecker_2b1808e5/BestLong/01_long_nPV"
"path"] = "/BestLong/01_long_nPV"
basedict["docaz"][
"path"] = "Track/BestLongTrackChecker_2b1808e5/BestLong/01_long_docaz"
"path"] = "/BestLong/01_long_docaz"
basedict["Pt"]["unit"] = "pT [MeV]"
basedict["P"]["unit"] = "p [MeV]"
basedict["Eta"]["unit"] = "#eta [-]"
@@ -79,15 +79,15 @@ def effPlotsDict_down():
}
basedict["Pt"][
"path"] = "Track/BestDownstreamTrackChecker_16cf5e80/BestDownstream/01_UT+T_Pt"
"path"] = "/BestDownstream/01_UT+T_Pt"
basedict["P"][
"path"] = "Track/BestDownstreamTrackChecker_16cf5e80/BestDownstream/01_UT+T_P"
"path"] = "/BestDownstream/01_UT+T_P"
basedict["Eta"][
"path"] = "Track/BestDownstreamTrackChecker_16cf5e80/BestDownstream/01_UT+T_Eta"
"path"] = "/BestDownstream/01_UT+T_Eta"
basedict["nPV"][
"path"] = "Track/BestDownstreamTrackChecker_16cf5e80/BestDownstream/01_UT+T_nPV"
"path"] = "/BestDownstream/01_UT+T_nPV"
basedict["docaz"][
"path"] = "Track/BestDownstreamTrackChecker_16cf5e80/BestDownstream/01_UT+T_docaz"
"path"] = "/BestDownstream/01_UT+T_docaz"
basedict["Pt"]["unit"] = "pT [MeV]"
basedict["P"]["unit"] = "p [MeV]"
basedict["Eta"]["unit"] = "#eta [-]"
@@ -115,15 +115,15 @@ def effPlotsDict_forward():
}
basedict["Pt"][
"path"] = "Track/ForwardTrackChecker_38a3d1fd/Forward/01_long_Pt"
"path"] = "/Forward/01_long_Pt"
basedict["P"][
"path"] = "Track/ForwardTrackChecker_38a3d1fd/Forward/01_long_P"
"path"] = "/Forward/01_long_P"
basedict["Eta"][
"path"] = "Track/ForwardTrackChecker_38a3d1fd/Forward/01_long_Eta"
"path"] = "/Forward/01_long_Eta"
basedict["nPV"][
"path"] = "Track/ForwardTrackChecker_38a3d1fd/Forward/01_long_nPV"
"path"] = "/Forward/01_long_nPV"
basedict["docaz"][
"path"] = "Track/ForwardTrackChecker_38a3d1fd/Forward/01_long_docaz"
"path"] = "/Forward/01_long_docaz"
basedict["Pt"]["unit"] = "pT [MeV]"
basedict["P"]["unit"] = "p [MeV]"
basedict["Eta"]["unit"] = "#eta [-]"
@@ -151,15 +151,15 @@ def effPlotsDict_velo():
}
basedict["Pt"][
"path"] = "Track/VeloFullTrackChecker_b448179f/VeloFull/01_notElectron_Velo_Pt"
"path"] = "/VeloFull/01_notElectron_Velo_Pt"
basedict["P"][
"path"] = "Track/VeloFullTrackChecker_b448179f/VeloFull/01_notElectron_Velo_P"
"path"] = "/VeloFull/01_notElectron_Velo_P"
basedict["Eta"][
"path"] = "Track/VeloFullTrackChecker_b448179f/VeloFull/01_notElectron_Velo_Eta"
"path"] = "/VeloFull/01_notElectron_Velo_Eta"
basedict["nPV"][
"path"] = "Track/VeloFullTrackChecker_b448179f/VeloFull/01_notElectron_Velo_nPV"
"path"] = "/VeloFull/01_notElectron_Velo_nPV"
basedict["docaz"][
"path"] = "Track/VeloFullTrackChecker_b448179f/VeloFull/01_notElectron_Velo_docaz"
"path"] = "/VeloFull/01_notElectron_Velo_docaz"
basedict["Pt"]["unit"] = "pT [MeV]"
basedict["P"]["unit"] = "p [MeV]"
basedict["Eta"]["unit"] = "#eta [-]"
@@ -186,14 +186,14 @@ def effPlotsDict_ttrack():
"docaz": {},
}
basedict["Pt"]["path"] = "Track/SeedTrackChecker_6f38a9cb/Seed/01_hasT_Pt"
basedict["P"]["path"] = "Track/SeedTrackChecker_6f38a9cb/Seed/01_hasT_P"
basedict["Pt"]["path"] = "/Seed/01_hasT_Pt"
basedict["P"]["path"] = "/Seed/01_hasT_P"
basedict["Eta"][
"path"] = "Track/SeedTrackChecker_6f38a9cb/Seed/01_hasT_Eta"
"path"] = "/Seed/01_hasT_Eta"
basedict["nPV"][
"path"] = "Track/SeedTrackChecker_6f38a9cb/Seed/01_hasT_nPV"
"path"] = "/Seed/01_hasT_nPV"
basedict["docaz"][
"path"] = "Track/SeedTrackChecker_6f38a9cb/Seed/01_hasT_docaz"
"path"] = "/Seed/01_hasT_docaz"
basedict["Pt"]["unit"] = "pT [MeV]"
basedict["P"]["unit"] = "p [MeV]"
basedict["Eta"]["unit"] = "#eta [-]"
@@ -238,6 +238,30 @@ class PrCheckerSummaryHandler(BaseHandler):
inputfile = ROOT.TFile.Open(os.path.join(directory, rootfile), 'read')
outputfile = ROOT.TFile("PrCheckerSummary.root", "recreate")
path_long = "Track/BestLongTrackChecker_"
path_down = "Track/BestDownstreamTrackChecker_"
path_forward = "Track/ForwardTrackChecker_"
path_velo = "Track/VeloFullTrackChecker_"
path_ttrack = "Track/SeedTrackChecker_"
#Get the hash codes
Trackfile = inputfile.GetDirectory("Track")
keys = Trackfile.GetListOfKeys()
for key in keys:
obj = key.ReadObj()
path = obj.GetPath()
if path_long in path:
pattern_long = path.split("_")[-1]
if path_down in path:
pattern_down = path.split("_")[-1]
if path_forward in path:
pattern_forward = path.split("_")[-1]
if path_velo in path:
pattern_velo = path.split("_")[-1]
if path_ttrack in path:
pattern_ttrack = path.split("_")[-1]
from .utils.LHCbStyle import setLHCbStyle
from .utils.Legend import place_legend
@@ -264,11 +288,13 @@ class PrCheckerSummaryHandler(BaseHandler):
effPlots_ttrack = getEffPlots_ttrack()
eff_dict_ttrack = effPlotsDict_ttrack()
#Put the hash codes inside the path
for effPlot in effPlots_long:
outputfile.cd("long")
effNom = inputfile.Get(eff_dict_long[effPlot]["path"] +
print(effPlot)
effNom = inputfile.Get(path_long+pattern_long+eff_dict_long[effPlot]["path"] +
"_reconstructed")
effDenom = inputfile.Get(eff_dict_long[effPlot]["path"] +
effDenom = inputfile.Get(path_long+pattern_long+eff_dict_long[effPlot]["path"] +
"_reconstructible")
canvas_eff = ROOT.TCanvas(effPlot, effPlot)
efficiency = ROOT.TGraphAsymmErrors()
@@ -302,9 +328,9 @@ class PrCheckerSummaryHandler(BaseHandler):
for effPlot in effPlots_down:
outputfile.cd("down")
effNom = inputfile.Get(eff_dict_down[effPlot]["path"] +
effNom = inputfile.Get(path_down+pattern_down+eff_dict_down[effPlot]["path"] +
"_reconstructed")
effDenom = inputfile.Get(eff_dict_down[effPlot]["path"] +
effDenom = inputfile.Get(path_down+pattern_down+eff_dict_down[effPlot]["path"] +
"_reconstructible")
canvas_eff = ROOT.TCanvas(effPlot, effPlot)
efficiency = ROOT.TGraphAsymmErrors()
@@ -338,9 +364,9 @@ class PrCheckerSummaryHandler(BaseHandler):
for effPlot in effPlots_forward:
outputfile.cd("forward")
effNom = inputfile.Get(eff_dict_forward[effPlot]["path"] +
effNom = inputfile.Get(path_forward+pattern_forward+eff_dict_forward[effPlot]["path"] +
"_reconstructed")
effDenom = inputfile.Get(eff_dict_forward[effPlot]["path"] +
effDenom = inputfile.Get(path_forward+pattern_forward+eff_dict_forward[effPlot]["path"] +
"_reconstructible")
canvas_eff = ROOT.TCanvas(effPlot, effPlot)
efficiency = ROOT.TGraphAsymmErrors()
@@ -374,9 +400,9 @@ class PrCheckerSummaryHandler(BaseHandler):
for effPlot in effPlots_velo:
outputfile.cd("velo")
effNom = inputfile.Get(eff_dict_velo[effPlot]["path"] +
effNom = inputfile.Get(path_velo+pattern_velo+eff_dict_velo[effPlot]["path"] +
"_reconstructed")
effDenom = inputfile.Get(eff_dict_velo[effPlot]["path"] +
effDenom = inputfile.Get(path_velo+pattern_velo+eff_dict_velo[effPlot]["path"] +
"_reconstructible")
canvas_eff = ROOT.TCanvas(effPlot, effPlot)
efficiency = ROOT.TGraphAsymmErrors()
@@ -410,9 +436,9 @@ class PrCheckerSummaryHandler(BaseHandler):
for effPlot in effPlots_ttrack:
outputfile.cd("ttrack")
effNom = inputfile.Get(eff_dict_ttrack[effPlot]["path"] +
effNom = inputfile.Get(path_ttrack+pattern_ttrack+eff_dict_ttrack[effPlot]["path"] +
"_reconstructed")
effDenom = inputfile.Get(eff_dict_ttrack[effPlot]["path"] +
effDenom = inputfile.Get(path_ttrack+pattern_ttrack+eff_dict_ttrack[effPlot]["path"] +
"_reconstructible")
canvas_eff = ROOT.TCanvas(effPlot, effPlot)
efficiency = ROOT.TGraphAsymmErrors()
Loading