def main(): canvas = ROOT.TCanvas("c", "c", 600, 450) axes = canvas.DrawFrame(105, 0, 160, 12) axes.GetXaxis().SetTitle("m_{H} [GeV]") axes.GetYaxis().SetTitle("-2 ln #Lambda") hLine68 = PyROOTUtils.DrawHLine(1.0, lineStyle=ROOT.kDashed, lineWidth=1) hLine95 = PyROOTUtils.DrawHLine(4.0, lineStyle=ROOT.kDotted, lineWidth=1) g, g_statOnly = content() g2, g2_statOnly = content(123.0, 8.0, ROOT.kRed) # create black line proxies for legend expectedLine = PyROOTUtils.DrawHLine(-10.0, lineWidth=2) statOnlyLine = PyROOTUtils.DrawHLine(-10.0, lineWidth=2, lineStyle=ROOT.kDashed) l1 = PyROOTUtils.Legend(0.94, 0.5, textSize=0.035, valign="bottom", halign="right") l1.AddEntry(expectedLine, "expected", "L") l1.AddEntry(statOnlyLine, "stat only", "L") l1.AddEntry(hLine95, "95% CL", "L") l1.AddEntry(hLine68, "68% CL", "L") l1.Draw() canvas.SaveAs('doc/example.svg') canvas.SaveAs('doc/example.png') canvas.SaveAs('doc/example.eps') print('Image saved to doc/example.{svg|png|eps}.')
def counting_kGlukGamma_overlay(opts): leg2 = PyROOTUtils.Legend(0.65, 0.90, textSize=0.03) leg2.AddEntry(SMMarker, "Standard Model", "P") color = [(ROOT.kAzure - 4, ROOT.kAzure + 2), (ROOT.kRed - 4, ROOT.kRed + 1)] lineStyle = [ (ROOT.kSolid, ROOT.kSolid, ROOT.kDashed, ROOT.kDashed), (ROOT.kSolid, ROOT.kSolid, ROOT.kDashed, ROOT.kDashed), ] lineWidth = [ (2, 1, 2, 1), (2, 1, 2, 1), ] ci = 0 for m in opts['model']: c68, c68_p, c68_n, recoupledLabel, recoupledLabel2 = draw_CouplingContour( m, opts, color[ci][0], color[ci][1], lineStyleFull1s=lineStyle[ci][0], lineStyleFull2s=lineStyle[ci][1], lineStyleRecoupled1s=lineStyle[ci][2], lineStyleRecoupled2s=lineStyle[ci][3], lineWidthFull1s=lineWidth[ci][0], lineWidthFull2s=lineWidth[ci][1], lineWidthRecoupled1s=lineWidth[ci][2], lineWidthRecoupled2s=lineWidth[ci][3], couplingType='kGlukGamma', ) lL = PyROOTUtils.DrawHLine(400, lineWidth=2, lineColor=color[ci][1]) container.append(lL) if 'wideGauss' in m: leg2.AddEntry(lL, 'uncertainties x1.3', "L") else: leg2.AddEntry(lL, 'nominal', "L") ci += 1 leg2.Draw() leg = PyROOTUtils.Legend(0.74, 0.75, textSize=0.03) # leg.AddEntry( bestFitBlack, "Best fit", "P" ) leg.AddEntry(blackSolid, "full", "L") leg.AddEntry(blackDashed, "recoupled", "L") leg.AddEntry(None, "", "") leg.AddEntry(blackSolid, "68% CL", "L") leg.AddEntry(blackSolidThin, "95% CL", "L") leg.Draw()
def countingMuTMuW(opts): mainModelSuffix = "" profileSuffix = "" modelSuffix = "" if 'model' in opts and opts['model'] != "" and opts['model'] != "template4": profileSuffix = "_" + opts['model'] if 'model' in opts and 'box' in opts['model']: mainModelSuffix = "_box" if 'model' in opts and 'wideGauss' in opts['model']: mainModelSuffix = "_wideGauss" if 'interpCode0' in opts: modelSuffix = '_interpCode0' # if 'model' in opts and ('template0' in opts['model'] or 'template10' in opts['model']): # if 'model' in opts and ('template0' in opts['model']): # modelSuffix = "_interpCode0" c68_2ph = drawContours("output/atlas_counting/2ph" + modelSuffix + mainModelSuffix + "/muTmuW.root", "profiledNLL", scale=2.0, color=ROOT.kRed - 3, lineStyle=ROOT.kDashed, lineWidth=3, drawSmallestBinMarker=True) c68_4l = drawContours("output/atlas_counting/4l" + modelSuffix + mainModelSuffix + "/muTmuW.root", "profiledNLL", scale=2.0, color=ROOT.kBlue, lineStyle=ROOT.kDashed, lineWidth=3, drawSmallestBinMarker=True) c68_lvlv = drawContours("output/atlas_counting/lvlv" + modelSuffix + mainModelSuffix + "/muTmuW.root", "profiledNLL", scale=2.0, color=ROOT.kGreen - 2, lineStyle=ROOT.kDashed, lineWidth=3, drawSmallestBinMarker=True) c68_2ph_f = drawContours("output/atlas_counting/2ph" + modelSuffix + "/muTmuW_eff.root", "profiledNLL", scale=2.0, color=ROOT.kRed - 3, lineStyle=ROOT.kDotted) c68_4l_f = drawContours("output/atlas_counting/4l" + modelSuffix + "/muTmuW_eff.root", "profiledNLL", scale=2.0, color=ROOT.kBlue, lineStyle=ROOT.kDotted) c68_lvlv_f = drawContours("output/atlas_counting/lvlv" + modelSuffix + "/muTmuW_eff.root", "profiledNLL", scale=2.0, color=ROOT.kGreen - 2, lineStyle=ROOT.kDotted) # c68_2ph_s = drawContours( "output/atlas_counting/2ph"+modelSuffix+"/muTmuW_statOnly.root", "profiledNLL", scale=2.0, color = ROOT.kRed-3, lineStyle=ROOT.kDashed, lineWidth=4, drawSmallestBinMarker=True ) # c68_4l_s = drawContours( "output/atlas_counting/4l"+modelSuffix+"/muTmuW_statOnly.root", "profiledNLL", scale=2.0, color = ROOT.kBlue, lineStyle=ROOT.kDashed, lineWidth=4 ) # c68_lvlv_s = drawContours( "output/atlas_counting/lvlv"+modelSuffix+"/muTmuW_statOnly.root", "profiledNLL", scale=2.0, color = ROOT.kGreen-2, lineStyle=ROOT.kDashed, lineWidth=4 ) if 'model' in opts: c68_2ph_p = drawContours("output/atlas_counting/2ph" + modelSuffix + "/muTmuW_profiledContour" + profileSuffix + ".root", "muTmuW", color=ROOT.kRed - 4, lineStyle=ROOT.kSolid, drawSmallestBinMarker=True) c68_4l_p = drawContours("output/atlas_counting/4l" + modelSuffix + "/muTmuW_profiledContour" + profileSuffix + ".root", "muTmuW", color=ROOT.kAzure - 4, lineStyle=ROOT.kSolid, drawSmallestBinMarker=True) c68_lvlv_p = drawContours("output/atlas_counting/lvlv" + modelSuffix + "/muTmuW_profiledContour" + profileSuffix + ".root", "muTmuW", color=ROOT.kGreen + 1, lineStyle=ROOT.kSolid, drawSmallestBinMarker=True) leg = PyROOTUtils.Legend(0.2, 0.20, textSize=0.025, valign="bottom") leg.AddEntry(SMMarker, "Standard Model", "P") leg.AddEntry(blackDashedThick, "68% CL full model", "L") leg.AddEntry(blackDotted, "68% CL w/o theory uncert.", "L") if 'model' in opts: leg.AddEntry(blackSolid, "68% CL recoupled", "L") leg.Draw() leg2 = PyROOTUtils.Legend(0.65, 0.90, textSize=0.025) l2ph = PyROOTUtils.DrawHLine(400.0, lineWidth=2, lineColor=ROOT.kRed - 3) l4l = PyROOTUtils.DrawHLine(400.0, lineWidth=2, lineColor=ROOT.kBlue) llvlv = PyROOTUtils.DrawHLine(400.0, lineWidth=2, lineColor=ROOT.kGreen - 2) container.append((l2ph, l4l, llvlv)) if c68_2ph: leg2.AddEntry(l2ph, "H #rightarrow #gamma#gamma", "L") if c68_4l: leg2.AddEntry(l4l, "H #rightarrow ZZ* #rightarrow 4l", "L") if c68_lvlv: leg2.AddEntry(llvlv, "H #rightarrow WW* #rightarrow l#nul#nu", "L") leg2.Draw()