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 draw_CouplingContour( model, opts, color=ROOT.kRed, lineStyle1s=ROOT.kSolid, lineStyle2s=ROOT.kDashed, lineWidth1s=2, lineWidth2s=2, couplingType='kVkF', ): c68 = drawContours('recoupled/' + couplingType + '_profiledContour_' + model + '.root', couplingType, color=color, lineStyle=lineStyle1s, lineWidth=lineWidth1s, drawSmallestBinMarker=True) c95 = drawContours('recoupled/' + couplingType + '_profiledContour_' + model + '.root', couplingType, color=color, lineStyle=lineStyle2s, lineWidth=lineWidth2s, level=6.0, levelName="95") return c68
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 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 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 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 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 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 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 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()
def draw_CouplingContour( model, opts, colorFull = ROOT.kBlue, colorRecoupled = ROOT.kRed, lineStyleFull1s=ROOT.kSolid, lineStyleFull2s=ROOT.kDashed, lineStyleRecoupled1s=ROOT.kSolid, lineStyleRecoupled2s=ROOT.kDashed, lineWidthFull1s=2, lineWidthFull2s=2, lineWidthRecoupled1s=2, lineWidthRecoupled2s=2, couplingType = 'kVkF', ): combination = "2ph_4l_lvlv" drawMarkers = True recoupledLabel = 'recoupled' recoupledLabel2 = None mainModelSuffix = "" profileSuffix = "" if 'interpCode0' in opts: combination += "_interpCode0" if model != "": profileSuffix = "_"+model if 'box' in model: mainModelSuffix += "_box" drawMarkers = False recoupledLabel = 'recoupled (Rfit)' if 'wideGauss' in model: mainModelSuffix += "_wideGauss" recoupledLabel = 'recoupled' recoupledLabel2 = '(x1.3 uncertainty)' c68 = drawContours( "output/atlas_counting/"+combination+mainModelSuffix+"/"+couplingType+".root", couplingType, color = colorFull, lineStyle=lineStyleFull1s, lineWidth=lineWidthFull1s, drawSmallestBinMarker=drawMarkers ) c95 = drawContours( "output/atlas_counting/"+combination+mainModelSuffix+"/"+couplingType+".root", couplingType, color = colorFull, lineStyle=lineStyleFull2s, lineWidth=lineWidthFull2s, level=6.0, levelName="95" ) c68_p = drawContours( "output/atlas_counting/"+combination+"/"+couplingType+"_profiledContour"+profileSuffix+".root", couplingType, color = colorRecoupled, lineStyle=lineStyleRecoupled1s, lineWidth=lineWidthRecoupled1s, drawSmallestBinMarker=drawMarkers ) c95_p = drawContours( "output/atlas_counting/"+combination+"/"+couplingType+"_profiledContour"+profileSuffix+".root", couplingType, color = colorRecoupled, lineStyle=lineStyleRecoupled2s, lineWidth=lineWidthRecoupled2s, level=6.0, levelName="95" ) if 'box' not in model and 'wideGauss' not in model and 'skipNaive' not in opts: c68_n = drawContours( "output/atlas_counting/"+combination+"/"+couplingType+"_profiledContour_template20_etasNone.root", couplingType, color = ROOT.kGreen-2, drawSmallestBinMarker=drawMarkers ) c95_n = drawContours( "output/atlas_counting/"+combination+"/"+couplingType+"_profiledContour_template20_etasNone.root", couplingType, color = ROOT.kGreen-2, lineStyle=ROOT.kDashed, level=6.0, levelName="95" ) else: c68_n,c95_n = (None,None) return (c68,c68_p,c68_n,recoupledLabel,recoupledLabel2)
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()
def draw_CouplingContour( model, opts, colorFull=ROOT.kBlue, colorRecoupled=ROOT.kRed, lineStyleFull1s=ROOT.kSolid, lineStyleFull2s=ROOT.kDashed, lineStyleRecoupled1s=ROOT.kSolid, lineStyleRecoupled2s=ROOT.kDashed, lineWidthFull1s=2, lineWidthFull2s=2, lineWidthRecoupled1s=2, lineWidthRecoupled2s=2, couplingType='kVkF', ): combination = "2ph_4l_lvlv" drawMarkers = True recoupledLabel = 'recoupled' recoupledLabel2 = None mainModelSuffix = "" profileSuffix = "" if 'interpCode0' in opts: combination += "_interpCode0" if model != "": profileSuffix = "_" + model if 'box' in model: mainModelSuffix += "_box" drawMarkers = False recoupledLabel = 'recoupled (Rfit)' if 'wideGauss' in model: mainModelSuffix += "_wideGauss" recoupledLabel = 'recoupled' recoupledLabel2 = '(x1.3 uncertainty)' c68 = drawContours("output/atlas_counting/" + combination + mainModelSuffix + "/" + couplingType + ".root", couplingType, color=colorFull, lineStyle=lineStyleFull1s, lineWidth=lineWidthFull1s, drawSmallestBinMarker=drawMarkers) c95 = drawContours("output/atlas_counting/" + combination + mainModelSuffix + "/" + couplingType + ".root", couplingType, color=colorFull, lineStyle=lineStyleFull2s, lineWidth=lineWidthFull2s, level=6.0, levelName="95") c68_p = drawContours("output/atlas_counting/" + combination + "/" + couplingType + "_profiledContour" + profileSuffix + ".root", couplingType, color=colorRecoupled, lineStyle=lineStyleRecoupled1s, lineWidth=lineWidthRecoupled1s, drawSmallestBinMarker=drawMarkers) c95_p = drawContours("output/atlas_counting/" + combination + "/" + couplingType + "_profiledContour" + profileSuffix + ".root", couplingType, color=colorRecoupled, lineStyle=lineStyleRecoupled2s, lineWidth=lineWidthRecoupled2s, level=6.0, levelName="95") if 'box' not in model and 'wideGauss' not in model and 'skipNaive' not in opts: c68_n = drawContours("output/atlas_counting/" + combination + "/" + couplingType + "_profiledContour_template20_etasNone.root", couplingType, color=ROOT.kGreen - 2, drawSmallestBinMarker=drawMarkers) c95_n = drawContours("output/atlas_counting/" + combination + "/" + couplingType + "_profiledContour_template20_etasNone.root", couplingType, color=ROOT.kGreen - 2, lineStyle=ROOT.kDashed, level=6.0, levelName="95") else: c68_n, c95_n = (None, None) return (c68, c68_p, c68_n, recoupledLabel, recoupledLabel2)
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 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 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()