###hists.append( plot.TH2FromTGraph2D(graph2, method='BinCenterAligned') ) ####plot.fastFillTH2(hists2, graph,interpolateMissing=True) ###if args.bg_exp: ### limit_bg = plot.MakeTChain(args.bg_exp, 'limit') ### best_bg = plot.TGraphFromTree( ### limit_bg, "CV", "CF", 'deltaNLL == 0') ### plot.RemoveGraphXDuplicates(best_bg) limit = plot.MakeTChain(args.files, 'limit') print limit graph = plot.TGraph2DFromTree( limit, "CV", "CF", '2*deltaNLL', 'quantileExpected > -0.5 && deltaNLL > 0 && deltaNLL < 1000') best = plot.TGraphFromTree(limit, "CV", "CF", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best) hists = plot.TH2FromTGraph2D(graph, method='BinCenterAligned') plot.fastFillTH2(hists, graph, interpolateMissing=True) if args.bg_exp: limit_bg = plot.MakeTChain(args.bg_exp, 'limit') best_bg = plot.TGraphFromTree(limit_bg, "CV", "CF", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best_bg) # If included just plot SM exp at 1,1 if args.sm_exp: limit_sm = plot.MakeTChain(args.sm_exp, 'limit') best_sm = ROOT.TGraph(1, array('d', [ 1, ]), array('d', [ 1, ])) plot.RemoveGraphXDuplicates(best_sm)
canv = ROOT.TCanvas(args.output, args.output) pads = plot.OnePad() if args.debug_output is not None: debug = ROOT.TFile(args.debug_output, 'RECREATE') else: debug = None limit = plot.MakeTChain(args.files, 'limit') graph = plot.TGraph2DFromTree( limit, "r_ggH", "r_bbH", '2*deltaNLL', 'quantileExpected > -0.5 && deltaNLL > 0 && deltaNLL < 1000') best = plot.TGraphFromTree( limit, "r_ggH", "r_bbH", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best) hists = plot.TH2FromTGraph2D(graph, method='BinCenterAligned') plot.fastFillTH2(hists, graph,interpolateMissing=True) if args.bg_exp: limit_bg = plot.MakeTChain(args.bg_exp, 'limit') best_bg = plot.TGraphFromTree( limit_bg, "r_ggH", "r_bbH", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best_bg) if args.sm_exp: limit_sm = plot.MakeTChain(args.sm_exp, 'limit') best_sm = plot.TGraphFromTree( limit_sm, "r_ggH", "r_bbH", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best_sm) hists.SetMaximum(6) hists.SetMinimum(0) hists.SetContour(255) # c2=ROOT.TCanvas() # hists.Draw("COLZ")
if args.debug_output is not None: debug = ROOT.TFile(args.debug_output, 'RECREATE') else: debug = None limit = plot.MakeTChain(args.files, 'limit') graph = plot.TGraph2DFromTree( limit, "r_ggH", "r_bbH", '2*deltaNLL', 'quantileExpected > -0.5 && deltaNLL > 0 && deltaNLL < 1000') best = plot.TGraphFromTree(limit, "r_ggH", "r_bbH", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best) # hists = plot.TH2FromTGraph2D(graph, method='BinCenterAligned') hists = plot.TH2FromTGraph2D(graph, method='BinCenterAligned') plot.fastFillTH2(hists, graph, interpolateMissing=args.interpolate_missing) if args.bg_exp: limit_bg = plot.MakeTChain(args.bg_exp, 'limit') best_bg = plot.TGraphFromTree(limit_bg, "r_ggH", "r_bbH", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best_bg) if args.sm_exp: limit_sm = plot.MakeTChain(args.sm_exp, 'limit') best_sm = plot.TGraphFromTree(limit_sm, "r_ggH", "r_bbH", 'deltaNLL == 0') plot.RemoveGraphXDuplicates(best_sm) hists.SetMaximum(6) hists.SetMinimum(0) hists.SetContour(255) # c2=ROOT.TCanvas() # hists.Draw("COLZ") # c2.SaveAs("heatmap.png") #Set x and y axis maxima: