2023-12-19 13:00:59 +01:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-27 15:59:53 +01:00
|
|
|
"execution_count": 62,
|
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-27 15:59:53 +01:00
|
|
|
"input_tree = uproot.open(\n",
|
|
|
|
" {\n",
|
|
|
|
" \"/work/cetin/LHCb/reco_tuner/data/tracking_losses_ntuple_B_BJpsi_def_selected.root\": \"Selected\"\n",
|
|
|
|
" }\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-27 15:59:53 +01:00
|
|
|
"array[\"dSlope_yEndT\"] = array[\"ideal_state_9410_ty\"] - array[\"ideal_state_770_ty\"]\n",
|
|
|
|
"array[\"dSlope_yEndT_abs\"] = abs(array[\"dSlope_yEndT\"])\n",
|
|
|
|
"\n",
|
|
|
|
"array[\"dSlope_xEndT\"] = array[\"ideal_state_9410_tx\"] - array[\"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-27 15:59:53 +01:00
|
|
|
" array[\"ideal_state_770_x\"]\n",
|
|
|
|
" - array[\"ideal_state_9410_x\"]\n",
|
|
|
|
" - array[\"ideal_state_770_tx\"] * array[\"ideal_state_770_z\"]\n",
|
|
|
|
" + array[\"ideal_state_9410_tx\"] * array[\"ideal_state_9410_z\"]\n",
|
|
|
|
") / array[\"dSlope_xEndT\"]\n",
|
|
|
|
"\n",
|
|
|
|
"array[\"z_mag_corr\"] = array[\"z_mag_xEndT\"] - array[\"match_zmag\"]\n",
|
|
|
|
"\n",
|
|
|
|
"sel_array = array[\n",
|
|
|
|
" (array[\"z_mag_xEndT\"] < 5700)\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-27 15:59:53 +01:00
|
|
|
"execution_count": 63,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-27 15:59:53 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC6HUlEQVR4nOzdT0xjZ77n/8+hezHS6IKhRiMhkDocp2aTxRSG6v0t7Ny7TcqGrHODnepVi+7CRfZTVXZ1UFbTZVP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DluNPP3Z2djQzM6NYLKbj42P98MMPXdU9NzfX9Lx2/thlSqVS0/NgMOiJtd26nlog6fP5FAgErvRaAAAAAACATrgWhC0uLioQCOjevXsXjtnd3dWjR48Ui8W0s7OjhYUFjY2NXWmdQCCg169fK5VK6Te/+U23ZZ/poGo3OGrstPL5fB2didWPtd24Htu2lc/nJUnRaLTt1wEAAAAAAHTD1Y6w8fHxlmMSiYRM09Qf//jHrtYyTVPLy8tKpVL6y1/+0tVcgUCg6Tyst2/ftvW6nZ2d+tenwyc313bjetgWCQAAAAAA3OBaECZJr1+/bvnznZ0dxWKxnqw1Pz8vx3HqdyrsxuLiYv3r2oHvl2kcF4/HPbX2oK+HbZEAAAAAAMANrgZhlykWiz0LSiYmJiRJuVyu67kaw7naFr9WGseYptnR+WD9XHuQ19O4LbIxgAMAAAAAAOg3TwdhPp9Pu7u7PZmrFoC1e1fEVgKBQFP4k81mW45vvFPlZd1T6XRa8Xj8wrO6+rF2P6/ntMZtkZFI5EqvBQAAAAAA6IbhOI7jdhEX+fjjj3V4eNj2uVUXOTo6qp9HNj4+rp9//rnr2iz
|
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",
|
|
|
|
"plt.show()"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-27 15:59:53 +01:00
|
|
|
"execution_count": 64,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-27 15:59:53 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOVCAYAAACLW0xhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACglUlEQVR4nOz9T2xbZ5rv+/5IO4FzkqZJp9GAIA0qVKWRGnWbtPegzqhL5K7BiZF0h7SB+MYB7i2RSVCnB8IOGSc4Q0ehukrAQR+kTbr6AtfZAbZNVu0EyQWyLTo9O4Ntia6eGbuayylAAoENRKLZCWIkDtcZqMiI+kMukmtxkVzfDyCUZD16+dCSK+bP7/u8PtM0TQEAAAAAAABTzu92AwAAAAAAAMAoEIQBAAAAAADAEwjCAAAAAAAA4AkEYQAAAAAAAPAEgjAAAAAAAAB4AkEYAAAAAAAAPIEgDAAAAAAAAJ5AEAYAAAAAAABPIAgDAAAAAACAJxCEAQAAAAAAwBMIwgAAAAAAAOAJBGEAAAAAAADwBIIwAAAAAAAAeAJBGAAAAAAAADyBIAwAAAAAAACeQBAGAAAAAAAATyAIAwAAAAAAgCcQhAEAAAAAAMATCMIAAAAAAADgCQRhAAAAAAAA8ASCMAAAAAAAAHgCQRgAAAAAAAA8gSAMAAAAAAAAnkAQBgAAAAAAAE8gCAMAAAAAAIAnEIQBAAAAAADAEwjCAAAAAAAA4AnH3W4AGMSTTz6phw8f6tixY/qLv/gLt9sBAAAAAAAW/c//+T/1/fff68SJE/r6669H+tg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
"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.4, 0.4, 50)\n",
|
|
|
|
"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",
|
2023-12-19 13:00:59 +01:00
|
|
|
"plt.xlabel(\"dx/dz(VELO)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"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": 65,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOVCAYAAACLW0xhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACnmUlEQVR4nOzdT2wj6X3n/w/Vk2ACJ+qiJgggSEDcxUzgnLJdVO8ht7XIzSWDJB6yG4hh+xCL9BjBHoSYnLbPHpl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c1w+n/f1GAAAAAAAgKDMNQj70pe+NNPrvf/++33vm0Ut1WpVkmZ+KmSL53lKJpO6f//+SMFfOp2+Ftxls9n2x372NescY5rmUu0PBgAAAAAAboa5b5Y/S9lsVv/yL/8yl2tXq1W5rivDMPTw4cOZX9/zPMXjcZmmqXw+L9d1hz7Gdd1259bVzfAty1IikWgHXNVqdeA+YZVKpf0x3WAAAAAAAGAeQhWEde5RNSnbtpVOp+V5nhKJhAqFQt+TE13X1c7OjiTp6dOnXftrzcr29rZc15XruorFYiM9tlQq9f16a669vb2+QZjnee1N8hOJxEgnVAIAAAAAAARlKYOw999/X57n+R7vuq5KpdJIjxmmUqm057Ntu73v1tXQqBWYra2t6ejoqGuT+1mJx+O+9/HqpV9wZZqmKpWK0um0HMdRsVjsuexze3tb0uVJkZ2dYQAAAAAAALO0FEHY+++/r0KhINu2fS3p66XZbCoSiQRWUzqdbnc5tZTLZT158kSJREJra2s6PDyU4zjK5XJ6+PDhXDr
|
|
|
|
"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",
|
|
|
|
"execution_count": 66,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-27 15:59:53 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC1HUlEQVR4nOz9TWxbd57mfV+kXYGDStOk0miAEIGqkJMbqVWPSXsWtesSidokSKZC2kCCJMCNEpnKUzMLYkLGlcX0LByF7Cpuep60Radv4HaQhU1Wd4JkURPR6d0Az0Sia3bBVPM4DUggMEBJx+wEMZKYfBYaski9kIfkIQ9fvh9AgGT99D+/Y73Y59L/xdVqtVoCAAAAAAAAFpzb6QYAAAAAAACAaSAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUiAIAwAAAAAAwFIgCAMAAAAAAMBSIAgDAAAAAADAUjjrdAPAKL7//e/rwYMHOnPmjP7iL/7C6XYAAAAAAIBF//t//289fPhQ586d01dffTXVa7tarVZrqlcEbHDmzBk1m02n2wAAAAAAACNyu916+PDhVK/JjDDMpXYQ5na75ff7J369er0+1etZQU/z149ET1bRkzWz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
|
|
|
|
},
|
|
|
|
"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",
|
2023-12-19 13:00:59 +01:00
|
|
|
"plt.xlabel(\"dy/dz(VELO)\")\n",
|
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"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": 67,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOVCAYAAACLW0xhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACcq0lEQVR4nOzdTWxbd5rn+9+hnMBB0jSpNAYQJGAqVGfgWnWbtGdRuymRVbOIkXSHtAcxbA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4zeN2A500d00lk8lDhWDS9m6sF154YQBd9W/n0cBhHgs8c+ZM6+2dRyg72VmXSqWGsiYAAAAAAICTRjoIax6dO3Xq1EDWy2azA1mnX4VCQZIGeldIOxKJROttOzPIdtYEAoF9Qzsn1gQAAAAAAHDSSAdhzV1gu+82eNj13FAoFFSpVOTz+XTp0qWhXjsYDLYFT81A7iD5fL719kE7t5xYEwAAAAAAwEkjHYT9/Oc/l2VZto/edfPrX/96IOtI2zuc/H6/DMNQJBLp2GOlUtHy8rIk6datW0MblL/Tzt1wzZsQ7KdWqymXy0naPr4Zj8eHuiYAAAAAAIBTRjoIO3bsmN5//33duHFDf/zjHw+93iCPRubz+daw+FKppFAo1HZcsKn5udnZWZXLZVt3V3RCIBBo7coyTVOZTGbfuuauOZ/P17aLa1hrAgAAAAAAOGWkgzBpe55WMBhULBY71Dr3798f2M4ySfv2k8vl5Pf7FYvFlEgkFAqFFIlEFI/Htb6+3pp55pZoNKpisSifz6dUKqVYLCbTNFWr1VqBnWmaCgaDun//vq2da06sCQAAAAAA4ATDsizL7SbsOHnypB4+fKhUKqXZ2VlbX/PgwQPVajWVy2X
|
|
|
|
"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-27 15:59:53 +01:00
|
|
|
"execution_count": 68,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOVCAYAAACLW0xhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC5qklEQVR4nOz9X4xb933ve39IOYZ84lDkuNjAYAZITNaFc9WKlHqRc9UM2WzgsWA3JqUNe1sG9pMhHT/ZveCuSSvGQdMLeUJml8BBexyRSgscuQaORCa1YT+Aq6HcuwLP1gyV3hk75bIDzIDABqxZ4rZhwZbJ52I2GXL+LC6Si//fL2AQjeY7v/VdmlEsfub3+y5Xs9lsCgAAAAAAAJhz7kk3AAAAAAAAAIwDQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWAkEYAAAAAAAAFgJBGAAAAAAAABYCQRgAAAAAAAAWA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OnlH86zo8gp9+5LK69Ln33Zu/bRh6XdS5Ln5OGP/e2/SP/5Xfv
|
|
|
|
"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-27 15:59:53 +01:00
|
|
|
"execution_count": 69,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACe5UlEQVR4nOzd349ieX7f/xc1k2gjx/ShxopUAsnbB0/kXK0aqnPxvfMWrG9iJd6BbimW7Ytsg8f6KhfEC9vra08teJebSPFArW8cWUo37CZRcuE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b5q5A9/+MPh7Xw+r0AgMDckmMRxHL18+VKO4+iLL77YZInwyH2/amQ2m1W1Wr31+0HQc5ds21Y0Gp34WLfbnRmUTROPxycG0ZVKRZlMZqnaksnkrX0DM5mMKpXKQnOUSiUVCoVbvzdNU61Wa+Jzbn4e2/gcAAAAAGAUV43cjJ1eGvnRRx/ps88+G953XXfmMqhZXNddafkX4IVpQdgqyyeXZZqmYrHYreAqlUqtFIJJ13VPqn2ZEMyyLCWTybHfGYahV69e3VrWOEs+n1cqlVI8Hh/rAru6upr6nFVfNwAAAABsyoMvSf/un0u/u8AuNB//i90Nwby200sjnzx5Itd1NWhaI8iCX0xbiretJXqTjrPOsSc9d5lwqdlsbiQEG63nzZs3YzWwGT4AAACAXfdbj+aP+bPUYuP8aqeDsEEHSSAQGAZiq/4A+2RaSHR4eLjdQnaAbds6OTm59ftarbZSCDZgGMbG9ljbJfV6/dbSUfycZVlelwAAAADcqX9JCDbTTi+NfPDggWKxmD777DM
|
|
|
|
"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-27 15:59:53 +01:00
|
|
|
"execution_count": 70,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-27 15:59:53 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACseklEQVR4nOz9X4xb933n/78OpRhy41DkuFhgQAKNOHXhXnVFjvYivWqGbBaojaQ1KS3in21gG3Ec/7K94K6HUYzvpTPmpCXwRfeXilT2C/yUGlhpmKwDp0Cqobx3C/xWM1R6Z2wzlAMMQWCBiEesDQuJxfO7mCVDzh/y8M85h3+eD4DIUPPm57xHnFF8XvP5Y1iWZQkAAAAAAACYcz6vGwAAAAAAAADcQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFQBAGAAAAAACAhUAQBgAAAAAAgIVAEAYAAAAAAICFcNbrBoBRfP7zn9fjx4915swZ/at/9a+8bgcAAAAAANj0v//3/9aTJ0907tw5ffLJJ65e27Asy3L1isAE+Hw+8a0LAAAAAMDsMgxDrVbL1WsyIwwzqTsEC4VCHnYynHq9rlarJZ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with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"bins = np.linspace(-1.0, 1.0, 50)\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",
|
2023-12-19 13:00:59 +01:00
|
|
|
"plt.ylabel(\"$z_{Mag}$ [mm]\")\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"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": 71,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
2024-02-27 15:59:53 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACEDElEQVR4nOz9T2yj6X0v+P6oqhht2FFR6oMBBAlImkof+OAuMkVVzSK7sciTTXzzp8XqQXxtb1xS2sjMBTTHkstezJlFtywl1uZc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XLk8/kTf5ZOp+O99957YVljM0tLSzE3NxczMzMnZoE9ffr03Odc9XUDAADQX/o6I7x3717U6/U4mrQmyCIpzluK160lemcd5zrHPuu5lwmXKpVKW0Kw4/189NFHJ3qwGT4AAMDw6+sg7GgGSSqVagRiV73BIDkvJBofH+9uI32gWq3G7OzsC3++ubl5pRDsSDqdbtsea/2kVCq9sHSUf1Eul3vdAgAA0EN9vTTy1q1bkc1m48MPP4zV1dXIZrNXCgKq1Wq89dZb8eMf/7j9TcIQOuvv2csvv9zW8Vr9u1woFF6YrTU/P9/yxvrNZDKZWFpauvKS626qVCqxsbER5XI5qtVqpNPpGB8fj3Q6HZlMJl5//fWIeH61y9XV1abLTsvlchQKhRgfH4+NjY22fC/7VbVajXK5HJubm40QrJ9+OZKk9wIAAPpBXwdhERGvv/56TE9Pxze/+c0rj3H79u147bXXEjmbBgZZuVw+c5P91dXVth3jwYMHjSCsVqv13X5gtVot7t+/37i6ZSaTaVw0pFqtRqVSiUql0vj60XO
|
|
|
|
"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",
|
|
|
|
"execution_count": 79,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"intercept= 5303.132333467949\n",
|
|
|
|
"coef= {'ideal_state_770_tx': -13.441950438394027, 'dSlope_xEndT': -4.369407701653064, 'dSlope_xEndT_abs': 230.37763264120008, 'x_EndT_abs': 0.026704166547390083, 'ideal_state_770_ty': -14.30702118941663, 'ideal_state_770_tx^2': 77928.66766333766, 'ideal_state_770_tx dSlope_xEndT': 69687.8060631645, 'ideal_state_770_tx dSlope_xEndT_abs': -86.35194840522867, 'ideal_state_770_tx x_EndT_abs': 0.00970580581706756, 'ideal_state_770_tx ideal_state_770_ty': -180.61816411073835, 'dSlope_xEndT^2': 7579.721527263535, 'dSlope_xEndT dSlope_xEndT_abs': -49.35311026671389, 'dSlope_xEndT x_EndT_abs': 0.015857700483615466, 'dSlope_xEndT ideal_state_770_ty': -35.74149120660231, 'dSlope_xEndT_abs^2': 7579.723402132595, 'dSlope_xEndT_abs x_EndT_abs': -0.22195273681292957, 'dSlope_xEndT_abs ideal_state_770_ty': 1.9491174288661794, 'x_EndT_abs^2': -0.0009034030507007965, 'x_EndT_abs ideal_state_770_ty': 0.0034286491846703187, 'ideal_state_770_ty^2': -2489.6827607187365, 'ideal_state_770_tx^3': 2357.797471515544, 'ideal_state_770_tx^2 dSlope_xEndT': 1960.401925113787, 'ideal_state_770_tx^2 dSlope_xEndT_abs': -20252.830218161023, 'ideal_state_770_tx^2 x_EndT_abs': -13.500325039413802, 'ideal_state_770_tx^2 ideal_state_770_ty': -766.130872351457, 'ideal_state_770_tx dSlope_xEndT dSlope_xEndT_abs': -19474.231043469852, 'ideal_state_770_tx dSlope_xEndT x_EndT_abs': -11.598943144027315, 'ideal_state_770_tx dSlope_xEndT ideal_state_770_ty': -626.8199943500564, 'ideal_state_770_tx dSlope_xEndT_abs^2': 573.5326109010182, 'ideal_state_770_tx dSlope_xEndT_abs x_EndT_abs': 0.001095488438740151, 'ideal_state_770_tx dSlope_xEndT_abs ideal_state_770_ty': 330.5306955155975, 'ideal_state_770_tx x_EndT_abs^2': -3.111920124211576e-05, 'ideal_state_770_tx x_EndT_abs ideal_state_770_ty': 0.06268520395759442, 'ideal_state_770_tx ideal_state_770_ty^2': 95.20495106050294, 'dSlope_xEndT^3': 42.93032905404232, 'dSlope_xEndT^2 dSlope_xEndT_abs': -4365.747480960424, 'dSlope_xEndT^2 x_EndT_abs': -1.2192562284269424, 'dSlope_xEndT^2 ideal_state_770_ty': -134.19763413582538, 'dSlope_xEndT dSlope_xEndT_abs^2': 42.930335617557944, 'dSlope_xEndT dSlope_xEndT_abs x_EndT_abs': -0.023890507178523725, 'dSlope_xEndT dSlope_xEndT_abs ideal_state_770_ty': 106.84806568209468, 'dSlope_xEndT x_EndT_abs ideal_state_770_ty': -0.009451904933143932, 'dSlope_xEndT ideal_state_770_ty^2': -8.505381537855747, 'dSlope_xEndT_abs^2 x_EndT_abs': -1.2193799254865163, 'dSlope_xEndT_abs x_EndT_abs^2': 0.0002552425918335738, 'dSlope_xEndT_abs x_EndT_abs ideal_state_770_ty': 0.01563137413267504, 'dSlope_xEndT_abs ideal_state_770_ty^2': 2033.0314554223403, 'x_EndT_abs^3': 1.5428826370868625e-07, 'x_EndT_abs^2 ideal_state_770_ty': 6.223748596200707e-06, 'x_EndT_abs ideal_state_770_ty^2': 0.5895518247828866}\n",
|
|
|
|
"r2 score= 0.8237497474212265\n",
|
|
|
|
"RMSE = 34.7702514276615\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
|
|
|
" # \"dSlope_yEndT\",\n",
|
|
|
|
" # \"dSlope_yEndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_ty\",\n",
|
|
|
|
" # \"ideal_state_9410_ty\",\n",
|
|
|
|
" # \"ideal_state_770_x\",\n",
|
|
|
|
" # \"x_EndVelo_abs\",\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",
|
|
|
|
"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-27 15:59:53 +01:00
|
|
|
"poly = PolynomialFeatures(degree=order, include_bias=False)\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",
|
|
|
|
"keep = [\n",
|
|
|
|
" \"ideal_state_770_tx\",\n",
|
|
|
|
" \"dSlope_xEndT\",\n",
|
|
|
|
" \"dSlope_xEndT_abs\", # keep\n",
|
|
|
|
" \"x_EndT_abs\", # keep\n",
|
|
|
|
" \"ideal_state_770_ty\",\n",
|
|
|
|
" \"ideal_state_770_tx^2\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx x_EndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx ideal_state_770_ty\",\n",
|
|
|
|
" \"dSlope_xEndT^2\", # keep\n",
|
|
|
|
" \"dSlope_xEndT dSlope_xEndT_abs\",\n",
|
|
|
|
" \"dSlope_xEndT x_EndT_abs\",\n",
|
|
|
|
" \"dSlope_xEndT ideal_state_770_ty\",\n",
|
|
|
|
" \"dSlope_xEndT_abs^2\",\n",
|
|
|
|
" \"dSlope_xEndT_abs x_EndT_abs\",\n",
|
|
|
|
" \"dSlope_xEndT_abs ideal_state_770_ty\",\n",
|
|
|
|
" \"x_EndT_abs^2\",\n",
|
|
|
|
" \"x_EndT_abs ideal_state_770_ty\",\n",
|
|
|
|
" \"ideal_state_770_ty^2\", # keep\n",
|
|
|
|
" \"ideal_state_770_tx^3\",\n",
|
|
|
|
" \"ideal_state_770_tx^2 dSlope_xEndT\",\n",
|
|
|
|
" \"ideal_state_770_tx^2 dSlope_xEndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx^2 x_EndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx^2 ideal_state_770_ty\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT dSlope_xEndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT x_EndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT ideal_state_770_ty\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT_abs^2\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT_abs x_EndT_abs\",\n",
|
|
|
|
" \"ideal_state_770_tx dSlope_xEndT_abs ideal_state_770_ty\",\n",
|
|
|
|
" \"ideal_state_770_tx x_EndT_abs^2\",\n",
|
|
|
|
" \"ideal_state_770_tx x_EndT_abs ideal_state_770_ty\",\n",
|
|
|
|
" \"ideal_state_770_tx ideal_state_770_ty^2\",\n",
|
|
|
|
" \"dSlope_xEndT^3\",\n",
|
|
|
|
" \"dSlope_xEndT^2 dSlope_xEndT_abs\",\n",
|
|
|
|
" \"dSlope_xEndT^2 x_EndT_abs\",\n",
|
|
|
|
" \"dSlope_xEndT^2 ideal_state_770_ty\",\n",
|
|
|
|
" \"dSlope_xEndT dSlope_xEndT_abs^2\",\n",
|
|
|
|
" \"dSlope_xEndT dSlope_xEndT_abs x_EndT_abs\",\n",
|
|
|
|
" \"dSlope_xEndT dSlope_xEndT_abs ideal_state_770_ty\",\n",
|
|
|
|
" \"dSlope_xEndT x_EndT_abs ideal_state_770_ty\",\n",
|
|
|
|
" \"dSlope_xEndT ideal_state_770_ty^2\",\n",
|
|
|
|
" \"dSlope_xEndT_abs^2 x_EndT_abs\",\n",
|
|
|
|
" \"dSlope_xEndT_abs x_EndT_abs^2\",\n",
|
|
|
|
" \"dSlope_xEndT_abs x_EndT_abs ideal_state_770_ty\",\n",
|
|
|
|
" \"dSlope_xEndT_abs ideal_state_770_ty^2\",\n",
|
|
|
|
" \"x_EndT_abs^3\",\n",
|
|
|
|
" \"x_EndT_abs^2 ideal_state_770_ty\",\n",
|
|
|
|
" \"x_EndT_abs ideal_state_770_ty^2\",\n",
|
|
|
|
"]\n",
|
|
|
|
"\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
"# keep = [\n",
|
|
|
|
"# \"ideal_state_770_tx^2\",\n",
|
|
|
|
"# \"dSlope_xEndT^2\",\n",
|
|
|
|
"# \"dSlope_xEndT_abs\",\n",
|
|
|
|
"# \"x_EndT_abs\",\n",
|
|
|
|
"# ]\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"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",
|
|
|
|
"# lin_reg = Lasso(alpha=0.1)\n",
|
|
|
|
"# lin_reg = LassoCV(max_iter=2000)\n",
|
|
|
|
"# lin_reg = ElasticNet(alpha=0.1)\n",
|
|
|
|
"# 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-27 15:59:53 +01:00
|
|
|
"execution_count": 77,
|
2023-12-19 13:00:59 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2024-02-27 15:59:53 +01:00
|
|
|
"['ideal_state_770_tx x_EndT_abs^2',\n",
|
|
|
|
" 'dSlope_xEndT x_EndT_abs^2',\n",
|
|
|
|
" 'x_EndT_abs^3',\n",
|
|
|
|
" 'x_EndT_abs^2 ideal_state_770_ty']"
|
2023-12-19 13:00:59 +01:00
|
|
|
]
|
|
|
|
},
|
2024-02-27 15:59:53 +01:00
|
|
|
"execution_count": 77,
|
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",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"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",
|
|
|
|
"execution_count": 60,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
2023-12-19 13:00:59 +01:00
|
|
|
{
|
|
|
|
"data": {
|
2024-02-27 15:59:53 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMEAAAOWCAYAAADm+IXMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAADZ2UlEQVR4nOz9T3Bb2X3nf39AeVJJTUJeUtlJVW5etH6VnUWAyuK3swh0e5GUxy2A6nJqkoVFQPLzq1nQFkB2FpNZRBKgbm2mHlsA1RvniWtEUOq4koUtgOr1zyKu1LtU3Likq6SliEsmqXElad5nwQEM8A+IPxfABfl+VaFMkOee+yUBqsxPf885Add1XQEAAAAAAACn2NiwCwAAAAAAAAD6jRAMAAAAAAAApx4hGAAAAAAAAE49QjAAAAAAAACceoRgAAAAAAAAOPUIwQAAAAAAAHDqEYIBAAAAAADg1CMEAwAAAAAAwKlHCAYAAAAAAIBTjxAMAAAAAAAApx4hGAAAAAAAAE49QjAAAAAAAACceoRgAAAAAAAAOPUIwQAAAAAAAHDqEYIBAAAAAADg1CMEAwAAAAAAwKlHCAYAAAAAAIBTjxAMAAAAAAAApx4hGAAAAAAAAE49QjAAAAAAAACceoRgAAAAAAAAOPUIwQAAAAAAAHDqEYIBAAAAAADg1CMEAwAAAAAAwKlHCAYAAAAAAIBTjxAMAAAAAAAApx4hGAAAAAAAAE49QjAAkiTHcYZdAgAAAAAAfUMIBpxhlmUpnU5rcnJSCwsLwy4HAAAAAIC++dqwCwBwNMuy9PjxY1mWJdu2tb29LcdxZBiGTNPU1NSUQqGQotGoIpHIoevj8bhs21a5XK5/znEclUolPX78WKVSie4vAAAAAMCZEXBd1x12ETid8vm8kslkx9eFQqGm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bRQKhQ5t7l4ulxUOh2VZlgqFgiqViqrVatNhAPl8XpZlKRqNqlQqqVgsqlqtqlqtqlgs1n92tm3r7t27R947Ho+3VeNRP5delEql+r2Xl5eb5g+FQioUCpL2a19YWGi61jAMhUKhQ4c31D7X+LVOX4uadDqtZDIpwzBUqVSUSqUUCoVkmqZisZjK5XK95rW1NQWDwab3xvb2tqLR6KH35MbGhqanp+vLeCuVinK5XP21chyHjf4BAACAs2bYKRzOFvmsEyyTyXQ938FOHJ3QCXawm6b2qHUiDdrBjqajumyOU+ss6vX7OO5n0s2cjXOd1H10sDvouG68gx1rjR1hjRp/Hsfdu1gsttW5Va1WPe0Ei8ViJ77fT5qn3dpr2n0tGjvATnqtGzu9jutabKzRMIwjX9eD791B/fsDAAAAYPjoBAMGxO+dYJ04eMqj1N33kUqlVK1Wj+1+qp1I2c7cR9V0nMbDCBKJxLF7oR08EfG47r/G+h3H8e1retx7sPHzXmyA3+5rkU6n6/dPJBJtjZX2u9uOOoyh8ftYWVk58nU9+F7b2Nhoq1YAAAAAo48QDBiQ44KBSqUy4Ep6d1SY8vbt267nKhQKKpfLh5bdSfuBx9zcnKfBUrtLPxtfs06Wi/rpJMWVlRVlMhkVCoUTgyZpcKFsPp+v36ud0CyRSDS9Bp0cxnBQ4/389FoBAAAA6C9CMGBAjus2Oqqjxe+OCi3Onz/f05yhUOjYvdYsyzq0X9UgdHty5/b2treF9MAwDKVSqWP3YOtkLzcvFYvF+sftdo41/g6N4u8NAAAAgOEiBAMG6KhOJ9u2fbt8rhOdLEdsJZFIqFKpHAqg1tbWfB18dBuYDZpt28rn8yqVSkduej/IOjp18D12Gn5vAAAAAAwOIRgwQNevXz/y834Od45zMPTxKgSrzVUulw/do9MTOfFbtdMtc7lcy33
|
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",
|
|
|
|
" 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",
|
2023-12-19 13:00:59 +01:00
|
|
|
"ax2 = ax.twinx()\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"ax2.hist(y_test, bins=50, range=[5150, 5700], color=\"#2A9D8F\", alpha=0.8, align=\"left\")\n",
|
2023-12-19 13:00:59 +01:00
|
|
|
"ax.set_xlabel(r\"z$_{Mag}$ [mm]\")\n",
|
|
|
|
"ax.set_ylabel(\"Mean Deviation [mm]\")\n",
|
|
|
|
"ax2.set_ylabel(\"Number of Tracks\")\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
"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": [],
|
|
|
|
"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-26 16:18:03 +01:00
|
|
|
"X_train, X_test, y_train, y_test = train_test_split(data,\n",
|
|
|
|
" target,\n",
|
2024-02-27 15:59:53 +01:00
|
|
|
" test_size=0.1,\n",
|
2024-02-26 16:18:03 +01:00
|
|
|
" random_state=42)\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",
|
|
|
|
"ax2.hist(y_test,\n",
|
|
|
|
" bins=30,\n",
|
|
|
|
" range=[-200, 200],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" alpha=0.8,\n",
|
|
|
|
" align=\"left\")\n",
|
|
|
|
"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
|
|
|
|
}
|