2023-12-19 13:00:59 +01:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-03-27 09:23:35 +01:00
|
|
|
"execution_count": 16,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-03-27 09:23:35 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"ename": "SyntaxError",
|
|
|
|
"evalue": "incomplete input (4052887367.py, line 38)",
|
|
|
|
"output_type": "error",
|
|
|
|
"traceback": [
|
|
|
|
"\u001b[0;36m Cell \u001b[0;32mIn[16], line 38\u001b[0;36m\u001b[0m\n\u001b[0;31m # & (array[\"match_chi2\"] < 5)]\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m incomplete input\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2023-12-19 13:00:59 +01:00
|
|
|
"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",
|
2024-03-27 09:23:35 +01:00
|
|
|
" & (array[\"z_mag_xEndT\"] > 5000)]\n",
|
|
|
|
" # & (array[\"match_chi2\"] < 5)]"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC2MklEQVR4nOz9T2wbd57n/79KyWGBxUgleTCAIAEdFeM9/HJYi5L7vhaZ7uvEpJxzOiLtOQWatmjlvrYpd/TLaduknJzHIu1ce0zKua9FOn3IKWFJDUggsLuRymwssJewvgeBHFF/KIr/qig+HwAxovTh+/MuUZ4ZvvL5fMpwXdcVAAAAAAAAcMWNeN0AAAAAAAAA0A8EYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGAoEYQAAAAAAABgKBGEAAAAAAAAYCgRhAAAAAAAAGArve90A0G3/+T//Z/2///f/9N577+mf/umfvG4HAAAAAAAc87/+1//Sr7/+qv/0n/6T/u///b99ndtwXdft64xAj7333nuqVqtetwEAAAAAAJoYGRnRr7/+2tc5WRGGK6cWhI2MjGhyctLrdhqUy2Xf9tZNw3Cdw3CN0nBc5zBcozQc1zkM1yhxnVfJMFyjNBzXOQzXKHGdV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JeBP/NsE/Id/l4D/8O/y8jwJwu7cuaO1tbWWx7uu21Zodvw1tVBsc3OzoyBsfn6+HuBIR4FOKyHQycPkA4GAL+b26nqOb4vsxflgfsWh+4D/8O8S8Cf+bQL+w79LwH/4d3l5I15MOjs7W98K57ruhQ/DMFoad96jxnVdZTKZjnqfm5treF7bdnmRUqnU8DwUCvlibq+up/Y+mKapYDB4qdcCAAAAAAC0w5MgTJIWFhYkSfl8XtVq9dxHMpmU67oKBoPK5XI6PDxsOv7kY3t7WzMzM4rH46pWq/rpp5866nt+fr7heavB0fGthKZptnUmVi/m9uJ6HMdRPp+XJMVisZZfBwAAAAAA0AnPgrDFxUUFg0HdunXr3DE7Ozt68OCB4vG4tre3tbCwoLGxsUvNEwwG9erVK6VSKf3Lv/xLp20rGAw2bB188+ZNS6/b3t6uf30yfPJybi+uZ1i3RQIAAAAAAG95uiJsfHy86ZhkMinLsvTnP/+5o7ksy9LS0pJSqZS+//77jmpJRyFezfHztZo5Pi6RSPhq7n5fD9siAQAAAACAFzwLwiTp1atXTX++vb2teDzelbnm5+fluq5SqVTHtY73VNvi18zxMZZltXU+WC/n7uf1HN8WeTyAAwAAAAAA6DVPg7CLFIvFrq0YmpiYkCTlcrmOawWDwYbwJ5vNNh1//ID+i1ZPpdNpJRKJc8/q6sXcvbyek45vi4xGo5d6LQAAAAAAQCcM9/htFX1mYmJCT5480R/+8IeOa929e1fpdFqGYejXX3/tuJ5t2woEApKOgqRCoXDmOMdx6ltAQ6FQ0yAuHA43rLY6PDxsOL+rl3P3ouZZatdomqYODw8v9dpWTU9Pa39/X1NTU9rb2+vJHAAAAAAAoD1efm739Yqw+fl5PX36tOM67969UzqdlqQzg6V2WJZVXxlVLBa1trZ25rja3TFN02xYSXWWk9s
|
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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACjlElEQVR4nOz9T4xj953fe39Y3RZajxU2WRoEIIrATJOjQLPKNNk9C99VpsjHGwl2RmR3YD2SgIyLlBXfLJiYdFm4GM9CLrPsIXCRG6PJ1gR42leLbtIeCdLCUbGd3QWSrmJ7dkJsHmmAKhAIoqrTH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QANxCszI9Hj6XX3rFW++rbUvPxVNsBAACa8SAskUjo6tWr3WBmUj//+c9tGadXKBRSsVhUPp9XKpUaOHutVCp1Z7lNwjAMRaNR+Xw+3b9/37YZc1L/ssibN28OrHXj3gG31Go15XI5+f1+bWxsuN0OgCVFsDJfflqTPv2dtdpPPpPuMIkeAICpm+kgTDre6H1vb09/93d/N/FYW1tbNnR0WiqVUjabVbFYVL1e19HRkfL5/JmzqWq1muLx+NjXqlQqCofDMgxDpmnK7/dre3t7gu77dZZbSrK0x5eT9w6cpxNSxeNxhcNh+f1+eTwe+f1+RaNRxeNx5XK5c2cwJpPJU0GtaZqqVCpKJpPdcba3t5kNBsBVBCvz5d0PRqt/b8R6AAAwOk+73R5ytoz7SqWSNjc39fHHH489xqNHj7S6uqovvvjCxs6Gq1Qq2tjYOPXiOZ/PK5vNWhrDNE2VSiUVi8V
|
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-03-27 09:23:35 +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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2024-02-27 15:59:53 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOVCAYAAACLW0xhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACnRklEQVR4nOz9T2wj+X3n/7+omQQOkqiLmmABQQLiLmYC7ynponoPufwQi1xfYuTPkN2LGLYvFukxgj1oM+S0c4hzsGXSsS4LOEPKuTg/A6sm7U2QHLLD6tn7tliT3Ixds3oMSCCwwIjVcoIYiUf1PWhJkxL/FMniH4nPB0BAEj/81JuSekZ88fN5fyK+7/sCAAAAAAAA7ri1RRcAAAAAAAAAzANBGAAAAAAAAFYCQRgAAAAAAABWAkEYAAAAAAAAVgJBGAAAAAAAAFYCQRgAAAAAAABWAkEYAAAAAAAAVgJBGAAAAAAAAFYCQRgAAAAAAABWAkEYAAAAAAAAVgJBGAAAAAAAAFYCQRgAAAAAAABWAkEYAAAAAAAAVgJBGAAAAAAAAFYCQRgAAAAAAABWAkEYAAAAAAAAVgJBGAAAAAAAAFYCQRgAAAAAAABWAkEYAAAAAAAAVgJ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q9Nb6rXXXhs5x4cffijP8/T06VO9fPlypvUOU61W5bquDMPQkydP5n79dghmmqby+XygLaau63ZWbl3vAWZZlhKJRKe5f7VaHRrGVSqVzsesBgMAAAAAAIuw1EGY4zidlWC1Wk27u7sTz5XL5fT666+HVZps21Y6nZbneUo
|
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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQ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8rn84rH45aHWJTLZZmmqc3NTRUKhWNnYklSLpfT1atXFQ6Hbd9PPp8/MgBLJpPdsTrjGYYhwzBULpd1586dbjh2MOA6eM/lcrn7eiQScWyvQgBYJCeZxXVcEBZ4crixhq0HAACLwdNut9tuN3GcCxcu6P79P2wY0W63TzRzpfdzv/32W6fag8tCoZB2dna0vLys7e1tt9txVCaTUalUOvT+ZDLZF9CMg2EYikQiR35sb2/vROFbLBY7cmbV+vq60un0UL0lEolDoVQ6ndb6+rqtMdbW1pTP5w+9PxwOq16vH/k5B78fk/g+AMA8+Hf/r3RviH+i/11I+v/+n6M/9vf/JP31x/bH+rvLx4dqAADAXW4+np/qPcKuXLmidrutTlZ30hAMmDXHLZM8yfLJYYXD4UPLBKX98OekM9CO63uYEKxarR6ameX3+7W1tWU7BJP2Z6DV6/VD97K7u3vs5zg18w4AFo2Ts7hejUpPfcfeOE8/Ib12+J8yAACA6Q7COg+ePR5PNxA76QswS45bdmi1HHHc1x/l2kd97jDhUq1WUyKROPT5d+/ePTK0s9PPgwcP+npgE3wAcN7l54arf96i/uwZ6Z0X7I1z40XJd2a4awMAgMUw1XuEnT17VtFoVPf
|
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-03-27 09:23:35 +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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACdw0lEQVR4nOzdTWxbZ5rm/etQjuEgbopUGg0IEtAVctJwrXpM2rPIbkokahMjmQrpADFiAy/KZGKkZyFMyLiy6JWjUFWlTTcyJl39Aq/TBsYmqzpBsqix6PSuF2PpuHpnTDVpFyCBwAAlUuoEMRKb511oyNIneUjx8PDj/wMI6OPWc25JdGJefp77GJZlWQIAAAAAAABGnMftBgAAAAAAAIB+IAgDAAAAAADAWCAIAwAAAAAAwFggCAMAAAAAAMBYIAgDAAAAAADAWCAIAwAAAAAA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UUQ9tVXX0na3lGUTCa7WsOyLBmG0cu2OraystJ8OxqN7vpc4/inXcFgsDlnLJ/PN3eA7RUKhXbd5fH+/fuH1h7W697gy4k1AQAA2rEsqW61rvEYkst/5QMAAANs4IOwd999V7lcTpJkGIYsq83ffg7gdgDWsPNoYD+PBZ4/f775M7R7PHRnXTqd7suaAAAArdQt6diHrWueXpMmBuOvfgAAYAAN9F0jb9y4oWw22wy/ugnBjvJ1vVYoFCSpp3eFtGPnLjo7M8h21gQCgQNDOyfWBAAAAAAAcNJA7wjLZrOS/rQTLBKJKBqNyufzdTwn7Pr163r8+LGD3bZWKBRULpfl8/l09erVvl47FAopEok0w6h
|
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.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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12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ValSRVKpVObTQaVTweVyQS0dramsrlsqLRaNd9FxcXZRhG5/4AAAAAgPE30ksjpd39wa5evarXX3/9WOPcv3+fF7QYWel0Wo1GQxsbG0omkz1r4/G41tbWOvV2ME1TtVpNhUKhc0jFYcLhsAqFgmq12pEhmLQbYDcaDUvBVjab1cbGhhqNhuUQrL1EcX8IlkwmVSqVOuO1H9fa2prS6XTnsVWrVa2srCiTyXQCu/0zvtrjmKZp2z6FAAAAAABvBUzTNL1u4ii///3vOx9ns1kFAoG+IcFhms2mbt68qWazqUePHtnZIjwyPz+vra0tzc3NaXNz0+t2bJfJZFQsFg98vR30OMkwDEUikUO/12g0egZlR4nFYocG0YVCQel0eqDeEonEgX0D0+m0CoWCpTFWVlaUy+UOfD0cDqtWqx16n/3PhxvPAwAAAADvPGpJJ9/tXfPwinRi5KcXjSYvX9OP9NLI9957T3fv3u18bppmz2VQvZimOdTyL8ALRwVhwyyfHFQ4HFY0Gj0QXCWTyaFCMGm378N6HyQEq1QqSiQSXV8LhUK6ffv2gWWNvWSzWSWTScVisa5ZYNvb20feZ9jHDQAAAAAYLSOdXV68eFGmaao9aY0gC35x1FI8t5boHXad41z7sPsOEi5Vq1VbQrC9/dy7d6+rBzbDBwAAAIDJN9JBWHsGSSAQ6ARiw96AcXJUSDQzM+NuIyPAMAwtLCwc+HqpVBoqBGsLhUK27bE2Ssrl8oGlo/iLSqXidQsAAAAAPDTSSyNPnz6taDSqu3fvKp/PKxqNDhUEGIah9957T1988YX9TQIT6LC/Z08//bSt41n9u5xKpQ7M1kqn05Y31u8lHA4rm80OveTaTdVqVYVCQZVKRYZhKBQKaWZmRqFQSOFwWJcuXZK0e9plPp/vuey0UqkolUppZmZGhULBlj/LUWUYhiqVikqlUicEG6U3R/z
|
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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACf1ElEQVR4nOz9T4wieX7n/7/I7rXGsk0F2dZKKZB2OnBbsye7IWsPe/MkrC+2dj0NVZIt24edAvdotQfkga7x2ZMD4+Gy0m5Djg+/8c/SZsGMbdkHf5uo9n0rkx7frF0T1SMlQlppMqMYWx7ZbuJ7qC8YMhMI/iQBGc+HlBJkfvjEmz9Z3fHK9+cTIdd1XQEAAAAAAAD33J7fBQAAAAAAAACbQBAGAAAAAACAQCAIAwAAAAAAQCAQhAE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vZ+AAAAAMCm/GZC+uAvvW2Y/9M/If1WYv64uxAOhxWNRmeO6fV6GgwGG6poUsh1XdeXI3tweHioTz75ZHTfdd2llnCNP/azzz5bV3nwUSwWU7fbVTQa1cXFhd/lrF273R5dNXXcIksHV3FbcLVKCDdt6eci//xYlqV0Oj3xPcMw9Pz58xvLGuexbVvJZHKiC2zWUs/rHWh3GUgCAAAAwDTfOZd+28MuNP//R9JvbPH1Av08p9/qq0Y+evRIruuOTpaXDcGAXTNt2eGs5Yh3ffxVjn3bYxdZ1tlut9cWgg3refny5UQNbIYPAAAAYNt5Cbe+k9nuEMxvWx2EDTtIQqHQKBBb9gvYJdNCov39/c0WsgVs29bR0dGN7zcajaVCsCHDMNZyoYFt02w22c9
|
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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00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c5/Pp6Ojo1M/F43EVCoWBx9zd3T01qDqNaZra3t7Wzs5Oz5rmv/tisdiqDYVCikQiWl1d1e7urgqFgkKhUMd7r1+/rkqlwn83AAAAAGCOTHUQ1lzK+Ad/8AdaWlrSY489plgsNvA4pmnqrbfeGnd7QF9vlKTPvrRR+GcJ6fGr2vx/VVT5v7d7hkiRSESpVEpra2utk1VH1dyLr1gsKpVKnTn7KRgMKpVKKRKJ9DzEIp/PyzRN7e3tKZ1Oq1gsnlm7ubmpa9euKRgM2v56UqnUqQFYLBZrjdUcr1KpqFKpKJ/P66233mqFY90BV/fXnM/nW89XV1fHtlchAAAAAMA9hmVN78Gaa2trunv3d+vKLMsaauZK+3u//vrrcbUHlwUCAVWrVfn9fh0cHLjdzqm+/Z+lD349QP1j0s//zfFBEblc7sTnY7FYR0AzCZVKRaurq6d+7ujoaKjwLRwOnzqzKpvNKpFIDNRbNBo9EUolEglls1lbY+zs7CiVSp34eDAYVLlcPvU93T8PJ34OAAAAANDt64bNUyOnekd4d+/np/pbc/XqVVmWpWZWN2wIBrjl6PPh6jc2Nk79/FkfH6dgMHhimaB0HP4MOwPtrL4HCcGKxeKJmVk+n0/7+/u2QzDpeAZauVw+8bUcHh6e+Z5xzbwDAAAAgEnjMLbepjoIa948G4bRCsSGfQBuWHp4uPqzlh32Wo44TqddZ5Rrn/beQcKlUqmkaDR64v0ffvjhqaGdnX7u3bvX0QOb4QMAAACYdnYPYyMMO9tU7xF28eJFhUIh3b17V+l0WqFQSMvLywOPU6lU9OMf/1i/+tWvxt8k0MOTjw+2NPKJx4//96yQaJjf/1lXqVS0vr5+4uP5fH6oEKypOZvsrGWgs6y5+b9TwemsKRa
|
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-03-27 09:23:35 +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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACLo0lEQVR4nOz9T2yj6X0n+v6oqgQOnFF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wCGaEXd213iPsu9/9bnzwwQetx81m81LLoA6fe5nlXzAIZwVhl1k+eVGZTCay2ewrwdXc3Nylr5S4sLBwau8XCcHK5XLk8/ljX0un0/Hee+9FNpvtuM7S0lLMzc3FzMzMsVlgL168OPM5rhAJAABwM1zrjPDBgwfRbDbjcNKaIIukOGspXr+W6J12nKsc+7TnXiRcqlQqXQnBjvbz0UcfHevBZvgAAAA337UOwg5nkKRSqVYgdtkbDJOzQqLx8fH+NnINVKvVmJ2dfeXrm5ublwrBDqXT6a7tsXadlEqlV5aO8s/K5fKgWwAAAAboWi+NvHPnTmSz2fjggw9idXU1stnspYKAarUa3/3ud+PDDz/sfpNwA532e/baa691tV6nv8uFQuGV2Vrz8/Mdb6zfTiaTiaWlpUsvue6nSqUSGxsbUS6Xo1qtRjqdjvHx8Uin05HJZOLhw4cREfHo0aNYXV1tu+y0XC5HoVCI8fHx2NjY6MrP8rqqVqtRLpdjc3OzFYJdpz+OJOm9AACA6+BaB2EREQ8fPozp6en45je/eekad+/eja9
|
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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
2024-03-27 09:23:35 +01:00
|
|
|
"intercept= 5308.975458144673\n",
|
|
|
|
"coef= {'dSlope_xEndT_abs': 84.02382370039953, 'x_EndT_abs': 0.03552632399369171, 'ideal_state_770_tx^2': 68529.10928948055, 'ideal_state_770_tx dSlope_xEndT': 60538.43896560162, 'dSlope_xEndT^2': 13284.852569734045, 'x_EndT_abs^2': -0.0008174639168529617, 'ideal_state_770_ty^2': -2163.1533980289814, 'ideal_state_770_tx^2 x_EndT_abs': -15.687680488172175, 'ideal_state_770_tx dSlope_xEndT x_EndT_abs': -13.288664637206063, 'dSlope_xEndT^2 x_EndT_abs': -3.077894760025427, 'dSlope_xEndT_abs ideal_state_770_ty^2': 3221.0446732918413, 'x_EndT_abs^3': 1.8433768191744582e-07}\n",
|
|
|
|
"r2 score= 0.8143147645331705\n",
|
|
|
|
"RMSE = 36.0572267645116\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-03-27 09:23:35 +01:00
|
|
|
"X_train, X_test, y_train, y_test = train_test_split(data,\n",
|
|
|
|
" target,\n",
|
|
|
|
" test_size=0.2,\n",
|
|
|
|
" random_state=42)\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",
|
2024-03-27 09:23:35 +01:00
|
|
|
"lin_reg = LinearRegression(fit_intercept=True)\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
"# lin_reg = Lasso(alpha=0.00001)\n",
|
|
|
|
"# lin_reg = LassoCV()\n",
|
2024-03-27 09:23:35 +01:00
|
|
|
"# lin_reg = ElasticNet()\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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
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-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2024-02-27 15:59:53 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
2023-12-19 13:00:59 +01:00
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9T2wbeZ7neX8o17OYxbMlheS+2UClgunGPKe2glIDtbeyyMw5zGC3yqSceAY7e8gUaXct9qBKk5b70DWHtkzZ6cugukzKeZnFACORdu5i91Bl0q5jAWWSct4GncmQEkiftlMMsXaxg91OxR7UjCL1h+J/UuL7BRDNPxG/3zdIytX85O+Pz3VdVwAAAAAAAMAFNzHsAgAAAAAAAIBBIAgDAAAAAADAWCAIAwAAAAAAwFggCAMAAAAAAMBYIAgDAAAAAADAWCAIAwAAAAAAwFggCAMAAAAAAMBYIAgDAAAAAADAWCAIAwAAAAAAwFggCAMAAAAAAMBYIAgDAAAAAADAWCAIAwAAAAAAwFggCAMAAAAAAMBYIAgDAAAAAADAWCAIAwAAAAAAwFggC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RiAjpw24uikUS2j7qTQ4vLly123a1nWqeuvlUqlY+tXDUKnu3ru7e31tpAuGIaheDx+6pps7a7v1iu5XM673+oIsvq/o/P4twMAAACcNwRhADp20mgn27ZHdhpdO9qZlniWaDSqcrl8LITKZrMjHX50GpoNmm3bSqfTyufzJy6EP8g62nX0e3YR/nYAAACAUUYQBqBjt27dOvH5UQ53TnM09OllEFZrr1gsHuun3d068Se1XS9TqVTTddE
|
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-03-27 09:23:35 +01:00
|
|
|
"plt.show()\n",
|
|
|
|
"# plt.savefig(\n",
|
|
|
|
"# \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_regression_plot.pdf\",\n",
|
|
|
|
"# format=\"PDF\",\n",
|
|
|
|
"# )"
|
2024-02-29 15:54:19 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-03-27 09:23:35 +01:00
|
|
|
"execution_count": null,
|
2024-02-29 15:54:19 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-03-27 09:23:35 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9b2wb6Z0ven4pdXI7J4lYoufFLuxFrGJ7tudeYGMVpQCZ8yqtYvdZnPROOialYDLdAW5bpJ3kzgJKTEodXJw5WMQSZbeBi9kkIuV+cToT4Eik3clNBtttltzvNntisuR+s+g7bZbUOPbdF2dMFpkEaSRt1r5QWM3/LJLF/98PQLREPfU8vyLpOPr59/weh2EYBoiIiIiIiIiIiMbc1KADICIiIiIiIiIi6gcmwoiIiIiIiIiIaCIwEUZERERERERERBOBiTAiIiIiIiIiIpoITIQREREREREREdFEYCKMiIiIiIiIiIgmAhNhREREREREREQ0EZgIIyIiIiIiIiKiicBEGBERERERERERT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sHx2mExZ3d3cRiUQQj8dbJpuA/iVnY7GYuZaVxFkgEKh4D9o9pKFc+XrD9F4REREREQ0bJsKIqCONKo7qVbUMu3pJi1OnTnU9ryRJDfuvqapa07+qHzo91TObzdobSBcEQUAoFGrYk63d/m52SSaT5tdWK8jK/xyN4p8dIiIiIqJRw0QYEXWsXrWTpmlDu42uHe1sS2wlEAggk8nUJKESicRQJz8
|
2024-02-29 15:54:19 +01:00
|
|
|
"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",
|
2024-03-27 09:23:35 +01:00
|
|
|
" y=ak.to_numpy(sel_array[\"z_mag_xEndT\"]) -\n",
|
|
|
|
" ak.to_numpy(sel_array[\"match_zmag\"]),\n",
|
2024-02-29 15:54:19 +01:00
|
|
|
" 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",
|
2024-03-27 09:23:35 +01:00
|
|
|
"plt.show()\n",
|
|
|
|
"# plt.savefig(\n",
|
|
|
|
"# \"/work/cetin/LHCb/reco_tuner/parameterisations/plots/magnet_kink_old_regression_plot.pdf\",\n",
|
|
|
|
"# format=\"PDF\",\n",
|
|
|
|
"# )"
|
2024-02-29 15:54:19 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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+AUT05+J1fylSmvDj6/peHtd1XQEAAAAAAABDbqzXBQAAAAAAAADdQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAYAAAAAAICRQBAGAAAAAACAkUAQBgAAAAAAgJFAEAZgoDmO0+sSAAAAAAADgiAMwMCxLEuxWExTU1NaXFzsdTkAAAAAgAHxQq8LADBcLMvS+vq6LMuSbdva3d2V4zjyer0y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ure 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
|
|
|
|
}
|