5 from array
import array
6 from pprint
import pprint
10 from ROOT
import TColor
12 inputfile =
"master_redo.txt" 19 with open(inputfile)
as f:
20 lines = [line.rstrip(
'\n').split()
for line
in open(inputfile)]
30 version =
"original_comparison" 40 if "mj_comparison" in version:
41 variations = [[
"MJdef_mj_",
"threshold_400"],[
"MJdef_mj_",
"threshold_350"],[
"MJdef_mj14",
"threshold_400"],[
"MJdef_mj14",
"threshold_350"]]
42 var_names = [
"R = 1.2, threshold = 400 GeV",
"R = 1.2, threshold = 350 GeV",
"R = 1.4, threshold = 400 GeV",
"R = 1.4, threshold = 350 GeV"]
43 var_colors = [36,36,49,49]
46 if "original_comparison" in version:
47 variations = [[
"binning_nominal",
"veto_off"],[
"binning_nominal",
"veto_on"],[
"binning_alternate",
"veto_off"],[
"binning_alternate",
"veto_on"]]
48 var_names = [
"RA4 2015",
"RA4 2015 + veto",
"Alternate binning",
"Alternate binning + veto"]
49 var_colors =[30,30,46,46]
52 var_linestyles = [1,7,1,7]
53 var_markerstyles = [20,22,20,22]
54 frames = [[
"mGluino-1600_mLSP-1000",
"sig_str0"],[
"mGluino-1600_mLSP-1000",
"sig_str1"],[
"mGluino-1800_mLSP-200",
"sig_str0"],[
"mGluino-1800_mLSP-200",
"sig_str1"],[
"mGluino-1400_mLSP-1000",
"sig_str0"],[
"mGluino-1400_mLSP-1000",
"sig_str1"]]
55 frame_titles = [
"T1tttt(1600,1000) Limit",
"T1tttt(1600,1000) Significance",
"T1tttt(1800,200) Limit",
"T1tttt(1800,200) Significance",
"T1tttt(1400,1000) Limit",
"T1tttt(1400,1000) Significance"]
65 ROOT.gROOT.SetBatch(ROOT.kTRUE)
66 ROOT.gStyle.SetCanvasDefW(600);
67 ROOT.gStyle.SetCanvasDefH(600);
68 ROOT.gStyle.SetTitleOffset(1.2,
"x")
69 ROOT.gStyle.SetTitleOffset(1.7,
"y")
70 ROOT.gStyle.SetPadLeftMargin(0.14)
71 ROOT.gStyle.SetPadBottomMargin(0.14)
72 ROOT.gStyle.SetLabelFont(42)
73 ROOT.gStyle.SetTitleFont(42)
81 for ifr,frame
in enumerate(frames):
83 for var
in variations:
87 for attribute
in frame:
88 if attribute
not in line[0]:
93 if attribute
not in line[0]:
99 xval = line[0].split(xvariable)[1].split(
"_")[0].split(
"ifb")[0]
100 pairs.append([float(xval),float(yval)])
104 x = [pair[0]
for pair
in pairs]
105 y = [pair[1]
for pair
in pairs]
106 graph = ROOT.TGraph(len(x),array(
"d",x),array(
"d",y))
110 leg = ROOT.TLegend(0.14,0.7,0.48,0.9)
113 title = frame_titles[ifr]+
";Luminosity [ifb]; Expected Significance;" 114 if "sig_str0" in frame:
117 title = frame_titles[ifr]+
";Luminosity [ifb]; Expected Limit;" 119 histframe = ROOT.TH2F(
"frame",
"",10,xmin,xmax,10,ymin,ymax)
121 histframe.SetStats(0)
123 histframe.SetTitle(title)
125 for i,graph
in enumerate(graphs):
126 graph.SetName(var_names[i])
127 graph.SetLineColor(var_colors[i])
128 graph.SetLineStyle(var_linestyles[i])
129 graph.SetMarkerColor(var_colors[i])
130 graph.SetMarkerStyle(var_markerstyles[i])
132 graph.Draw(
"lp same")
133 leg.AddEntry(graph,var_names[i],
"lp")
136 c.Print(version+
"_"+frame[0]+
"_"+frame[1]+
".pdf")