Example #1
0
            else:
                key = bin.leaves['CMS_channel'].index

            tot += bin.weight
            if key in asimov:
                asimov[key] += bin.weight
            else:
                asimov[key] = bin.weight

    asitot = total.Clone()
    asitot.Reset()
    asitot.Fill(tot, height)
    asitot.markerstyle = 20
    asitot.markercolor = 'red'

    f1 = plotter.parse_formula('height*TMath::Poisson(x, mean)',
                               'height[1], mean[%f]' % (tot), [0, 100000])
    f1.linecolor = 'red'
    f1.linewidth = 2
    peak = f1(tot)
    f1 = plotter.parse_formula('height*TMath::Poisson(x, mean)',
                               'height[%f], mean[%f]' % (height / peak, tot),
                               [0, 100000])

    canlog = all(i > 0 for i in asimov.itervalues())
    #jmap[savename] = asimov
    asimov = asimov.items()
    asimov.sort(key=sorting)

    havg = flush(avgs, linewidth=2, linecolor='red')
    hmed = flush(meds, linewidth=2, linecolor='blue')
    hasi = flush(asimov, linewidth=2, linecolor='black')
Example #2
0
                    toy.IsA().Destructor(toy)

        if args.conly:
            ccover.Fill(cval, float(ccover_ok) / cover_tot)
            if args.systematic:
                ccover_p.Fill(cval, float(ccoverp_ok) / cover_tot)
        else:
            ccover.Fill(cval, lval, float(ccover_ok) / cover_tot)
            lcover.Fill(cval, lval, float(lcover_ok) / cover_tot)
            if args.systematic:
                ccover_p.Fill(cval, lval, float(ccoverp_ok) / cover_tot)
                lcover_p.Fill(cval, lval, float(lcoverp_ok) / cover_tot)

        mtot = max(tot, mtot) if not args.asimov else 1
        fcn = BasePlotter.parse_formula(
            'amplitude*TMath::Gaus(x, mean, width)',
            'amplitude[100, 0, 1000], mean[1, 0, 2], width[0.5, 0, 2]', [0, 2])
        if args.conly:
            failing.Fill(cval, failed)
        else:
            failing.Fill(cval, lval, failed)
        xb = cbias.xaxis.find_bin(cval)
        if not args.conly:
            yb = cbias.yaxis.find_bin(lval)

        if args.usemean:
            bias = ufloat(csf.GetMean(), 0)
        elif args.asimov:
            bias = ufloat(csf, 0)
        else:
            csf.Fit(fcn, 'LQN0')