예제 #1
0
                      pregraph=tmp_gr))

if args.envelope and args.breakdown:
    for i in xrange(n_env):
        print '>> Correcting breakdown offsets for envelope index %i' % i
        gr = other_scans[i]['graph'].Clone()
        plot.RemoveSmallDelta(gr, 1E-6)
        bf = other_scans[i + n_env]['val'][0]
        y_off = other_scans[i]['func'].Eval(bf)
        print '>> Evaluating for offset at best-fit of %f gives %f' % (bf,
                                                                       y_off)
        for j in xrange(1, n_brk):
            oth = other_scans[i + j * n_env]
            print '>> Applying shift of %f to graph %s' % (
                y_off, other_scans_opts[i + j * n_env][0])
            plot.ApplyGraphYOffset(oth['graph'], y_off)
            color = oth['func'].GetLineColor()
            oth['spline'] = ROOT.TSpline3("spline3", oth['graph'])
            oth['func'] = ROOT.TF1(
                'splinefn' + str(NAMECOUNTER), partial(Eval, oth['spline']),
                oth['graph'].GetX()[0],
                oth['graph'].GetX()[oth['graph'].GetN() - 1], 1)
            func.SetNpx(NPX)
            oth['func'].SetLineColor(color)
            NAMECOUNTER += 1
    new_others = []
    for j in xrange(n_brk):
        if args.old_envelope:
            new_gr = ProcessEnvelope(main_scan,
                                     other_scans[n_env * j:n_env * (j + 1)],
                                     args.relax_safety)
예제 #2
0
                      improve=args.improve,
                      pregraph=tmp_gr))

if args.envelope and args.breakdown:
    for i in xrange(n_env):
        print '>> Correcting breakdown offsets for envelope index %i' % i
        gr = other_scans[i]['graph'].Clone()
        plot.RemoveSmallDelta(gr, 1E-6)
        bf = other_scans[i + n_env]['val'][0]
        y_off = other_scans[i]['func'].Eval(bf)
        print '>> Evaluating for offset at best-fit of %f gives %f' % (bf,
                                                                       y_off)
        for j in xrange(1, n_brk):
            print '>> Applying shift of %f to graph %s' % (
                y_off, other_scans_opts[i + j * n_env][0])
            plot.ApplyGraphYOffset(other_scans[i + j * n_env]['graph'], y_off)
    new_others = []
    for j in xrange(n_brk):
        new_gr = ProcessEnvelope(main_scan,
                                 other_scans[n_env * j:n_env * (j + 1)],
                                 args.relax_safety)
        if j == 0:
            main_scan = BuildScan(args.output,
                                  args.POI, [args.main],
                                  args.main_color,
                                  yvals,
                                  args.chop,
                                  args.remove_near_min,
                                  args.rezero,
                                  pregraph=new_gr)
        else: