Ejemplo n.º 1
0
def getEff(name, den_input, num_input, rebin=0, xtitle='', ytitle=''):
    c = TCanvas(name + '_Canvas')
    legend = TLegend(0.8, 0.1, 0.999, 0.6)
    legend.SetFillColor(kWhite)
    den = den_input.Clone()
    num = num_input.Clone()
    if rebin != 0:
        den.Rebin(rebin)
        num.Rebin(rebin)
    error_bars = TGraphAsymmErrors()
    error_bars.Divide(num, den, "cl=0.683 b(1,1) mode")
    error_bars.SetLineWidth(3)
    if xtitle == '':
        error_bars.GetXaxis().SetTitle(num.GetXaxis().GetTitle())
    else:
        error_bars.GetXaxis().SetTitle(xtitle)
    if ytitle == '':
        error_bars.GetYaxis().SetTitle(num.GetYaxis().GetTitle())
    else:
        error_bars.GetYaxis().SetTitle(ytitle)
    error_bars.GetXaxis().SetRangeUser(400, 2000)
    error_bars.SetLineColor(kBlack)
    error_bars.SetMaximum(1.01)
    error_bars.SetMinimum(0.)
    if ytitle == '':
        error_bars.GetYaxis().SetTitle("Trigger rate")
    else:
        error_bars.GetYaxis().SetTitle(ytitle)
    error_bars.SetTitle('')
    error_bars.Draw('AP')
    c.SaveAs('pdf/' + name + '.pdf')
    c.Write(name + '_Canvas')
    error_bars.Write(name)
Ejemplo n.º 2
0
def makePlot(finname,foutname,plottitle='',masstitle='',scale=False):
  xsecs = resonantXsecs if 'resonant' in finname else fcncXsecs
  points = {}
  if BLIND:
    cls = [2.5, 16, 50, 84, 97.5]
  else:
    cls = [2.5, 16, 50, 84, 97.5,'Observed']
  xaxis = []
  for cl in cls:
    points[cl] = []
  xsec=1
  for l in open(finname):
    try:
      if l.strip()[0]=='#':
        continue
      if 'MASS' in l:
        if scale:
          xsec = xsecs[int(l.split()[1])] 
        if VERBOSE:
          print ''
          stdout.write('$%6s$ & $%7.3g$'%(l.split()[1],xsec/(0.667)))
        xaxis.append(float(l.split()[1]))
      else:
        cl,val = parseLine(l)
        points[cl].append(val/xsec)
        if VERBOSE and (cl==50 or cl=='Observed'):
          stdout.write(' & $%10.4g$'%(val/xsec))
    except:
      pass
  if VERBOSE:
    print ''
  
  N = len(xaxis)
  up1Sigma=[]; up2Sigma=[]
  down1Sigma=[]; down2Sigma=[]
  for iM in xrange(N):
    up1Sigma.append(points[84][iM]-points[50][iM])
    up2Sigma.append(points[97.5][iM]-points[50][iM])
    down1Sigma.append(-points[16][iM]+points[50][iM])
    down2Sigma.append(-points[2.5][iM]+points[50][iM])
  
  up1Sigma = array('f',up1Sigma)
  up2Sigma = array('f',up2Sigma)
  down1Sigma = array('f',down1Sigma)
  down2Sigma = array('f',down2Sigma)
  cent = array('f',points[50])
  if not BLIND:
    obs = array('f',points['Observed'])
  xarray = array('f',xaxis)

  xsecarray = array('f',[xsecs[xx] for xx in xaxis])
  xsecarrayLow = array('f',[0.0625*xsecs[xx] for xx in xaxis])
  onearray = array('f',[1 for xx in xaxis])
  graphXsec = TGraph(N,xarray,xsecarray)
  graphXsecLow = TGraph(N,xarray,xsecarrayLow)
  graphOne = TGraph(N,xarray,onearray)

  zeros = array('f',[0 for i in xrange(N)])
  graphCent = TGraph(N,xarray,cent)
  if not BLIND:
    graphObs = TGraph(N,xarray,obs)
  graph1Sigma = TGraphAsymmErrors(N,xarray,cent,zeros,zeros,down1Sigma,up1Sigma)
  graph2Sigma = TGraphAsymmErrors(N,xarray,cent,zeros,zeros,down2Sigma,up2Sigma)
  c = TCanvas('c','c',700,600)
  c.SetLogy()
  c.SetLeftMargin(.15)
  graph2Sigma.GetXaxis().SetTitle(masstitle+' [GeV]')
  if scale:
    graph2Sigma.GetYaxis().SetTitle('Upper limit [#sigma/#sigma_{theory}]')  
  else:
    graph2Sigma.GetYaxis().SetTitle("Upper limit [#sigma] [pb]")  
  graph2Sigma.SetLineColor(5)
  graph1Sigma.SetLineColor(3)
  graph2Sigma.SetFillColor(5)
  graph1Sigma.SetFillColor(3)
  graph2Sigma.SetMinimum(0.5*min(points[2.5]))
  if scale:
    graph2Sigma.SetMaximum(10*max(max(points[97.5]),max(xsecarray),4))
  else:
    graph2Sigma.SetMaximum(10*max(max(points[97.5]),max(xsecarray)))
  graphCent.SetLineWidth(2)
  graphCent.SetLineStyle(2)
  if not BLIND:
    graphObs.SetLineColor(1)
    graphObs.SetLineWidth(3)
  graph1Sigma.SetLineStyle(0)
  graph2Sigma.SetLineStyle(0)
 
  leg = TLegend(0.55,0.7,0.9,0.9)
  leg.AddEntry(graphCent,'Expected','L')
  if not BLIND:
    leg.AddEntry(graphObs,'Observed','L')
  leg.AddEntry(graph1Sigma,'1 #sigma','F')
  leg.AddEntry(graph2Sigma,'2 #sigma','F')
  leg.SetFillStyle(0)
  leg.SetBorderSize(0)

  graph2Sigma.Draw('A3')
  graph1Sigma.Draw('3 same')
  graphCent.Draw('same L')
  if not BLIND:
    graphObs.Draw('same L')
  if scale:
    graphOne.SetLineColor(2)
    graphOne.SetLineWidth(2)
    graphOne.SetLineStyle(2)
    graphOne.Draw('same L')
  else:
    graphXsec.SetLineColor(2)
    graphXsecLow.SetLineColor(4)
    subscript = 'SR' if 'Resonant' in plottitle else 'FC'
    if 'Resonant' in plottitle:
      leg.AddEntry(graphXsec,'Theory #splitline{a_{%s}=b_{%s}=0.1}{m_{#chi}=100 GeV}'%(subscript,subscript),'l')
    else:
      leg.AddEntry(graphXsec,'Theory a_{%s}=b_{%s}=0.1'%(subscript,subscript),'l')
#    leg.AddEntry(graphXsecLow,'Theory a_{%s}=b_{%s}=0.025'%(subscript,subscript),'l')
    for g in [graphXsec]:
      g.SetLineWidth(2)
      g.SetLineStyle(2)
      g.Draw('same L')
  leg.Draw()
  label = TLatex()
  label.SetNDC()
  label.SetTextFont(62)
  label.SetTextAlign(11)
  label.DrawLatex(0.19,0.85,"CMS")
  label.SetTextFont(52)
  label.DrawLatex(0.28,0.85,"Preliminary")
  label.SetTextFont(42)
  label.SetTextSize(0.6*c.GetTopMargin())
  label.DrawLatex(0.19,0.77,plottitle)
  if scale:
    if 'Resonant' in plottitle:
      label.DrawLatex(0.19,0.7,"a_{SR} = b_{SR} = 0.1")
      label.DrawLatex(0.19,0.64,"m_{#chi}=100 GeV")
    else:
      label.DrawLatex(0.19,0.7,"a_{FC} = b_{FC} = 0.1")
  label.SetTextSize(0.5*c.GetTopMargin())
  label.SetTextFont(42)
  label.SetTextAlign(31) # align right
  label.DrawLatex(0.9, 0.94,"%.1f fb^{-1} (13 TeV)"%(plotConfig.lumi))
  c.SaveAs(foutname+'.pdf')
  c.SaveAs(foutname+'.png')
Ejemplo n.º 3
0
def makePlot1D(filepath, foutname, plottitle='', masstitle=''):
    br = 1 if 'Resonant' in plottitle else 0.68
    limits = parseLimitFiles2D(filepath, br)

    xaxis = []
    xseclist = []
    xsecerr = []
    cent = []
    obs = []
    up1 = []
    up2 = []
    down1 = []
    down2 = []
    maxval = 0
    minval = 999
    for m in sorted(limits):
        l = limits[m]
        xaxis.append(m)
        xseclist.append(l.xsec)
        xsecerr.append(l.xsec * .2)
        cent.append(l.cent)
        up1.append(l.up1 - l.cent)
        up2.append(l.up2 - l.cent)
        down1.append(l.cent - l.down1)
        down2.append(l.cent - l.down2)
        obs.append(l.obs)
        maxval = max(maxval, l.up2)
        minval = min(minval, l.down2)

    N = len(xaxis)

    up1Sigma = array('f', up1)
    up2Sigma = array('f', up2)
    down1Sigma = array('f', down1)
    down2Sigma = array('f', down2)
    cent = array('f', cent)
    obs = array('f', obs)
    xarray = array('f', xaxis)
    xsecarray = array('f', xseclist)
    xsecerrarray = array('f', xsecerr)
    zeros = array('f', [0 for i in xrange(N)])

    graphXsec = TGraphErrors(N, xarray, xsecarray, zeros, xsecerrarray)

    graphCent = TGraph(N, xarray, cent)
    graphObs = TGraph(N, xarray, obs)
    graph1Sigma = TGraphAsymmErrors(N, xarray, cent, zeros, zeros, down1Sigma,
                                    up1Sigma)
    graph2Sigma = TGraphAsymmErrors(N, xarray, cent, zeros, zeros, down2Sigma,
                                    up2Sigma)

    c = TCanvas('c', 'c', 700, 600)
    c.SetLogy()
    c.SetLeftMargin(.15)

    graph2Sigma.GetXaxis().SetTitle(masstitle + ' [GeV]')
    graph2Sigma.GetYaxis().SetTitle(
        '95% C.L. upper limit [#sigma/#sigma_{theory}]')
    c2 = root.kOrange
    c1 = root.kGreen + 1
    graph2Sigma.SetLineColor(c2)
    graph1Sigma.SetLineColor(c1)
    graph2Sigma.SetFillColor(c2)
    graph1Sigma.SetFillColor(c1)
    graph2Sigma.SetMinimum(0.5 * minval)
    graph2Sigma.SetMaximum(10 * maxval)
    graphCent.SetLineWidth(2)
    graphCent.SetLineStyle(2)
    graphObs.SetLineColor(1)
    graphObs.SetLineWidth(3)
    graphObs.SetMarkerStyle(20)
    graphObs.SetMarkerSize(1)
    graphObs.SetMarkerColor(1)
    graph1Sigma.SetLineStyle(0)
    graph2Sigma.SetLineStyle(0)

    leg = TLegend(0.55, 0.7, 0.9, 0.9)
    leg.AddEntry(graphCent, 'Expected', 'L')
    if not BLIND:
        leg.AddEntry(graphObs, 'Observed', 'Lp')
    leg.AddEntry(graph1Sigma, '1 std. dev.', 'F')
    leg.AddEntry(graph2Sigma, '2 std. dev.', 'F')
    leg.SetFillStyle(0)
    leg.SetBorderSize(0)

    graph2Sigma.Draw('A3')
    graph1Sigma.Draw('3 same')
    graphCent.Draw('same L')
    if not BLIND:
        graphObs.Draw('same Lp')

    subscript = 'SR' if 'Resonant' in plottitle else 'FC'
    coupling = '0.1' if 'Resonant' in plottitle else '0.25'

    graphXsec.SetLineColor(2)
    graphXsec.SetLineWidth(2)
    graphXsec.SetLineStyle(2)
    graphXsec.SetFillColor(2)
    graphXsec.SetFillStyle(3005)
    graphXsec.Draw('same L3')
    '''
  if not scale:
    if 'Resonant' in plottitle:
      leg.AddEntry(graphXsec,'Theory #splitline{a_{%s}=b_{%s}=%s}{m_{#chi}=100 GeV}'%(subscript,subscript,coupling),'l')
    else:
      leg.AddEntry(graphXsec,'Theory #splitline{a_{%s}=b_{%s}=%s}{m_{#chi}=10 GeV}'%(subscript,subscript,coupling),'l')
  '''
    if not BLIND:
        findIntersect1D(graphObs, graphXsec, xaxis[0], xaxis[-1])
    findIntersect1D(graphCent, graphXsec, xaxis[0], xaxis[-1])

    leg.Draw()

    label = TLatex()
    label.SetNDC()
    label.SetTextSize(0.8 * c.GetTopMargin())
    label.SetTextFont(62)
    label.SetTextAlign(11)
    label.DrawLatex(0.15, 0.94, "CMS")
    label.SetTextFont(52)
    label.SetTextSize(0.6 * c.GetTopMargin())
    #  label.DrawLatex(0.25,0.94,"Preliminary")
    label.SetTextFont(42)
    label.SetTextSize(0.7 * c.GetTopMargin())
    label.DrawLatex(0.19, 0.83, plottitle)
    if 'Resonant' in plottitle:
        label.DrawLatex(0.19, 0.75, "a_{SR} = b_{SR} = %s" % coupling)
        label.DrawLatex(0.19, 0.68, "m_{#chi}=100 GeV")
    else:
        label.DrawLatex(0.19, 0.75, "g_{DM}^{V}=1,g_{q}^{V}=0.25")
        label.DrawLatex(0.19, 0.68, "m_{#chi}=1 GeV")
    label.SetTextSize(0.6 * c.GetTopMargin())
    label.SetTextFont(42)
    label.SetTextAlign(31)  # align right
    label.DrawLatex(0.95, 0.94, "%.1f fb^{-1} (13 TeV)" % (plotConfig.lumi))

    c.SaveAs(foutname + '.pdf')
    c.SaveAs(foutname + '.png')
Ejemplo n.º 4
0
expected68 = TGraphAsymmErrors(massv, expv, masserrv, masserrv, exp68Lv,
                               exp68Hv)
expected68.SetFillColor(ROOT.kGreen)
expected95 = TGraphAsymmErrors(massv, expv, masserrv, masserrv, exp95Lv,
                               exp95Hv)
expected95.SetFillColor(ROOT.kYellow)

c4 = TCanvas("c4", "Diphoton c = 01 Limits", 1000, 800)

c4.SetBottomMargin(0.15)
c4.SetRightMargin(0.06)

#c4.SetLogy(1)

#expected95.SetMinimum(0.0001);
expected95.SetMaximum(0.0057)
expected95.Draw("a3")
expected95.GetXaxis().SetTitle("Diphoton Mass [GeV/c^{2}]")
expected95.GetYaxis().SetTitle("#sigma(G_{RS} #rightarrow #gamma #gamma)[pb]")
expected68.Draw("3same")
expected_p.Draw("csame")
observed_p.Draw("cpsame")
theory.Draw("same")

latex = TLatex()
latex.SetNDC()
latex.SetTextSize(0.04)
latex.SetTextAlign(31)  # align right
latex.DrawLatex(0.45, 0.95, "CMS Preliminary")

latex2 = TLatex()
Ejemplo n.º 5
0
            exp2sigma = TGraphAsymmErrors(3, x, y_exp, zeros, zeros,
                                          y_err2down, y_err2up)
            explim = TGraph(3, x, y_exp)
            obslim = TGraph(3, x, y_obs)
            obslim.SetLineWidth(3)
            explim.SetLineWidth(3)
            explim.SetLineStyle(2)
            explim.SetTitle('')
            obslim.SetTitle('')
            exp2sigma.SetTitle('')
            exp1sigma.SetTitle('')
            #obslim.SetMinimum(0.001);
            #duesigma=TGraphAsymmErrors(3,)
            exp1sigma.SetFillColor(kGreen + 1)
            exp2sigma.SetFillColor(kOrange)
            exp2sigma.SetMaximum(150)
            exp2sigma.SetMinimum(0.07)
            exp2sigma.Draw('a3lp')
            exp2sigma.GetXaxis().SetTitle("Z' mass [TeV]")
            exp2sigma.GetXaxis().SetRangeUser(1.4, 2.6)
            exp2sigma.GetYaxis().SetTitle("Upper cross section limit [pb]")

            sizefactor = 1.6
            exp2sigma.GetXaxis().SetTitleSize(
                sizefactor * exp2sigma.GetXaxis().GetTitleSize())
            exp2sigma.GetYaxis().SetTitleSize(
                sizefactor * exp2sigma.GetYaxis().GetTitleSize())
            exp2sigma.GetXaxis().SetLabelSize(
                sizefactor * exp2sigma.GetXaxis().GetLabelSize())
            exp2sigma.GetYaxis().SetLabelSize(
                sizefactor * exp2sigma.GetYaxis().GetLabelSize())
Ejemplo n.º 6
0
expected68 = TGraphAsymmErrors(massv, expv, masserrv, masserrv, exp68Lv,
                               exp68Hv)
expected68.SetFillColor(ROOT.kGreen)
expected95 = TGraphAsymmErrors(massv, expv, masserrv, masserrv, exp95Lv,
                               exp95Hv)
expected95.SetFillColor(ROOT.kYellow)

c4 = TCanvas("c4", "Diphoton c = 01 Limits", 1000, 800)

c4.SetBottomMargin(0.15)
c4.SetRightMargin(0.06)

c4.SetLogy(1)

#expected95.SetMinimum(0.0001);
expected95.SetMaximum(0.01)
expected95.Draw("a3")
expected95.GetXaxis().SetTitle("Diphoton Mass [GeV/c^{2}]")
expected95.GetYaxis().SetTitle("#sigma(G_{RS} #rightarrow #gamma #gamma)[pb]")
expected68.Draw("3same")
expected_p.Draw("csame")
observed_p.Draw("cpsame")
theory.Draw("same")

latex = TLatex()
latex.SetNDC()
latex.SetTextSize(0.04)
latex.SetTextAlign(31)  # align right
latex.DrawLatex(0.45, 0.95, "CMS Preliminary")

latex2 = TLatex()
Ejemplo n.º 7
0
def trigger_efficiency(year, separate=False):
    from root_numpy import root2array, fill_hist
    from aliases import triggers, triggers_PFHT, triggers_Jet, triggers_BTag
    import numpy as np
    #spec_triggers = {"PFHT": triggers_PFHT, "Jet": triggers_Jet, "BTag": triggers_BTag}
    spec_triggers = {
        "HT/Jet": "(" + triggers_PFHT + " || " + triggers_Jet + ")",
        "BTag": triggers_BTag
    }
    spec_triggers_colors = {
        "PFHT": 418,
        "Jet": 4,
        "BTag": 6,
        "HT/Jet": 4,
        "total": 2
    }

    hist_pass = TH1F("pass", "pass", 100, 0., 10000.)
    if separate:
        hist_pass_spec = {}
        for trig in spec_triggers.keys():
            hist_pass_spec[trig] = TH1F("pass_" + trig, "pass_" + trig, 100,
                                        0., 10000.)
    hist_all = TH1F("all", "all", 100, 0., 10000.)

    file_list = []

    data_2016_letters = ["B", "C", "D", "E", "F", "G", "H"]
    data_2017_letters = ["B", "C", "D", "E", "F"]
    data_2018_letters = ["A", "B", "C", "D"]

    sample_names = []
    if year == '2016':
        letters = data_2016_letters
    elif year == '2017':
        letters = data_2017_letters
    elif year == '2018':
        letters = data_2018_letters
    else:
        print "unknown year"
        sys.exit()
    for letter in letters:
        #dir_content =  os.listdir(TRIGGERDIR+"/SingleMuon_{}_{}/".format(year, letter)) ## intended to run directly on ntuples
        #for entry in dir_content:
        #    if "_flatTuple" in entry: file_list.append(TRIGGERDIR+"/SingleMuon_{}_{}/".format(year, letter)+entry)
        file_list.append(TRIGGERDIR +
                         "/SingleMuon_{}_{}.root".format(year, letter))
        print "appending:", TRIGGERDIR + "/SingleMuon_{}_{}.root".format(
            year, letter)

    for file_name in file_list:
        temp_array = root2array(file_name,
                                treename='tree',
                                branches='jj_mass_widejet',
                                selection="jj_deltaEta_widejet<1.1")
        fill_hist(hist_all, temp_array)
        temp_array = root2array(file_name,
                                treename='tree',
                                branches='jj_mass_widejet',
                                selection="jj_deltaEta_widejet<1.1 && " +
                                triggers)
        fill_hist(hist_pass, temp_array)
        if separate:
            for trig in spec_triggers.keys():
                temp_array = root2array(
                    file_name,
                    treename='tree',
                    branches='jj_mass_widejet',
                    selection="jj_deltaEta_widejet<1.1 && " +
                    spec_triggers[trig])
                fill_hist(hist_pass_spec[trig], temp_array)
        temp_array = None

    import array
    from aliases import dijet_bins
    binning = []
    for num in dijet_bins:
        if num <= 10000: binning.append(num)
    #binning = range(0,1500,100)+range(1500,2000,100)+range(2000,3100,150)+range(3100,10000,300)
    binning_ = array.array('d', binning)
    hist_pass2 = hist_pass.Rebin(
        len(binning_) - 1, "hist_pass_rebinned", binning_)
    hist_all2 = hist_all.Rebin(
        len(binning_) - 1, "hist_all_rebinned", binning_)

    if separate:
        hist_pass_spec2 = {}
        for trig in spec_triggers.keys():
            hist_pass_spec2[trig] = hist_pass_spec[trig].Rebin(
                len(binning_) - 1, "hist_pass_" + trig + "_rebinned", binning_)

    hist_pass2.Sumw2()
    hist_all2.Sumw2()
    eff = TGraphAsymmErrors()
    eff.Divide(hist_pass2, hist_all2)

    eff.SetMarkerColor(spec_triggers_colors["total"])
    if separate:
        eff.SetMarkerStyle(5)
    else:
        eff.SetMarkerStyle(1)
    eff.SetLineColor(spec_triggers_colors["total"])
    eff.SetLineWidth(2)

    if separate:
        eff_spec = {}
        for trig in spec_triggers.keys():
            hist_pass_spec2[trig].Sumw2()
            eff_spec[trig] = TGraphAsymmErrors()
            eff_spec[trig].Divide(hist_pass_spec2[trig], hist_all2)
            eff_spec[trig].SetMarkerColor(spec_triggers_colors[trig])
            eff_spec[trig].SetMarkerStyle(1)
            eff_spec[trig].SetLineColor(spec_triggers_colors[trig])
            eff_spec[trig].SetLineWidth(2)

    one_line = TGraph()
    one_line.SetPoint(0, 0., 1.)
    one_line.SetPoint(1, 10000., 1.)
    one_line.SetLineStyle(2)

    c1 = TCanvas("c1", "Trigger Efficiency", 800, 800)
    c1.cd(1)
    eff.Draw("AP")
    one_line.Draw("L")
    eff.SetTitle(";m_{jj} (GeV);trigger efficiency")
    eff.SetMinimum(0.)
    eff.SetMaximum(1.4)  #0.65

    ## new
    dijet_bin_centers = []
    for b, lthr in enumerate(dijet_bins[:-1]):
        if lthr < 1200 or lthr > 2500: continue
        dijet_bin_centers.append(0.5 * (dijet_bins[b] + dijet_bins[b + 1]))
    print "total trigger efficiency:"
    for cval in dijet_bin_centers:
        print cval, ":", eff.Eval(cval)
    ## end new

    if separate:
        leg = TLegend(0.65, 0.75, 0.9, 0.95)
        leg.AddEntry(eff, "total")
        for trig in spec_triggers.keys():
            leg.AddEntry(eff_spec[trig], trig + "-based")
            eff_spec[trig].Draw("P SAME")
            ## new
            print trig, "trigger efficiency"
            for cval in dijet_bin_centers:
                print cval, ":", eff_spec[trig].Eval(cval)
            ## end new
        leg.Draw()

    eff.GetXaxis().SetTitleSize(0.045)
    eff.GetYaxis().SetTitleSize(0.045)
    eff.GetYaxis().SetTitleOffset(1.1)
    eff.GetXaxis().SetTitleOffset(1.05)
    eff.GetXaxis().SetLimits(700., 5000.)
    c1.SetTopMargin(0.05)
    #drawCMS(-1, "Preliminary", year=year) #Preliminary
    #drawCMS(-1, "Work in Progress", year=year, suppressCMS=True)
    drawCMS(-1, "", year=year, suppressCMS=True)
    drawAnalysis("")

    suffix = ""
    if separate: suffix = "_sep"

    c1.Print("plots/Efficiency/trigger_" + year + suffix + ".pdf")
    c1.Print("plots/Efficiency/trigger_" + year + suffix + ".png")
Ejemplo n.º 8
0
c = TCanvas()
c.SetLeftMargin(0.14)
c.SetBottomMargin(0.14)
c.SetRightMargin(0.04)
c.SetTopMargin(0.08)
g_th_162.GetXaxis().SetTitle('m_{t#bar{t}} [GeV]')
g_th_162.GetYaxis().SetTitle('d#sigma_{t#bar{t}} / dm_{t#bar{t}} #Deltam_{t#bar{t}} [pb]')
g_th_162.GetYaxis().SetTitleSize(0.05)
g_th_162.GetYaxis().SetTitleOffset(1.2)
g_th_162.GetXaxis().SetTitleSize(0.06)
g_th_162.GetXaxis().SetTitleOffset(1)
g_th_162.GetYaxis().SetLabelSize(0.05)
g_th_162.GetXaxis().SetLabelSize(0.05)
g_th_162.GetXaxis().SetRangeUser(bins[0],bins[len(bins)-1])
g_th_162.GetXaxis().SetLimits(137,2162)
g_th_162.SetMaximum(360)


g_th_162.Draw('ap')
g_th_162.Draw('psame')
g_exp.Draw('psame')
g_th_164.Draw('psame')
g_th_166.Draw('psame')
g_exp.Draw('psame')
leg1.Draw('same')
leg2.Draw('same')


if cms: latexLabel1.DrawLatex(0.16, 0.94, "CMS")
latexLabel2.DrawLatex(0.76, 0.94, "35.9 fb^{-1} (13 TeV)")
if preliminary: latexLabel3.DrawLatex(0.215, 0.92 , "#it{Preliminary}")
Ejemplo n.º 9
0
            explim = TGraph(3, x, y_exp)
            obslim = TGraph(3, x, y_obs)
            obslim.SetLineWidth(2)
            explim.SetLineWidth(2)
            explim.SetLineStyle(2)
            explim.SetTitle('')
            obslim.SetTitle('')
            exp2sigma.SetTitle('')
            exp1sigma.SetTitle('')
            #obslim.SetMinimum(0.001);
            #duesigma=TGraphAsymmErrors(3,)
            exp1sigma.SetFillColor(kGreen + 1)
            exp2sigma.SetFillColor(kOrange)
            # exp2sigma.SetMaximum(150)
            # exp2sigma.SetMinimum(0.07)
            exp2sigma.SetMaximum(10000)
            if triplet[0] == 0.0:
                exp2sigma.SetMinimum(0.0007)
            else:
                exp2sigma.SetMinimum(0.007)
            exp2sigma.Draw('a3lp')
            if triplet[0] == 0.0:
                exp2sigma.GetXaxis().SetTitle("#rho^{0}_{L} mass [TeV]")
            else:
                exp2sigma.GetXaxis().SetTitle("G* mass [TeV]")
            exp2sigma.GetXaxis().SetRangeUser(1.4, 2.6)
            exp2sigma.GetYaxis().SetTitle("Upper cross section limit [pb]")

            sizefactor = 1.6
            exp2sigma.GetXaxis().SetTitleSize(
                sizefactor * exp2sigma.GetXaxis().GetTitleSize())