iline[x] = i+1 _styleDict = { 'obs' : {'LineWidth': 2,}, 'exp0': {'LineWidth': 2, 'LineColor': ROOT.TColor.GetColor('#9e0142')}, 'exp1': {'FillColor': ROOT.TColor.GetColor('#55b748')}, 'exp2': {'FillColor': ROOT.TColor.GetColor('#fdbf11')} } # Process each input argument for src in args.input: splitsrc = src.split(':') file = splitsrc[0] # limit.json => Draw as full obs + exp limit band if len(splitsrc) == 1: graph_sets.append(plot.StandardLimitsFromJSONFile(file, args.show.split(','))) if axis is None: axis = plot.CreateAxisHists(len(pads), graph_sets[-1].values()[0], True) DrawAxisHists(pads, axis, pads[0]) plot.StyleLimitBand(graph_sets[-1], overwrite_style_dict=_styleDict) plot.DrawLimitBand(pads[0], graph_sets[-1], legend=legend) pads[0].RedrawAxis() pads[0].RedrawAxis('g') pads[0].GetFrame().Draw() # limit.json:X => Draw a single graph for entry X in the json file # 'limit.json:X:Title="Blah",LineColor=4,...' => # as before but also apply style options to TGraph elif len(splitsrc) >= 2: settings = {} settings['Title'] = src
if args.auto_style is not None: icol = {x: 0 for x in args.auto_style.split(',')} icol['default'] = 0 iline = {} iline['default'] = 1 for i, x in enumerate(args.auto_style.split(',')): iline[x] = i + 1 # Process each input argument for src in args.input: splitsrc = src.split(':') file = splitsrc[0] # limit.json => Draw as full obs + exp limit band if len(splitsrc) == 1: graph_sets.append( plot.StandardLimitsFromJSONFile(file, args.show.split(','))) if axis is None: axis = plot.CreateAxisHists(len(pads), graph_sets[-1].values()[0], True) DrawAxisHists(pads, axis, pads[0]) plot.StyleLimitBand(graph_sets[-1]) plot.DrawLimitBand(pads[0], graph_sets[-1], legend=legend) pads[0].RedrawAxis() pads[0].RedrawAxis('g') pads[0].GetFrame().Draw() # limit.json:X => Draw a single graph for entry X in the json file # 'limit.json:X:Title="Blah",LineColor=4,...' => # as before but also apply style options to TGraph elif len(splitsrc) >= 2: settings = {}
axis_hists[i].Draw('AXIGSAME') if def_pad is not None: def_pad.cd() ## Boilerplate ROOT.PyConfig.IgnoreCommandLineOptions = True ROOT.gROOT.SetBatch(ROOT.kTRUE) plot.ModTDRStyle(height=500) ROOT.gStyle.SetNdivisions(510, 'XYZ') # probably looks better canv = ROOT.TCanvas('ttH_comb_limit', 'ttH_comb_limit') pads = plot.OnePad() graphs = plot.StandardLimitsFromJSONFile('merged_limit.json') legend = ROOT.TLegend(0.17, 0.50, 0.55, 0.75, '', 'NBNDC') plot.Set(legend, NColumns=1, Header='#bf{ttH production limits}') for name, gr in graphs.iteritems(): gr.Print() newgr = ROOT.TGraphAsymmErrors(gr.GetN()) for i in xrange(gr.GetN()): if name in ['exp1', 'exp2']: newgr.GetEYlow()[i] = gr.GetEYlow()[i] newgr.GetEYhigh()[i] = gr.GetEYhigh()[i] else: newgr.GetEYlow()[i] = 0. newgr.GetEYhigh()[i] = 0.