Skip to content

Commit

Permalink
update labels
Browse files Browse the repository at this point in the history
  • Loading branch information
rkansal47 committed Jul 18, 2024
1 parent 50b803a commit 7f2e34a
Showing 1 changed file with 36 additions and 16 deletions.
52 changes: 36 additions & 16 deletions src/binder/VBFPlots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"metadata": {},
"outputs": [],
"source": [
"plot_dir = Path(\"../../plots/VBF/24May13\")\n",
"plot_dir = Path(\"../../plots/VBF/24Jul18\")\n",
"plot_dir.mkdir(parents=True, exist_ok=True)"
]
},
Expand Down Expand Up @@ -332,20 +332,32 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(1, 1, figsize=(12, 12))\n",
"plot_interference = False\n",
"\n",
"fig, ax = plt.subplots(1, 1, figsize=(12, 12 if plot_interference else 8))\n",
"\n",
"bin_centers = (bins[1:] + bins[:-1]) / 2\n",
"scs = []\n",
"\n",
"colors = [\"blue\", \"orange\", \"red\", \"purple\", \"green\"]\n",
"\n",
"# for i, (sample, label) in enumerate(\n",
"# [\n",
"# ((1, 1, 1), \"SM\"),\n",
"# ((1, 0, 1), r\"No HHVV diagram ($\\kappa_{2V}=0$)\"),\n",
"# ((0, 1, 0), r\"HHVV diagram ($\\kappa_{V}=\\kappa_\\lambda=0$)\"),\n",
"# ((1, 0, 0), r\"(HVV)$^2$ diagram ($\\kappa_{2V}=\\kappa_\\lambda=0$)\"),\n",
"# ((1, 2, 1), r\"Enhanced $\\kappa_{2V}=2$ Coupling\"),\n",
"# ]\n",
"# ):\n",
"\n",
"for i, (sample, label) in enumerate(\n",
" [\n",
" ((1, 1, 1), \"SM\"),\n",
" ((1, 0, 1), r\"No HHVV diagram ($\\kappa_{2V}=0$)\"),\n",
" ((0, 1, 0), r\"HHVV diagram ($\\kappa_{V}=\\kappa_\\lambda=0$)\"),\n",
" ((1, 0, 0), r\"(HVV)$^2$ diagram ($\\kappa_{2V}=\\kappa_\\lambda=0$)\"),\n",
" ((1, 2, 1), r\"Enhanced $\\kappa_{2V}=2$ Coupling\"),\n",
" ((1, 0, 1), r\"$\\kappa_{2V}=0$\"),\n",
" ((0, 1, 0), r\"$\\kappa_{V}=\\kappa_\\lambda=0$\"),\n",
" ((1, 0, 0), r\"$\\kappa_{2V}=\\kappa_\\lambda=0$\"),\n",
" ((1, 2, 1), r\"$\\kappa_{2V}=2$\"),\n",
" ]\n",
"):\n",
" from scipy.interpolate import interp1d, CubicSpline, UnivariateSpline, splrep, BSpline, Rbf\n",
Expand All @@ -366,24 +378,32 @@
" ax.plot(new_bin_centers, smooth_counts, label=label, color=colors[i])\n",
" # ax.plot(bin_centers, interp_counts, label=f\"CV={sample[0]}, C2V={sample[1]}, kl={sample[2]}\")\n",
"\n",
"ax.plot(\n",
" new_bin_centers,\n",
" # -np.sqrt(np.power(scs[1], 2) + np.power(scs[2], 2) - np.power(scs[0], 2)),\n",
" -(scs[1] + scs[2] - scs[0]),\n",
" label=\"Interference\",\n",
" color=\"gray\",\n",
")\n",
"if plot_interference:\n",
" ax.plot(\n",
" new_bin_centers,\n",
" # -np.sqrt(np.power(scs[1], 2) + np.power(scs[2], 2) - np.power(scs[0], 2)),\n",
" -(scs[1] + scs[2] - scs[0]),\n",
" label=\"Interference\",\n",
" color=\"gray\",\n",
" )\n",
"\n",
"ax.set_xlim(bin_centers.min(), 800)\n",
"ax.hlines(0, bin_centers.min(), 800, linestyle=\"--\", color=\"gray\")\n",
"ax.set_ylim(-0.012, 0.012)\n",
"ax.set_ylim(-0.012 if plot_interference else 0, 0.012)\n",
"ax.set_ylabel(r\"d$\\sigma$/d$m_{HH}$ [fb/GeV]\")\n",
"ax.set_xlabel(r\"$m_{HH}$ [GeV]\")\n",
"hep.cms.label(data=False, com=\"13\", ax=ax)\n",
"hep.cms.label(label=\"Preliminary\", data=False, com=\"13\", ax=ax)\n",
"ax.legend()\n",
"plt.savefig(plot_dir / \"diagrams.pdf\", bbox_inches=\"tight\")\n",
"plt.savefig(plot_dir / \"diagrams_prelim.pdf\", bbox_inches=\"tight\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 7f2e34a

Please sign in to comment.