#!/usr/bin/env python # contourPlotterExample.py ################# # # Example for using contourPlotter.py # # See README for details # # By: Larry Lee - Dec 2017 import ROOT import contourPlotter drawTheorySysts = False plot = contourPlotter.contourPlotter("contourPlotterExample",800,600) #plot.canvas.SetLogy() plot.ATLASlabel = "ATLAS" plot.ATLASlabel2 = "Internal" #plot.processLabel = "tW+MET 2L" plot.limitCaveatLabel = "All limits at 95% CL" discovery = False plot.lumiLabel = "#sqrt{s}=13 TeV, 139 fb^{-1}"#, All limits at 95% CL" ## Just open up a root file with TGraphs in it so you can hand them to the functions below! f1 = ROOT.TFile("tw.root") f1.ls() f2 = ROOT.TFile("dmtt.root") f2.ls() ## Axes #plot.drawAxes( [400,0.5,1600,4] ) #mhtb grid plot.drawAxes( [100,400,600,1600] ) #mamh grid ## Other limits to draw # plot.drawShadedRegion( externalGraphs.curve, title="ATLAS 8 TeV, 20.3 fb^{-1} (observed)" ) ## Main Result #plot.drawTextFromTGraph2D( f1.Get("upperLimit_gr"), title = "Numbers give upper limits", color=ROOT.kBlack, format="%.2f",size=0.025, alpha=0.5, angle=0) plot.drawOneSigmaBand( f1.Get("Band_1s_0") ) plot.drawExpected( f1.Get("Exp_0"), color=ROOT.kRed - 0 , title="Expected" ) plot.drawExpected( f2.Get("Exp_0"), color=ROOT.kBlue - 0, title="Expected (DMt+DMtt)" ) plot.drawObserved( f1.Get("Obs_0"), title="Observed") plot.drawObserved( f2.Get("Obs_0"), title="Observed (DMt+DMtt)", color=ROOT.kBlue) #plot.drawOneSigmaBand( f1.Get("Band_1s_0") ) ## Axis Labels plot.setXAxisLabel( "m_{a} [GeV]" ) plot.setYAxisLabel( "M_{H} [GeV]" ) plot.createLegend(shape=(0.63,0.17,0.93,0.45) ).Draw() #mamh grid #plot.createLegend(shape=(0.63,0.30,0.93,0.58) ).Draw() #mhtb grid #if drawTheorySysts: # plot.drawTheoryUncertaintyCurve( f.Get("Obs_0_Up") ) # plot.drawTheoryUncertaintyCurve( f.Get("Obs_0_Down") ) # coordinate in NDC # plot.drawTheoryLegendLines( xyCoord=(0.234,0.6625), length=0.057 ) plot.decorateCanvas( ) latexObject = ROOT.TLatex() latexObject.SetTextFont(42) latexObject.SetTextSize(0.045) latexObject.DrawLatexNDC(0.16,0.69,"SR(tW_{2L})") latexObject.DrawLatexNDC(0.64,0.83,"2HDM+a, Dirac DM") latexObject.SetTextSize(0.032) latexObject.DrawLatexNDC(0.64,0.78,"m_{#chi} = 10 GeV, g_{#chi} = 1") latexObject.DrawLatexNDC(0.64,0.73,"sin#theta = 1/#sqrt{2}, tan#beta = 1") #mamh grid #latexObject.DrawLatexNDC(0.64,0.73,"sin#theta = 1/#sqrt{2}, m_{a} = 250 GeV") #mhtb grid latexObject.DrawLatexNDC(0.64,0.68,"M_{H^{#pm}} = M_{H} = M_{A}") plot.writePlot( )