Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fc992c4
generalize eta labels better for plot_decorr_params
cippy Oct 17, 2025
d330024
plotting and testing
cippy Nov 13, 2025
09c630f
Protection on the fakes estimation: fake yield is set to zero for the…
rubenforti Nov 10, 2025
8c5d50d
Protection on the fakes estimation: fake yield is set to zero for the…
rubenforti Nov 10, 2025
e5ed649
small changes for plotting
rubenforti Dec 5, 2025
6085af8
consider the polVar as noi - workaround to better interface with the …
rubenforti Dec 5, 2025
5f8ce1f
fake prediction for uT<0 is now evaluated by scaling the ABCD predict…
rubenforti Dec 5, 2025
c9354b7
label change for the utAngleSign axis
rubenforti Dec 5, 2025
e433ca3
small fix
cippy Dec 8, 2025
4bc98b5
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Dec 8, 2025
c79eca9
moved reference commit of rabbit
rubenforti Dec 9, 2025
4c95789
remove Zmumu OOA for theory agnostic with pol var
cippy Dec 9, 2025
488f6cc
fakes in uT<0 are evaluated by scaling the ABCD prediction on uT>0 wi…
rubenforti Dec 22, 2025
9293126
decorrelate FakeParam syst in uT bins
rubenforti Dec 22, 2025
3f96a4c
new syst for eta nonclosure in ut<0 bin
rubenforti Dec 22, 2025
fec8ace
updates for veto (no default change)
cippy Dec 24, 2025
e7c51cc
merge from rubenforti/signUtAnalysis
cippy Dec 24, 2025
65201f6
updates
cippy Dec 25, 2025
f1a26ce
updates for fakes vs uT
cippy Dec 26, 2025
ea0dfe2
updates
cippy Dec 26, 2025
2fc7884
set noi=False for polynomial variations
cippy Dec 28, 2025
811a7b0
fixes and updates to fit uT^mu
cippy Dec 28, 2025
ba08ba7
foo
cippy Dec 28, 2025
4d1e7b5
fixes
cippy Dec 31, 2025
ea60c34
fixes
cippy Jan 6, 2026
60299aa
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Jan 6, 2026
1cd1a13
set default W width variation to original 0.6 MeV
cippy Jan 7, 2026
98d150a
updates
cippy Jan 11, 2026
8a3041a
Merge branch 'main_mergeUpstream_testRuben' into main_mergeUpstream_c…
cippy Jan 11, 2026
4369f3a
restore default dictionary for datasets
cippy Jan 11, 2026
faa2675
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Jan 11, 2026
02f2540
updates
cippy Jan 14, 2026
78f3057
updates
cippy Jan 19, 2026
5683c7e
Merge branch 'main_mergeUpstream_testRuben' into main_mergeUpstream_c…
cippy Jan 19, 2026
32b866c
implement some comments for the PR
cippy Jan 19, 2026
cb76f64
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Jan 19, 2026
32e3fea
updates for tests
cippy Jan 30, 2026
5e5e6d9
updates for width and uT
cippy Feb 2, 2026
9b17700
Merge branch 'main_mergeUpstream_testRuben' into main_mergeUpstream_c…
cippy Feb 2, 2026
82e762b
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Feb 2, 2026
2ce8861
Merge pull request #8 from cippy/main_mergeUpstream_cherrypick
rubenforti Feb 12, 2026
68bb723
added smoothing of the TF for fakes
rubenforti Feb 12, 2026
d2f7534
small fix
cippy Feb 17, 2026
bfd4437
Merge branch 'main_mergeUpstream_testRuben' into main_mergeUpstream_c…
cippy Feb 17, 2026
3aac876
Merge branch 'main' of github.com:WMass/WRemnants into main_mergeUpst…
cippy Feb 17, 2026
d0d76ea
pylint
cippy Feb 17, 2026
048935e
trying to fix pylint
cippy Feb 17, 2026
04d26f1
smoothing of TF correction
rubenforti Feb 25, 2026
c44dcc1
addition of syst uncertainties related to TF correction
rubenforti Feb 25, 2026
90259e0
Merge pull request #9 from cippy/main_mergeUpstream_cherrypick
rubenforti Feb 25, 2026
48ea77b
changed hardcoded 'utAngleSign' into datagroups.fakeTransferAxis
rubenforti Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
995 changes: 593 additions & 402 deletions notebooks/CompareCorrections.ipynb

Large diffs are not rendered by default.

106 changes: 70 additions & 36 deletions notebooks/EWClosure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"metadata": {},
"outputs": [],
"source": [
"res, meta, _ = input_tools.read_infile(\"/scratch/dwalter/results_histmaker/230907_ew_closure/w_z_gen_dists.hdf5\")"
"res, meta, _ = input_tools.read_infile(\n",
" \"/scratch/dwalter/results_histmaker/230907_ew_closure/w_z_gen_dists.hdf5\"\n",
")"
]
},
{
Expand Down Expand Up @@ -79,21 +81,21 @@
"base_process = \"WplusToMuNu\"\n",
"# base_process = \"WminusToMuNu\"\n",
"# base_process = \"ZToMuMu\"\n",
"# generator = \"winhac\" \n",
"# generator = \"winhac\"\n",
"generator = \"horace\"\n",
"generatorNLO = \"horace\"\n",
"process = f\"{base_process}_{generator}\"\n",
"processNLO = f\"{base_process}_{generatorNLO}\"\n",
"var = \"ewLepEta1\"\n",
"showFlow = False\n",
"flow=True\n",
"flow = True\n",
"colors = mpl.colormaps[\"tab10\"]\n",
"text_dict = {\n",
" \"ZToMuMu\": r\"$\\mathrm{Z}\\rightarrow\\mu\\mu$\",\n",
" \"WplusToMuNu\": r\"$\\mathrm{W}^+\\rightarrow\\mu\\nu$\",\n",
" \"WminusToMuNu\": r\"$\\mathrm{W}^-\\rightarrow\\mu\\nu$\"\n",
" \"WminusToMuNu\": r\"$\\mathrm{W}^-\\rightarrow\\mu\\nu$\",\n",
"}\n",
"plotname = f\"{process}{var}\"\n"
"plotname = f\"{process}{var}\""
]
},
{
Expand All @@ -105,11 +107,15 @@
"source": [
"def load(process, order, var, appendix=\"\", idx=None):\n",
" proc_name = f\"{process}-{order}\"\n",
" histo = res[proc_name]['output'][f\"nominal_{var}{appendix}\"].get()\n",
" histo = res[proc_name][\"output\"][f\"nominal_{var}{appendix}\"].get()\n",
" if idx is not None:\n",
" histo = histo[...,idx]\n",
" histo = hh.scaleHist(histo, res[proc_name][\"dataset\"][\"xsec\"]*10e6/res[proc_name]['weight_sum'], createNew=True)\n",
" return histo\n"
" histo = histo[..., idx]\n",
" histo = hh.scaleHist(\n",
" histo,\n",
" res[proc_name][\"dataset\"][\"xsec\"] * 10e6 / res[proc_name][\"weight_sum\"],\n",
" createNew=True,\n",
" )\n",
" return histo"
]
},
{
Expand All @@ -121,7 +127,7 @@
"source": [
"hLO_Uncorr = load(process, \"lo-photos\", var)\n",
"hLO_Corr = load(process, \"lo-photos\", var, appendix=\"_horacenloewCorr\", idx=1)\n",
"hNLO = load(processNLO, \"nlo\", var)\n"
"hNLO = load(processNLO, \"nlo\", var)"
]
},
{
Expand Down Expand Up @@ -152,61 +158,89 @@
"outputs": [],
"source": [
"def plot(h1ds, ratio=False):\n",
" \n",
" labels = [f\"{generator} LO\",f\"{generator} \" + r\"LO $\\times$ Corr(Horace)\", f\"{generatorNLO} NLO\"]\n",
"\n",
" labels = [\n",
" f\"{generator} LO\",\n",
" f\"{generator} \" + r\"LO $\\times$ Corr(Horace)\",\n",
" f\"{generatorNLO} NLO\",\n",
" ]\n",
" linestyles = [\"-\", \"--\", \":\"]\n",
" \n",
"\n",
" if ratio:\n",
" ylabel=f\"1./{labels[-1]}\"\n",
" ylabel = f\"1./{labels[-1]}\"\n",
" else:\n",
" ylabel=\"a.u.\"\n",
" \n",
" ylabel = \"a.u.\"\n",
"\n",
" ymin = None if ratio else 0\n",
" ymax = None\n",
"\n",
" ymax = ymax if ymax is not None else max([max(h.values(flow=showFlow)) for h in h1ds])\n",
" ymin = ymin if ymin is not None else min([min(h.values(flow=showFlow)) for h in h1ds])\n",
" ymax = (\n",
" ymax if ymax is not None else max([max(h.values(flow=showFlow)) for h in h1ds])\n",
" )\n",
" ymin = (\n",
" ymin if ymin is not None else min([min(h.values(flow=showFlow)) for h in h1ds])\n",
" )\n",
" yrange = ymax - ymin\n",
" ymin = ymin if ymin == 0 else ymin - yrange*0.3\n",
" ymax = ymax + yrange*0.3\n",
" ymin = ymin if ymin == 0 else ymin - yrange * 0.3\n",
" ymax = ymax + yrange * 0.3\n",
"\n",
" fig, ax = plot_tools.figure(hNLO, \n",
" xlabel=xaxis_labels[var], ylabel=ylabel, cms_label=\"Preliminary\", \n",
" automatic_scale=False, width_scale=1.2,ylim=(ymin, ymax))\n",
" fig, ax = plot_tools.figure(\n",
" hNLO,\n",
" xlabel=xaxis_labels[var],\n",
" ylabel=ylabel,\n",
" cms_label=\"Preliminary\",\n",
" automatic_scale=False,\n",
" width_scale=1.2,\n",
" ylim=(ymin, ymax),\n",
" )\n",
" if ratio:\n",
" x = h1ds[0].axes.edges[0][:-1]\n",
" ax.plot([min(x), max(x)], [1,1], color=\"black\", linestyle=\"--\")\n",
" \n",
" ax.plot([min(x), max(x)], [1, 1], color=\"black\", linestyle=\"--\")\n",
"\n",
" for i, h1d in enumerate(h1ds):\n",
" x = h1d.axes.edges[0][:-1]\n",
" y = h1d.values(flow=flow)\n",
" err = np.sqrt(h1d.variances(flow=flow))\n",
"\n",
" ax.set_xlim((min(x),max(x)))\n",
" ax.set_ylim((ymin,ymax))\n",
" ax.set_xlim((min(x), max(x)))\n",
" ax.set_ylim((ymin, ymax))\n",
"\n",
" if flow:\n",
" # add extra bin with bin wdith of 1% of total width\n",
" rangex = x[-1] - x[0]\n",
"\n",
" if h1d.axes[0].traits.underflow:\n",
" x = np.insert(x, 0, x[0] - rangex*0.02)\n",
" x = np.insert(x, 0, x[0] - rangex * 0.02)\n",
" if h1d.axes[0].traits.overflow:\n",
" x = np.append(x, x[-1] + rangex*0.02)\n",
" x = np.append(x, x[-1] + rangex * 0.02)\n",
"\n",
" if showFlow:\n",
" ax.set_xlim((min(x),max(x)))\n",
" \n",
"# ax.set_xlim(26,56)#-2.4,2.4)\n",
" ax.set_xlim((min(x), max(x)))\n",
"\n",
" # ax.set_xlim(26,56)#-2.4,2.4)\n",
"\n",
" ax.step(x, y, color=colors(i), linestyle=linestyles[i], label=labels[i], where=\"post\")\n",
" ax.step(\n",
" x,\n",
" y,\n",
" color=colors(i),\n",
" linestyle=linestyles[i],\n",
" label=labels[i],\n",
" where=\"post\",\n",
" )\n",
" # ax.fill_between(x, y - err, y + err, alpha=0.3, color=colors(i), step=\"post\")\n",
"\n",
" ax.text(1.0, 1.003, text_dict[base_process], transform=ax.transAxes, fontsize=30,\n",
" verticalalignment='bottom', horizontalalignment=\"right\")\n",
" ax.text(\n",
" 1.0,\n",
" 1.003,\n",
" text_dict[base_process],\n",
" transform=ax.transAxes,\n",
" fontsize=30,\n",
" verticalalignment=\"bottom\",\n",
" horizontalalignment=\"right\",\n",
" )\n",
" plot_tools.addLegend(ax, ncols=2, text_size=12)\n",
" if ratio:\n",
" plot_name = plotname+\"_ratio\"\n",
" plot_name = plotname + \"_ratio\"\n",
" else:\n",
" plot_name = plotname\n",
" plot_tools.save_pdf_and_png(\"./\", plot_name)"
Expand Down
Loading