예제 #1
0
파일: dijet.py 프로젝트: nhanvtran/dijets
def main(iAxial,i90CL,iExp,iGB):
    leg   = ROOT.TLegend(0.62,0.60,0.82,0.85)
    leg.SetHeader("g_{q}=0.25")
    leg.SetFillColor(0)    
    leg.SetBorderSize(0)  
    leg.SetFillStyle(0)  
    canv0 = ROOT.TCanvas("can0","can0",1200,800)
    exp=dijetexp(ROOT.kGreen,i90CL)
    obs=dijetobs(ROOT.kRed  ,i90CL)
    xs=dijetxs(ROOT.kBlack)
    divide(exp,xs,True)
    divide(obs,xs,True)
    exp.GetXaxis().SetTitle("m_{med}")
    exp.GetYaxis().SetTitle("g_{B}")
    #exp.GetYaxis().SetTitle("#sigma_{J}(m_{med})")
    #exp.GetYaxis().SetTitle("#mu=#sigma_{J}/#sigma_{0}")
    if iGB:
        exp.Draw("alp")
        obs.Draw("lp")
        lFile = ROOT.TFile("Output.root","RECREATE")
        exp.SetName("exp")
        obs.SetName("obs")
        exp.Write()
        obs.Write()
        lFile.Close()
        #xs .Draw("lp")                                                                                                                                      #leg.AddEntry(exp,"expected","lp")
        leg.AddEntry(obs,"observed","lp")
        leg.AddEntry(exp,"expected","lp")
        leg.Draw()
        canv0.Update()
        #leg.AddEntry(xs ,"DM Model","lp")
        end()
        exit()
    gdm=1
    canv1 = ROOT.TCanvas("can1","can1",1200,800)
    lCL="90" if i90CL else "95"
    lExp,lXExp=make2DGraph(exp,gdm,canv1,leg,"expected "+lCL+"% CL.",1,iAxial)
    lObs,lXObs=make2DGraph(obs,gdm,canv1,leg,"observed "+lCL+"% CL.",ROOT.kOrange,iAxial)
    if iExp:
	    lExp.Draw("colz")
    else:
	    lObs.Draw("colz")

    lXObs.SetFillColor(ROOT.kOrange+5)
    lXObs.SetFillStyle(3001)
    lXExp.Draw("l sames")
    lXObs.Draw("l sames")
    leg.Draw()
    canv1.Update()
    ROOT.gPad.Modified()
    ROOT.gPad.RedrawAxis()
    fileend="_dijet_av" if iAxial else "_dijet_v"
    fileend=fileend+"_90" if i90CL else fileend
    fileend=fileend+"_Exp" if iExp else fileend
    canv1.SaveAs("gq_mdm_mmed"+fileend+".png")
    canv1.SaveAs("gq_mdm_mmed"+fileend+".pdf")
    lFile = ROOT.TFile("MMedMDM"+fileend+".root","RECREATE")
    lObs.SetName("obs")
    lObs.SetTitle("obs")
    lExp.SetName("exp")
    lExp.SetTitle("exp")
    lXObs.SetName("obs_025")
    lXObs.SetTitle("obs_025")
    lXExp.SetName("exp_025")
    lXExp.SetTitle("exp_025")
    lObs.Write()
    lExp.Write()
    lXObs.Write()
    lXExp.Write()
    end()
예제 #2
0
def main(iAxial, i90CL, iExp, iGB):
    leg = ROOT.TLegend(0.62, 0.60, 0.82, 0.85)
    leg.SetHeader("g_{q}=0.25")
    leg.SetFillColor(0)
    leg.SetBorderSize(0)
    leg.SetFillStyle(0)
    canv0 = ROOT.TCanvas("can0", "can0", 1200, 800)
    exp = dijetexp(ROOT.kGreen, i90CL)
    obs = dijetobs(ROOT.kRed, i90CL)
    xs = dijetxs(ROOT.kBlack)
    divide(exp, xs, True)
    divide(obs, xs, True)
    exp.GetXaxis().SetTitle("m_{med}")
    exp.GetYaxis().SetTitle("g_{B}")
    #exp.GetYaxis().SetTitle("#sigma_{J}(m_{med})")
    #exp.GetYaxis().SetTitle("#mu=#sigma_{J}/#sigma_{0}")
    if iGB:
        exp.Draw("alp")
        obs.Draw("lp")
        lFile = ROOT.TFile("Output.root", "RECREATE")
        exp.SetName("exp")
        obs.SetName("obs")
        exp.Write()
        obs.Write()
        lFile.Close()
        #xs .Draw("lp")                                                                                                                                      #leg.AddEntry(exp,"expected","lp")
        leg.AddEntry(obs, "observed", "lp")
        leg.AddEntry(exp, "expected", "lp")
        leg.Draw()
        canv0.Update()
        #leg.AddEntry(xs ,"DM Model","lp")
        end()
        exit()
    gdm = 1
    canv1 = ROOT.TCanvas("can1", "can1", 1200, 800)
    lCL = "90" if i90CL else "95"
    lExp, lXExp = make2DGraph(exp, gdm, canv1, leg,
                              "expected " + lCL + "% CL.", 1, iAxial)
    lObs, lXObs = make2DGraph(obs, gdm, canv1, leg,
                              "observed " + lCL + "% CL.", ROOT.kOrange,
                              iAxial)
    if iExp:
        lExp.Draw("colz")
    else:
        lObs.Draw("colz")

    lXObs.SetFillColor(ROOT.kOrange + 5)
    lXObs.SetFillStyle(3001)
    lXExp.Draw("l sames")
    lXObs.Draw("l sames")
    leg.Draw()
    canv1.Update()
    ROOT.gPad.Modified()
    ROOT.gPad.RedrawAxis()
    fileend = "_dijet_av" if iAxial else "_dijet_v"
    fileend = fileend + "_90" if i90CL else fileend
    fileend = fileend + "_Exp" if iExp else fileend
    canv1.SaveAs("gq_mdm_mmed" + fileend + ".png")
    canv1.SaveAs("gq_mdm_mmed" + fileend + ".pdf")
    lFile = ROOT.TFile("MMedMDM" + fileend + ".root", "RECREATE")
    lObs.SetName("obs")
    lObs.SetTitle("obs")
    lExp.SetName("exp")
    lExp.SetTitle("exp")
    lXObs.SetName("obs_025")
    lXObs.SetTitle("obs_025")
    lXExp.SetName("exp_025")
    lXExp.SetTitle("exp_025")
    lObs.Write()
    lExp.Write()
    lXObs.Write()
    lXExp.Write()
    end()
예제 #3
0
def main(iAxial, i90CL, iExp, iGB):
    leg = ROOT.TLegend(0.207, 0.682, 0.427, 0.835)
    leg.SetHeader("")
    leg.SetFillColor(0)
    leg.SetBorderSize(0)
    leg.SetTextFont(42)
    leg.SetFillStyle(0)
    canv0 = ROOT.TCanvas("can0", "can0", 1200, 800)
    exp = dijetexp(ROOT.kGreen, i90CL)
    obs = dijetobs(ROOT.kRed, i90CL)
    xs = dijetxs(ROOT.kBlack)
    divide(exp, xs, True)
    divide(obs, xs, True)
    exp.GetXaxis().SetTitle("m_{med}")
    exp.GetYaxis().SetTitle("g_{B}")
    #exp.GetYaxis().SetTitle("#sigma_{J}(m_{med})")
    #exp.GetYaxis().SetTitle("#mu=#sigma_{J}/#sigma_{0}")
    if iGB:
        exp.Draw("alp")
        obs.Draw("lp")
        lFile = ROOT.TFile("Output.root", "RECREATE")
        exp.SetName("exp")
        obs.SetName("obs")
        exp.Write()
        obs.Write()
        lFile.Close()
        #xs .Draw("lp")                                                                                                                                      #leg.AddEntry(exp,"expected","lp")
        leg.AddEntry(obs, "observed", "lp")
        leg.AddEntry(exp, "expected", "lp")
        leg.Draw()
        canv0.Update()
        #leg.AddEntry(xs ,"DM Model","lp")
        end()
        exit()
    gdm = 1
    canv1 = ROOT.TCanvas("can1", "can1", 1200, 800)
    #    canv1.cd(1)
    #    frame = canv1.cd(1).DrawFrame(600,0,3700,1700)
    lCL = "90" if i90CL else "95"
    print 'exp\n\n\n\n\n\n'
    lExp, lXExp = make2DGraph(exp, gdm, canv1, leg, "Expected", 1, iAxial)
    print 'obs\n\n\n\n\n\n'
    lObs, lXObs = make2DGraph(obs, gdm, canv1, leg, "Observed", ROOT.kBlack,
                              iAxial)
    if iExp:
        lExp.GetYaxis().SetRangeUser(0, 3000)
        lExp.GetXaxis().SetRangeUser(600, 3700)
        lExp.GetYaxis().SetTitle('m_{DM} [GeV]')
        lExp.GetXaxis().SetTitle('Mediator mass [GeV]')
        lExp.Draw("colz")

    else:
        lObs.Draw("colz")
        lObs.GetYaxis().SetRangeUser(0, 3000)
        lObs.GetXaxis().SetRangeUser(600, 3700)
        lObs.GetYaxis().SetTitle('m_{DM} [GeV]')
        lObs.GetXaxis().SetTitle('Mediator mass [GeV]')

    lXObs.SetFillColor(ROOT.kOrange + 5)
    lXObs.SetFillStyle(3001)
    lXExp.SetLineStyle(ROOT.kDashed)

    lXExp.Draw("l sames")
    lXObs.Draw("l sames")
    leg.Draw()
    leg1 = ROOT.TLatex(2350, 2070, '27 fb^{-1} & 36 fb^{-1} (13 TeV)')
    leg1.SetTextFont(42)
    leg1.SetTextSize(0.045)
    leg2 = ROOT.TLatex(750, 1600, '#scale[1]{CMS}')
    #    leg2.SetTextFont(42)
    leg2.SetTextSize(0.045)
    leg1.Draw()
    leg2.Draw()

    #    pad=ROOT.TPad('mypad','mypad',0.93,0.8,1.00,1)
    #    pad.Draw()
    leg3 = ROOT.TLatex(4400, 1200, '#scale[1]{Coupling #font[11]{g}_{q}}')
    #    leg3.SetFillColor(0)
    leg3.SetTextAngle(90)
    leg3.SetTextFont(42)
    leg4 = ROOT.TLatex(
        2670, 610,
        '#splitline{#scale[0.78]{Vector mediator}}{#scale[0.78]{& Dirac DM}}')
    leg4.SetTextFont(42)
    leg4.Draw()
    leg5 = ROOT.TLatex(
        2670, 383,
        '#splitline{#scale[0.78]{g_{DM} = 1.0}}{#scale[0.78]{g_{q} = 0.25}}')
    leg5.SetTextFont(42)
    leg5.Draw()
    leg6 = ROOT.TLatex(750, 1500, '#scale[0.78]{95% CL Limits}')

    leg6.SetTextFont(42)
    leg6.Draw()
    leg3.Draw('same')
    canv1.Update()
    ROOT.gPad.Modified()
    ROOT.gPad.RedrawAxis()
    fileend = "_dijet_v" if iAxial else "_dijet_v"
    fileend = fileend + "_90" if i90CL else fileend
    fileend = fileend + "_Exp" if iExp else fileend
    canv1.SaveAs("gq_mdm_mmed" + fileend + ".png")
    canv1.SaveAs("gq_mdm_mmed" + fileend + ".pdf")
    lFile = ROOT.TFile("MMedMDM" + fileend + ".root", "RECREATE")
    lObs.SetName("obs")
    lObs.SetTitle("obs")
    lExp.SetName("exp")
    lExp.SetTitle("exp")
    lXObs.SetName("obs_025")
    lXObs.SetTitle("obs_025")
    lXExp.SetName("exp_025")
    lXExp.SetTitle("exp_025")
    lObs.Write()
    lExp.Write()
    lXObs.Write()
    lXExp.Write()
    end()