Пример #1
0
def main(args):
    """Main"""
    set_basic_style()
    infiles = [r.TFile.Open(f) for f in args.inputfiles]

    outfile = r.TFile(args.outfile, 'recreate')
    outfile.cd()

    for var in ['lth', 'dlth', 'norm']:
        comb_ppd = get_combined_ppd(infiles, var)
        comb_ppd.SetName('ppd_1d_{}'.format(var))
        comb_ppd.Write()

        if args.debug_plots:
            outdir = dirname(args.outfile)
            filebase = basename(args.outfile).replace('.root', '')
            can = make_debug_plot(comb_ppd, infiles, var)
            can.SaveAs('{}/{}_comb_ppd_{}.pdf'.format(outdir, filebase, var))

    for var1, var2 in combinations(['lth', 'dlth', 'norm'], 2):
        comb_ppd = get_combined_ppd_2d(infiles, var1, var2)
        comb_ppd.SetName('ppd_2d_{}_{}'.format(var1, var2))
        comb_ppd.Write()

    outfile.Close()
Пример #2
0
def main(args):
    """Main"""
    set_basic_style()
    sdc_dir = args.inputdir
    cond_mkdir(args.outdir)
    if args.plot_all:
        plot_all_sdcs(sdc_dir, args.type, args.outdir)

    plot_psi_sdcs(sdc_dir, args.type, args.outdir)
    plot_chic1_sdcs(sdc_dir, args.type, args.outdir)
    plot_chic2_sdcs(sdc_dir, args.type, args.outdir)
def main(args):
    """Main"""
    set_basic_style()

    input_files = parse_inputs(args.input)
    outdir = '/'.join(['.', args.outdir])
    cond_mkdir(outdir)

    for var_pair in PLOT_PAIRS:
        can = make_2d_contour_plot(input_files, var_pair)
        save_name = outdir + '/' + 'corr_2d_{}_{}.pdf'.format(*var_pair)
        can.SaveAs(save_name)
Пример #4
0
def main(args):
    """Main"""
    set_basic_style()
    cgraph_file = r.TFile.Open(args.centralfile)
    var_files = [
        r.TFile.Open(f) for f in args.variationfiles if f != args.centralfile
    ]

    with open('variation_files.json', 'w') as varf:
        variations = [[i, f.GetName()] for i, f in enumerate(var_files)]
        json.dump(variations, varf, indent=2)

    for param in args.params.split(','):
        process_param(cgraph_file, var_files, param, args.variable,
                      'all_systematic_graphs.root')
def main(args):
    """Main"""
    set_basic_style()
    dbfile = r.TFile.Open(args.debugfile)
    var = determine_bin_variable(dbfile)

    cond_mkdir(args.outdir)

    for state in ['chi1', 'chi2']:
        can = make_rej_evs_w_state_prob_plot(dbfile, state, var)
        can.SaveAs('{}/{}_state_probs_rej_evs_{}_bins.pdf'.format(
            args.outdir, state, var))

        can = make_state_prob_plot(dbfile, state, var)
        can.SaveAs('{}/{}_state_prob_{}_bins.pdf'.format(
            args.outdir, state, var))
def main(args):
    """Main"""
    set_basic_style()
    vargraph_f = r.TFile.Open(args.variationfile)

    with open(args.plot_config, 'r') as pconff:
        plot_config = json.load(pconff)

    cond_mkdir(args.outdir)

    can = make_ratio_comp_plot(vargraph_f, plot_config, args.variable)
    can.SaveAs('{}/r_chic2_chic1_comp_vars_nominal.pdf'.format(args.outdir))

    can = make_abs_diff_plot(vargraph_f, plot_config, args.variable)
    can.SaveAs('{}/r_chic2_chic1_abs_diff_comp_vars.pdf'.format(args.outdir))

    can = make_rel_diff_plot(vargraph_f, plot_config, args.variable)
    can.SaveAs('{}/r_chic2_chic1_rel_diff_comp_vars.pdf'.format(args.outdir))
def main(args):
    """Main"""
    set_basic_style()
    r.gStyle.SetPadLeftMargin(0.4)

    with open(args.plotconfig, 'r') as conff:
        plot_config = json.load(conff)

    var_files = open_files(plot_config['variations'])
    nom_file = r.TFile.Open(plot_config['nominal'])

    cond_mkdir(args.outdir)
    can = make_var_plot(nom_file, var_files, args.variable)
    can.SaveAs('{}/comp_ppd_variations_nominal.pdf'.format(args.outdir))

    if args.plot_ppd:
        set_basic_style()
        can = make_ppd_comp_plot(nom_file, var_files, args.variable)
        can.SaveAs('{}/comp_ppds_full_ppds_variations_nominal.pdf'.format(
            args.outdir))
Пример #8
0
def main(args):
    """Main"""
    set_basic_style()
    llh_data = get_dataframe(args.scanfile, 'log_like_scan')

    cond_mkdir(args.outdir)

    can = make_plot_good_fit(llh_data, args.variable_x, args.variable_y,
                             args.transform_x, args.transform_y)
    can.SaveAs('/'.join([args.outdir, 'scan_good_fit.pdf']))

    can = make_plot_min_chi2(llh_data, args.variable_x, args.variable_y,
                             args.transform_x, args.transform_y)
    can.SaveAs('/'.join([args.outdir, 'chi2_vals_all_fits.pdf']))

    can = make_plot_min_chi2(llh_data,
                             args.variable_x,
                             args.variable_y,
                             args.transform_x,
                             args.transform_y,
                             gf_only=True)
    can.SaveAs('/'.join([args.outdir, 'chi2_vals_good_fits.pdf']))
def main(args):
    """Main"""
    set_basic_style()
    gfile = r.TFile.Open(args.graphfile)

    cond_mkdir(args.outdir)

    for pfunc in [
            psi2S_cs, jpsi_cs, chic_cs, chic_ratio_cs, psi_pol, combined_cs,
            psi2S_cs_pulls, jpsi_cs_pulls, psi_2S_rel_diff, jpsi_rel_diff
    ]:
        can = pfunc(gfile)
        can.SaveAs('/'.join([args.outdir, pfunc.__name__ + '.pdf']))

    for ptm, can in costh_ratios(gfile):
        can.SaveAs('/'.join(
            [args.outdir, 'costh_ratio_ptm_{}.pdf'.format(ptm)]))

    can = combined_cs(gfile, 'ATLAS')
    can.SaveAs('/'.join([args.outdir, 'combined_cs_ATLAS']) + '.pdf')

    can = combined_cs(gfile, 'CMS')
    can.SaveAs('/'.join([args.outdir, 'combined_cs_CMS']) + '.pdf')