def muTMuWOverview(opts={}): cont = [ ("scenarioA", ROOT.kRed - 3, "output/twoBin/scenarioA/muTmuW.root"), ("scenarioB", ROOT.kGreen, "output/twoBin/scenarioB/muTmuW.root"), ("scenarioC", ROOT.kBlue, "output/twoBin/scenarioC/muTmuW.root"), ] leg2 = PyROOTUtils.Legend(0.65, 0.90, textSize=0.03) for name, color, inFile in cont: c68 = drawContours(inFile, "profiledNLL", scale=2.0, color=color) c68_f = drawContours(inFile.replace(".root", "_eff.root"), "profiledNLL", scale=2.0, color=color, lineStyle=ROOT.kDashed) container.append((c68, c68_f)) if c68: leg2.AddEntry(c68[0], name, "L") leg2.Draw() leg = PyROOTUtils.Legend(0.2, 0.90, textSize=0.03) leg.AddEntry(SMMarker, "Standard Model", "P") leg.AddEntry(blackSolid, "68% CL full model", "L") leg.AddEntry(blackDashed, "68% CL fixed effective", "L") leg.Draw()
def muTMuWInterpCodes(opts={}): cont = [ ("InterpCode=0", ROOT.kRed - 3, "output/twoBin/scenarioC/muTmuW_profiledContour_template0.root"), ("InterpCode=4", ROOT.kGreen, "output/twoBin/scenarioC/muTmuW_profiledContour.root"), ("InterpCode=-1", ROOT.kBlue, "output/twoBin/scenarioC/muTmuW_profiledContour_templateM1.root"), ("InterpCode=-4", ROOT.kGray, "output/twoBin/scenarioC/muTmuW_profiledContour_template14_etasgeneric_M4.root" ), ] leg2 = PyROOTUtils.Legend(0.65, 0.90, textSize=0.03) for name, color, inFile in cont: c68 = drawContours(inFile, "muTmuW", scale=2.0, color=color) container.append(c68) if c68: leg2.AddEntry(c68[0], name, "L") leg2.Draw() leg = PyROOTUtils.Legend(0.2, 0.90, textSize=0.03) leg.AddEntry(SMMarker, "Standard Model", "P") leg.AddEntry(blackSolid, "68% CL full model", "L") leg.AddEntry(blackDashed, "68% CL fixed effective", "L") leg.Draw()
def muTMuWOverviewNegScenarios(opts={}): cont = [ ("1x sys, cat. uni.", ROOT.kRed - 3, "output/twoBin/oneAlpha_catUniversal/muTmuW.root"), ("1x sys, not cat. uni.", ROOT.kGreen, "output/twoBin/oneAlpha_catNonUniversal/muTmuW.root"), ("2x sys, cat. uni.", ROOT.kOrange, "output/twoBin/twoAlpha_catUniversal/muTmuW.root"), ("2x sys, not cat. uni.", ROOT.kBlue, "output/twoBin/twoAlpha_catNonUniversal/muTmuW.root"), ] leg2 = PyROOTUtils.Legend(0.65, 0.90, textSize=0.03) for name, color, inFile in cont: c68 = drawContours(inFile, "profiledNLL", scale=2.0, color=color) c68_f = drawContours(inFile.replace(".root", "_eff.root"), "profiledNLL", scale=2.0, color=color, lineStyle=ROOT.kDashed) container.append((c68, c68_f)) leg2.AddEntry(c68[0], name, "L") leg2.Draw() leg = PyROOTUtils.Legend(0.2, 0.90, textSize=0.03) leg.AddEntry(SMMarker, "Standard Model", "P") leg.AddEntry(blackSolid, "68% CL full model", "L") leg.AddEntry(blackDashed, "68% CL fixed effective", "L") leg.Draw()
def profiledContourOverlay(opts={}): if 'box' not in opts: fullFile = "output/twoBin/" + opts['type'] + "/muTmuW.root" else: fullFile = "output/twoBin/" + opts['type'] + "_box/muTmuW.root" effFile = "output/twoBin/" + opts['type'] + "/muTmuW_eff.root" learningSuffix = '' if 'learningFull' in opts: learningSuffix = 'Full' profiledFiles = [ ('aligned', "output/twoBin/" + opts['type'] + "/muTmuW_profiledContour_template0.root", ROOT.kRed, ROOT.kSolid), ('learning', "output/twoBin/" + opts['type'] + "/muTmuW_profiledContour_template20_etasgeneric20_learning" + learningSuffix + ".root", ROOT.kBlue, 5), ] if 'byHand' in opts: profiledFiles.insert( 1, ('by hand', "output/twoBin/" + opts['type'] + "/muTmuW_profiledContour_template10_etasgeneric_M5.root", ROOT.kGreen + 2, ROOT.kDashed)) if 'box' in opts: profiledFiles = [(n, f.replace('.root', '_box1.0.root'), c, s) for n, f, c, s in profiledFiles] PyROOTUtils.DrawText(0.22, 0.88, "Recoupled contours", textSize=0.03) leg2 = PyROOTUtils.Legend(0.22, 0.86, textSize=0.03) for label, fileName, color, lineStyle in profiledFiles: c68_p = drawContours(fileName, "muTmuW", color=color, lineStyle=lineStyle) if c68_p: leg2.AddEntry(c68_p[0], label, "L") leg2.Draw() PyROOTUtils.DrawText(0.66, 0.88, "68% CL contours", textSize=0.03) leg = PyROOTUtils.Legend(0.65, 0.86, textSize=0.03) leg.AddEntry(SMMarker, "Standard Model", "P") c68 = drawContours(fullFile, "profiledNLL", scale=2.0, color=ROOT.kBlack, lineStyle=ROOT.kDashed, lineWidth=3) c68_f = drawContours(effFile, "profiledNLL", scale=2.0, color=ROOT.kBlack, lineStyle=ROOT.kDotted) if c68: leg.AddEntry(c68[0], "full model", "L") if c68_f: leg.AddEntry(c68_f[0], "fixed effective", "L") leg.Draw()
def counting_kVkF(opts): c68_nominal = draw_CouplingContour(opts['modelNominal'], opts, color=ROOT.kBlue) c68_alt = draw_CouplingContour(opts['modelAlt'], opts, color=ROOT.kRed) leg2 = PyROOTUtils.Legend(0.67, 0.35, textSize=0.03, valign="bottom") if c68_nominal: leg2.AddEntry(c68_nominal[0], "nominal", "L") if c68_alt: leg2.AddEntry(c68_alt[0], "uncertainties x1.3", "L") leg2.Draw() leg = PyROOTUtils.Legend(0.67, 0.2, textSize=0.03, valign="bottom") leg.AddEntry(SMMarker, "Standard Model", "P") leg.AddEntry(blackSolid, "68% CL", "L") leg.AddEntry(blackDashed, "95% CL", "L") leg.Draw()
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 counting_kGlukGamma(opts): leg2 = PyROOTUtils.Legend(0.67, 0.77, textSize=0.03) c68, c68_p, c68_n, recoupledLabel, recoupledLabel2 = draw_CouplingContour( opts['model'], opts, couplingType='kGlukGamma') if c68: leg2.AddEntry(c68[0], "full", "L") if c68_n: leg2.AddEntry(c68_n[0], "naive", "L") if c68_p: leg2.AddEntry(c68_p[0], recoupledLabel, "L") if recoupledLabel2: leg2.AddEntry(c68_p[0], recoupledLabel2, "") leg2.AddEntry(None, "", "") leg2.Draw() leg = PyROOTUtils.Legend(0.67, 0.90, textSize=0.03) # leg.AddEntry( bestFitBlack, "Best fit", "P" ) leg.AddEntry(SMMarker, "Standard Model", "P") leg.AddEntry(blackSolid, "68% CL", "L") leg.AddEntry(blackDashed, "95% CL", "L") leg.Draw()
def plot(values, suffix=None): canvas = ROOT.TCanvas("canvas", "canvas", 800, 600) axes = canvas.DrawFrame(-1.55, -0.6, 1.15, 2.6) axes.GetXaxis().SetTitle("#eta#alpha") axes.GetYaxis().SetTitle("response") axes.GetYaxis().SetTitleOffset(1.2) PyROOTUtils.DrawText(0.2, 0.87, "InterpCode = " + str(options.interpcode), textSize=0.03) leg = PyROOTUtils.Legend(0.2, 0.83, textSize=0.03) for etaData in values: eta = etaData['eta'] data = etaData['data'] g = PyROOTUtils.Graph(data) container.append(g) gDerivative = PyROOTUtils.Graph(g.derivativeData(), lineStyle=ROOT.kDashed) container.append(gDerivative) gDerivative2 = PyROOTUtils.Graph(g.derivative2Data(), lineStyle=ROOT.kDotted) if 'secondDerivative' in etaData: gDerivative2 = PyROOTUtils.Graph(etaData['secondDerivative'], lineStyle=ROOT.kDotted) gDerivative2.transformY(lambda y: y / 10.0) container.append(gDerivative2) infoStr = "#eta = " + str(eta) + " " if 'slopeAtZero' in etaData: infoStr += "\nslope(0) = %.2f " % (etaData['slopeAtZero']) t = PyROOTUtils.DrawText(data[0][0], data[0][1], infoStr, textSize=0.025, halign="right", valign="center", NDC=False) container.append(t) g.Draw("L") gDerivative.Draw("L") gDerivative2.Draw("L") leg.AddEntry(g, "f(#eta#alpha)", "L") leg.AddEntry(gDerivative, "f'(#eta#alpha)", "L") leg.AddEntry(gDerivative2, "1/10 f''(#eta#alpha)", "L") leg.Draw() outFileName = options.output if suffix: outFileName = outFileName.replace(".eps", suffix + ".eps") canvas.SaveAs(outFileName)
def countingMuTMuWArrowsAtMuHat(opts): modelSuffix = '' if 'interpCode0' in opts: modelSuffix = '_interpCode0' arrows = [] for c in ['2ph', '4l', 'lvlv']: try: with open( "output/atlas_counting/" + c + modelSuffix + "/table_etas.pickle", "rb") as f: etasAll = pickle.load(f) muHat = { 'muT': etasAll['generic20_learning'].values()[0]['muT__hat'], 'muW': etasAll['generic20_learning'].values()[0]['muW__hat'], } arrows = etas.drawArrows('fisherInfo', etasAll['fisherInfo'], muHat, lineWidth=2.0) container.append(arrows) label = PyROOTUtils.DrawText( muHat['muT'], muHat['muW'], { '2ph': 'H#rightarrow#gamma#gamma ', '4l': 'H#rightarrowZZ*#rightarrow4l ', 'lvlv': 'H#rightarrowWW*#rightarrowl#nul#nu ', }[c], textSize=0.03, halign="right", valign="top", NDC=False) container.append(label) except IOError: print("WARNING: Could not open:") print("output/atlas_counting/" + c + modelSuffix + "/table_etas.pickle") except: print("ERROR!!!!!!!!!!!!") leg = PyROOTUtils.Legend(0.2, 0.9, textSize=0.03) for a, p in arrows: leg.AddEntry(a, p.replace("alpha_", ""), "L") leg.Draw()
def profiledContour(opts={}): if opts["type"] == "oneAlpha_catUniversal": modelType = "oneAlpha_catUniversal" color = ROOT.kRed - 3 elif opts["type"] == "oneAlpha_catNonUniversal": modelType = "oneAlpha_catNonUniversal" color = ROOT.kGreen - 2 elif opts["type"] == "twoAlpha_catUniversal": modelType = "twoAlpha_catUniversal" color = ROOT.kOrange - 3 elif opts["type"] == "twoAlpha_catNonUniversal": modelType = "twoAlpha_catNonUniversal" color = ROOT.kBlue elif opts["type"] == "oneAlpha_catUniversal_interpCode0": modelType = "oneAlpha_catUniversal_interpCode0" color = ROOT.kRed - 3 elif opts["type"] == "oneAlpha_catNonUniversal_interpCode0": modelType = "oneAlpha_catNonUniversal_interpCode0" color = ROOT.kGreen - 2 elif opts["type"] == "twoAlpha_catUniversal_interpCode0": modelType = "twoAlpha_catUniversal_interpCode0" color = ROOT.kOrange - 3 elif opts["type"] == "twoAlpha_catNonUniversal_interpCode0": modelType = "twoAlpha_catNonUniversal_interpCode0" color = ROOT.kBlue elif opts["type"] == "scenarioA": modelType = "scenarioA" color = ROOT.kRed - 3 elif opts["type"] == "scenarioA2": modelType = "scenarioA2" color = ROOT.kRed - 3 elif opts["type"] == "scenarioB": modelType = "scenarioB" color = ROOT.kGreen - 2 elif opts["type"] == "scenarioC": modelType = "scenarioC" color = ROOT.kBlue elif opts["type"] == "scenarioC2": modelType = "scenarioC2" color = ROOT.kBlue elif opts["type"] == "scenarioD": modelType = "scenarioD" color = ROOT.kGreen elif opts["type"] == "scenarioA_interpCode0": modelType = "scenarioA_interpCode0" color = ROOT.kRed - 3 elif opts["type"] == "scenarioA2_interpCode0": modelType = "scenarioA2_interpCode0" color = ROOT.kRed - 3 elif opts["type"] == "scenarioB_interpCode0": modelType = "scenarioB_interpCode0" color = ROOT.kGreen - 2 elif opts["type"] == "scenarioC_interpCode0": modelType = "scenarioC_interpCode0" color = ROOT.kBlue elif opts["type"] == "scenarioC2_interpCode0": modelType = "scenarioC2_interpCode0" color = ROOT.kBlue elif opts["type"] == "scenarioD_interpCode0": modelType = "scenarioD_interpCode0" color = ROOT.kGreen effFile = "output/twoBin/" + modelType + "/muTmuW_eff.root" if "template0" in opts: inFile = "output/twoBin/" + modelType + "_interpCode0/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template0.root" elif "templateM1" in opts: inFile = "output/twoBin/" + modelType + "_additiveMu_interpCode0/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_templateM1.root" elif "template14_etasgeneric_M4" in opts: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template14_etasgeneric_M4.root" elif "template14_etasgeneric_M5" in opts: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template14_etasgeneric_M5.root" elif "template14_etasgeneric_fisherInfo" in opts: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template14_etasgeneric_fisherInfo.root" elif "template10_etasgeneric10_learning" in opts: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template10_etasgeneric10_learning.root" elif "template14_etasgeneric14_learning" in opts: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template14_etasgeneric14_learning.root" elif "template20_etasgeneric20_learning" in opts: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template20_etasgeneric20_learning.root" elif "template24_etasgeneric24_learning" in opts: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template24_etasgeneric24_learning.root" elif "template20_etasgeneric20_learning_box1.0" in opts: inFile = "output/twoBin/" + modelType + "_box/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour_template20_etasgeneric20_learning_box1.0.root" else: inFile = "output/twoBin/" + modelType + "/muTmuW.root" profiledFile = "output/twoBin/" + modelType + "/muTmuW_profiledContour.root" c68 = drawContours(inFile, "profiledNLL", scale=2.0, color=color) c68_f = drawContours(effFile, "profiledNLL", scale=2.0, color=color, lineStyle=ROOT.kDashed) c68_p = drawContours(profiledFile, "muTmuW", color=ROOT.kGray + 2, lineStyle=ROOT.kDotted) container.append((c68, c68_f, c68_p)) PyROOTUtils.DrawText(0.66, 0.88, "68% CL contours", textSize=0.03) leg2 = PyROOTUtils.Legend(0.65, 0.85, textSize=0.03) leg2.AddEntry(SMMarker, "Standard Model", "P") if c68: leg2.AddEntry(c68[0], "full model", "L") if c68_f: leg2.AddEntry(c68_f[0], "fixed effective", "L") if c68_p: leg2.AddEntry(c68_p[0], "profiled effective", "L") leg2.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()
def countingMuTMuWShifted(opts): modelSuffix = '' if 'interpCode0' in opts: modelSuffix = '_interpCode0' drawMarker = True if 'etaArrows' in opts: drawMarker = False c68_2ph_f = drawContours("output/atlas_counting/2ph" + modelSuffix + "/muTmuW_eff_" + opts['model'] + "_0.0.root", "muTmuW", color=ROOT.kRed - 3, drawSmallestBinMarker=drawMarker) c68_4l_f = drawContours("output/atlas_counting/4l" + modelSuffix + "/muTmuW_eff_" + opts['model'] + "_0.0.root", "muTmuW", color=ROOT.kBlue, drawSmallestBinMarker=drawMarker) c68_lvlv_f = drawContours("output/atlas_counting/lvlv" + modelSuffix + "/muTmuW_eff_" + opts['model'] + "_0.0.root", "muTmuW", color=ROOT.kGreen - 2, drawSmallestBinMarker=drawMarker) c68_2ph_s = drawContours("output/atlas_counting/2ph" + modelSuffix + "/muTmuW_eff_" + opts['model'] + "_1.0.root", "muTmuW", color=ROOT.kRed - 3, lineStyle=ROOT.kDashed, drawSmallestBinMarker=drawMarker) c68_4l_s = drawContours("output/atlas_counting/4l" + modelSuffix + "/muTmuW_eff_" + opts['model'] + "_1.0.root", "muTmuW", color=ROOT.kBlue, lineStyle=ROOT.kDashed, drawSmallestBinMarker=drawMarker) c68_lvlv_s = drawContours("output/atlas_counting/lvlv" + modelSuffix + "/muTmuW_eff_" + opts['model'] + "_1.0.root", "muTmuW", color=ROOT.kGreen - 2, lineStyle=ROOT.kDashed, drawSmallestBinMarker=drawMarker) if 'etaArrows' in opts: arrows = [] for c in ['2ph', '4l', 'lvlv']: try: with open( "output/atlas_counting/" + c + modelSuffix + "/table_etas.pickle", "rb") as f: etasAll = pickle.load(f) muHat = { 'muT': etasAll['generic20_learning'].values()[0]['muT__hat'], 'muW': etasAll['generic20_learning'].values()[0]['muW__hat'], } arrows = etas.drawArrows(etasAll['fisherInfo'], muHat, lineWidth=1.0, template=0) container.append(arrows) except IOError: print("WARNING: Could not open:") print("output/atlas_counting/" + c + modelSuffix + "/table_etas.pickle") except: print("ERROR!!!!!!!!!!") leg = PyROOTUtils.Legend(0.64, 0.78, textSize=0.025) for a, p in arrows: leg.AddEntry(a, parameterNames[p.replace("alpha_", "")], "L") leg.Draw() leg = PyROOTUtils.Legend(0.2, 0.30, textSize=0.025) leg.AddEntry(SMMarker, "Standard Model", "P") leg.AddEntry(blackSolid, "68% CL with #alpha at nominal", "L") leg.AddEntry(blackDashed, "68% CL with #alpha at +1 #sigma", "L") leg.Draw() leg2 = PyROOTUtils.Legend(0.64, 0.90, textSize=0.025) if c68_2ph_f: leg2.AddEntry(c68_2ph_f[0], "H #rightarrow #gamma#gamma", "L") if c68_4l_f: leg2.AddEntry(c68_4l_f[0], "H #rightarrow ZZ* #rightarrow 4l", "L") if c68_lvlv_f: leg2.AddEntry(c68_lvlv_f[0], "H #rightarrow WW* #rightarrow l#nul#nu", "L") leg2.Draw()
line.SetLineColor(R.kRed) #line.Draw() gr_med.Draw("L") gr_obs.SetLineColor(R.kBlack) gr_obs.SetLineWidth(3) gr_obs.Draw("L") sm_pred = PyROOTUtils.Graph(masses, sm) sm_pred.SetLineWidth(2) sm_pred.SetLineColor(R.kRed) #sm_pred.Draw("L,same") # Draw Legend leg = PyROOTUtils.Legend(0.62, 0.9, textSize=0.037) leg.AddEntry(gr_obs, "Observed", "l") leg.AddEntry(gr_med, "Expected Median", "l") leg.AddEntry(band_1sigma, "Expected #pm1 #sigma", "f") leg.AddEntry(band_2sigma, "Expected #pm2 #sigma", "f") #leg.AddEntry(sm_pred, "#sigma_{SM} x BR", "l") leg.Draw() # Draw Text col_l = 0.19 AtlasUtil.AtlasLabel(col_l, 0.85) #AtlasUtil.DrawLuminosityFbEcmFirst(col_l, 0.78, 20.3, size=0.037, sqrts=8) #AtlasUtil.DrawLuminosityFb(col_l, 0.78, 5, 13) AtlasUtil.DrawLuminosityFb(col_l, 0.78, 13.3, 13) ## in fb #AtlasUtil.DrawText(col_l, 0.71, "H#rightarrowZZ*#rightarrow4#font[12]{l}", size=0.037) AtlasUtil.DrawText(col_l,
def drawAllArrows(allEtas, cut=0.03, detailed=False): for etasName, etas in allEtas.iteritems(): canvas = ROOT.TCanvas("c1", "c1", 600, 600) if detailed: axes = canvas.DrawFrame(0.48, 0.48, 1.62, 1.82) else: axes = canvas.DrawFrame(0.58, 0.58, 1.42, 1.42) axes.GetXaxis().SetTitle("#mu^{f}_{ggF+ttH}") axes.GetYaxis().SetTitle("#mu^{f}_{VBF+VH}") #axes.GetYaxis().SetTitleOffset( 1.2 ) template = 0 if 'generic' in etasName: template = 10 if 'generic10' in etasName: template = 10 if 'generic14' in etasName: template = 14 if 'generic20' in etasName: template = 20 if 'generic24' in etasName: template = 24 print("For " + etasName + " chose template " + str(template) + ".") scanPoints = [{'muT': 1.0, 'muW': 1.0}] npVals = [(1.0, 3.0)] # nuis par values and line widths if detailed: scanPoints = [{ 'muT': 1.0, 'muW': 1.0 }, { 'muT': 1.3, 'muW': 1.0 }, { 'muT': 1.0, 'muW': 1.3 }] npVals = [(-1.0, 1.5), (1.0, 2.5)] for muIn in scanPoints: for npVal, lineWidth in npVals: arrows = drawArrows(etas, muIn, npVal, lineWidth, cut, template=template) container.append(arrows) leg = PyROOTUtils.Legend(0.2, 0.85, textSize=0.035) for a, p in arrows: leg.AddEntry(a, parameterNames[p.replace("alpha_", "")], "L") leg.Draw() if cut > 0.0: PyROOTUtils.DrawText(0.2, 0.88, "showing only |#eta| > %.0f%%" % (cut * 100.0), textSize=0.035) if detailed: PyROOTUtils.DrawText( 0.2, 0.25, "positive variation thick\nnegative variation thin", textSize=0.035) if detailed: canvas.SaveAs(options.output + etasName + "_detailed.eps") else: canvas.SaveAs(options.output + etasName + ".eps")