diff --git a/extras/lh_bench_23/.gitignore b/extras/lh_bench_23/.gitignore index 2942ad98d..79e096ab2 100644 --- a/extras/lh_bench_23/.gitignore +++ b/extras/lh_bench_23/.gitignore @@ -1,3 +1,4 @@ *.tar *.csv *.dat +*.tex diff --git a/extras/lh_bench_23/cfg.py b/extras/lh_bench_23/cfg.py index ef7c747ef..c3700687d 100644 --- a/extras/lh_bench_23/cfg.py +++ b/extras/lh_bench_23/cfg.py @@ -62,10 +62,12 @@ def vfns_theory(xif=1.0): ] -def ffns_theory(xif=1.0): +def ffns_theory(xif=1.0, pto=2): """Generate a VFNS theory card.""" tt = copy.deepcopy(_t_ffns) tt["xif"] = xif + tt["order"] = (pto + 1, 0) + tt["matching_order"] = (pto, 0) return runcards.TheoryCard.from_dict(tt) @@ -107,9 +109,15 @@ def n3lo_theory(ad_variation, is_ffns, use_fhmruvv=False, xif=1.0): ) vfns_operator = runcards.OperatorCard.from_dict(_o_vfns) -_o_ffns = copy.deepcopy(_o_vfns) -_o_ffns["mugrid"] = [(100.0, 4)] -ffns_operator = runcards.OperatorCard.from_dict(_o_ffns) + +def ffns_operator(ev_method="iterate-exact"): + """Generate a FFNS theory card.""" + op = copy.deepcopy(_o_vfns) + op["mugrid"] = [(100.0, 4)] + op["configs"]["evolution_method"] = ev_method + if ev_method == "truncated": + op["configs"]["ev_op_iterations"] = 1 + return runcards.OperatorCard.from_dict(op) # flavor rotations diff --git a/extras/lh_bench_23/parse_to_latex.py b/extras/lh_bench_23/parse_to_latex.py new file mode 100644 index 000000000..7f59ddc2b --- /dev/null +++ b/extras/lh_bench_23/parse_to_latex.py @@ -0,0 +1,179 @@ +from cfg import here, table_dir, xgrid +from utils import compute_n3lo_avg_err, load_n3lo_tables + +n3lo_table_dir = table_dir + +latex_tab = here / "latex_tab" +latex_tab.mkdir(exist_ok=True) + +SVS = ["central", "up", "down"] + +MIDRULE1 = r""" +\hline \hline +\multicolumn{9}{||c||}{} \\[-3mm] +\multicolumn{9}{||c||}{""" + +MIDRULE2 = r"""} \\ +\multicolumn{9}{||c||}{} \\[-0.3cm] +\hline \hline + & & & & & & & \\[-0.3cm] +""" + +BOTTOMRULE = r""" +\hline \hline +\end{tabular} +\end{center} +\end{table} +""" + +VFNS_LABELS = r""" + \multicolumn{1}{c|} {$xu_v$} & + \multicolumn{1}{c|} {$xd_v$} & + \multicolumn{1}{c|} {$xL_-$} & + \multicolumn{1}{c|} {$xL_+$} & + \multicolumn{1}{c|} {$xs_+$} & + \multicolumn{1}{c|} {$xc_+$} & + \multicolumn{1}{c|} {$xb_+$} & + \multicolumn{1}{c||}{$xg$} \\[0.5mm] + """ + +FFNS_LABELS = r""" + \multicolumn{1}{c|} {$xu_v$} & + \multicolumn{1}{c|} {$xd_v$} & + \multicolumn{1}{c|} {$xL_-$} & + \multicolumn{1}{c|} {$xL_+$} & + \multicolumn{1}{c|} {$xs_v$} & + \multicolumn{1}{c|} {$xs_+$} & + \multicolumn{1}{c|} {$xc_+$} & + \multicolumn{1}{c||}{$xg$} + """ + + +def insert_headrule(scheme, approx, caption): + """Insert the middle rule.""" + label = r"\label{tab:" + f"n3lo_{scheme.lower()}_{approx.lower()}" + "}" + scheme_label = ( + r", $\, N_{\rm f} = 3\ldots 5\,$," + if scheme == "VFNS" + else r"$\, N_{\rm f} = 4$," + ) + HEADRULE = ( + r""" + \begin{table}[htp] + \caption{""" + + caption + + r"""} + """ + + label + + r""" + \begin{center} + \vspace{5mm} + \begin{tabular}{||c||r|r|r|r|r|r|r|r||} + \hline \hline + \multicolumn{9}{||c||}{} \\[-3mm] + \multicolumn{9}{||c||}{""" + # + r"""aN$^3$LO, """ + + approx + + scheme_label + + r"""$\,\mu_{\rm f}^2 = 10^4 \mbox{ GeV}^2$} \\ + \multicolumn{9}{||c||}{} \\[-0.3cm] + \hline \hline + \multicolumn{9}{||c||}{} \\[-3mm] + \multicolumn{1}{||c||}{$x$} & + """ + ) + HEADRULE += VFNS_LABELS if scheme == "VFNS" else FFNS_LABELS + HEADRULE += r"""\\[0.5mm]""" + return HEADRULE + + +def insert_midrule(sv): + """Insert the middle rule.""" + # TODO: is this mapping correct or the other way round ?? + # xif2 = 2 -> up + # xif2 = 1/2 -> down + label = { + "central": r"$\mu_{\rm r}^2 = \ \mu_{\rm f}^2$", + "down": r"$\mu_{\rm r}^2 = 0.5 \ \mu_{\rm f}^2$", + "up": r"$\mu_{\rm r}^2 = 2 \ \mu_{\rm f}^2$", + } + return MIDRULE1 + label[sv] + MIDRULE2 + + +def format_float(values): + """Clean float format.""" + values = values.replace("0000", "0") + values = values.replace("e-0", "$^{-") + values = values.replace("e-10", "$^{-10") + values = values.replace("e+0", "$^{+") + values = values.replace("&", "}$ &") + values = values.replace(r"\\", r"}$ \\") + return values + + +def dump_table(scheme: str, approx: str, caption: str): + """Write a nice latex table.""" + final_tab = insert_headrule(scheme, approx.replace("EKO", "NNPDF"), caption) + # loop on scales + for sv in SVS: + # load tables + dfs = load_n3lo_tables(n3lo_table_dir, scheme, sv=sv, approx=approx) + + central, err = compute_n3lo_avg_err(dfs) + + central.insert(0, "x", xgrid) + values = central.to_latex(float_format="{:.4e}".format, index=False) + values = "".join(e for e in values.split("\n")[4:-3]) + final_tab += insert_midrule(sv) + format_float(values) + + final_tab += BOTTOMRULE + + # write + with open( + latex_tab / f"table-{scheme}-{approx.replace('EKO', 'NNPDF')}.tex", + "w", + encoding="utf-8", + ) as f: + f.writelines(final_tab) + + +if __name__ == "__main__": + approx = "FHMRUVV" + scheme = "FFNS" + caption = r""" + Results for the FFNS aN$^3$LO evolution + for the initial conditions and the input parton distributions + given in Sec.~\ref{sec:toy_pdf}, + with the FHMRUVV splitting functions approximation and the NNPDF code. + """ + dump_table(scheme, approx, caption) + + approx = "FHMRUVV" + scheme = "VFNS" + caption = r""" + Results for the VFNS aN$^3$LO evolution + for the initial conditions and the input parton distributions + given in Sec.~\ref{sec:toy_pdf}, + with the FHMRUVV splitting functions approximation and the NNPDF code. + """ + dump_table(scheme, approx, caption) + + approx = "EKO" + scheme = "FFNS" + caption = r""" + Results for the FFNS aN$^3$LO evolution + for the initial conditions and the input parton distributions + given in Sec.~\ref{sec:toy_pdf}, + with the NNPDF splitting functions approximation. + """ + dump_table(scheme, approx, caption) + + approx = "EKO" + scheme = "VFNS" + caption = r""" + Results for the VFNS aN$^3$LO evolution + for the initial conditions and the input parton distributions + given in Sec.~\ref{sec:toy_pdf}, + with the NNPDF splitting functions approximation. + """ + dump_table(scheme, approx, caption) diff --git a/extras/lh_bench_23/plot_bench.py b/extras/lh_bench_23/plot_bench.py deleted file mode 100644 index 6887e7ac3..000000000 --- a/extras/lh_bench_23/plot_bench.py +++ /dev/null @@ -1,49 +0,0 @@ -from cfg import here, table_dir, xgrid -from utils import ( - compute_n3lo_avg_err, - compute_n3lo_nnlo_diff, - load_n3lo_tables, - load_nnlo_table, - plot_diff_to_nnlo, - plot_pdfs, -) - -USE_LINX = True -REL_DIFF = True -SCHEME = "VFNS" -SV = "central" - -plot_dir = here / "plots" -n3lo_table_dir = table_dir # / SCHEME - - -# load tables -eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="EKO") -fhmv_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="FHMV") -nnlo_central = load_nnlo_table(table_dir, SCHEME, SV) - -# compute avg and std -eko_res = compute_n3lo_avg_err(eko_dfs) -fhmv_res = compute_n3lo_avg_err(fhmv_dfs) -# eko_4mom_res = = compute_n3lo_avg_err(eko_dfs_4mom) - -n3lo_dfs = [ - (eko_res, "aN3LO EKO"), - (fhmv_res, "aN3LO FHMV"), - # (eko_4mom_res, "aN3LO EKO 4 mom"), -] - -# PDFs plots -plot_pdfs(xgrid, n3lo_dfs, nnlo_central, SCHEME, USE_LINX, plot_dir) - -# relative diff plots -eko_diff = compute_n3lo_nnlo_diff(eko_res, nnlo_central, REL_DIFF) -fhmv_diff = compute_n3lo_nnlo_diff(fhmv_res, nnlo_central, REL_DIFF) -n3lo_dfs = [ - (eko_diff, "aN3LO EKO"), - (fhmv_diff, "aN3LO FHMV"), - # (eko_4mom_res, "aN3LO EKO 4 mom"), -] - -# relative, absolute diff plots -plot_diff_to_nnlo(xgrid, n3lo_dfs, SCHEME, USE_LINX, plot_dir, REL_DIFF) diff --git a/extras/lh_bench_23/plot_bench_evol.py b/extras/lh_bench_23/plot_bench_evol.py index 92972af14..af25f5c65 100644 --- a/extras/lh_bench_23/plot_bench_evol.py +++ b/extras/lh_bench_23/plot_bench_evol.py @@ -18,17 +18,21 @@ # load tables -eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="EKO", rotate_to_evol=True) -fhmv_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="FHMV", rotate_to_evol=True) +eko_dfs = load_n3lo_tables( + n3lo_table_dir, SCHEME, sv="central", approx="EKO", rotate_to_evol=True +) +fhmruvv_dfs = load_n3lo_tables( + n3lo_table_dir, SCHEME, sv="central", approx="FHMRUVV", rotate_to_evol=True +) nnlo_central = load_nnlo_table(table_dir, SCHEME, SV, rotate_to_evol=True) # compute avg and std eko_res = compute_n3lo_avg_err(eko_dfs) -fhmv_res = compute_n3lo_avg_err(fhmv_dfs) +fhmruvv_res = compute_n3lo_avg_err(fhmruvv_dfs) n3lo_dfs = [ (eko_res, "aN3LO EKO"), - (fhmv_res, "aN3LO FHMV"), + (fhmruvv_res, "aN3LO FHMRUVV"), ] # absolute plots @@ -36,10 +40,10 @@ # relative, absolute diff plots eko_diff = compute_n3lo_nnlo_diff(eko_res, nnlo_central, REL_DIFF) -fhmv_diff = compute_n3lo_nnlo_diff(fhmv_res, nnlo_central, REL_DIFF) +fhmruvv_diff = compute_n3lo_nnlo_diff(fhmruvv_res, nnlo_central, REL_DIFF) n3lo_dfs = [ (eko_diff, "aN3LO EKO"), - (fhmv_diff, "aN3LO FHMV"), + (fhmruvv_diff, "aN3LO FHMRUVV"), ] plot_diff_to_nnlo(xgrid, n3lo_dfs, SCHEME, USE_LINX, plot_dir, REL_DIFF) diff --git a/extras/lh_bench_23/plot_bench_msht.py b/extras/lh_bench_23/plot_bench_msht.py index f693d5bbd..f99c4c613 100644 --- a/extras/lh_bench_23/plot_bench_msht.py +++ b/extras/lh_bench_23/plot_bench_msht.py @@ -15,48 +15,51 @@ SV = "central" plot_dir = here / "plots_msht" -n3lo_table_dir = table_dir # / SCHEME +n3lo_table_dir = table_dir msht_table_dir = table_dir # load tables -eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="EKO") -fhmv_eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, approx="FHMV") -msht_dfs = load_msht(msht_table_dir, SCHEME, approx="MSHT") -fhmv_msht_dfs = load_msht(msht_table_dir, SCHEME, approx="FHMV") +eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, SV, approx="EKO") + +fhmruvv_eko_dfs = load_n3lo_tables(n3lo_table_dir, SCHEME, SV, approx="FHMRUVV") +fhmruvv_msht_dfs = load_msht(msht_table_dir, SCHEME, approx="FHMRUVV") + +msht_post_dfs = load_msht(msht_table_dir, SCHEME, approx="MSHTposterior") +msht_prior_dfs = load_msht(msht_table_dir, SCHEME, approx="MSHTprior") nnlo_central = load_nnlo_table(table_dir, SCHEME, SV) # compute avg and std eko_res = compute_n3lo_avg_err(eko_dfs) -fhmv_eko_res = compute_n3lo_avg_err(fhmv_eko_dfs) -msht_res = compute_n3lo_avg_err(msht_dfs) -fhmv_msht_res = compute_n3lo_avg_err(fhmv_msht_dfs) -# eko_4mom_res = = compute_n3lo_avg_err(eko_dfs_4mom) +fhmruvv_eko_res = compute_n3lo_avg_err(fhmruvv_eko_dfs) +fhmruvv_msht_res = compute_n3lo_avg_err(fhmruvv_msht_dfs) +msht_post_res = compute_n3lo_avg_err(msht_post_dfs) +msht_prior_res = compute_n3lo_avg_err(msht_prior_dfs) -n3lo_dfs = [ - (eko_res, "EKO"), - (fhmv_eko_res, "FHMV EKO"), - (msht_res, "MSHT"), - (fhmv_msht_res, "FHMV MSHT"), - # (eko_4mom_res, "aN3LO EKO 4 mom"), -] +# compute average of FHMRUVV +fhmruvv_res = [] +for a, b in zip(fhmruvv_msht_res, fhmruvv_eko_res): + fhmruvv_res.append((a + b) / 2) # PDFs plots +n3lo_dfs = [ + (fhmruvv_res, "FHMRUVV"), + (msht_prior_res, "MSHT (prior)"), + (msht_post_res, "MSHT (posterior)"), + (eko_res, "NNPDF"), +] plot_pdfs(xgrid, n3lo_dfs, nnlo_central, SCHEME, USE_LINX, plot_dir) -# relative diff plots +# relative, absolute diff plots eko_diff = compute_n3lo_nnlo_diff(eko_res, nnlo_central, REL_DIFF) -fhmv_eko_diff = compute_n3lo_nnlo_diff(fhmv_eko_res, nnlo_central, REL_DIFF) -msht_diff = compute_n3lo_nnlo_diff(msht_res, nnlo_central, REL_DIFF) -fhmv_msht_diff = compute_n3lo_nnlo_diff(fhmv_msht_res, nnlo_central, REL_DIFF) +fhmruvv_diff = compute_n3lo_nnlo_diff(fhmruvv_res, nnlo_central, REL_DIFF) +msht_prior_diff = compute_n3lo_nnlo_diff(msht_prior_res, nnlo_central, REL_DIFF) +msht_post_diff = compute_n3lo_nnlo_diff(msht_post_res, nnlo_central, REL_DIFF) n3lo_dfs = [ - (eko_diff, "EKO"), - (fhmv_eko_diff, "FHMV EKO"), - (msht_diff, "MSHT"), - (fhmv_msht_diff, "FHMV MSHT"), - # (eko_4mom_res, "aN3LO EKO 4 mom"), + (fhmruvv_diff, "FHMRUVV"), + (msht_prior_diff, "MSHT (prior)"), + (msht_post_diff, "MSHT (posterior)"), + (eko_diff, "NNPDF"), ] - -# relative, absolute diff plots plot_diff_to_nnlo(xgrid, n3lo_dfs, SCHEME, USE_LINX, plot_dir, REL_DIFF) diff --git a/extras/lh_bench_23/plot_trn_exa.py b/extras/lh_bench_23/plot_trn_exa.py new file mode 100644 index 000000000..7558cedab --- /dev/null +++ b/extras/lh_bench_23/plot_trn_exa.py @@ -0,0 +1,64 @@ +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +from cfg import table_dir, xgrid +from utils import HERE, lha_labels + +from eko.io.types import EvolutionMethod + +plt.style.use(HERE / "plotstyle.mplstyle") +plot_dir = HERE / "plots_trn_exa" + +PTOS = {1: "NLO", 2: "NNLO", 3: "N$^3$LO"} + +COLUMNS_TO_KEEP = ["L_m", "L_p", "g"] + + +def load_table(method): + """Load tables.""" + dfs = {} + for pto in PTOS: + with open(table_dir / f"table_FFNS-{pto}_{method}.csv", encoding="utf-8") as f: + dfs[pto] = pd.read_csv(f, index_col=0) + return dfs + + +def plot_diff(xgrid, dfs_trn, dfs_exa): + cut_smallx = 0 + cut_largex = -1 + xgrid = xgrid[cut_smallx:cut_largex] + + plot_dir.mkdir(exist_ok=True) + + # loop on PDFs + for column in COLUMNS_TO_KEEP: + _, ax = plt.subplots(1, 1, figsize=(1 * 5, 1 * 3.5)) + j = np.where(dfs_trn[1].columns == column)[0][0] + + # loop on ptos + for pto, pto_label in PTOS.items(): + diff = (dfs_trn[pto] - dfs_exa[pto]) / dfs_trn[pto] * 100 + + ax.plot(xgrid, diff.values[cut_smallx:cut_largex, j], label=pto_label) + ax.hlines( + 0, + xgrid.min() - xgrid.min() / 3, + 1, + linestyles="dotted", + color="black", + linewidth=0.5, + ) + ax.set_xscale("log") + ax.set_xlabel("$x$") + ax.set_ylabel(f'${lha_labels("FFNS")[j]}$') + ax.set_xlim(xgrid.min() - xgrid.min() / 3, 1) + + plt.legend() + plt.tight_layout() + plt.savefig(f"{plot_dir}/diff_trn_exa_{column}.pdf") + + +if __name__ == "__main__": + dfs_trn = load_table(EvolutionMethod.TRUNCATED.value) + dfs_exa = load_table(EvolutionMethod.ITERATE_EXACT.value) + plot_diff(xgrid, dfs_trn, dfs_exa) diff --git a/extras/lh_bench_23/run-n3lo.py b/extras/lh_bench_23/run-n3lo.py index 4ee00d520..8098f28dc 100644 --- a/extras/lh_bench_23/run-n3lo.py +++ b/extras/lh_bench_23/run-n3lo.py @@ -76,7 +76,7 @@ use_fhmruvv=args.use_fhmruvv, xif=xif, ) - o = ffns_operator + o = ffns_operator() tab = 14 lab = ffns_labels rot = ffns_rotate_to_LHA diff --git a/extras/lh_bench_23/run-nnlo.py b/extras/lh_bench_23/run-nnlo.py index 85ab2f984..9f5c681cc 100644 --- a/extras/lh_bench_23/run-nnlo.py +++ b/extras/lh_bench_23/run-nnlo.py @@ -3,7 +3,6 @@ import pathlib import sys -import numpy as np import pandas as pd import yaml from banana import toy @@ -63,7 +62,7 @@ if args.scheme == "FFNS": scheme = "FFNS" t = ffns_theory(xif) - o = ffns_operator + o = ffns_operator() tab = 14 lab = ffns_labels rot = ffns_rotate_to_LHA diff --git a/extras/lh_bench_23/run-trn_exa.py b/extras/lh_bench_23/run-trn_exa.py new file mode 100644 index 000000000..97d1a1cf5 --- /dev/null +++ b/extras/lh_bench_23/run-trn_exa.py @@ -0,0 +1,72 @@ +import logging +import pathlib +import sys + +import pandas as pd +from banana import toy +from cfg import ( + ffns_labels, + ffns_operator, + ffns_rotate_to_LHA, + ffns_theory, + n3lo_theory, + table_dir, + xgrid, +) + +import eko +from eko.io.types import EvolutionMethod +from eko.runner.managed import solve +from ekobox import apply + +stdout_log = logging.StreamHandler(sys.stdout) +logger = logging.getLogger("eko") +logger.handlers = [] +logger.setLevel(logging.INFO) +logger.addHandler(stdout_log) + + +def compute(op_card, th_card): + rot = ffns_rotate_to_LHA + lab = ffns_labels + + method = op_card.configs.evolution_method.value + pto = th_card.order[0] - 1 + path = pathlib.Path(f"ekos/FFNS-{pto}_{method}.tar") + path.unlink(missing_ok=True) + + solve(th_card, op_card, path) + + # apply PDF + out = {} + with eko.EKO.read(path) as eko_: + pdf = apply.apply_pdf_flavor(eko_, toy.mkPDF("ToyLH", 0), xgrid, rot, lab) + for lab, f in list(pdf.values())[0]["pdfs"].items(): + out[lab] = xgrid * f + + # display result + pd.set_option("display.float_format", "{:.4e}".format) + me = pd.DataFrame(out) + print("EKO") + print(me) + # dump to file + table_dir.mkdir(exist_ok=True) + me.to_csv(f"{table_dir}/table_FFNS-{pto}_{method}.csv") + + +if __name__ == "__main__": + # loop on ev methods + for ev_method in [EvolutionMethod.TRUNCATED, EvolutionMethod.ITERATE_EXACT]: + op_card = ffns_operator(ev_method=ev_method.value) + # loop on pto + for pto in [1, 2, 3]: + if pto == 3: + th_card = n3lo_theory( + ad_variation=(0, 0, 0, 0, 0, 0, 0), + is_ffns=True, + use_fhmruvv=True, + xif=1.0, + ) + else: + th_card = ffns_theory(xif=1.0, pto=pto) + compute(op_card, th_card) diff --git a/extras/lh_bench_23/run_fhmv.sh b/extras/lh_bench_23/run_fhmruvv.sh similarity index 76% rename from extras/lh_bench_23/run_fhmv.sh rename to extras/lh_bench_23/run_fhmruvv.sh index 45807ea4d..a9c572ea8 100755 --- a/extras/lh_bench_23/run_fhmv.sh +++ b/extras/lh_bench_23/run_fhmruvv.sh @@ -1,12 +1,12 @@ #!/bin/bash -SCHEME="FFNS" -SV="central" +SCHEME="VFNS" +SV="up" AD_VAR=(0 0 0 0 0 0 0) # run the central -python run-n3lo.py $SCHEME $SV "${AD_VAR[@]}" "--use_fhmv" +python run-n3lo.py $SCHEME $SV "${AD_VAR[@]}" "--use_fhmruvv" # loop on gammas for I in {0..6} @@ -15,7 +15,7 @@ for I in {0..6} for VAR in {1..2} do AD_VAR[$I]=$VAR - python run-n3lo.py $SCHEME $SV "${AD_VAR[@]}" "--use_fhmv" + python run-n3lo.py $SCHEME $SV "${AD_VAR[@]}" "--use_fhmruvv" AD_VAR[$I]=0 done done diff --git a/extras/lh_bench_23/tables/EKO.zip b/extras/lh_bench_23/tables/EKO.zip new file mode 100644 index 000000000..66a797e7a Binary files /dev/null and b/extras/lh_bench_23/tables/EKO.zip differ diff --git a/extras/lh_bench_23/tables/MSHT.zip b/extras/lh_bench_23/tables/MSHT.zip new file mode 100644 index 000000000..f8b21d7e3 Binary files /dev/null and b/extras/lh_bench_23/tables/MSHT.zip differ diff --git a/extras/lh_bench_23/tables/table14-part1.csv b/extras/lh_bench_23/tables/table14-part1.csv new file mode 100644 index 000000000..a097532e3 --- /dev/null +++ b/extras/lh_bench_23/tables/table14-part1.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_v,s_p,c_p,g +0,0.00015287245911193973,0.00010244420879692456,5.701804944047695e-06,131.87354078018697,3.1436816070190436e-05,64.86280173199475,64.14679157813721,997.1307561193358 +1,0.0006917569524690991,0.0004428380604103019,2.540962411572222e-05,68.4720191281346,9.42792786741986e-05,33.38326131051351,32.81465915127868,490.92487156828173 +2,0.0030981326270356786,0.0018974460360321244,0.00010718483116568849,33.461112615453715,0.00022789575898341058,16.053854716894566,15.602425570742932,222.8638269365544 +3,0.013721769310852954,0.008101888077206186,0.0004255769417049491,15.198222322725028,0.0003664344617706678,7.064240906094766,6.707006911909647,90.62109137834351 +4,0.05915981022842837,0.034050091187079676,0.001600817741486654,6.320848112146725,0.00014478892398732063,2.746344166794711,2.4693798899099697,31.335057045083516 +5,0.23078124616541104,0.12918608326642272,0.005568820929143852,2.274488527118306,-0.0005731348830417141,0.8546973873853968,0.6659329364925008,8.134786865601695 +6,0.5517722225901678,0.27164625865340714,0.01002324771919923,0.3901999927214852,-0.0003062707790024255,0.11386287962380881,0.05978038012395867,0.9057095918940038 +7,0.350710705459186,0.13024518634017762,0.0030097514678153223,0.03538233025460973,-3.189051747450462e-05,0.009059784104510277,0.00331784676447431,0.08419882231397229 +8,0.12116571740510448,0.03152817955811504,0.0003774489567551988,0.0023978725250082887,-2.7212872822323428e-06,0.0005852689571532032,0.00017734627513034333,0.008114298655058918 +9,0.02007661343791621,0.003089686879163111,1.3425066324357693e-05,5.645029865879282e-05,-1.009573276531744e-07,1.4094927426920052e-05,4.729604168208169e-06,0.0003893466314738704 +10,0.00034831969426205625,1.8126120451104446e-05,1.3857168200479219e-08,1.0976694347403099e-07,-1.9538726216645008e-10,4.266251710132014e-08,3.467022512797678e-08,1.3144918135419134e-06 diff --git a/extras/lh_bench_23/tables/table15-part1.csv b/extras/lh_bench_23/tables/table15-part1.csv new file mode 100644 index 000000000..26e73cb1b --- /dev/null +++ b/extras/lh_bench_23/tables/table15-part1.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_p,c_p,b_p,g +0,0.000159782374311217,0.00010699241911535113,6.009015496846315e-06,139.13928062954858,68.49731978436135,66.91697983928132,57.42568592704109,996.6675145065224 +1,0.0007178657639104188,0.0004592942706299979,2.6568708091322922e-05,71.68226745584901,34.989734427967946,33.836111498021616,28.320322848276696,487.9438171573828 +2,0.0031907023731048067,0.0019531589653931118,0.00011115555132507422,34.72298924611498,16.685881942626345,15.870039212653651,12.89214786058769,220.04499947199793 +3,0.0140232686578052,0.008274868945261757,0.00043743669108779867,15.611573096850242,7.271850237393598,6.721668446807849,5.257516676590805,88.7642975497294 +4,0.06001919955770306,0.03451917692499591,0.0016295699869199906,6.4149915243002935,2.794346511134117,2.448361021098347,1.813137812920204,30.390653078319012 +5,0.2324397382646147,0.12999889623824362,0.005609993691256854,2.2770541079861912,0.8571489068450455,0.6671721948337064,0.45050945142907206,7.787634909871445 +6,0.5499296886621222,0.27035225414735103,0.009959484979999919,0.3852489055042383,0.11229965666994945,0.06446333792031315,0.03727981250433008,0.852656883395241 +7,0.3462202170026868,0.12832721263591973,0.0029571097572013033,0.03460464974152799,0.008843196612568945,0.004015330303851035,0.0021060685257447464,0.07889787366674228 +8,0.11867951049731149,0.03081193356732983,0.0003676360060554282,0.0023218852746459554,0.0005641707476070221,0.00023861193568355801,0.00012078286516159336,0.007639901954040944 +9,0.019485952078180744,0.0029916486471481363,1.2941610344354708e-05,5.2561756934419664e-05,1.2683117277967177e-05,5.826485625318874e-06,3.040799711776502e-06,0.00037059333306847114 +10,0.000333151299898071,1.7424361032069554e-05,1.0526658121963792e-08,5.649526949817055e-08,2.021241819112724e-08,1.4645616584749484e-08,7.723841186086722e-09,1.2675973256045495e-06 diff --git a/extras/lh_bench_23/tables/table_FFNS-1_iterate-exact.csv b/extras/lh_bench_23/tables/table_FFNS-1_iterate-exact.csv new file mode 100644 index 000000000..aa9194389 --- /dev/null +++ b/extras/lh_bench_23/tables/table_FFNS-1_iterate-exact.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_v,s_p,c_p,g +0,0.0001061603548957915,6.23275472893752e-05,4.243957986065169e-06,135.94488325163329,-1.3010426069826054e-24,66.89456720413183,66.1759773366227,1147.8382214801056 +1,0.0005417657995652307,0.0003171899670480823,1.924091431171264e-05,68.36483648465217,-2.803667050041078e-16,33.326476266126036,32.75582146241892,538.7782369295227 +2,0.002687028982050863,0.0015677446978947405,8.357487370497726e-05,32.717724902071076,-1.8013338745430897e-16,15.679390309776986,15.22631846481875,235.17837712758714 +3,0.012841192800483271,0.007455766650175842,0.0003491097699833948,14.740323158751147,-1.3713861343986286e-16,6.8326719755594665,6.474102527297386,92.82524428423069 +4,0.05792559347182856,0.03333664735103119,0.0014161667774037975,6.162724959898692,-3.8507059009079235e-17,2.664880702993033,2.3867931368899464,31.488337782656565 +5,0.2302608560372903,0.12928105161452907,0.005325089076559043,2.252020696315615,3.390856095543345e-17,0.8418976521783023,0.6521710660642149,8.103188280181767 +6,0.5545223543069604,0.2733637481554953,0.010011414114518028,0.39337625615206745,1.113642593562985e-17,0.11490132195877217,0.06035880709178404,0.8987461285947349 +7,0.3539304069655586,0.13157575236540345,0.0030361828873799843,0.035871126114853706,7.415413557939977e-18,0.009214748678713814,0.0034006624187515656,0.08346281894419927 +8,0.12270649770189059,0.03196706036819016,0.00038269696480829947,0.0024236558222823206,2.2470104466262916e-18,0.0005898279188058254,0.00017515898522900972,0.008048879945233074 +9,0.020428258680076757,0.003148466517802246,1.3695745989556196e-05,5.5812869364637646e-05,6.435968613004415e-19,1.354956993547647e-05,3.978271511150513e-06,0.00038707753770232445 +10,0.0003581429894790383,1.8653182735031733e-05,1.432179062713306e-08,1.0462935965324338e-07,1.8140662449013975e-21,3.9923215185189465e-08,3.166189618573618e-08,1.312069774579141e-06 diff --git a/extras/lh_bench_23/tables/table_FFNS-1_truncated.csv b/extras/lh_bench_23/tables/table_FFNS-1_truncated.csv new file mode 100644 index 000000000..f715f873a --- /dev/null +++ b/extras/lh_bench_23/tables/table_FFNS-1_truncated.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_v,s_p,c_p,g +0,0.00010723462916228652,6.304516731093268e-05,4.164754964544373e-06,144.7074897533197,-5.960464476584964e-15,71.2774049623324,70.55983828629708,1082.3435303578935 +1,0.0005529404443077009,0.0003239489663496582,1.9582315470878136e-05,71.99355059408438,-6.08338701678715e-16,35.14205400224067,34.57221241418926,519.0923112686206 +2,0.002752823008775745,0.0016061384086087883,8.692003845839459e-05,34.08769374774182,-1.3183035262390176e-15,16.36536133478021,15.912941478487049,230.44661277831844 +3,0.013127888818741155,0.007618165274080762,0.000364589152972101,15.1988585225735,5.422061193975909e-16,7.062798109064177,6.704776954280582,92.07354002420296 +4,0.05883095627749258,0.033827800671777576,0.001459631770358389,6.2914783388055495,-3.6956091097739395e-16,2.730169759944633,2.4526358335997442,31.462899314870818 +5,0.23167881712726682,0.12994135536864662,0.005373644291797339,2.274599763663608,-4.8956523416453433e-17,0.8543182778232005,0.66530007595447,8.117887458641773 +6,0.5522575156446576,0.27202612064233395,0.00995515975019518,0.39182409193767676,2.2212724689685632e-17,0.11477319000703984,0.06065996190862552,0.8993713711837812 +7,0.35089903645815546,0.1303562018256726,0.0030049658601700546,0.0354244566460661,2.892217229418544e-18,0.009089472631843735,0.0033407274714736626,0.08337894062943672 +8,0.12131178404157113,0.03157689188696171,0.0003775209180593767,0.002373517635653355,2.3288897822325384e-18,0.00057357538258912,0.00016478380969987654,0.008036211750807088 +9,0.020124308519381684,0.003098254604289683,1.3453716672555602e-05,5.252415879933615e-05,1.266815138828743e-19,1.2165349290370563e-05,2.7674656796985234e-06,0.0003868979493775284 +10,0.00035004483153421116,1.8218743777857735e-05,1.3974787856675872e-08,4.5802256991335265e-08,1.2083432589668223e-20,1.0836648105239018e-08,2.7932619550552214e-09,1.3200600133284349e-06 diff --git a/extras/lh_bench_23/tables/table_FFNS-2_iterate-exact.csv b/extras/lh_bench_23/tables/table_FFNS-2_iterate-exact.csv new file mode 100644 index 000000000..c90a657b8 --- /dev/null +++ b/extras/lh_bench_23/tables/table_FFNS-2_iterate-exact.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_v,s_p,c_p,g +0,0.00015287245911193973,0.00010244420879692456,5.701804950008159e-06,131.87354078018686,3.1436816070190436e-05,64.86280173199472,64.14679157813718,997.1307561193353 +1,0.00069175695246707,0.0004428380604096013,2.5409624115590328e-05,68.47201912813458,9.427927867448377e-05,33.38326131051349,32.81465915127866,490.9248715682815 +2,0.0030981326270347925,0.0018974460360332897,0.00010718483116562811,33.46111261545371,0.00022789575898237165,16.05385471689456,15.602425570742922,222.8638269365543 +3,0.013721769310853001,0.008101888077207107,0.00042557694170455466,15.198222322725023,0.0003664344617713608,7.064240906094763,6.7070069119096445,90.62109137834348 +4,0.0591598102284284,0.03405009118707939,0.0016008177414868765,6.320848112146719,0.00014478892398720895,2.7463441667947093,2.4693798899099675,31.33505704508351 +5,0.23078124616541115,0.12918608326642275,0.005568820929143788,2.274488527118306,-0.0005731348830417624,0.8546973873853969,0.6659329364925008,8.134786865601694 +6,0.5517722225901677,0.2716462586534072,0.010023247719199276,0.39019999272148476,-0.0003062707790024365,0.11386287962380857,0.059780380123958435,0.9057095918940035 +7,0.3507107054591861,0.1302451863401776,0.003009751467815323,0.035382330254609344,-3.1890517474502425e-05,0.009059784104510091,0.003317846764474124,0.08419882231397235 +8,0.12116571740510446,0.03152817955811504,0.0003774489567551988,0.002397872525008188,-2.7212872822324266e-06,0.0005852689571531542,0.00017734627513029414,0.00811429865505891 +9,0.020076613437916207,0.003089686879163111,1.342506632435769e-05,5.6450298658805325e-05,-1.009573276531752e-07,1.4094927426926308e-05,4.729604168214425e-06,0.0003893466314738745 +10,0.0003483196942620561,1.812612045110442e-05,1.3857168200479224e-08,1.097669434718655e-07,-1.9538726217870197e-10,4.266251710024964e-08,3.4670225126906276e-08,1.3144918135418981e-06 diff --git a/extras/lh_bench_23/tables/table_FFNS-2_truncated.csv b/extras/lh_bench_23/tables/table_FFNS-2_truncated.csv new file mode 100644 index 000000000..4a30a0d0a --- /dev/null +++ b/extras/lh_bench_23/tables/table_FFNS-2_truncated.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_v,s_p,c_p,g +0,0.00015464892296731592,0.00010386845929324279,5.622136690381462e-06,133.5008556575877,3.230329199268242e-05,65.67708705995717,64.9614951356641,957.8459618822479 +1,0.000705761751535839,0.0004544718539811671,2.552290008851311e-05,69.0459315375376,0.00010257666378171392,33.67072527472724,33.10245592445913,481.395736551108 +2,0.0031543548925255615,0.0019427658309667177,0.0001089583218359887,33.63400688767619,0.00025888450199084177,16.140738848131477,15.689576595242569,221.1108702725517 +3,0.013871461518441982,0.00821362657668037,0.00043455283477972126,15.247894082263796,0.0004316495749325127,7.089499957980763,6.732485313205018,90.43515209072363 +4,0.05939964914027976,0.034196408019453645,0.0016281518752570255,6.3362000014014255,0.00018796981996899924,2.75443288697,2.477658630817675,31.34333829821278 +5,0.2308928793883309,0.12918385023233087,0.005610278860597694,2.2776538021950508,-0.000664249033788116,0.8565598999207122,0.6679632514950151,8.141202826783472 +6,0.5512875337070124,0.27134247402403655,0.010026111044900999,0.38992719563912914,-0.00036314888983881395,0.1138207754296992,0.05981844415766429,0.9061993666236493 +7,0.3501501361492662,0.13001356714644208,0.003005291520931824,0.0353162398653188,-3.7948403987817344e-05,0.009041931769499358,0.0033124999482985174,0.08421298934125289 +8,0.12089891642500451,0.031452150037026866,0.0003765528652237452,0.0023858872242725794,-3.2484391630543913e-06,0.0005806863423718898,0.00017393403039317015,0.008113446103398255 +9,0.02001562863727675,0.003079462568012769,1.3378254744689383e-05,5.423860954782834e-05,-1.2134014422699058e-07,1.3026681982729941e-05,3.697431328199803e-06,0.00038922380774916254 +10,0.00034657115630683396,1.803163500131224e-05,1.377129575740517e-08,5.132838245453915e-08,-2.379670148646283e-10,1.3462540042524917e-08,5.5180040543152174e-09,1.3143045886089883e-06 diff --git a/extras/lh_bench_23/tables/table_FFNS-3_iterate-exact.csv b/extras/lh_bench_23/tables/table_FFNS-3_iterate-exact.csv new file mode 100644 index 000000000..312a0139c --- /dev/null +++ b/extras/lh_bench_23/tables/table_FFNS-3_iterate-exact.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_v,s_p,c_p,g +0,9.836966763886141e-05,4.5170742957375996e-05,7.5012328115190414e-06,148.84799237885335,-2.910510638420082e-05,73.35205515462158,72.63743281068673,1084.619419631402 +1,0.0005640468145243254,0.00030894671096854564,3.073021905703312e-05,71.89461934475517,-4.673850737514722e-05,35.09609129818501,34.52859011025279,503.5885387790783 +2,0.0028945500676357703,0.0016810059147198179,0.00012301844981643713,33.85784622588853,-3.576027917521773e-06,16.25335183240206,15.802791260701232,222.82008299478002 +3,0.013633373064192496,0.007983215957929687,0.0004727422596436446,15.18190430761921,0.00021123185549078844,7.057102726770337,6.700536655532829,90.22155735168695 +4,0.05956724448832024,0.03438239502080433,0.0017231472128767477,6.300657024758889,0.00039314366013802556,2.7376273069860146,2.461131322708324,31.33586645434436 +5,0.2312988676321237,0.1296171473701861,0.005764529760983026,2.266845426007164,-0.00019644172893536565,0.85223443579442,0.6637194063930979,8.153411502330735 +6,0.5513064130916566,0.27140173696369135,0.010084634312905192,0.38980785041340793,-0.0003181208486145095,0.11388551884287841,0.05985044225727633,0.9062273296258492 +7,0.350435004860364,0.13014939156487818,0.003014371134640736,0.035450376781638544,-3.840886663652588e-05,0.00910188797427251,0.0033625040119352944,0.0844438866160732 +8,0.1211157932395667,0.031518221573520404,0.0003778065281636942,0.00240854950195688,-3.3050615272961475e-06,0.000590651121445557,0.00018275868728082553,0.008158561478268737 +9,0.02007701303116419,0.003090021580448757,1.3437066675585028e-05,5.681843776186922e-05,-1.1797439429869178e-07,1.426872161058544e-05,4.900884840678453e-06,0.00039235288217883514 +10,0.00034849118995363597,1.813462901552704e-05,1.3838070181071031e-08,1.098165927081218e-07,-2.1739624242785753e-10,4.262671491267176e-08,3.462774080439957e-08,1.3275395881221502e-06 diff --git a/extras/lh_bench_23/tables/table_FFNS-3_truncated.csv b/extras/lh_bench_23/tables/table_FFNS-3_truncated.csv new file mode 100644 index 000000000..2af479512 --- /dev/null +++ b/extras/lh_bench_23/tables/table_FFNS-3_truncated.csv @@ -0,0 +1,12 @@ +,u_v,d_v,L_m,L_p,s_v,s_p,c_p,g +0,9.343544936160187e-05,3.97588703957356e-05,7.634774574396073e-06,149.2941807579001,-3.5112148919386776e-05,73.57549898868884,72.86111343997482,1094.9096593483566 +1,0.0005471412343189227,0.0002907014882532298,3.126654684783732e-05,72.02462076969448,-6.65807383351694e-05,35.161356463659104,34.59404352385236,502.66814204097983 +2,0.002860229680268774,0.0016435696614229855,0.0001250321221518455,33.851910501447826,-4.4612311751533015e-05,16.25057461444312,15.800163462117418,221.92343864456535 +3,0.013610087080486177,0.00795365036709451,0.00048003091119545,15.159194026054355,0.00017475522591764659,7.045913097763293,6.689463282492342,89.97002152475457 +4,0.059618653451713306,0.03442582573289902,0.0017449527633395375,6.292121369891762,0.0004306457612423186,2.7335965648161547,2.457180790439582,31.299425909077453 +5,0.2313135880726135,0.12965308150200883,0.005802386394720998,2.2653807925410363,-0.0001265579405988536,0.8517371085580833,0.6632490854010611,8.152997034692607 +6,0.5512372240903152,0.2713868904410041,0.010100355232325945,0.3898481360803727,-0.0003222658041364934,0.11390490344974787,0.05984920401442433,0.9070889105845987 +7,0.35060974087052527,0.13023248263157344,0.0030183456887526304,0.03547319264938169,-3.99386992765339e-05,0.009104957227957185,0.0033594667088998804,0.08458842159263354 +8,0.12124915825634185,0.031558328219426696,0.00037847824987194986,0.0024032844752700715,-3.4419617890271927e-06,0.0005869941348835454,0.00017842340253973495,0.008174904794978325 +9,0.02011332077796066,0.0030962001697032305,1.3469938870202546e-05,5.459642840965752e-05,-1.22113552126173e-07,1.3122645783811846e-05,3.7325652398707082e-06,0.0003931456259688344 +10,0.00034957384653626496,1.8192571716122362e-05,1.38785628504736e-08,5.0388199511750236e-08,-2.2288232162085576e-10,1.2854620431865581e-08,4.825330555106835e-09,1.3296138258473455e-06 diff --git a/extras/lh_bench_23/utils.py b/extras/lh_bench_23/utils.py index dc83a2c7e..50033ad15 100644 --- a/extras/lh_bench_23/utils.py +++ b/extras/lh_bench_23/utils.py @@ -102,13 +102,21 @@ def rotate_lha_to_evol(df: pd.DataFrame, scheme: str) -> pd.DataFrame: def load_n3lo_tables( - n3lo_table_dir: pathlib.Path, scheme: str, approx: str, rotate_to_evol: bool = False + n3lo_table_dir: pathlib.Path, + scheme: str, + sv: str, + approx: str, + rotate_to_evol: bool = False, ) -> list: """Load the N3LO tables.""" dfs = [] + n3lo_table_dir = n3lo_table_dir / "EKO" / f"N3LO_{approx}_{scheme}" for p in n3lo_table_dir.iterdir(): if scheme not in p.stem: continue + if sv not in p.stem: + continue + if approx in p.stem: table = pd.read_csv(p, index_col=0) table.rename(columns=LHA_LABELS_MAP, inplace=True) @@ -140,21 +148,11 @@ def load_msht( table_dir: pathlib.Path, scheme: str, approx: str, rotate_to_evol: bool = False ) -> list: """Load MSHT files.""" - - if scheme != "VFNS": - raise ValueError(f"{scheme} not provided by MSHT, comment it out") - APPROX_MAP = { - "FHMV": "Moch", - "MSHT": "Posterior", - } - fhmv_msht_table_dir = table_dir / f"{scheme}_{APPROX_MAP[approx]}_numbers" + fhmruvv_msht_table_dir = table_dir / "MSHT" / f"N3LO_{approx}_{scheme}" columns = lha_labels(scheme) - # columns.insert(0,'x') - # columns.insert(0,'Q') dfs = [] - - for p in fhmv_msht_table_dir.iterdir(): + for p in fhmruvv_msht_table_dir.iterdir(): data = np.loadtxt(p) data = pd.DataFrame(data[:, 2:], columns=columns) if rotate_to_evol: @@ -167,10 +165,13 @@ def compute_n3lo_avg_err(dfs: list) -> tuple: """Compute N3LO average and error.""" df_central = np.mean(dfs, axis=0) df_central = pd.DataFrame(df_central, columns=dfs[0].columns) - # TODO: improve errors. - df_std = np.std(dfs, axis=0) - df_std = pd.DataFrame(df_std, columns=dfs[0].columns) - return df_central, df_std + + # NOTE: here we compute the error as an envelope + up = np.max(dfs, axis=0) + dw = np.min(dfs, axis=0) + df_err = (up - dw) / 2 + df_err = pd.DataFrame(df_err, columns=dfs[0].columns) + return df_central, df_err def compute_n3lo_nnlo_diff(n3lo: tuple, nnlo: pd.DataFrame, rel_diff: bool) -> tuple: @@ -194,16 +195,18 @@ def plot_pdfs( ) -> None: """Absolute PDFs plots.""" - fig, axs = plt.subplots(2, 4, figsize=(15, 7)) + ncols = 2 + nrows = 4 + fig, axs = plt.subplots(nrows, ncols, figsize=(ncols * 5, nrows * 3.5)) xcut = 4 if use_linx else 0 xgrid = xgrid[xcut:] xscale = "linx" if use_linx else "logx" - plot_name = f"lh_n3lo_bench_{scheme}_{xscale}" + plot_name = f"n3lo_bench_{scheme}_{xscale}" plot_dir.mkdir(exist_ok=True) - fig.suptitle(f"{scheme}" + " $Q: \\sqrt{2} \\to 100 \\ GeV$") + fig.suptitle(f"{scheme}" + r", $\mu_{\rm f}^2 = 10^4 \ \mbox{GeV}^2$") # loop on PDFs for i, ax in enumerate( @@ -260,18 +263,23 @@ def plot_diff_to_nnlo( ) -> None: """Difference w.r.t NNLO PDFs plots.""" - fig, axs = plt.subplots(2, 4, figsize=(15, 7)) + ncols = 2 + nrows = 4 + fig, axs = plt.subplots(nrows, ncols, figsize=(ncols * 5, nrows * 3.5)) - xcut = 4 if use_linx else 0 - xgrid = xgrid[xcut:] + # cut away small- and large-x values, for plotting + smallx_cut = 4 if use_linx else 2 + largex_cut = -1 if not use_linx else None + xgrid = xgrid[smallx_cut:largex_cut] xscale = "linx" if use_linx else "logx" diff_type = "rel_diff" if rel_dff else "abs_diff" - plot_name = f"lh_n3lo_bench_{scheme}_{xscale}_{diff_type}" + plot_name = f"n3lo_bench_{scheme}_{xscale}_{diff_type}" diff_type = "Relative" if rel_dff else "Absolute" fig.suptitle( - f"{diff_type} difference to NNLO, {scheme}" + " $Q: \\sqrt{2} \\to 100 \\ GeV$" + f"{diff_type} difference to NNLO, {scheme}" + + r", $\mu_{\rm f}^2 = 10^4 \ \mbox{GeV}^2$" ) for i, ax in enumerate( @@ -282,22 +290,26 @@ def plot_diff_to_nnlo( # loop on n3lo for j, (tabs, approx_label) in enumerate(n3lo_dfs): central, err = tabs - ax.errorbar( + obj = ax.errorbar( xgrid, - central.values[xcut:, i], - yerr=err.values[xcut:, i], + central.values[smallx_cut:largex_cut, i], + yerr=err.values[smallx_cut:largex_cut, i], fmt=FMT_LIST[j], label=approx_label, capsize=5, ) - # ax.errorbar( - # xgrid, - # eko_4mom_diff.values[:, i], - # yerr=eko_4mom_diff_std.values[:, i], - # fmt="x", - # label="aN3LO EKO (4 moments)", - # capsize=5, - # ) + ax.plot( + xgrid, + central.values[smallx_cut:largex_cut, i], + color=obj[0].get_color(), + alpha=0.3, + ) + ax.fill_between( + xgrid, + (central - err).values[smallx_cut:largex_cut, i], + (central + err).values[smallx_cut:largex_cut, i], + alpha=0.2, + ) ax.hlines( 0, xgrid.min() - xgrid.min() / 3,