From 9c777c95eb69b7465a54ffc184c3f2a9800cd1e6 Mon Sep 17 00:00:00 2001 From: Joosep Pata Date: Tue, 26 Mar 2024 14:10:14 +0200 Subject: [PATCH] add valid notebook --- notebooks/validate.ipynb | 601 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 601 insertions(+) create mode 100644 notebooks/validate.ipynb diff --git a/notebooks/validate.ipynb b/notebooks/validate.ipynb new file mode 100644 index 0000000..9c154fc --- /dev/null +++ b/notebooks/validate.ipynb @@ -0,0 +1,601 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "e84b6480-a15f-4c77-9437-eddf489c1a37", + "metadata": {}, + "outputs": [], + "source": [ + "import awkward as ak\n", + "import glob\n", + "import tqdm\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import mplhep\n", + "import boost_histogram as bh\n", + "import vector\n", + "import matplotlib" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c662127e-adad-4625-9954-dd5131bea0de", + "metadata": {}, + "outputs": [], + "source": [ + "titles_z = \"Z\"\n", + "titles_zh = \"ZH\"\n", + "titles_qq = \"qq\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c32a9f8-42bd-4548-9f53-73a62f8dc9fa", + "metadata": {}, + "outputs": [], + "source": [ + "def to_bh(data, bins, cumulative=False):\n", + " h1 = bh.Histogram(bh.axis.Variable(bins))\n", + " h1.fill(data)\n", + " if cumulative:\n", + " h1[:] = np.sum(h1.values()) - np.cumsum(h1)\n", + " return h1\n", + "\n", + "\n", + "def to_p4(p4_obj):\n", + " return vector.awk(\n", + " ak.zip(\n", + " {\n", + " \"mass\": p4_obj.tau,\n", + " \"x\": p4_obj.x,\n", + " \"y\": p4_obj.y,\n", + " \"z\": p4_obj.z,\n", + " }\n", + " )\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "07e23877-b5f0-4c3a-909b-933122f31c5d", + "metadata": {}, + "outputs": [], + "source": [ + "d = ak.from_parquet(\"/home/joosep/ML-tau-data/p8_ee_Z_Ztautau_ecm380/reco_p8_ee_Z_Ztautau_ecm380_400001.parquet\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5237de64-9a31-4b8b-8b44-8cfcdc5621f9", + "metadata": {}, + "outputs": [], + "source": [ + "d.fields" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd844f2a-090c-4fa6-96b1-e77e6b54bafc", + "metadata": {}, + "outputs": [], + "source": [ + "def load_sample(path, max_files):\n", + " columns = [\n", + " #basic reco inputs\n", + " \"reco_jet_p4s\",\n", + " \"reco_cand_p4s\",\n", + " \"reco_cand_charge\",\n", + " \"reco_cand_pdg\",\n", + "\n", + " #advanced reco inputs: tracking variables\n", + " \"reco_cand_dz\",\n", + " \"reco_cand_dz_err\",\n", + " \"reco_cand_d3\",\n", + " \"reco_cand_d3_err\",\n", + " \"reco_cand_z0\",\n", + " \"reco_cand_z0_err\",\n", + " \"reco_cand_d0\",\n", + " \"reco_cand_d0_err\",\n", + "\n", + " #targets\n", + " \"gen_jet_p4s\",\n", + " \"gen_jet_tau_p4s\",\n", + " \"gen_jet_tau_decaymode\",\n", + " \"gen_jet_full_tau_p4s\" #for debugging\n", + " ]\n", + " data = []\n", + " for fi in tqdm.tqdm(list(glob.glob(path + \"/*.parquet\"))[:max_files]):\n", + " ret = ak.from_parquet(fi, columns=columns)\n", + " ret = ak.Array({k: ret[k] for k in ret.fields})\n", + " ret = ret[to_p4(ret[\"gen_jet_p4s\"]).pt>10]\n", + " data.append(ret)\n", + " data = ak.concatenate(data)\n", + " return data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f4b46228-4da7-4875-ba3a-458507bdad97", + "metadata": {}, + "outputs": [], + "source": [ + "data_qq = load_sample(\"/home/joosep/ML-tau-data/p8_ee_qq_ecm380\", 100)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b5bb2ef3-41dc-42c6-8086-efb1024511e4", + "metadata": {}, + "outputs": [], + "source": [ + "data_z = load_sample(\"/home/joosep/20240326_hepmc_genjets/Z_Ztautau/\", 100)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "98ddf68b-1dd0-4490-8e6e-d7d72ffbc51b", + "metadata": {}, + "outputs": [], + "source": [ + "data_zh = load_sample(\"/home/joosep/20240326_hepmc_genjets/ZH_Htautau/\", 100)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0f89aa00-1d46-420f-a551-667f2804d851", + "metadata": {}, + "outputs": [], + "source": [ + "len(data_qq), len(data_z), len(data_zh)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "676e3fcc-cd01-4901-97ad-3cfdde37f561", + "metadata": {}, + "outputs": [], + "source": [ + "ak.to_parquet(data_qq, \"qq.parquet\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f97fc31b-cf64-4b83-aa60-3e575140c730", + "metadata": {}, + "outputs": [], + "source": [ + "ak.to_parquet(data_z, \"z.parquet\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3247630c-ff35-438e-b3c2-7b8084a0964c", + "metadata": {}, + "outputs": [], + "source": [ + "ak.to_parquet(data_zh, \"zh.parquet\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "252100aa-ffa9-4989-aaac-21556a276548", + "metadata": {}, + "outputs": [], + "source": [ + "!du -csh *.parquet" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "679342ba-8477-4cc2-8492-c25c7e33534f", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0,220,51)\n", + "mplhep.histplot(to_bh(to_p4(data_z[\"gen_jet_tau_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\")\n", + "mplhep.histplot(to_bh(to_p4(data_zh[\"gen_jet_tau_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "#mplhep.histplot(to_bh(to_p4(data_qq[\"gen_jet_tau_p4s\"]).pt, bins=bins), histtype=\"step\", lw=2, flow=\"sum\", label=\"qq\")\n", + "plt.legend(loc=\"best\")\n", + "plt.yscale(\"log\")\n", + "plt.xlabel(\"gen tau visible pT [GeV]\")\n", + "plt.ylabel(\"Number of gen jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "98f1ecd5-3d01-4c00-982f-ac5ea1740b8f", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0,220,51)\n", + "mplhep.histplot(to_bh(to_p4(data_z[\"gen_jet_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\")\n", + "mplhep.histplot(to_bh(to_p4(data_zh[\"gen_jet_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "mplhep.histplot(to_bh(to_p4(data_qq[\"gen_jet_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"qq\")\n", + "plt.legend(loc=\"best\")\n", + "plt.yscale(\"log\")\n", + "plt.xlabel(\"gen jet pT [GeV]\")\n", + "plt.ylabel(\"Number of gen jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "046e6997-1b30-43a0-a0cf-5f78316264fc", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0,220,51)\n", + "mplhep.histplot(to_bh(to_p4(data_z[\"reco_jet_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\")\n", + "mplhep.histplot(to_bh(to_p4(data_zh[\"reco_jet_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "mplhep.histplot(to_bh(to_p4(data_qq[\"reco_jet_p4s\"]).pt, bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"qq\")\n", + "plt.legend(loc=\"best\")\n", + "plt.yscale(\"log\")\n", + "plt.xlabel(\"reco jet pT [GeV]\")\n", + "plt.ylabel(\"Number of gen jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c3d95c34-14b3-498d-9a38-606b803d5193", + "metadata": {}, + "outputs": [], + "source": [ + "b = np.linspace(0,220,221)\n", + "plt.title(titles_qq)\n", + "plt.hist2d(\n", + " ak.to_numpy(to_p4(data_qq[\"gen_jet_p4s\"]).pt),\n", + " ak.to_numpy(to_p4(data_qq[\"reco_jet_p4s\"]).pt),\n", + " bins=(b,b),\n", + " norm=matplotlib.colors.LogNorm(),\n", + " cmap=\"Blues\",\n", + ");\n", + "plt.colorbar()\n", + "plt.plot([0,220],[0,220], color=\"black\", ls=\"--\", lw=1.0)\n", + "plt.xlabel(\"gen jet pt\")\n", + "plt.ylabel(\"reco jet pt\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0ab71888-a208-4579-b694-cfb7b35b2137", + "metadata": {}, + "outputs": [], + "source": [ + "b = np.linspace(0,220,221)\n", + "plt.title(titles_z)\n", + "plt.hist2d(\n", + " ak.to_numpy(to_p4(data_z[\"gen_jet_p4s\"]).pt),\n", + " ak.to_numpy(to_p4(data_z[\"reco_jet_p4s\"]).pt),\n", + " bins=(b,b),\n", + " norm=matplotlib.colors.LogNorm(),\n", + " cmap=\"Blues\",\n", + ");\n", + "plt.colorbar()\n", + "plt.plot([0,220],[0,220], color=\"black\", ls=\"--\", lw=1.0)\n", + "plt.xlabel(\"gen jet pt\")\n", + "plt.ylabel(\"reco jet pt\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a57934f7-6005-4f43-8d20-d3fb9f65a791", + "metadata": {}, + "outputs": [], + "source": [ + "b = np.linspace(0,220,221)\n", + "plt.title(titles_zh)\n", + "plt.hist2d(\n", + " ak.to_numpy(to_p4(data_zh[\"gen_jet_p4s\"]).pt),\n", + " ak.to_numpy(to_p4(data_zh[\"reco_jet_p4s\"]).pt),\n", + " bins=(b,b),\n", + " norm=matplotlib.colors.LogNorm(),\n", + " cmap=\"Blues\",\n", + ");\n", + "plt.colorbar()\n", + "plt.plot([0,220],[0,220], color=\"black\", ls=\"--\", lw=1.0)\n", + "plt.xlabel(\"gen jet pt\")\n", + "plt.ylabel(\"reco jet pt\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10615e49-ee7a-4792-a073-ee4e96923cd0", + "metadata": {}, + "outputs": [], + "source": [ + "b = np.linspace(0,220,221)\n", + "plt.title(titles_z)\n", + "plt.hist2d(\n", + " ak.to_numpy(to_p4(data_z[\"gen_jet_tau_p4s\"]).pt),\n", + " ak.to_numpy(to_p4(data_z[\"reco_jet_p4s\"]).pt),\n", + " bins=(b,b),\n", + " norm=matplotlib.colors.LogNorm(),\n", + " cmap=\"Blues\",\n", + ");\n", + "plt.colorbar()\n", + "plt.plot([0,220],[0,220], color=\"black\", ls=\"--\", lw=1.0)\n", + "plt.xlabel(\"gen tau visible pt\")\n", + "plt.ylabel(\"reco jet pt\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3aa52f66-3f17-45fa-8adb-318f8280fed5", + "metadata": {}, + "outputs": [], + "source": [ + "b = np.linspace(0,220,221)\n", + "plt.title(titles_zh)\n", + "plt.hist2d(\n", + " ak.to_numpy(to_p4(data_zh[\"gen_jet_tau_p4s\"]).pt),\n", + " ak.to_numpy(to_p4(data_zh[\"reco_jet_p4s\"]).pt),\n", + " bins=(b,b),\n", + " norm=matplotlib.colors.LogNorm(),\n", + " cmap=\"Blues\",\n", + ");\n", + "plt.colorbar()\n", + "plt.plot([0,220],[0,220], color=\"black\", ls=\"--\", lw=1.0)\n", + "plt.xlabel(\"gen tau visible pt\")\n", + "plt.ylabel(\"reco jet pt\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1231c2a4-ec2b-4f09-939e-f49d20670b9d", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0.0,2,201)\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_z[\"gen_jet_p4s\"]).pt / to_p4(data_z[\"gen_jet_full_tau_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\"\n", + ")\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_zh[\"gen_jet_p4s\"]).pt / to_p4(data_zh[\"gen_jet_full_tau_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "\n", + "plt.legend(loc=\"best\")\n", + "#plt.yscale(\"log\")\n", + "plt.xlabel(\"genjet pt / gentau pt\")\n", + "plt.ylabel(\"matched jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "89afe119-41c6-4517-ac18-e79747181897", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0.95, 1.05, 201)\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_z[\"gen_jet_p4s\"]).pt / to_p4(data_z[\"gen_jet_tau_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\"\n", + ")\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_zh[\"gen_jet_p4s\"]).pt / to_p4(data_zh[\"gen_jet_tau_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "plt.legend(loc=\"best\")\n", + "#plt.yscale(\"log\")\n", + "plt.xlabel(\"genjet pt / gentau visible pt\")\n", + "plt.ylabel(\"matched jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "68d8bbca-af92-4c20-9406-75ec13da3b2a", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0.75,1.25,101)\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_z[\"reco_jet_p4s\"]).pt / to_p4(data_z[\"gen_jet_tau_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\")\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_zh[\"reco_jet_p4s\"]).pt / to_p4(data_zh[\"gen_jet_tau_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "plt.legend(loc=\"best\")\n", + "#plt.yscale(\"log\")\n", + "plt.xlabel(\"recojet pt / gentau visible pt\")\n", + "plt.ylabel(\"matched jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dcaccb4a-4b8d-493c-b367-2e52c99d814e", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0.5,2,101)\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_z[\"reco_jet_p4s\"]).pt / to_p4(data_z[\"gen_jet_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\")\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_zh[\"reco_jet_p4s\"]).pt / to_p4(data_zh[\"gen_jet_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "\n", + "mplhep.histplot(\n", + " to_bh(\n", + " to_p4(data_qq[\"reco_jet_p4s\"]).pt / to_p4(data_qq[\"gen_jet_p4s\"]).pt\n", + " , bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"qq\")\n", + "\n", + "plt.legend(loc=\"best\")\n", + "plt.yscale(\"log\")\n", + "plt.xlabel(\"recojet pt / genjet pt\")\n", + "plt.ylabel(\"jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6be2458b-d42d-4a1d-95f4-c1e52819636f", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0,50,51)\n", + "mplhep.histplot(to_bh(ak.num(data_z[\"reco_cand_p4s\"]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"Z\")\n", + "mplhep.histplot(to_bh(ak.num(data_zh[\"reco_cand_p4s\"]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"ZH\")\n", + "mplhep.histplot(to_bh(ak.num(data_qq[\"reco_cand_p4s\"]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=\"qq\")\n", + "plt.legend(loc=\"best\")\n", + "plt.yscale(\"log\")\n", + "plt.xlabel(\"Number of reco particles / jet\")\n", + "plt.ylabel(\"Number of reco jets / bin\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "87860450-7063-43e4-b371-afe418031f67", + "metadata": {}, + "outputs": [], + "source": [ + "dms = np.arange(17)\n", + "plt.title(titles_z)\n", + "plt.hist(\n", + " data_z[\"gen_jet_tau_decaymode\"], bins=dms,\n", + " width=0.8\n", + ")\n", + "\n", + "plt.xticks(dms+0.4, dms);" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "561fe859-640c-4c97-b608-c8ed26a9550a", + "metadata": {}, + "outputs": [], + "source": [ + "dms = np.arange(17)\n", + "plt.title(titles_zh)\n", + "plt.hist(\n", + " data_zh[\"gen_jet_tau_decaymode\"], bins=dms,\n", + " width=0.8\n", + ")\n", + "\n", + "plt.xticks(dms+0.4, dms);" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "659b30db-c39f-44c5-864b-e42514ff7372", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0,10,100)\n", + "mplhep.histplot(to_bh(ak.flatten(data_z[\"reco_cand_d3\"][data_z[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_z)\n", + "mplhep.histplot(to_bh(ak.flatten(data_zh[\"reco_cand_d3\"][data_zh[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_zh)\n", + "mplhep.histplot(to_bh(ak.flatten(data_qq[\"reco_cand_d3\"][data_qq[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_qq)\n", + "plt.yscale(\"log\")\n", + "plt.legend(loc=\"best\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5bf41d01-8893-4a94-9236-1eac7a821f1c", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(-10,10,100)\n", + "mplhep.histplot(to_bh(ak.flatten(data_z[\"reco_cand_d0\"][data_z[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_z)\n", + "mplhep.histplot(to_bh(ak.flatten(data_zh[\"reco_cand_d0\"][data_zh[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_zh)\n", + "mplhep.histplot(to_bh(ak.flatten(data_qq[\"reco_cand_d0\"][data_qq[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_qq)\n", + "plt.yscale(\"log\")\n", + "plt.legend(loc=\"best\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9330c8fa-00ad-4dc5-b401-f6b4d02ac038", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0,10,100)\n", + "mplhep.histplot(to_bh(ak.flatten(data_z[\"reco_cand_dz\"][data_z[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_z)\n", + "mplhep.histplot(to_bh(ak.flatten(data_zh[\"reco_cand_dz\"][data_zh[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_zh)\n", + "mplhep.histplot(to_bh(ak.flatten(data_qq[\"reco_cand_dz\"][data_qq[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_qq)\n", + "plt.yscale(\"log\")\n", + "plt.legend(loc=\"best\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "763bc9e8-164f-4c66-9936-33d4fbf3419b", + "metadata": {}, + "outputs": [], + "source": [ + "bins = np.linspace(0,10,100)\n", + "mplhep.histplot(to_bh(ak.flatten(data_z[\"reco_cand_z0\"][data_z[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_z)\n", + "mplhep.histplot(to_bh(ak.flatten(data_zh[\"reco_cand_z0\"][data_zh[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_zh)\n", + "mplhep.histplot(to_bh(ak.flatten(data_qq[\"reco_cand_z0\"][data_qq[\"reco_cand_charge\"]!=0]), bins=bins), histtype=\"step\", lw=1, flow=\"sum\", label=titles_qq)\n", + "plt.yscale(\"log\")\n", + "plt.legend(loc=\"best\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}