tracking-parametrisation-tuner/parameterisations/notebooks/hough_histogram.ipynb

243 lines
179 KiB
Plaintext
Raw Permalink Normal View History

2023-12-19 13:00:59 +01:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import uproot\n",
"import awkward as ak\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"input_tree = uproot.open({\"/work/guenther/reco_tuner/data/param_data_selected_all_p.root\": \"Selected\"})\n",
"array = input_tree.arrays()\n",
"array = array[[field for field in ak.fields(array) if \"scifi_hit\" not in field]]\n",
"df = ak.to_pandas(array)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAuEAAAJQCAYAAAAg1rpCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy89olMNAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB0JklEQVR4nO3dd3xUVf7/8fdAKgmEQOiEIhAINhCCIrAYRBBRQVFUumJbo6LiqqCC+LWhiKIbKy5FlKIuqKCsrLQgLSJioQhSAoJCaCGkQJLz+4Nf7maSmWSSTEvyej4eeTxm5p577uee3Jl8cubcc2zGGCMAAAAAXlPN1wEAAAAAVQ1JOAAAAOBlJOEAAACAl5GEAwAAAF5GEg4AAAB4GUk4AAAA4GUk4QAAAICXkYQDAAAAXkYSDgAAAHgZSThQxc2cOVM2m002m02jRo1yW7179+616m3RooXb6gXc4dNPP9X111+vJk2aKDg42LpWr7jiCl+HhkqmRYsW1vW1d+9eX4cDPxLg6wAAAPCmESNG6MMPP/R1GACqOJJwACXau3evWrZsKUlq3rw5vTmosObOnWuXgHfp0kXt27dXWFiYJKlNmza+Cg1AFUMSDgCoMmbNmmU9njRpkiZMmODDaABUZTZjjPF1EAD8Gz3hqCzq16+vI0eOSJIOHDigJk2a+DgiVHYtWrTQvn37JEl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IhMZGVliXZJMkyZNHNYxY8YMq8zIkSOdbnPlp6A9e/ZYrzdv3rzY80hPTze33HJLifU3atTIfPXVV8XWNXHiRKv8xIkTzYEDB8zll19ebL233367yc3NdVrnqVOnzPXXX+9yO7z//vvFxugqd14rzZs3t8rv2bPHLFy40ERERDitMzQ01CxevNgt51H4WsjOzjb33nuvw+OOGTPGbt/c3Fzz9NNPm5CQkGLbICAgwIwfP97k5eUVe+7F/Ti7ThcsWGAaNmxY4v7XXnutOXHihNN2KPxe++OPP0yPHj0c1rVw4UK7fY8dO2YGDRpUYgy1a9c2n3zySbG/D09eC6tXrzYxMTEutffjjz/utB53nq+rVqxYYdXbs2dPk5aWZgYOHFjs8ePi4swff/xRbL2F29uRzz77zAQHB7vUbh06dHBaT77C19qJEydK/Ay7+uqrTUZGRontlJWVZe69915TvXr1YusLDQ01b775Zon1VWXMjgK/NXz4cH399deaO3euzpw5oyFDhmjTpk0KDQ21K3fw4EGNHj3aej5+/Hj16NHDbXHs27dPjzzyiI4fP66wsDD16tVLDRo00J9//qkVK1bo9OnTysvL04svvqicnBy9/PLLTutavXq1+vXrp4yMDOu1Ll266Pzzz9eZM2e0fv16/f7775KkZcuWqXv37lqzZo3q1atXpK7vv/9eN910k/X1emhoqC677DK1aNFCwcHBSktL0++//66ff/7Z7nilERsbq4SEBJ06dUqzZ8+WJNWsWVMjRowoU32OZGRkqFevXtq4caP1WuPGjdWjRw+Fh4dr165dWrNmjXJzc3Xo0CFdf/31mjt3rm666aYS605PT9fVV1+tX375RTVq1FCPHj0UHR2tU6dOacWKFTp8+LAkacaMGWrbtq0ef/xxh/UMHz5cX3zxhfW8devW6tixo+rUqaOzZ8/qyJEj+vnnn916w6o7r5XCvv32W91zzz3Kzc1Vs2bN1LVrV9WqVUt79uzRypUrlZOTo8zMTA0ePFi//PKL3Tch7vDwww/rnXfekSRdeOGFuvjiixUYGKjffvvNbohIbm6ubrnlFn322WfWa40aNdKll16q+vXrKz09XRs2bNDvv/+unJwcvfDCCzpy5Ijee+89u+ONHDlSR48elSQlJiZaryckJNiVq1u3bpFYX3vtNY0dO9bqJaxZs6a6du2q6Oho5ebmauvWrUpOTpYxRosXL1bPnj21du1a1ahRo9g2yM7O1vXXX69NmzYpICBAl19+uVq3bq2srCz98MMPdmX//PNP9erVS9u2bbNei42NVYcOHVSzZk0dPnxYa9asUWpqqk6cOKHBgwfrww8/1NChQ4uNQXLvtTBv3jyNGDHC7pugmJgYXXLJJYqIiNDJkyf166+/6tdff1VeXp6ysrIc1uPJ8y2N22+/3fpGIv+9l52drfXr12v37t2SzvXU9+rVS2vXrlWdOnXKfKzDhw8rOztbktS0aVO1b99eDRs2VI0aNZSenq5t27bphx9+kDFGP/74o3r06KEff/zR4TVbWG5urgYNGqRvv/1WQUFBuvzyy9WqVStlZWUpKSlJKSkpkqSlS5fqkUce0dtvv+20rtOnT6tv37767rvvrNdatmypzp07KzIyUsePH9fatWv1xx9/KDMzUw888IDS0tI0fvz4MrdNpebjfwKAYp04ccKuF+Hee++1256Xl2d69+5tbb/00kvN2bNny33cgj3hQUFBRpIZMmRIkV6uEydOmFtvvdXuv//ly5c7rPPYsWN2vemtWrUyycnJRcrNmTPHhIaGWuWuu+46h/UNGDDAKjNo0CBz7Ngxh+WysrLMkiVLzD333ONwe3E94flK06td2n3+/ve/W+WqV69upk6dWqRX+rfffjOdOnWyytWqVcvs3r3bYX0Fe8Lze5ZGjhxpjh49alfu9OnT5rbbbrPKhoeHm/T09CL1bd682a5McT3xv//+u3nuuefMF198UUzLlMzd14ox9r1xwcHBJiwszHz44YdFeo5/+eUXu2Pffvvt5ToXY+yvhfzes+joaIffWGVlZVmPn376aWu/+vXrm/nz5zv8xuKTTz6x68mdP3++01gKvldL8t///tdUq1bNSDKBgYHmueeec3qNtG/f3qr373//u8P6Cr7XAgICrB5XR72a+e2Qm5tr4uPjrf0uueQSh9dCZmameeaZZ4zNZjOSTFhYmNP3iCeuhR9++MHu24qOHTua9evXOyx76NA
"text/plain": [
"<Figure size 800x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"urax = df.loc[(df[\"x_ref\"] > -3200) & (df[\"x_ref\"] < 3200), \"x_ref\"].plot.hist(bins=100, logy=True,title='x positions on reference plane', figsize=(8,6), fontsize=20,edgecolor='black')\n",
"urax.set_xlabel('x [mm]', fontsize=24)\n",
"urax.set_ylabel('Count', fontsize=24)\n",
"urax.title.set_size(24)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"from scipy.optimize import curve_fit\n",
"import numpy as np\n",
"def fitFastSigmoid(x, p0, p1, p2 ):\n",
" return p0 + p1 * x / (1 + abs(x * p2) ) \n",
"\n",
"def sqrtSigmoid( x, p0, p1, p2 ):\n",
" return p0 + p1 * x / np.sqrt( p2 + x**2 )"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"-1152.3191321144784 1144.5112688972854\n",
"BINS=900\n",
"shift=126.0\n",
"[ 4.50871394e+02 5.78026621e-01 -6.72848459e-04]\n",
"at -3000 = 2\n",
"at 0 = 576\n",
"at 3000 = 1151\n",
"at -3000 = 2.3960602381498575\n",
"at 0 = 576.8713937732111\n",
"at 3000 = 1151.3467273082724\n",
"\n",
"-1152.3191321144784 1145.2265343593158\n",
"BINS=1000\n",
"shift=140.0\n",
"[5.00965281e+02 6.42244329e-01 6.72824292e-04]\n",
"at -3000 = 2\n",
"at 0 = 640\n",
"at 3000 = 1279\n",
"at -3000 = 2.6514499904290005\n",
"at 0 = 640.965281389201\n",
"at 3000 = 1279.279112787973\n",
"\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>NBINS</th>\n",
" <th>nBinsReal</th>\n",
" <th>minBinWidth</th>\n",
" <th>maxBinWidth</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>900</td>\n",
" <td>1152</td>\n",
" <td>1.520524</td>\n",
" <td>411.883522</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1000</td>\n",
" <td>1280</td>\n",
" <td>1.378500</td>\n",
" <td>406.784548</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" NBINS nBinsReal minBinWidth maxBinWidth\n",
"0 900 1152 1.520524 411.883522\n",
"1 1000 1280 1.378500 406.784548"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAB5AAAAdnCAYAAAADTeAUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy89olMNAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3hUVdf38e+kF5JAgDR670VAIRRDD0izgqARRFEeQUUsgOANYqGIFEUUARFEikoRLPQuLVKkVwMIBClCQgmp+/ljzMiQQoDAJPD7XFfe9z777NlnnTPjPKxZ++xjMcYYRERERERERERERERERETknufk6ABERERERERERERERERERCRnUAFZREREREREREREREREREQAFZBFRERERERERERERERERORfKiCLiIiIiIiIiIiIiIiIiAigArKIiIiIiIiIiIiIiIiIiPxLBWQREREREREREREREREREQFUQBYRERERERERERERERERkX+pgCwiIiIiIiIiIiIiIiIiIoAKyCIiIiIiIiIiIiIiIiIi8i8VkEVEREREREREREREREREBFABWUREREREROSesnr1atq0aUNISAgWi4V58+bZ9iUmJtKnTx+qVKmCt7c3ISEhPPPMM5w4ccJuj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REbkXZJY3ieQEyu1FJKv0nSAiIiL3otuV1+sOZBERERERERERERERERERAVRAFhERERE
"text/plain": [
"<Figure size 2400x2400 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import pandas as pd\n",
"from math import ceil\n",
"selection = (df[\"x_ref\"] > -3000) & (df[\"x_ref\"] < 3000) \n",
"data = df.loc[selection, \"x_ref\"]\n",
"#func = sqrtSigmoid\n",
"func = fitFastSigmoid\n",
"#NBINS=[800, 900, 1000, 1100]\n",
"NBINS=[900, 1000]\n",
"#SHIFTS = [48, 50, 53, 52]\n",
"SHIFTS=[126., 140.]\n",
"minBinWidths = []\n",
"maxBinWidths = []\n",
"nBinsReal = []\n",
"fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(24, 24))\n",
"for i, BINS in enumerate(NBINS):\n",
" out, equal_bins = pd.qcut(data, q=BINS, retbins=True)\n",
" binWidths = np.array([ abs(equal_bins[j] - equal_bins[j+1]) for j in range(len(equal_bins)-1)])\n",
" minBinWidths.append( binWidths.min() )\n",
" maxBinWidths.append( binWidths.max() )\n",
" bin_numbering = np.arange(0, BINS+1)\n",
" equalbins_center = equal_bins[int(BINS/10):int(9*BINS/10)]\n",
" bin_numbering_center = bin_numbering[int(BINS/10):int(9*BINS/10)]\n",
" print(equalbins_center[0], equalbins_center[-1])\n",
" popt, pcov = curve_fit( func, xdata=equalbins_center, ydata=bin_numbering_center )\n",
" if i<2:\n",
" axes[0,i].plot(equal_bins, bin_numbering, '.', label='data')\n",
" axes[0,i].plot(equal_bins, func(equal_bins, *popt), label=f'p0={popt[0]}\\np1={popt[1]}\\np2={popt[2]}\\n')\n",
" axes[0,i].legend()\n",
" else:\n",
" axes[1,i-2].plot(equal_bins, bin_numbering, '.', label='data')\n",
" axes[1,i-2].plot(equal_bins, func(equal_bins, *popt), label=f'p0={popt[0]}\\np1={popt[1]}\\np2={popt[2]}\\n')\n",
" axes[1,i-2].legend()\n",
" shift = SHIFTS[i]\n",
" nBinsReal.append(ceil(func(3000, popt[0]+shift, popt[1], popt[2])))\n",
" print(f'BINS={BINS}')\n",
" print(f'shift={shift}')\n",
" print(popt)\n",
" print(f'at -3000 = {int(func(-3000., popt[0]+shift, popt[1], popt[2]))}')\n",
" print(f'at 0 = {int(func(0., popt[0]+shift, popt[1], popt[2]))}')\n",
" print(f'at 3000 = {int(func(3000., popt[0]+shift, popt[1], popt[2]))}')\n",
" print(f'at -3000 = {func(-3000., popt[0]+shift, popt[1], popt[2])}')\n",
" print(f'at 0 = {func(0., popt[0]+shift, popt[1], popt[2])}')\n",
" print(f'at 3000 = {func(3000., popt[0]+shift, popt[1], popt[2])}')\n",
" print()\n",
"binData = pd.DataFrame({'NBINS':NBINS, 'nBinsReal': nBinsReal,'minBinWidth':minBinWidths, 'maxBinWidth':maxBinWidths})\n",
"#ax = binData.plot(x='NBINS', y=['minBinWidth', 'maxBinWidth'], logy=True)\n",
"binData"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.6 (conda)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "a2eff8b4da8b8eebf5ee2e5f811f31a557e0a202b4d2f04f849b065340a6eda6"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}