tracking-parametrisation-tuner/thesis/TMVA_stuff.ipynb

468 lines
355 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
2024-02-13 09:34:22 +01:00
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import uproot\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import mplhep\n",
"\n",
"mplhep.style.use([\"LHCbTex2\"])\n",
"plt.rcParams[\"savefig.dpi\"] = 600\n",
"# %matplotlib inline"
]
},
{
"cell_type": "code",
2024-02-19 15:41:09 +01:00
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
2024-02-21 08:34:33 +01:00
"train_tree = uproot.open(\n",
" {\n",
" \"/work/cetin/LHCb/reco_tuner/nn_electron_training/result_e_filterT_sample4/matching_ghost_mlp_training.root\": \"MatchNNDataSet/TrainTree\"\n",
2024-02-21 08:34:33 +01:00
" }\n",
")\n",
"test_tree = uproot.open(\n",
" {\n",
" \"/work/cetin/LHCb/reco_tuner/nn_electron_training/result_e_filterT_sample4/matching_ghost_mlp_training.root\": \"MatchNNDataSet/TestTree\"\n",
2024-02-21 08:34:33 +01:00
" }\n",
")\n",
"train_array = train_tree.arrays()\n",
"test_array = test_tree.arrays()"
]
},
{
"cell_type": "code",
2024-02-19 15:41:09 +01:00
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9bWzkeJ4feH5DVd1T7fZIDKUxQK4EdIlRtYvd8+1kMpT9bgF3idF9Cxi4GxdDqsMO0Fh3KVjpVwvNVESq7N2ZWdilZFSXzq88Sara64YHO5YYmfVmcO7JoLIMz75YTymY1bAPPm9XMHOAlAXYLgVTsz1d09Ul3gsd2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bhBElUNJbhA2jdfZHYLTtKBaLaDQaXVtB+TNVDlJ2p5i6CU9QUCgUuo6N1jpTYrdWgOH4XddN7DHtVgfDz0cxKP6gx6JUKgXrLxQKAy0LXLRy6zRBQ3g79vb2Oh7X1rp2dHQ0UKxERERERJRcTIQRJVC35EC9Xp9yJOPrlFD57LPPRi7LNE3UarW2LnjARdJjbW0t0uTSoN1Aw8dsmK6jSZphcW9vD5qmwTTNvskmYHqJWcMwgnUNkjgrFApNx2CYCRpahdeXpGNFRERERESjYSKMKIG6tTrq1LIl6TolLq5duzZWmZIkdR17zbbttvGrpmHUGT1PT0+jDWQMgiCgWCx2HZNtmLHdolStVoP/D9qCLPwZmsXPDRERERERTQYTYUQJ1anFk+M4ie1KN4xhuib2UigUUK/X25JQlUol0cmPUZNm0+Y4DgzDgGVZHQf
"text/plain": [
"<Figure size 1200x900 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"train_bkg = train_array[train_array.classID == 1]\n",
"train_sig = train_array[train_array.classID == 0]\n",
"test_bkg = test_array[test_array.classID == 1]\n",
"test_sig = test_array[test_array.classID == 0]\n",
2024-02-19 15:41:09 +01:00
"plt.hist(\n",
" train_sig.matching_mlp,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"plt.hist(\n",
" train_bkg.matching_mlp,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"mplhep.histplot(\n",
" np.histogram(np.array(test_sig.matching_mlp), 50),\n",
" histtype=\"errorbar\",\n",
" density=True,\n",
" yerr=True,\n",
" color=\"#107E7D\",\n",
" marker=\"^\",\n",
" markersize=7,\n",
" label=\"test sample, true pairs\",\n",
")\n",
"mplhep.histplot(\n",
" np.histogram(np.array(test_bkg.matching_mlp), 50),\n",
" histtype=\"errorbar\",\n",
" density=True,\n",
" yerr=True,\n",
" color=\"#F05342\",\n",
" label=\"test sample, wrong pairs\",\n",
")\n",
"plt.xlabel(\"neural network response\")\n",
"plt.ylabel(\"Number of tracks (normalised)\")\n",
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
"plt.legend(loc=\"upper center\")\n",
"plt.savefig(\"/work/cetin/LHCb/reco_tuner/thesis/filtered_NN_elec_response.pdf\",\n",
" format=\"PDF\")\n",
"# plt.show()"
]
},
{
"cell_type": "code",
2024-02-19 15:41:09 +01:00
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABYkAAAXuCAYAAAAuuqfOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9X2wj+33nfX4on2TOk4x1SuoZ76OVgHUX7evYpDrAA+ws4CMyWGCvMibVvstFItK+WjwamOz2zWRurEM6EbB7kYRsz4WvFmrSnqvnQfaw2l7MBM8AabFO5tpm9QnQergI5kjV9GRiJ2PxudBUhaQosvi3iuT7BQhNSj/+6lfFKvWPX33r+4t1u92uAAAAAAAAAAAbaSvsAQAAAAAAAAAAwkOQGAAAAAAAAAA2GEFiAAAAAAAAANhgBIkBAAAAAAAAYIMRJAYAAAAAAACADUaQGAAAAAAAAAA2GEFiAAAAAAAAANhgBIkBAAAAAAAAYIMRJAYAAAAAAACADUaQGAAAAAAAAAA2GEFiAAAAAAAAANhgBIkBAAAAAAAAYIMRJAYAAAAAAACADUaQGAAAAAAAAAA2GEFiAAAAAAAAANhgBIkBAAAAAAAAYIMRJAYAAAAAAACADUaQGAAAAAAAAAA2GEFiAAAAAAAAANhgBIkBAAAAAAAAYIMRJAYAAAAAAACADUaQGAAAAAAAAAA2GEFiAAAAAAAAANhgBIkBAAAAAAAAYIMRJAYAAAAAAACADUaQGAAAAAAAAAA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KpVN8dBmdnZ2Nf0xuAHZbhnkgk+oK
"text/plain": [
"<Figure size 1400x1500 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, axes = plt.subplots(3, 2, figsize=(14, 15), sharey=False)\n",
"# 0,0\n",
2024-02-19 15:41:09 +01:00
"axes[0, 0].hist(\n",
" train_sig.chi2,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[0, 0].hist(\n",
" train_bkg.chi2,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[0, 0].set_xlabel(r\"$\\chi^{2}_{\\mathrm{match}}$\")\n",
2024-02-19 15:41:09 +01:00
"axes[0, 0].legend(prop={\"size\": 20})\n",
"# 1,0\n",
2024-02-19 15:41:09 +01:00
"axes[1, 0].hist(\n",
" train_sig.distX,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[1, 0].hist(\n",
" train_bkg.distX,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[1, 0].set_xlabel(r\"$D_{x}$ [mm]\")\n",
"axes[1, 0].set_ylabel(\"Number of tracks (normalised)\",\n",
" va=\"bottom\",\n",
" ha=\"center\")\n",
"# 0,1\n",
2024-02-19 15:41:09 +01:00
"axes[0, 1].hist(\n",
" train_sig.teta2,\n",
" bins=50,\n",
" range=(0.0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[0, 1].hist(\n",
" train_bkg.teta2,\n",
" bins=50,\n",
" range=(0.0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[0, 1].set_xlabel(r\"$t_{x}^{2}+t_{y}^{2}$\")\n",
"# 1,1\n",
2024-02-19 15:41:09 +01:00
"axes[1, 1].hist(\n",
" train_sig.distY,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[1, 1].hist(\n",
" train_bkg.distY,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[1, 1].set_xlabel(r\"$D_{y}$ [mm]\")\n",
"# 2,0\n",
2024-02-19 15:41:09 +01:00
"axes[2, 0].hist(\n",
" train_sig.dSlope,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[2, 0].hist(\n",
" train_bkg.dSlope,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[2, 0].set_xlabel(r\"$|\\Delta t_{x}^{\\mathrm{match}}|$\")\n",
"# 2,1\n",
2024-02-19 15:41:09 +01:00
"axes[2, 1].hist(\n",
" train_sig.dSlopeY,\n",
" bins=50,\n",
" range=(0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[2, 1].hist(\n",
" train_bkg.dSlopeY,\n",
" bins=50,\n",
" range=(0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[2, 1].set_xlabel(r\"$|\\Delta t_{y}^{\\mathrm{match}}|$\")\n",
"plt.savefig(\n",
" \"/work/cetin/LHCb/reco_tuner/thesis/filtered_NN_elec_variables.pdf\",\n",
" format=\"PDF\")\n",
"# plt.show()"
2024-02-21 08:34:33 +01:00
]
},
{
"cell_type": "code",
"execution_count": 5,
2024-02-21 08:34:33 +01:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAACdYAAAUmCAYAAACRBHQVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdT2wbZ57n/w/VvYsGdpsuybsLCBLQUbFzHpuU+56wmD13h7T7NoeOyOTKmYhWLjN7iUymW8cZk04f5rYSmfR1NqTTl9+pLZYz52mWPIANAosNVebsAoNdDPk7aKqapCSK///p/QIIk9JTz/OtYlGuYn3r+wTa7XZbAAAAAAAAAAAAAAAAAABAkrQ27wAAAAAAAAAAAAAAAAAAAFgkJNYBAAAAAAAAAAAAAAAAANCBxDoAAAAAAAAAAAAAAAAAADqQWAcAAAAAAAAAAAAAAAAAQAcS6wAAAAAAAAAAAAAAAAAA6EBiHQAAAAAAAAAAAAAAAAAAHUisAwAAAAAAAAAAAAAAAACgA4l1AAAAAAAAAAAAAAAAAAB0ILEOAAAAAAAAAAAAAAAAAIAOJNYBAAAAAAAAAAAAAAAAANCBxDoAAAAAAAAAAAAAAAAAADr8cN4BDOvVq1eybVuNRkOu6+r777+XJN29e1eGYcg0Te3u7ioYDM45UgAAAAAAAAAAAAAAAADAMlqKxLqvv/5a5XJZJycncl13oGVM05RlWUokEnr//fenGyAAAAAAAAAAAAAAAAAAYGUE2u12e95BXOfLL79UNpuV4ziSpM5QA4HAlctc1cY0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xlmhX0Ny65er2t
2024-02-21 08:34:33 +01:00
"text/plain": [
"<Figure size 2500x1300 with 6 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, axes = plt.subplots(2, 3, figsize=(25, 13), sharey=False)\n",
"# 0,0\n",
"axes[0, 0].hist(\n",
" train_sig.chi2,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[0, 0].hist(\n",
" train_bkg.chi2,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[0, 0].set_xlabel(r\"$\\chi^{2}_{\\mathrm{match}}$\")\n",
"axes[0, 0].legend(prop={\"size\": 20})\n",
"\n",
"# 0,1\n",
"axes[0, 1].hist(\n",
" train_sig.teta2,\n",
" bins=50,\n",
" range=(0.0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[0, 1].hist(\n",
" train_bkg.teta2,\n",
" bins=50,\n",
" range=(0.0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[0, 1].set_xlabel(r\"$t_{x}^{2}+t_{y}^{2}$\")\n",
"# 0,2\n",
"axes[0, 2].hist(\n",
" train_sig.distX,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[0, 2].hist(\n",
" train_bkg.distX,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[0, 2].set_xlabel(r\"$D_{x}$ [mm]\")\n",
"axes[0, 0].set_ylabel(\"Number of tracks (normalised)\",\n",
" va=\"bottom\",\n",
" ha=\"center\")\n",
2024-02-21 08:34:33 +01:00
"# 1,0\n",
"axes[1, 0].hist(\n",
" train_sig.distY,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[1, 0].hist(\n",
" train_bkg.distY,\n",
" bins=50,\n",
" range=(0, 100),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[1, 0].set_xlabel(r\"$D_{y}$ [mm]\")\n",
"# 2,0\n",
"axes[1, 1].hist(\n",
" train_sig.dSlope,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[1, 1].hist(\n",
" train_bkg.dSlope,\n",
" bins=50,\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[1, 1].set_xlabel(r\"$|\\Delta t_{x}^{\\mathrm{match}}|$\")\n",
"# 2,1\n",
"axes[1, 2].hist(\n",
" train_sig.dSlopeY,\n",
" bins=50,\n",
" range=(0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#107E7D\",\n",
" label=\"training sample, true pairs\",\n",
")\n",
"axes[1, 2].hist(\n",
" train_bkg.dSlopeY,\n",
" bins=50,\n",
" range=(0, 0.02),\n",
" alpha=0.5,\n",
" density=True,\n",
" log=False,\n",
" color=\"#F05342\",\n",
" label=\"training sample, wrong pairs\",\n",
")\n",
"axes[1, 2].set_xlabel(r\"$|\\Delta t_{y}^{\\mathrm{match}}|$\")\n",
"plt.savefig(\n",
" \"/work/cetin/LHCb/reco_tuner/thesis/filtered_NN_elec_variables_landscape.pdf\",\n",
" format=\"PDF\",\n",
")\n",
"# plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "tuner",
"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.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}