Skip to content

Commit

Permalink
some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed May 17, 2024
1 parent 8be96bb commit 379e13a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 70 deletions.
49 changes: 0 additions & 49 deletions extras/lh_bench_23/plot_bench.py

This file was deleted.

8 changes: 4 additions & 4 deletions extras/lh_bench_23/plot_bench_msht.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)

USE_LINX = False
REL_DIFF = False
REL_DIFF = True
SCHEME = "VFNS"
SV = "central"

Expand Down Expand Up @@ -39,14 +39,14 @@
# compute average of FHMRUVV
fhmruvv_res = []
for a, b in zip(fhmruvv_msht_res, fhmruvv_eko_res):
fhmruvv_res.append((a + b )/ 2)
fhmruvv_res.append((a + b) / 2)

# PDFs plots
n3lo_dfs = [
(eko_res, "EKO"),
(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)

Expand All @@ -57,9 +57,9 @@
msht_post_diff = compute_n3lo_nnlo_diff(msht_post_res, nnlo_central, REL_DIFF)

n3lo_dfs = [
(eko_diff, "EKO"),
(fhmruvv_diff, "FHMRUVV"),
(msht_prior_diff, "MSHT (prior)"),
(msht_post_diff, "MSHT (posterior)"),
(eko_diff, "NNPDF"),
]
plot_diff_to_nnlo(xgrid, n3lo_dfs, SCHEME, USE_LINX, plot_dir, REL_DIFF)
23 changes: 6 additions & 17 deletions extras/lh_bench_23/plot_trn_exa.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,16 @@ def load_table(method):


def plot_diff(xgrid, dfs_trn, dfs_exa):
ncols = 3
nrows = 1
fig, axs = plt.subplots(nrows, ncols, figsize=(ncols * 5, nrows * 3.5))

cut_smallx = 0
cut_largex = -1
xgrid = xgrid[cut_smallx:cut_largex]

plot_dir.mkdir(exist_ok=True)

fig.suptitle(
r"\% difference Exact vs Truncated" + r", $\mu_{\rm f}^2 = 10^4 \ \mbox{GeV}^2$"
)

# loop on PDFs
for i, ax in enumerate(
axs.reshape(
ncols * nrows,
)
):
j = np.where(dfs_trn[1].columns == COLUMNS_TO_KEEP[i])[0][0]
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():
Expand All @@ -64,9 +53,9 @@ def plot_diff(xgrid, dfs_trn, dfs_exa):
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.pdf")
plt.legend()
plt.tight_layout()
plt.savefig(f"{plot_dir}/diff_trn_exa_{column}.pdf")


if __name__ == "__main__":
Expand Down

0 comments on commit 379e13a

Please sign in to comment.