From e1cea9e23c2fb25ed8adcac4fabd1ed9844c5634 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 7 Dec 2024 12:39:42 -0500 Subject: [PATCH] backwards_ecal: smooth fil_between, adjust xlim --- benchmarks/backwards_ecal/backwards_ecal.org | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/benchmarks/backwards_ecal/backwards_ecal.org b/benchmarks/backwards_ecal/backwards_ecal.org index 5ef59c8..6ca1e91 100644 --- a/benchmarks/backwards_ecal/backwards_ecal.org +++ b/benchmarks/backwards_ecal/backwards_ecal.org @@ -212,13 +212,17 @@ for clf_label, sigma_rel_FWHM_cb in sigmas_rel_FWHM_cb.items(): lw=0.5, label=f"Functional fit: ${np.ceil(stochastic * 10) / 10:.1f}\% / \sqrt{{E}} \oplus {np.ceil(constant * 10) / 10:.1f}\%$", ) +xmin = np.min(energy_values) +xmax = np.max(energy_values) * 1.05 +xs = np.arange(xmin, xmax + 0.1, 0.1) plt.fill_between( - energy_values, - np.sqrt((2 / np.sqrt(energy_values)) ** 2 + 1 ** 2), - np.sqrt((2 / np.sqrt(energy_values)) ** 2 + 3 ** 2), - alpha=0.2, color="black", label=r"YR requirement $2\% / \sqrt{E} \oplus (1-3)\%$", + xs, + np.sqrt((2 / np.sqrt(xs)) ** 2 + 1 ** 2), + np.sqrt((2 / np.sqrt(xs)) ** 2 + 3 ** 2), + lw=0., alpha=0.2, color="black", label=r"YR requirement $2\% / \sqrt{E} \oplus (1-3)\%$", ) -plt.ylim(top=10.) +plt.xlim(0., xmax) +plt.ylim(top=6.) plt.legend() plt.xlabel("Energy, GeV", loc="right") plt.ylabel(r"$\sigma_{E} / E$ derived from FWHM, %", loc="top") @@ -296,6 +300,8 @@ for clf_label, roc in rocs.items(): marker=".", label=f"{clf_label}", ) +xmax = np.max(energy_values) * 1.05 +plt.xlim(0., xmax) plt.yscale("log") plt.legend() plt.xlabel("Energy, GeV")