if [masspoint,i,j] in codes: contour.SetLineWidth(703) contour.SetFillStyle(3005) contour.SetFillColor(2) #contour.Draw('c') tutti.append(contour.Clone()) if masspoint in [3,4]: xcont=array('d',[0,1]) ycont=array('d',[1,0]) allcont=TGraph(2,ycont,xcont) allcont.SetLineWidth(706) allcont.SetFillStyle(3005) allcont.SetFillColor(2) allcont.SetLineColor(2) #allcont.Draw('c') tutti.append(allcont.Clone()) if masspoint in [2]: xcont=array('d',[0]) ycont=array('d',[0]) allcont=TGraph(1,ycont,xcont) allcont.SetLineWidth(706) allcont.SetFillStyle(3005) allcont.SetFillColor(2) allcont.SetLineColor(2) #allcont.Draw('c') tutti.append(allcont.Clone()) #print conts #print conts.GetSize()
def plotUpperLimits(model, lambdas, helicity): N = len(lambdas) #yellow = TGraph(2*N) # yellow band #green = TGraph(2*N) # green band #median = TGraph(N) # median line Mmin = [100 + i * 100 for i in range(40)] graphs = [] for i in range(N): thislam = TGraph(len(Mmin)) thislimit = [] for mm in range(len(Mmin)): file_name = "./%sdataCards/ee_signif%s/higgsCombine%d.Significance.mH%d.root" % ( model, helicity, Mmin[mm], lambdas[i]) limit = getLimits(file_name) thislam.SetPoint(mm, Mmin[mm], limit[0]) thislam.SetLineColor(i + 2) thislam.SetLineWidth(2) thislimit.append(limit[0]) graphs.append(thislam.Clone()) print "this minimum mass cut is %d" % Mmin[mm] print thislimit #yellow.SetPoint( i, values[i], limit[4] ) # + 2 sigma #green.SetPoint( i, values[i], limit[3] ) # + 1 sigma #median.SetPoint( i, labels[i], limit[0] ) # median #green.SetPoint( 2*N-1-i, values[i], limit[1] ) # - 1 sigma #yellow.SetPoint( 2*N-1-i, values[i], limit[0] ) # - 2 sigma W = 800 H = 600 T = 0.08 * H B = 0.12 * H L = 0.12 * W R = 0.04 * W c = TCanvas("c", "c", 100, 100, W, H) c.SetFillColor(0) c.SetBorderMode(0) c.SetFrameFillStyle(0) c.SetFrameBorderMode(0) c.SetLeftMargin(L / W) c.SetRightMargin(R / W) c.SetTopMargin(T / H) c.SetBottomMargin(B / H) c.SetTickx(0) c.SetTicky(0) c.SetGrid() c.cd() if model == "ADD": frame = c.DrawFrame(100, 0.01, 4000, 22) elif "Con" in helicity: frame = c.DrawFrame(100, 0.01, 4000, 15) else: frame = c.DrawFrame(100, 0.01, 4000, 10) frame.GetYaxis().CenterTitle() frame.GetYaxis().SetTitleSize(0.05) frame.GetXaxis().SetTitleSize(0.05) frame.GetXaxis().SetLabelSize(0.04) frame.GetYaxis().SetLabelSize(0.04) frame.GetYaxis().SetTitleOffset(0.9) frame.GetXaxis().SetNdivisions(508) frame.GetYaxis().CenterTitle(True) frame.GetYaxis().SetTitle("Significance") frame.GetXaxis().SetTitle("M_{min} [GeV]") frame.SetMinimum(0) #frame.SetMaximum(max(up2s)*1.05) #frame.GetXaxis().SetLimits(min(values),max(values)) for gf in graphs: gf.Draw('Lsame') ''' yellow.SetFillColor(ROOT.kOrange) yellow.SetLineColor(ROOT.kOrange) yellow.SetFillStyle(1001) yellow.Draw('F') green.SetFillColor(ROOT.kGreen+1) green.SetLineColor(ROOT.kGreen+1) green.SetFillStyle(1001) green.Draw('Fsame') median.SetLineColor(1) median.SetLineWidth(2) median.SetLineStyle(2) median.Draw('Lsame')''' CMS_lumi.CMS_lumi(c, 13, 11) ROOT.gPad.SetTicks(1, 1) frame.Draw('sameaxis') x1 = 0.75 x2 = x1 + 0.24 y2 = 0.86 y1 = 0.60 legend = TLegend(x1, y1, x2, y2) legend.SetFillStyle(0) legend.SetBorderSize(0) legend.SetTextSize(0.041) legend.SetTextFont(42) for i in range(N): legend.AddEntry(graphs[i], "#Lambda = %d" % lambdas[i], 'l') #legend.AddEntry(median, "Asymptotic CL_{s} expected",'L') #legend.AddEntry(green, "#pm 1 std. deviation",'f') #legend.AddEntry(green, "Asymptotic CL_{s} #pm 1 std. deviation",'f') #legend.AddEntry(yellow,"#pm 2 std. deviation",'f') #legend.AddEntry(green, "Asymptotic CL_{s} #pm 2 std. deviation",'f') legend.Draw() print " " c.SaveAs("%slimits/%sSignificance_ee%s.png" % (model, model, helicity)) c.Close()
else: gr1 = TGraph() dumb = drawlik(options.input, gr = gr1, color = 53, second = False, Folder = options.outFolder) gr1 = dumb.Clone() gr1.GetYaxis().SetRangeUser(0.,3.) gr1.Draw("Ap") mg.Add(gr1) colorset(gr = gr1, color = 53) leg.AddEntry(gr1, options.label, 'Lp') entries += 1 if options.input2 != "none" : gr2 = TGraph() dumb = TGraph() dumb = drawlik(options.input2, gr = gr2, color = 8, second = False, Folder = options.outFolder2) gr2 = dumb.Clone() gr2.GetYaxis().SetRangeUser(0.,3.) gr2.Draw("p, same") mg.Add(gr2) colorset(gr = gr2, color = 6) leg.AddEntry(gr2, options.label2, 'Lp') entries += 1 if options.input3 != "none" : gr3 = TGraph() dumb = drawlik(options.input3, gr = gr3, color = 93, second = False, Folder = options.outFolder3) gr3 = dumb.Clone() gr3.GetYaxis().SetRangeUser(0.,3.) gr3.Draw("p, same") #gr3.Draw("p, same") mg.Add(gr3)
x_1110_2 = array('d', x1110[nwa1110:]) y_theory1110 = array('d', theory1110[:nwa1110 + 1]) y_theory1110_2 = array('d', theory1110[nwa1110:]) theory_curve_1110 = TGraph(len(theory1110[:nwa1110 + 1]), x_1110, y_theory1110) theory_curve_1110_2 = TGraph(len(theory1110[nwa1110:]), x_1110_2, y_theory1110_2) #theory_curve_1410=TGraph(len(theory1410),x_1410,y_theory1410) theory_curve_1110.SetLineWidth(3) theory_curve_1110.SetLineColor(kAzure) theory_curve_1110.SetMarkerColor(kAzure) theory_curve_1110_2.SetLineWidth(3) theory_curve_1110_2.SetLineColor(kAzure) theory_curve_1110_2.SetMarkerColor(kAzure) theory_curve_1110_2.SetLineStyle(7) theory_curve_1110_33 = theory_curve_1110_2.Clone() theory_curve_1110_33.SetLineColor(1) theory_curve_1110_33.SetMarkerColor(1) theory_curve_1410.SetLineWidth(3) theory_curve_1410.SetLineColor(kGreen + 3) theory_curve_1410.SetMarkerColor(kGreen + 3) theory_curve_1410_2.SetLineWidth(3) theory_curve_1410_2.SetLineColor(kGreen + 3) theory_curve_1410_2.SetMarkerColor(kGreen + 3) theory_curve_1410_2.SetLineStyle(7) zeros_theory = array('d', [0 for i in range(len(theory_values[1]))]) theory_sigma = TGraphAsymmErrors(len(theory_values[1]), x_theory, y_theory, zeros_theory, zeros_theory, y_theory_down, y_theory_up)
g_width.GetYaxis().SetTitleSize(0.05) g_width.GetYaxis().SetLabelSize(0.05) g_width.GetYaxis().SetTitleOffset(0.8) g_width.GetYaxis().SetRangeUser(0., mass * 0.12) g_width.GetXaxis().SetTitleSize(0.05) g_width.GetXaxis().SetLabelSize(0.05) g_width.GetXaxis().SetTitleOffset(0.88) g_partial_width.SetLineColor(4) g_partial_width.SetLineWidth(3003) g_partial_width.SetFillStyle(3002) g_partial_width.Draw('C') legend = TLegend(0.15, 0.6, 0.4, 0.85) legend.AddEntry(g_width, 'Total width', 'l') legend.AddEntry(g_partial_width, 'Partial width (t#bar{t})', 'l') g_partial_width_excl = g_partial_width.Clone('g_partial_width_excl') g_partial_width_excl.SetLineWidth(0) g_partial_width_excl.SetLineColor(0) legend.AddEntry(g_partial_width_excl, 'Forbidden', 'f') legend.AddEntry(p_25percent, 'Sample (2.5% width)', 'p') legend.AddEntry(p_5percent, 'Sample (5% width)', 'p') legend.AddEntry(p_10percent, 'Sample (10% width)', 'p') legend.SetBorderSize(0) legend.Draw() c.Print('width_vs_tanb_mA{mass}.pdf'.format(mass=int(mass)))
zeros = array('d', [0] * len(lines_exp)) print lumi for i in range(len(lines_exp)): print masses[i], '&', rounding(lines_exp[i][2]), '&', rounding( lines_exp[i][4]), '&', rounding(lines_exp[i][1]), '&', rounding( lines_exp[i][5]), '&', rounding(lines_exp[i][3]), '\\\\' exp1sigma = ROOT.TGraphAsymmErrors(5, x, y_exp, zeros, zeros, y_err1down, y_err1up) exp2sigma = ROOT.TGraphAsymmErrors(5, x, y_exp, zeros, zeros, y_err2down, y_err2up) explim = TGraph(5, x, y_exp) explim.SetLineWidth(2) explim.SetLineStyle(2) explim.SetTitle('') limits.append(explim.Clone()) exp2sigma.SetTitle('') exp1sigma.SetTitle('') exp1sigma.SetFillColor(ROOT.kGreen + 1) exp2sigma.SetFillColor(ROOT.kOrange) exp2sigma.SetMaximum(10000) exp2sigma.SetMinimum(0.0007) exp2sigma.Draw('a3lp') exp2sigma.GetXaxis().SetTitle("g_{KK} mass [TeV]") exp2sigma.GetXaxis().SetRangeUser(1500, 6500) exp2sigma.GetYaxis().SetTitle("Upper cross section limit [pb]") sizefactor = 1.5 exp2sigma.GetXaxis().SetTitleSize(sizefactor * exp2sigma.GetXaxis().GetTitleSize())