Exemple #1
0
                canvas.legend.add('eff',
                                  title=title,
                                  opt='LP',
                                  color=ROOT.kBlack,
                                  mstyle=8)
                canvas.legend.apply('eff', eff)
            else:
                eff.SetMarkerColor(ROOT.kBlack)
                eff.SetMarkerStyle(8)

            canvas.addHistogram(eff, drawOpt='EP', clone=False)

            canvas.xtitle = vtitle
            canvas.ylimits = (0., 1.1)

            canvas.Update()

            if type(binning) is tuple:
                eff.GetXaxis().SetLimits(binning[1], binning[2])
                eff.GetXaxis().SetRangeUser(binning[1], binning[2])
            else:
                eff.GetXaxis().SetLimits(binning[0], binning[-1])
                eff.GetXaxis().SetRangeUser(binning[0], binning[-1])

            eff.GetYaxis().SetRangeUser(0., 1.2)

            #            if tname == 'sph165abs' and vname.startswith('pt'):
            #                canvas.addLine(175., canvas.ylimits[0], 175., canvas.ylimits[1], color = ROOT.kRed, width = 2, style = ROOT.kDashed)

            canvas.printWeb(outName,
                            oname + '_' + mname + '_' + tname + '_' + vname,
Exemple #2
0
                nompset = nomparams.get(ip)
                if nompset.find('tpconf').getLabel() == conf and nompset.find(
                        'binName').getLabel() == bin:
                    break
            else:
                raise RuntimeError('Nom pset for ' + suffix + ' not found')

            nZ = nompset.find('nZ').getVal()

            toydist = toydists[bin][conf]
            toydist.Scale(1. / toydist.GetSumOfWeights())

            canvas.legend.apply('toys', toydist)

            canvas.addHistogram(toydist, drawOpt='HIST')
            canvas.Update(logy=False)
            arrow = canvas.addLine(nZ,
                                   toydist.GetMaximum() * 0.2,
                                   nZ,
                                   0.,
                                   width=2,
                                   cls=ROOT.TArrow)
            arrow.SetArrowSize(0.1)

            canvas.legend.apply('nominal', arrow)

            canvas.printWeb('efake/toys_' + binningName,
                            dataType + '_' + conf + '_' + bin,
                            logy=False)

outputFile.Close()