2023-12-19 13:00:59 +01:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 1,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"import uproot\n",
|
|
|
|
"import awkward as ak\n",
|
|
|
|
"import matplotlib.pyplot as plt\n",
|
|
|
|
"import seaborn as sns\n",
|
|
|
|
"import numpy as np\n",
|
|
|
|
"import mplhep\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"mplhep.style.use([\"LHCbTex2\"])\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"input_tree = uproot.open({\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/data/tracking_losses_ntuple_B_BJpsi_def_selected.root\":\n",
|
|
|
|
" \"Selected\"\n",
|
|
|
|
"})\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"array = input_tree.arrays()\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"array[\"dSlope_yEndT\"] = array[\"ideal_state_9410_ty\"] - array[\n",
|
|
|
|
" \"ideal_state_770_ty\"]\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"array[\"dSlope_yEndT_abs\"] = abs(array[\"dSlope_yEndT\"])\n",
|
|
|
|
"\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"array[\"dSlope_xEndT\"] = array[\"ideal_state_9410_tx\"] - array[\n",
|
|
|
|
" \"ideal_state_770_tx\"]\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"array[\"dSlope_xEndT_abs\"] = abs(array[\"dSlope_xEndT\"])\n",
|
|
|
|
"array[\"x_EndT_abs\"] = abs(array[\"ideal_state_9410_x\"])\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"array[\"x_EndVelo_abs\"] = abs(array[\"ideal_state_770_x\"])\n",
|
|
|
|
"\n",
|
|
|
|
"array[\"y_EndT_abs\"] = abs(array[\"ideal_state_9410_y\"])\n",
|
|
|
|
"array[\"y_EndVelo_abs\"] = abs(array[\"ideal_state_770_y\"])\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"\n",
|
|
|
|
"array[\"z_mag_xEndT\"] = (\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
" array[\"ideal_state_770_x\"] - array[\"ideal_state_9410_x\"] -\n",
|
|
|
|
" array[\"ideal_state_770_tx\"] * array[\"ideal_state_770_z\"] +\n",
|
|
|
|
" array[\"ideal_state_9410_tx\"] *\n",
|
|
|
|
" array[\"ideal_state_9410_z\"]) / array[\"dSlope_xEndT\"]\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"\n",
|
|
|
|
"array[\"z_mag_corr\"] = array[\"z_mag_xEndT\"] - array[\"match_zmag\"]\n",
|
|
|
|
"\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"sel_array = array[(array[\"z_mag_xEndT\"] < 5800)\n",
|
|
|
|
" & (array[\"z_mag_xEndT\"] > 5000)\n",
|
|
|
|
" # & (array[\"match_chi2\"] < 5)\n",
|
|
|
|
" ]"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 2,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACxsElEQVR4nOz9T2wbd57n/79K3YcFF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gIBrJ+ACAADA1XQlg7Dl5WV98skn+uUvf+l3KQB8Vg+pLMtqbKOud22ZpqmxsTFFIpHGdurjEomEbNtWuVxufM9xHJVKJT19+lSlUkmO4/TwjgAAAAAAl9U3h+XXPX/+XHfv3tXNmzf1/PnzU8fMzMxoenpaH374oX788cceVwh4K5/PNx4GcZHXzMyMJ+tfZu3R0dEz50skEpeas1QqtV2z4zhKp9ONP4dsNqtSqSTbthuhleM4sixLpVJJ2WxWsVisMT6dTiufzyuRSGh9ff3E/AsLC3r48KHW19cJwQAAAACgj/RNEPbFF1/o2rVrSiQSyufzsiyrcUD+cfF4XLZt629/+5tM09S3337b42oRBNVqVZOTky1fKysrfpd5rmQyqf39fZXLZcXj8ZZjo9GoisViY7wXXNdVpVJRLpdrefaVaZrK5XKqVCra398/c1yhUND+/r6KxeKpHVhHLS0tqVwua39//9yxdel0WqOjo8pms03fj8fjKhQKjfnq91UsFpVMJhv3ZlmWstmsUqlUIwQ7HnbV53FdV6ZptlUXAAAAAAyClZWVcz+LV6tV3+oL/NbIt2/fanZ2VrZt6+i5/oZ
|
2023-12-19 13:00:59 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"fig = plt.figure()\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.hist(\n",
|
|
|
|
" sel_array[\"z_mag_xEndT\"],\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" # range=[5100, 5700],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" density=True,\n",
|
|
|
|
")\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"plt.xlabel(r\"z$_{Mag}$ [mm]\")\n",
|
|
|
|
"plt.ylabel(\"Number of Tracks (normalised)\")\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"plt.show()\n",
|
|
|
|
"# plt.savefig(\n",
|
|
|
|
"# \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_dist.pdf\",\n",
|
|
|
|
"# format=\"PDF\",\n",
|
|
|
|
"# )"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 3,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACcKklEQVR4nOz9T4xb953ne39YUgwF8VBkuTEAUQS6RbYHzmpapHQXvesWOdnYSGZMSoMYtjcp0u2n7yw4HTIVr+0KK2lu+j6BSLkXj3INjETG7cBZdKeozO4Cd1RFpXfGJDxygCoQGIxVR+wYMRKbfBbVZMj6Qx6Sh+eQPO8XQKD+fOt3vqfIKul86vf7HV+32+0KAAAAAAAAWHFrbjcAAAAAAAAAOIEgDAAAAAAAAJ5AEAYAAAAAAABPIAgDAAAAAACAJxCEAQAAAAAAwBMIwgAAAAAAAOAJBGEAAAAAAADwBIIwAAAAAAAAeAJBGAAAAAAAADyBIAwAAAAAAACeQBAGAAAAAAAATyAIAwAAAAAAgCcQhAEAAAAAAMATCMIAAAAAAADgCQRhAAAAAAAA8ASCMAAAAAAAAHgCQRgAAAAAAAA8gSAMAAAAAAAAnkAQBgAAAAAAAE8gCAMAAAAAAIAnEIQBAAAAAADAEwjCAAAAAAAA4AkEYQA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dJJBITvb4BYF4IVpbLSy9IP/ul9foXX5hfLwAA4NhCL428efOmut2uuv96exsngqxZWd2HbNyMmt5+RsViUUdHR6pWqyoWi6pWq2o2myoWi0P16XR65PHGzeYax8pMPLvOHcd3TJ3k43a
|
2023-12-19 13:00:59 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-29 15:54:19 +01:00
|
|
|
"bins = np.linspace(-0.35, 0.35, 35)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"sns.regplot(\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_770_tx\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"# plt.ylim(5100, 5700)\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"plt.xlabel(\"$t_x$\")\n",
|
|
|
|
"plt.ylabel(r\"$z_{\\mathrm{Mag}}$ [mm]\")\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"# plt.show()\n",
|
|
|
|
"plt.savefig(\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_tx_dist.pdf\",\n",
|
|
|
|
" format=\"PDF\",\n",
|
|
|
|
")"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 4,
|
2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nPnz/vue03aLt+yufx8fF4xQEAAAAAAExhqYMwSZ3m8O0TByf14sWLwFcgmaapUqmkQqGgTCYzdGVUuVxWPB4fa/7293x0dDRVnePoDqcGhW/Xw7JJV4TN8oRNAAAAAACA65a6R1hbrVbTzs6OXn/9deXzeW1sbPh63NnZmTzPU6PR0NOnT2dS2/WwyPM8lctlHRwc3Nhm6DiOksmkarXayHmr1aqq1apqtdpYWxun1b1qbtApmNeDsEld//kAAAAAAADM0koEYe+9956kqxVEk24xbLVaikQiQZbVl2EYyuVyyuVyqlar2tvb6wl8bNtWsVhULpcbOIfneUqn08pkMn23Js6K67qdVXOFQmHgSq9JA6zrgV4QhyA0m01tb29PPc/+/r729/ennue6Vku6bA0fsxaR5vCrCQAAAADAVA4PD3V4eDj1PM1mM4BqJrP0Qdhbb72lcrksSYpEImq1RqQKfcwjAOsnlUopkUhod3e3Z1vmwcHB0CBsd3e3s+1yngqFgqSrLYzD6gtKECvCLi8vdXp6OvU8FxcXU8/Rz2VLeuVPh4/5+bekOwRhAAAAAIAld3FxEchr8EVa6iDs6OioEwZNGoJJmvhxQTAMQ/V6XfF4vBOGeZ4n27b7rvYqFotyHEf1en2udTqOo3K5LMMwRm7dNAwjkBAriC2fa2tr2tzcnHqe9fX1qecAAAAAAOA2W19f19bW1tTzNJtNXV5eBlDR+JY6CLsegiUSCSWTSRmGMXafsHfeeUcffvjhDKsd7ujoqKdZfq1WuxGEOY6jfD6vQqEgy7LmWt/e3p4k6dmzZyOb329sbAQShPl9DofZ3NzUycnJ1PMAAAAAAIDhgmortL29vbCVZUsdhDmOo0gkIsMwdHx8rHv37k08197enl577bUAqxuPZVlKJBKybVtS/4bz6XRalmX
|
2024-02-27 15:59:53 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"bins = np.linspace(-0.25, 0.25, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_9410_tx\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"# plt.ylim(4500, 5700)\n",
|
|
|
|
"\n",
|
|
|
|
"plt.xlabel(\"dx/dz(T)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 5,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACphElEQVR4nOz9TYxid57n+38gs6y0ykNCuNVSCKTpBHnkXnUnpO+idt0JXRtbdo8hc2TLtnSnElz+150FMwWO8tqOIrqaTd9rJaTrSp1uL9JQ7irZixoHWbO6V/pPBmT1zuoqTrqlCCGNpjJO0raccjk5dxEDBfEABzhwIHi/JKR4+MbvfE8E+cAnfg8ey7IsAQAAAAAAAKec1+0GAAAAAAAAgHkgCAMAAAAAAMBKIAgDAAAAAADASiAIAwAAAAAAwEogCAMAAAAAAMBKIAgDAAAAAADASiAIAwAAAAAAwEogCAMAAAAAAMBKIAgDAA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j7ArV67IsixZliVpsuVbOP28Xq+CweDQh8/nc7vNsZy0THKS5ZPjCofDR5YJSgch3KQz0E7qe5wQrFarHZmZ5ff7Va/XTwzBjpPL5dRsNo/cy/3790/8Gqdm3gHAqnFyFtcrUenb37I3zhOPSa8e/acMAADMgc/nG/ka3et1L45a6BlhmUxGb775pjweTy8MAw5bX1/X7u6u22046qRlh8OWIzp9/cMzuKa59nFfO0641Gg0lEgkjnz97du3jw3t7PRz7949Xbhwobckkk3
|
2023-12-19 13:00:59 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-26 16:18:03 +01:00
|
|
|
"bins = np.linspace(-0.25, 0.25, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_770_ty\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"# plt.ylim(4500, 5700)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"plt.xlabel(\"$t_y$\")\n",
|
|
|
|
"plt.ylabel(r\"$z_{\\mathrm{Mag}}$ [mm]\")\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"# plt.show()\n",
|
|
|
|
"plt.savefig(\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_ty_dist.pdf\",\n",
|
|
|
|
" format=\"PDF\",\n",
|
|
|
|
")"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 6,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACcfUlEQVR4nOz9TWxbd57n+38O5QQOkqZIpzGAIAHToToN16oh0p5FLUskahMj6QppAzFsA4MSmeRfdxbCFBlXFr1yVFRVtJl70xZdPQunDbRNVk2CZJGx6PTuAv+xRFfvgqnWcQqQQGCAMilVghiJzXMXajKiHshD8hwePrxfAAHJ+vJ3vhIp2/zw92BYlmUJAAAAAAAAGHE+rxsAAAAAAAAA+oEgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY4EgDAAAAAAAAGOBIAwAAAAAAABjgSAMAAAAAAAAY+GE1w0A3Xj++ef1+PFjTUxM6D/8h//gdTsAAAAAAMCm//N//o+ePn2qkydP6uuv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02-27 15:59:53 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2023-12-19 13:00:59 +01:00
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-0.25, 0.25, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_9410_ty\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"# plt.ylim(4500, 5700)\n",
|
|
|
|
"\n",
|
|
|
|
"plt.xlabel(\"dy/dz(T)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 7,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOVCAYAAACLW0xhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACbDElEQVR4nOz9TWxbd57v+X9IO4EzSdGUczeCBHSF7DRSq74m7buo2UVk1wUmRtId0gaSSQL8u0QmQaYX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AAAuOdhUzr5bu+aB1ekExM/vWgyufmafqKXRv785z/X3bt32++bptlzGVQvpmkOtfwLcMNxQdgwyycHFQqFFIlEDgVXiURiqBBM2u/7qN4HCcHK5bLi8XjXx4LBoG7fvn1oWWMvmUxGiURC0Wi0axbY7u7usV8z7P0GAAAAAEyWic4uL168KNM01Zq0RpAFrzhuKd64lugddZ1Rrn3U1w4SLlUqFVtCsM5+vvzyy64e2AwfAAAAAGbfRAdhrRkkPp+vHYgNewOmyXEh0ZkzZ8bbyAQwDENLS0uHPl4sFocKwVqCwaBte6xNklKpdGjpKP5DuVx2uwUAAAAALpropZGnT59WJBLR3bt3lcvlFIlEhgoCDMPQz3/+c/32t7+1v0lgBh31c/bkk0/aOp7Vn+VkMnlotlYqlbK8sX4voVBImUxm6CXX41SpVJTP51Uul2UYhoLBoM6cOaNgMKhQKKRLly5J2j/tMpfL9Vx2Wi6XlUwmdebMGeXzeVu+l5PKMAyVy2UVi8V2CDZJfxzx0mM
|
2024-02-27 15:59:53 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2023-12-19 13:00:59 +01:00
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-300, 300, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_770_x\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"plt.xlabel(\"x (VELO)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 8,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOUCAYAAABAB5/EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACo3klEQVR4nOz9T2xjaZrf+f6oTBs98DTzUFkwIFBAVxx2Ar6rdhwqvLg7l0jXZoyZ7iQVwBhjA+MW6WxceMF2kRnlhduLThVZVdwYmE4yqu/Ccw1YQVb1vZhZNIpH2XuHdLK8G/gWT2QBIggYSPEEexrTsDt57iIu2aTEfyIpHknn+wEEkNLL9zz6E9nNXz3vcyK+7/sCAAAAAAAAHrmdoAsAAAAAAAAAtoEgDAAAAAAAAKFAEAYAAAAAAIBQIAgDAAAAAABAKBCEAQAAAAAAIBQIwgAAAAAAABAKBGEAAAAAAAAIBYIwAAAAAAAAhAJBGAAAAAAAAEKBIAwAAAAAAAChQBAGAAAAAACAUCAIAwAAAAAAQCgQhAEAAAAAACAUCMIAAAAAAAAQCgRhAAAAAAAACAWCMAAAAAAAAIQCQRgAAAAAAABCgSAMAAAAAAAAoUAQBgAAAAAAgFAgCAMAAAAAAEAoEIQBAAAAAAAgFAjCAAAAAAAAEAoEYQAAAAAAAAgFgjAAAAAAAACEAkEYAAAAAAAAQoEgDAAAAAAAAKFAEAYAAAAAAIBQIAgDAAAAAABAKLwfdAHAKv7W3/pb+su//Eu99957+tt/+28HXQ4AAAAAAFjSf/7P/1nffPONfu3Xfk1/8Rd/sdVr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|
2024-02-27 15:59:53 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2023-12-19 13:00:59 +01:00
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-300, 300, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"x_EndT_abs\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"plt.xlabel(\"x (T)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 9,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACtxUlEQVR4nOz9X4xb953f/78OpRjyxktxxkWBAQlsxVkXDn7Ab1fkqBfZq12RzUXtX7JrUiri2gbaiHTcfPeCbYZWjC+6vXAmnKQEvui3qYbKFvjJ6wuZtNeG3R9SD529+wKtZqjsndGElAMMQaBo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eW/SB/+bIz6p6Qf/8vDgyIKhcKRjycSib6Axgm1Wk3r6+vHfqzZbE4UvkWj0WNnVu3s7CiVSo3VWzwePxJKpVIp7ezs2Bpje3tb2Wz2yPvD4bCq1eqxrxn8frjxfQAAAACAXv/3/yP9H+/br/+Pz0rf+rJz/UzDy/v5ud4s/8qVK7IsS52sbtIQDPBK87PJ6tPp9LEfP+n9sxQOh48sE5QOw59JZ6Cd1Pc4IVi5XD4yMysQCGh/f992CCYdzkCrVqtHPpf79++f+JpZzbwDAAAAgEm9//F49R+MWb8s5joI69w8G4bRDcQmfQBeWHl8svqTlh0OW444S8ddZ5prH/faccKlSqWieDx+5PUfffTRsaGdnX7u3bvX1wOb4QMAAACYZ5NOtEC/ud4j7Pz584pEIrp7965yuZwikYhWV1fHHqdWq+m73/2ufvrTn86+SWCIZ58eb2nkM08f/u9JIdEkP/+Lrlar6fLly0feXyw
|
2023-12-19 13:00:59 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-29 15:54:19 +01:00
|
|
|
"bins = np.linspace(-1.0, 1.0, 51)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"sns.regplot(\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" x=ak.to_numpy(sel_array[\"dSlope_xEndT\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.xlabel(\"$\\Delta t_x$\")\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"plt.ylabel(r\"$z_{\\mathrm{Mag}}$ [mm]\")\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"# plt.show()\n",
|
|
|
|
"plt.savefig(\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_deltatx_dist.pdf\",\n",
|
|
|
|
" format=\"PDF\",\n",
|
|
|
|
")"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 10,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-29 15:54:19 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMAAAAOWCAYAAAAJOu7yAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACCGklEQVR4nOz9X0yk6X0v+v6KblsT2aELZikSAimZIrPlpXMRddG9L3K3TbF9E5/8GWpGirftGzd4rJx1JPYyuO2LdWUzRWJu1lEyVHtdHOdY2t1g70TJkSJTM7k7F3ugxvvOWivUjCVQSUtyU01ixXJmqHPRmzLQUBRQf18+H6mkKvjV8/6AKuj328/zvKl6vV4PAAAAAEiooV43AAAAAACdJAADAAAAINEEYAAAAAAkmgAMAAAAgEQTgAEAAACQaAIwAAAAABJNAAYAAABAognAAAAAAEg0ARgAAAAAiSYAAwAAACDRBGAAAAAAJJoADAAAAIBEE4ABAAAAkGgCMAAAAAASTQAGAAAAQKIJwAAAAABINAEYAAAAAIkmAAMAAAAg0QRgAAAAACSaAAwAAACARBOAAQAAAJBoAjAAAAAAEk0ABgAAAECiCcAAAAAASDQBGAAAAACJJgADAAAAIN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tba8v3sV5VKJUqlUqyvrzfCr376T5Gb9LMAAIBe6usALCLijTfeiMnJyfj6179+5THu3r0br7322o2cQQODqlQqnbl5fqFQaNsxHj582AjAarVaX+73VavV4sGDB40rVmYymcbFQCqVSpT
|
2024-02-27 15:59:53 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2023-12-19 13:00:59 +01:00
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-0.5, 0.5, 100)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"dSlope_yEndT\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"plt.xlabel(\"$\\Delta t_y$\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-27 15:59:53 +01:00
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 11,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
2024-02-29 15:54:19 +01:00
|
|
|
"intercept= 5308.689740859701\n",
|
|
|
|
"coef= {'dSlope_xEndT_abs': 94.8390840129271, 'x_EndT_abs': 0.03952176022974936, 'ideal_state_770_tx^2': 70418.55504271125, 'ideal_state_770_tx dSlope_xEndT': 62087.4827671762, 'dSlope_xEndT^2': 13580.830615214854, 'x_EndT_abs^2': -0.000842287765099925, 'ideal_state_770_ty^2': -2237.8985443626666, 'ideal_state_770_tx^2 x_EndT_abs': -16.447718852307414, 'ideal_state_770_tx dSlope_xEndT x_EndT_abs': -13.929546692369508, 'dSlope_xEndT^2 x_EndT_abs': -3.2033475757333143, 'dSlope_xEndT_abs ideal_state_770_ty^2': 3364.6401097763382, 'x_EndT_abs^3': 1.936634587279551e-07}\n",
|
|
|
|
"r2 score= 0.8153420697863665\n",
|
|
|
|
"RMSE = 37.11860171392724\n"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"from sklearn.preprocessing import PolynomialFeatures\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"from sklearn.linear_model import LinearRegression, Lasso, Ridge, ElasticNet, LassoCV\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"from sklearn.model_selection import train_test_split\n",
|
|
|
|
"from sklearn.pipeline import Pipeline\n",
|
|
|
|
"from sklearn.metrics import mean_squared_error\n",
|
|
|
|
"import numpy as np\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"features = [\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
" \"ideal_state_770_tx\",\n",
|
|
|
|
" \"dSlope_xEndT\",\n",
|
|
|
|
" \"dSlope_xEndT_abs\",\n",
|
|
|
|
" \"x_EndT_abs\",\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" \"ideal_state_770_ty\",\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"]\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"target_feat = \"z_mag_xEndT\"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"order = 3\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"data = np.column_stack([ak.to_numpy(sel_array[feat]) for feat in features])\n",
|
|
|
|
"target = ak.to_numpy(sel_array[target_feat])\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"X_train, X_test, y_train, y_test = train_test_split(\n",
|
|
|
|
" data, target, test_size=0.2, random_state=42\n",
|
|
|
|
")\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"poly = PolynomialFeatures(degree=order, include_bias=True)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"X_train_model = poly.fit_transform(X_train)\n",
|
|
|
|
"X_test_model = poly.fit_transform(X_test)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
|
|
|
"poly_features = poly.get_feature_names_out(input_features=features)\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"# keep = [\n",
|
|
|
|
"# \"ideal_state_770_tx^2\",\n",
|
|
|
|
"# \"dSlope_xEndT^2\",\n",
|
|
|
|
"# \"dSlope_xEndT_abs\",\n",
|
|
|
|
"# \"x_EndT_abs\",\n",
|
|
|
|
"# ]\n",
|
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"keep = [\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
" # \"ideal_state_770_tx\",\n",
|
|
|
|
" # \"dSlope_xEndT\",\n",
|
|
|
|
" # \"ideal_state_770_ty\", # no\n",
|
|
|
|
" # \"ideal_state_770_tx x_EndT_abs\", # maybe no\n",
|
|
|
|
" # \"ideal_state_770_tx ideal_state_770_ty\", # dont keep\n",
|
|
|
|
" # \"dSlope_xEndT_abs x_EndT_abs\", # dont keep\n",
|
|
|
|
" # \"ideal_state_770_tx^2 dSlope_xEndT_abs\", # dont keep\n",
|
|
|
|
" # \"ideal_state_770_tx dSlope_xEndT dSlope_xEndT_abs\", # dont keep\n",
|
|
|
|
" # \"dSlope_xEndT^2 dSlope_xEndT_abs\", # no\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" \"dSlope_xEndT_abs\", # keep\n",
|
|
|
|
" \"x_EndT_abs\", # keep\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
" \"ideal_state_770_tx^2\", # do keep\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT\", # do keep\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" \"dSlope_xEndT^2\", # keep\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
" \"x_EndT_abs^2\", # do keep\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" \"ideal_state_770_ty^2\", # keep\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
" \"ideal_state_770_tx^2 x_EndT_abs\", # do keep\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT x_EndT_abs\", # do keep\n",
|
|
|
|
" \"dSlope_xEndT^2 x_EndT_abs\", # do keep\n",
|
|
|
|
" \"dSlope_xEndT_abs ideal_state_770_ty^2\", # maybe keep\n",
|
|
|
|
" \"x_EndT_abs^3\", # do keep\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"]\n",
|
|
|
|
"\n",
|
|
|
|
"remove = [i for i, f in enumerate(poly_features) if f not in keep]\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"X_train_model = np.delete(X_train_model, remove, axis=1)\n",
|
|
|
|
"X_test_model = np.delete(X_test_model, remove, axis=1)\n",
|
|
|
|
"poly_features = np.delete(poly_features, remove)\n",
|
|
|
|
"# print(poly_features)\n",
|
|
|
|
"\n",
|
|
|
|
"lin_reg = LinearRegression()\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"# lin_reg = Lasso(alpha=0.00001)\n",
|
|
|
|
"# lin_reg = LassoCV()\n",
|
|
|
|
"# lin_reg = ElasticNet(alpha=0.0001)\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"# lin_reg = Ridge(alpha=0)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"lin_reg.fit(X_train_model, y_train)\n",
|
|
|
|
"y_pred_test = lin_reg.predict(X_test_model)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"print(\"intercept=\", lin_reg.intercept_)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"print(\"coef=\", dict(zip(poly_features, lin_reg.coef_)))\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"print(\"r2 score=\", lin_reg.score(X_test_model, y_test))\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"print(\"RMSE =\", mean_squared_error(y_test, y_pred_test, squared=False))"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 12,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2024-02-29 15:54:19 +01:00
|
|
|
"['x_EndT_abs^3']"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 12,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
2024-02-27 15:59:53 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"koeffs = dict(zip(poly_features, lin_reg.coef_))\n",
|
|
|
|
"\n",
|
|
|
|
"remove = []\n",
|
|
|
|
"for itr in koeffs.items():\n",
|
|
|
|
" if abs(itr[1]) < 1e-4:\n",
|
|
|
|
" remove.append(itr[0])\n",
|
|
|
|
"remove"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 13,
|
2024-02-27 15:59:53 +01:00
|
|
|
"metadata": {},
|
2024-02-29 15:54:19 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"['dSlope_xEndT_abs',\n",
|
|
|
|
" 'x_EndT_abs',\n",
|
|
|
|
" 'ideal_state_770_tx^2',\n",
|
|
|
|
" 'ideal_state_770_tx dSlope_xEndT',\n",
|
|
|
|
" 'dSlope_xEndT^2',\n",
|
|
|
|
" 'x_EndT_abs^2',\n",
|
|
|
|
" 'ideal_state_770_ty^2',\n",
|
|
|
|
" 'ideal_state_770_tx^2 x_EndT_abs',\n",
|
|
|
|
" 'ideal_state_770_tx dSlope_xEndT x_EndT_abs',\n",
|
|
|
|
" 'dSlope_xEndT^2 x_EndT_abs',\n",
|
|
|
|
" 'dSlope_xEndT_abs ideal_state_770_ty^2',\n",
|
|
|
|
" 'x_EndT_abs^3']"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 13,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
2024-02-27 15:59:53 +01:00
|
|
|
"source": [
|
|
|
|
"ls_koeffs = []\n",
|
|
|
|
"for itr in koeffs.items():\n",
|
|
|
|
" ls_koeffs.append(itr[0])\n",
|
|
|
|
"ls_koeffs"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-29 15:54:19 +01:00
|
|
|
"execution_count": 14,
|
2024-02-27 15:59:53 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
2023-12-19 13:00:59 +01:00
|
|
|
{
|
|
|
|
"data":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lmUpk8lIOoh9eXm56VzDMGRZ1pFNHerPNb521s+iLpFIKBaLyTAMlctlxeNxWZYl0zQVDodVLBa9mLPZrPx+f9N3o1KpKBQKHfleFgoFzc7Oest6y+WyUqmU91k5jkPzfwAAAOA0w87EAeeZRqwiLJlMdjze4WocnVIRdriipn6rVyMN2uGqplaVNsepVxf14jqOe186GbdxrNOqkA5XCR1XmXe4cq2xMqxR43ty3Ny5XK6tCq5qtdrTirBwOHzqd/60cdqNva7dz6KxEuy0z7qx4uu4CsbGGA3DaPm5Hv7+Dur/gwAAAIDziIowAB0Z9Yqwszi886PU+XXE43FVq9Vjq6Dqu1W2M36ruI7TuElBNBo9tj/a4Z0Sj6sEbIzfcZyR/VyP+x42Pt+LpvjtfhaJRMKbPxqNtnWsdFDl1mqThsbrWF9fb/m5Hv6uFQqFtmIFAAAAxhGJMAAdOS4xUC6XBxxJ91olU96/f9/VeJlMRsVi8cgSPOkg6bG4uNjT5FK7S0EbP7ezLB8dpR0W19fXlUwmlclkTk02SYNLzqbTaW+udhJn0Wi06TM46yYNjRrnG6XPCgAAABg1JMIAdOS4iqNWVS2jrlXS4vLly12Pa1nWsf3XSqXSkf5Vg9Dprp6VSqW3gXTBMAzF4/Fje7Kdtb9br+RyOe9+uxVkjX9H5/FvBwAAADhvSIQB6Firaifbtkd2Gd1ZnGVZ4mmi0ajK5fKRJFQ2mx3p5EenSbNBs21b6XRa+Xy+ZSP8QcZxVoe/ZxfhbwcAAAAYZSTCAHTs1q1bLZ8f5eTOcQ4nfXqZCKuPVywWj8xz1t068Vf1XS9TqdSJfdEGpTG
|
2023-12-19 13:00:59 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 2 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(5150, 5700, 50)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"ax = sns.regplot(\n",
|
|
|
|
" x=y_test,\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
" y=y_test - y_pred_test,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
" label=\"bla\",\n",
|
|
|
|
")\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"ax.set_ylim(-150, 175)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"ax2 = ax.twinx()\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"ax2.hist(\n",
|
|
|
|
" y_test,\n",
|
|
|
|
" bins=50,\n",
|
|
|
|
" range=[5150, 5700],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" align=\"mid\",\n",
|
|
|
|
" density=True,\n",
|
|
|
|
")\n",
|
|
|
|
"ax.set_xlabel(r\"$z_{\\mathrm{Mag}}$ [mm]\")\n",
|
|
|
|
"ax.set_ylabel(\n",
|
|
|
|
" r\"$\\left\\langle z_{\\mathrm{Mag}}-z_{\\mathrm{Mag}}^{\\mathrm{pred}}\\right\\rangle$ [mm]\"\n",
|
|
|
|
")\n",
|
|
|
|
"ax2.set_ylabel(\"Number of Tracks (normalised)\")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"# plt.show()\n",
|
|
|
|
"plt.savefig(\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_regression_plot.pdf\",\n",
|
|
|
|
" format=\"PDF\",\n",
|
|
|
|
")"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 15,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|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JBVVXE43FkMhnkcrmKQwJisRhUVYXH44GiKEgmk8jlcsjlckgmk+brp2kaNjY2ao7t8/kszbHW69IJRVHMsdfX1yv6l2UZ8XgcwPHc/X5/xXNFUYQsy1WHOpTuK3+s1feiJBwOIxgMQhRFZDIZhEIhyLIMSZLg9XqRTqfNOScSCTidzoqfjWw2C4/HU/VzmUqlMDs7a27rzWQyiEaj5nul6zqL/xMRERERNdPvJI5omGHAVoRFIpG2+zu5GgdNVoSdXFFTupVWI/XayVVNtVba1FNaXWTHddR7Xdrpt7yvZquQTq4Sqrcy7+TKtfKVYeXKX5N6YyeTSUsruHK5nK0rwrxeb9Of+Wb9WJ17idX3onwlWLP3unzFV70VjOVzFEWx5vt68ue3V38GERERERENI64II6K2DPqKsFacPPkRaP86QqEQcrlc3VVQpdMqrfRfa171lB9SEAgE6tZHO3lSYr2VgOXz13V9YN/Xej+H5ffbURTf6nsRDofN8QOBgKW2wPEqt1qHNJRfx87OTs339eTPWiqVsjRXIiIiIqJxxCCMiNpSLxjIZDI9nknnaoUpDx8+7Ki/eDyOdDpdtQUPOA49FhcXbQ2XrG4FLX/fWtk+OkgnLO7s7CASiSAejzcNm4DehbOxWMwcy0pwFggEKt6DVg9pKFc+3iC9V0REREREg4ZBGBG1pd6Ko1qrWgZdrdDi1KlTHfcry3Ld+muqqlbVr+qFdk/1zGaz9k6kA6IoIhQK1a3J1mp9N7skk0nza6sryMp/j4bxd4eIiIiIaNgwCCOittVa7aRp2sBuo2tFK9sSmwkEAshkMlU
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 2 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"bins = np.linspace(5150, 5700, 50)\n",
|
|
|
|
"ax = sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]) - ak.to_numpy(sel_array[\"match_zmag\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
" label=\"bla\",\n",
|
|
|
|
")\n",
|
|
|
|
"ax.set_ylim(-150, 175)\n",
|
|
|
|
"ax2 = ax.twinx()\n",
|
|
|
|
"ax2.hist(\n",
|
|
|
|
" ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" bins=50,\n",
|
|
|
|
" range=[5150, 5700],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" align=\"mid\",\n",
|
|
|
|
" density=True,\n",
|
|
|
|
")\n",
|
|
|
|
"ax.set_xlabel(r\"$z_{\\mathrm{Mag}}$ [mm]\")\n",
|
|
|
|
"ax.set_ylabel(\n",
|
|
|
|
" r\"$\\left\\langle z_{\\mathrm{Mag}}-z_{\\mathrm{Mag}}^{\\mathrm{old}}\\right\\rangle$ [mm]\"\n",
|
|
|
|
")\n",
|
|
|
|
"ax2.set_ylabel(\"Number of Tracks (normalised)\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
|
|
|
|
"# plt.show()\n",
|
|
|
|
"plt.savefig(\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_old_regression_plot.pdf\",\n",
|
|
|
|
" format=\"PDF\",\n",
|
|
|
|
")"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"plt.hist(\n",
|
|
|
|
" ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" bins=50,\n",
|
|
|
|
" range=[5150, 5700],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" align=\"mid\",\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" label=\"True\",\n",
|
|
|
|
")\n",
|
|
|
|
"plt.hist(\n",
|
|
|
|
" ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" bins=50,\n",
|
|
|
|
" range=[5150, 5700],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" align=\"mid\",\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" label=\"True\",\n",
|
|
|
|
")\n",
|
|
|
|
"plt.xlabel(r\"$z_{\\mathrm{Mag}}$ [mm]\")\n",
|
|
|
|
"plt.ylabel(\"Number of Tracks (normalised)\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
|
|
|
|
"# plt.show()\n",
|
|
|
|
"plt.savefig(\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_old_new.pdf\",\n",
|
|
|
|
" format=\"PDF\",\n",
|
|
|
|
")"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 330,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAADmiklEQVR4nOz9T2yb6X3vf38oTYMpmkqU3J0HyOjmuMhZ1bopB0h3GZEzmwzajEl50CAJcDIi7Tz9nYUTi9Zk0y5imfLEm/N7EpNyDnCmJ8BPIu1pMV1MTcrZ/YJnTN5ydkUzvKUBxruOdEtp0aCNdT8LhRySkij+//t+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WetgqwvH7Hcfr2OT3tNVj+9XY0xa/3uYjFYqXrRyKRusZKR6vcTjqgofxxrK2tnfi8Vr/WcrlcXbUCAAAAqEQQBqCm08KBQqHQ5Upad1Kg8tlnnzU9VyqVUj6fP7YFTzoKPebn59saLtW7DbT8OWtk62g/nbC4trameDyuVCp1ZtgkdS+YTSaTpWvVE5xFIpGK56CRAxqqlV+vn54rAAAAYJAQhAGo6bRVRyetbOl3JwUX586da2lO0zRP7b1mWdax/lXd0OyJnru7u+0tpAVer1dLS0un9mRrpLdbO2UymdLH9a4gK/8dGsTfGwAAAGCYEIQBONNJK55s2+7brXSNaGRrYi2RSESFQuFYCJVOp/s6/Gg2NOs227aVTCaVzWZPbITfzToaVf0aG4bfGwAAAGBQEYQBONOVK1dO/Ho/BzynqQ5+2hWEFefK5/PHrtHoSZ34XPHUy0Q
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 2 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"xlim = 1\n",
|
|
|
|
"bins = np.linspace(-xlim, xlim, 50)\n",
|
|
|
|
"ax = sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"dSlope_xEndT\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"ax2 = ax.twinx()\n",
|
|
|
|
"ax2.hist(\n",
|
|
|
|
" ak.to_numpy(sel_array[\"dSlope_xEndT\"]),\n",
|
|
|
|
" bins=bins,\n",
|
|
|
|
" color=\"#FB8F67\",\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" align=\"mid\",\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" range=[-xlim, xlim],\n",
|
|
|
|
")\n",
|
|
|
|
"ax.set_xlabel(r\"$\\Delta t_x$\")\n",
|
|
|
|
"ax.set_ylabel(r\"$\\left\\langle z_{\\mathrm{Mag}}\\right\\rangle$ [mm]\")\n",
|
|
|
|
"ax2.set_ylabel(f\"Number of Tracks (normalised)\", labelpad=15.0)\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
|
|
|
|
"# plt.show()\n",
|
|
|
|
"plt.savefig(\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_zmag_deltatx_dist.pdf\",\n",
|
|
|
|
" format=\"PDF\",\n",
|
|
|
|
")"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
2024-02-29 15:54:19 +01:00
|
|
|
{
|
|
|
|
"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": []
|
|
|
|
},
|
2023-12-19 13:00:59 +01:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"fig = plt.figure()\n",
|
|
|
|
"plt.hist(\n",
|
|
|
|
" sel_array[\"z_mag_corr\"],\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" # range=[5100, 5700],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" density=True,\n",
|
|
|
|
")\n",
|
|
|
|
"plt.xlabel(r\"z$_{Mag}$ correction [mm]\")\n",
|
|
|
|
"plt.ylabel(\"Number of Tracks (normalised)\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-0.4, 0.4, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_770_tx\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"# plt.ylim(5100, 5700)\n",
|
|
|
|
"plt.xlabel(\"dx/dz(VELO)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-0.25, 0.25, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_770_ty\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"# plt.ylim(4500, 5700)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.xlabel(\"dy/dz(VELO)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-0.25, 0.25, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_9410_ty\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"# plt.ylim(4500, 5700)\n",
|
|
|
|
"\n",
|
|
|
|
"plt.xlabel(\"dy/dz(T)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2024-02-27 15:59:53 +01:00
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"bins = np.linspace(-300, 300, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"ideal_state_770_x\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
")\n",
|
|
|
|
"plt.xlabel(\"x (VELO)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
2023-12-19 13:00:59 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(0, 500, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" # x=ak.to_numpy(sel_array[\"ideal_state_770_y\"]),\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"x_EndT_abs\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.xlabel(\"x (T)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(0, 500, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" # x=ak.to_numpy(sel_array[\"ideal_state_770_y\"]),\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"y_EndVelo_abs\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.xlabel(\"y (VELO)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(0, 500, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" # x=ak.to_numpy(sel_array[\"ideal_state_770_y\"]),\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"y_EndT_abs\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.xlabel(\"y (T)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-1.0, 1.0, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"dSlope_xEndT\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.xlabel(\"$\\Delta t_x$\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-1.0, 1.0, 50)\n",
|
|
|
|
"sns.regplot(\n",
|
|
|
|
" x=ak.to_numpy(sel_array[\"dSlope_yEndT_abs\"]),\n",
|
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_corr\"]),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"plt.xlabel(\"$\\Delta t_y$\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ correction [mm]\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"features = [\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" # # \"ideal_state_770_tx\",\n",
|
|
|
|
" # \"ideal_state_770_ty\",\n",
|
|
|
|
" # \"ideal_state_9410_ty\",\n",
|
|
|
|
" # # \"dSlope_yEndT\",\n",
|
|
|
|
" # # \"dSlope_yEndT_abs\",\n",
|
|
|
|
" # # \"ideal_state_770_x\",\n",
|
|
|
|
" # # \"ideal_state_9410_x\",\n",
|
|
|
|
" # # \"x_EndVelo_abs\",\n",
|
|
|
|
" # \"y_EndVelo_abs\",\n",
|
|
|
|
" # # \"y_EndT_abs\",\n",
|
|
|
|
" # \"dSlope_xEndT\",\n",
|
|
|
|
" # \"dSlope_xEndT_abs\",\n",
|
|
|
|
" # \"x_EndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx\",\n",
|
|
|
|
" \"ideal_state_770_ty\",\n",
|
|
|
|
" \"ideal_state_9410_ty\",\n",
|
|
|
|
" \"ideal_state_9410_tx\",\n",
|
|
|
|
" \"dSlope_xEndT\",\n",
|
|
|
|
" \"dSlope_xEndT_abs\",\n",
|
|
|
|
" \"x_EndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_x\",\n",
|
|
|
|
" \"x_EndVelo_abs\",\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"]\n",
|
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"target_feat = \"z_mag_corr\"\n",
|
|
|
|
"order = 4\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"data = np.column_stack([ak.to_numpy(sel_array[feat]) for feat in features])\n",
|
|
|
|
"target = ak.to_numpy(sel_array[target_feat])\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"X_train, X_test, y_train, y_test = train_test_split(\n",
|
|
|
|
" data, target, test_size=0.1, random_state=42\n",
|
|
|
|
")\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"poly = PolynomialFeatures(degree=order, include_bias=True)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"X_train_model = poly.fit_transform(X_train)\n",
|
|
|
|
"X_test_model = poly.fit_transform(X_test)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"poly_features = poly.get_feature_names_out(input_features=features)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"# keep = [\n",
|
|
|
|
"# \"ideal_state_770_tx^2\",\n",
|
|
|
|
"# \"ideal_state_770_x\",\n",
|
|
|
|
"# # \"x_EndVelo_abs\",\n",
|
|
|
|
"# \"dSlope_xEndT^2\",\n",
|
|
|
|
"# \"dSlope_xEndT_abs\",\n",
|
|
|
|
"# \"x_EndT_abs\",\n",
|
|
|
|
"# ]\n",
|
|
|
|
"# remove = [i for i, f in enumerate(poly_features) if f not in keep]\n",
|
|
|
|
"# remove_term = [\n",
|
|
|
|
"# \"ideal_state_770_x^2 ideal_state_9410_x\",\n",
|
|
|
|
"# ]\n",
|
|
|
|
"# remove = [i for i, f in enumerate(poly_features) if f in remove_term]\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"# X_train_model = np.delete(X_train_model, remove, axis=1)\n",
|
|
|
|
"# X_test_model = np.delete(X_test_model, remove, axis=1)\n",
|
|
|
|
"# poly_features = np.delete(poly_features, remove)\n",
|
|
|
|
"# print(poly_features)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"# lin_reg = LinearRegression()\n",
|
|
|
|
"lin_reg = Lasso(alpha=0.1, max_iter=2000)\n",
|
|
|
|
"# lin_reg = LassoCV()\n",
|
|
|
|
"# lin_reg = ElasticNet(alpha=1)\n",
|
|
|
|
"# lin_reg = Ridge(alpha=1)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"lin_reg.fit(X_train_model, y_train)\n",
|
|
|
|
"y_pred_test = lin_reg.predict(X_test_model)\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"print(\"intercept=\", lin_reg.intercept_)\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"print(\"coef=\", dict(zip(poly_features, lin_reg.coef_)))\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"print(\"r2 score=\", lin_reg.score(X_test_model, y_test))\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"print(\"RMSE =\", mean_squared_error(y_test, y_pred_test, squared=False))"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-200, 200, 50)\n",
|
|
|
|
"ax = sns.regplot(\n",
|
|
|
|
" x=y_test,\n",
|
|
|
|
" y=abs(y_test - y_pred_test),\n",
|
|
|
|
" x_bins=bins,\n",
|
|
|
|
" fit_reg=None,\n",
|
|
|
|
" x_estimator=np.mean,\n",
|
|
|
|
" label=\"bla\",\n",
|
|
|
|
")\n",
|
|
|
|
"ax2 = ax.twinx()\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"ax2.hist(y_test, bins=30, range=[-200, 200], color=\"#2A9D8F\", alpha=0.8, align=\"left\")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"ax.set_xlabel(r\"z$_{Mag}$ correction [mm]\")\n",
|
|
|
|
"ax.set_ylabel(\"Mean Deviation [mm]\")\n",
|
|
|
|
"ax2.set_ylabel(\"Number of Tracks\")\n",
|
|
|
|
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2024-02-27 15:59:53 +01:00
|
|
|
"source": []
|
2023-12-19 13:00:59 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2024-02-27 15:59:53 +01:00
|
|
|
"source": []
|
2023-12-19 13:00:59 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "Python 3.10.6",
|
|
|
|
"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",
|
2024-02-26 16:18:03 +01:00
|
|
|
"version": "3.10.12"
|
2023-12-19 13:00:59 +01:00
|
|
|
},
|
|
|
|
"orig_nbformat": 4,
|
|
|
|
"vscode": {
|
|
|
|
"interpreter": {
|
|
|
|
"hash": "a2eff8b4da8b8eebf5ee2e5f811f31a557e0a202b4d2f04f849b065340a6eda6"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|