2024-01-22 16:03:16 +01:00
{
"cells": [
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 24,
2024-01-22 16:03:16 +01:00
"metadata": {},
"outputs": [],
"source": [
"import uproot\t\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from mpl_toolkits import mplot3d\n",
"import awkward as ak\n",
"from scipy.optimize import curve_fit\n",
"from methods.fit_linear_regression_model import fit_linear_regression_model\n",
"import sklearn\n",
2024-01-26 11:34:42 +01:00
"import seaborn as sns\n",
"import pandas as pd\n",
2024-01-22 16:03:16 +01:00
"%matplotlib inline"
]
},
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 10,
2024-01-22 16:03:16 +01:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-01-26 11:34:42 +01:00
"41978 8523\n",
2024-01-22 16:03:16 +01:00
"50501\n"
]
}
],
"source": [
"file = uproot.open(\n",
2024-01-26 11:34:42 +01:00
" \"tracking_losses_ntuple_B_EndVeloP.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\"\n",
2024-01-22 16:03:16 +01:00
")\n",
"\n",
"# selektiere nur elektronen von B->K*ee\n",
"allcolumns = file.arrays()\n",
2024-01-26 11:34:42 +01:00
"found = allcolumns[\n",
" (allcolumns.isElectron) & (~allcolumns.lost) & (allcolumns.fromB)\n",
"] # B: 9056\n",
"lost = allcolumns[\n",
" (allcolumns.isElectron) & (allcolumns.lost) & (allcolumns.fromB)\n",
"] # B: 1466\n",
2024-01-22 16:03:16 +01:00
"\n",
"electrons = allcolumns[(allcolumns.isElectron) & (allcolumns.fromB)]\n",
"\n",
"print(ak.num(found, axis=0), ak.num(lost, axis=0))\n",
"print(ak.num(electrons, axis=0))\n",
"# ak.count(found, axis=None)"
]
},
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 11,
2024-01-22 16:03:16 +01:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-01-26 11:34:42 +01:00
"stretch factor: 0.20303492305493354\n"
2024-01-22 16:03:16 +01:00
]
}
],
"source": [
"rad_length_found = ak.to_numpy(found[\"rad_length_frac\"])\n",
"eta_found = ak.to_numpy(found[\"eta\"])\n",
2024-01-26 11:34:42 +01:00
"phi_found = ak.to_numpy(found[\"phi\"])\n",
2024-01-22 16:03:16 +01:00
"rad_length_lost = ak.to_numpy(lost[\"rad_length_frac\"])\n",
"eta_lost = ak.to_numpy(lost[\"eta\"])\n",
2024-01-26 11:34:42 +01:00
"phi_lost = ak.to_numpy(lost[\"phi\"])\n",
2024-01-22 16:03:16 +01:00
"\n",
"stretch_factor = ak.num(eta_lost, axis=0) / ak.num(eta_found, axis=0)\n",
"print(\"stretch factor: \", stretch_factor)"
]
},
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 12,
2024-01-22 16:03:16 +01:00
"metadata": {},
"outputs": [
{
"data": {
2024-01-26 11:34:42 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAj8AAAHLCAYAAAAnR/mlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAx7klEQVR4nO3dT4zb6IH3+V9N8nbFeQtuVjmXHF5gTAFzWmANqnLYxiJuwBJyyGEXsGTfkgEaJSKom4EU47m4fBktC3MtIJIxmH5z6xKN3T3MYSB60M4hwK4txgEWi/1X9AA55AXedBVj1Bun+p2B9uCQLpVUKhUlSqL5/QCFbpMin0ekSvzVw4fPs9Lv9/sCAAAoiL9YdAUAAADmifADAAAKhfADAAAKhfADAAAKhfADAAAKhfADAAAKhfADAAAKhfADAAAKhfCDQguCQO12e9HVKLwoitRutxWG4aKrgividwh5RPhBIYVhqHq9rnK5rFarNbB8fX19pl/mWexzUkEQyHEclctllcvluZc/iXa7rZs3b8q2bUVRNNW+4vdbr9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sVcvPj370I337298euW57ezu3CRYAgLza39/X/v7+yHV//OMfMykzdfi5c+fO2PWmaepnP/vZUoWfX/ziF7T8AACwRMY1PsQtP7OWOvyMe5IrDEM5jpN21wAAAJlJHX4sy9LKysqF6/v9vvb29tLuHgAAIBOpw49hGLp3754Mwxhad+PGDVmWdemtMQAAgHlLHX6ePHmiu3fvzrIuAAAAmUs9wjPBBwAA5FFmc3v95Cc/0ebmpj777LOJt4miSM1mU5Lkuu7Y1/q
2024-01-22 16:03:16 +01:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.hist(\n",
" rad_length_lost,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" color=\"darkorange\",\n",
" histtype=\"bar\",\n",
" label=\"lost\",\n",
" range=[0, 1],\n",
")\n",
"plt.hist(\n",
" rad_length_found,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" color=\"blue\",\n",
" histtype=\"bar\",\n",
" label=\"found\",\n",
" range=[0, 1],\n",
")\n",
"plt.xlim(0, 1)\n",
"# plt.yscale(\"log\")\n",
"plt.title(\"radiation length fraction endVelo\")\n",
"plt.xlabel(f\"$x/X_0$\")\n",
"plt.ylabel(\"a.u.\")\n",
"\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 13,
2024-01-22 16:03:16 +01:00
"metadata": {},
"outputs": [
{
"data": {
2024-01-26 11:34:42 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABiMAAAL7CAYAAACfnvZxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC4UElEQVR4nOz9fXhb133g+/62SEdVIikQnTkdR85cG8i0dpwXzwYdtc2dOD0GnrGcpnOmIuXU0zYZv4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WrHv3gNw/EZxHvTj88WP94/ndoWQb23/diuqVRq1bNU5ufnVz3cus6PdQzT+wIAAAwWJiMAAAA6wPaAUZ36l0Gzs7NdzWMlL7fjqP+yt1wuG79Arn95p/uiLQiRSKSxve+7775Vv3JeaXx83PiMh3aNj49LLpeTbDbb+G+rt2fqpduitHu81b/UnZ2dNR4vExMT2i+oe/343Mh7sx2d/mzZ6PtHt986tS2CfG/78Zm99pZMax9cLeLPOobpfQEAAAYLkxEAAAAdUP/C7ejRo6vKV35xtfJLpPptOWq1WuNBpiuXO3bsmIjob81R70v3pVS7eegelLq2X1t/U1NTjS/K6uu0Uv3LrpXLtaLTX8iv3N7xeHzVupbLZYnH4+K6bss52vKbmJho+1YureyHTjN9qdmOjRz38Xhc5ufnG/FisSixWGzVl5/9dHy2u6285rCRzxaTdt8/6+23Tm6LoN7bfmzXqampxv/rJiJ0fXdiHf16XwAAAKxLAQAAYF0iokREpVIpbTyVSjWWiUajamxsTEWjUZXL5ZrKK5WKts7U1JSamppS0WhUua7
2024-01-22 16:03:16 +01:00
"text/plain": [
"<Figure size 2000x800 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"nbins = 100\n",
"vmax = 80\n",
"\n",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20, 8))\n",
"\n",
"a0 = ax0.hist2d(\n",
" rad_length_found,\n",
" eta_found,\n",
" density=False,\n",
" bins=nbins,\n",
" cmap=plt.cm.jet,\n",
" cmin=1,\n",
" vmax=vmax,\n",
" range=[[0, 0.6], [2, 5]],\n",
")\n",
"ax0.set_xlabel(f\"$x/X_0$\")\n",
"ax0.set_ylabel(f\"$\\eta$\")\n",
"ax0.set_title(f\"found $\\eta$ rad_length_frac\")\n",
"\n",
"a1 = ax1.hist2d(\n",
" rad_length_lost,\n",
" eta_lost,\n",
" density=False,\n",
" bins=nbins,\n",
" cmap=plt.cm.jet,\n",
" cmin=1,\n",
" vmax=vmax * stretch_factor,\n",
" range=[[0, 0.6], [2, 5]],\n",
")\n",
"ax1.set_xlabel(f\"$x/X_0$\")\n",
"ax1.set_ylabel(f\"$\\eta$\")\n",
"ax1.set_title(f\"lost $\\eta$ rad_length_frac\")\n",
"# ax1.set(xlim=(0,4000), ylim=(-1000,1000))\n",
"\n",
"plt.suptitle(\"radiation length fraction and eta endVelo\")\n",
"plt.colorbar(a0[3], ax=ax1)\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 14,
2024-01-22 16:03:16 +01:00
"metadata": {},
2024-01-23 16:00:16 +01:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Parameterisation for rad_length_frac:\n",
"intercept= 0.0\n",
2024-01-26 11:34:42 +01:00
"coef= {'1': 0.19830920321074946, 'x': -4.49175976974402e-05, 'y': 0.00039490060416272056, 'tx': 0.00015102371088508598, 'ty': -0.3004315695136339, 'qop': -15.314945266490128, 'x^2': -1.8619394568578818e-05, 'x y': -4.953907513838906e-06, 'x tx': 0.021617503882699386, 'x ty': 0.03829244150062255, 'x qop': -0.41798007270055415, 'y^2': -2.4410328131494868e-05, 'y tx': -0.03443063985633742, 'y ty': 0.024201355785359608, 'y qop': 0.069823295273139, 'tx^2': -9.507076220830514, 'tx ty': -0.3980701633198789, 'tx qop': -0.04742639222342226, 'ty^2': -5.342167619183405, 'ty qop': 0.04842038611881145, 'qop^2': 0.2070268831284635, 'x^3': 1.5823479402461545e-07, 'x^2 y': -5.806838940825474e-07, 'x^2 tx': -0.00023418353598118923, 'x^2 ty': 0.0037081774556846224, 'x^2 qop': 0.01641641113222204, 'x y^2': 6.398758958085149e-08, 'x y tx': -0.002932641224303519, 'x y ty': -0.001396824762733282, 'x y qop': -0.020888196868450136, 'x tx^2': 0.09096908124129072, 'x tx ty': -2.939755357349759, 'x tx qop': -8.73057282483271, 'x ty^2': -0.15340975596199197, 'x ty qop': 9.249941815315987, 'x qop^2': 0.030205199863621846, 'y^3': 1.6478595155078324e-07, 'y^2 tx': 0.0013152209574444013, 'y^2 ty': -0.000257931039205234, 'y^2 qop': -0.0057816482028933735, 'y tx^2': 2.685350530706497, 'y tx ty': 0.17814134491255038, 'y tx qop': 9.050929476915277, 'y ty^2': 0.10064678584510746, 'y ty qop': 4.6142369495362185, 'y qop^2': -0.00046589334175238057, 'tx^3': -0.6242025517665986, 'tx^2 ty': -0.017658603327465147, 'tx^2 qop': -0.022216794668845363, 'tx ty^2': -0.01024816705930792, 'tx ty qop': 0.024042119917448937, 'tx qop^2': 6.093129132646114e-05, 'ty^3': 0.09834545208780196, 'ty^2 qop': 0.011664187426493774, 'ty qop^2': -2.1825340747940462e-05, 'qop^3': -1.559907925017188e-06, 'x^4': -2.9483981922595603e-09, 'x^3 y': -6.13444928188045e-09, 'x^3 tx': 7.101384723817716e-06, 'x^3 ty': 7.16725431293419e-06, 'x^3 qop': 4.00953960828232e-05, 'x^2 y^2': 1.0679747086683733e-08, 'x^2 y tx': 7.616826922074438e-06, 'x^2 y ty': -3.91052449297824e-05, 'x^2 y qop': 9.93899828579223e-05, 'x^2 tx^2': -0.005400741368580057, 'x^2 tx ty': -0.009338160688408294, 'x^2 tx qop': -0.0017215190824096578, 'x^2 ty^2': 0.0007665795500993852, 'x^2 ty qop': 0.08528819041114723, 'x^2 qop^2': 8.037042310903203, 'x y^3': 8.933181749881669e-09, 'x y^2 tx': 1.766907321343325e-05, 'x y^2 ty': -2.1412010806409754e-05, 'x y^2 qop': -7.010215747540322e-05, 'x y tx^2': -0.0021778144582400415, 'x y tx ty': 0.0326584774738, 'x y tx qop': -0.1598215452174385, 'x y ty^2': 0.012945427966444779, 'x y ty qop': -0.23950569088511311, 'x y qop^2': -0.8775916738593352, 'x tx^3': 1.366672968587086, 'x tx^2 ty': 1.7459886700480327, 'x tx^2 qop': 0.4423601484422016, 'x tx ty^2': -1.0803356692637864, 'x tx ty qop': -0.0706577637682464, 'x tx qop^2': 0.006422119173581787, 'x ty^3': -2.2905272843167253, 'x ty^2 qop': -0.0063092971067729734, 'x ty qop^2': -0.001963650254414034, 'x qop^3': -1.0318719588655238e-06, 'y^4': -2.213189409516758e-09, 'y^3 tx': 7.716181404937572e-08, 'y^3 ty': 3.7462658548648164e-06, 'y^3 qop': -2.6897178570957402e-05, 'y^2 tx^2': -0.019391135282039867, 'y^2 tx ty': 0.003922857934752042, 'y^2 tx qop': 0.30048105074735626, 'y^2 ty^2': -0.0014404468920953982, 'y^2 ty qop': 0.017062949506976018, 'y^2 qop^2': -0.5172314152946776, 'y tx^3': 1.1761566789450086, 'y tx^2 ty': -1.8639649790914088, 'y tx^2 qop': -0.07088661078488609, 'y tx ty^2': -2.1282820437243197, 'y tx ty qop': -0.001276549939024397, 'y tx qop^2': -0.0019180156335069092, 'y ty^3': -0.06849699842395515, 'y ty^2 qop': -0.0351395250211265, 'y ty qop^2': -0.0005408300561230844, 'y qop^3': 4.1258598459708434e-06, 'tx^4': -0.02399482130004447, 'tx^3 ty': 0.010297903626621132, 'tx^3 qop': 0.0018304232474417028, 'tx^2 ty^2': -0.01163526658236639, 'tx^2 ty qop': -0.00029701477688915344, 'tx^2 qop^2': 2.0001744822333693e-06, 'tx ty^3': -0.014645131120788562, 'tx ty^2 qop': -2.1232731978440055e-05, 'tx ty qop^2': -3.4544969537609295e-06, 'tx qop^3': 8.78704309226661e-09, 'ty^4': -0.001422061237110601, 'ty^3 qop': -0.00017083649574085
"r2 score= -0.008270330873300091\n",
"RMSE = 0.10823208615961777\n",
2024-01-23 16:00:16 +01:00
"\n"
]
},
{
"data": {
2024-01-26 11:34:42 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAHLCAYAAAAa1ZjDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABqCElEQVR4nO3de3xTdZ4//lcoFAqFpgVF5NoTQLmO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OhvNrXj9cue9+/kvL5fu16enqwYsUK/OY3v4m5zIcnzmOr5xSunTgG80Z8hr/70Y9C945UOHPmDHoBLANQquQ4ALb19uLMmTMxJyOx3IOTeZ8OSmoy0tTUhNraWqxYsWLQIlA+nw9utxsPP/wwHnjgAdx///1hjxF8E0NlVvG+SZPJFLHfSLBp5ktf+hJuvvnmuI4dNGbMGNxwww0JlQWAoqKiiAuEZWr59vZ2AMB1112HcePGpfXcuVBe7evHa5e9719JeV67S3+zY/17/8pHp+Dc3YL7bpuFv62YhXf/+AcAUNSsH6spACYrKD8mgTKx3IOTfZ8GkpyMNDc3hzq2hFNRUYGamhqsWbNmyNcEe+PK25yC2waDIe64gsckUkqj2SjZnjNHpUCIKKVEUURj83H85v2juPtLk3D/1wQMG6aJXjDLxXIPTsV9OqmjaYLLsUcTqdOPVquFXq8f1Bs3WLuxfPnyuGJyOp2SlVuJiIgiEUURv3r3CH7z/lH8ny9Pw8qb1ElECnCpxiDRR0EC54zlHpzs+zSQ5GTk8OHDWLt2LY4ePRp2/5EjR/Dkk0+GOr8MZcuWLaHlz4N
2024-01-23 16:00:16 +01:00
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2024-01-22 16:03:16 +01:00
"source": [
"rad_length_frac = found[\"rad_length_frac\"]\n",
"# @ z = 9400.mm or 770.mm\n",
"state = 1\n",
"\n",
"if state == 1:\n",
" slopex = found[\"ideal_state_770_tx\"]\n",
" slopey = found[\"ideal_state_770_ty\"]\n",
" x = found[\"ideal_state_770_x\"]\n",
" y = found[\"ideal_state_770_y\"]\n",
" qop = found[\"ideal_state_770_qop\"]\n",
"elif state == 2:\n",
" slopex = found[\"ideal_state_9410_tx\"]\n",
" slopey = found[\"ideal_state_9410_ty\"]\n",
" x = found[\"ideal_state_9410_x\"]\n",
" y = found[\"ideal_state_9410_y\"]\n",
" qop = found[\"ideal_state_9410_qop\"]\n",
"\n",
2024-01-26 11:34:42 +01:00
"data = ak.zip({\n",
" \"rad_length_frac\": rad_length_frac,\n",
" \"x\": x,\n",
" \"y\": y,\n",
" \"tx\": slopex,\n",
" \"ty\": slopey,\n",
" \"qop\": qop,\n",
"})\n",
2024-01-23 16:00:16 +01:00
"lin_reg, features, xx0_test, xx0_predicted = fit_linear_regression_model(\n",
" data,\n",
" \"rad_length_frac\",\n",
" [\"x\", \"y\", \"tx\", \"ty\", \"qop\"],\n",
2024-01-26 11:34:42 +01:00
" 5,\n",
2024-01-23 16:00:16 +01:00
" include_bias=True,\n",
")\n",
"\n",
"nbins = 100\n",
2024-01-26 11:34:42 +01:00
"vmax = 100\n",
2024-01-23 16:00:16 +01:00
"\n",
"a0 = plt.hist2d(\n",
" xx0_test,\n",
" xx0_predicted,\n",
" density=False,\n",
" bins=nbins,\n",
" cmap=plt.cm.jet,\n",
" cmin=1,\n",
" vmax=vmax,\n",
2024-01-26 11:34:42 +01:00
" range=[[0, 0.5], [0, 0.5]],\n",
2024-01-23 16:00:16 +01:00
")\n",
2024-01-26 11:34:42 +01:00
"plt.plot([0, 0.5], [0, 0.5], marker=\"\", alpha=0.8)\n",
2024-01-23 16:00:16 +01:00
"plt.xlabel(f\"True $x/X_0$\")\n",
"plt.ylabel(f\"Predicted $x/X_0$\")\n",
"plt.title(f\"found rad_length_frac\")\n",
"\n",
"plt.colorbar(a0[3])\n",
"plt.show()"
2024-01-22 16:03:16 +01:00
]
},
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMAAAAIoCAYAAACPjZdDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACdcUlEQVR4nOz9f5wb+X3feb6bHA3VMkVimn5EURyvRUDK2rlTPFPoSXa1PlMSASlZbfZW0wDpfV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MEPW19eVy+Vchead3wdHFTEHgH4RgAEBZZqmtra2JvbH3qSPPwrNZlPXrl1TLBZTOByedHeAuRSPxxUOh1UsFlvvra+vq1gsant7u7WNJFWr1dY2pVJJ6XRaXLYAwOxxan9xfQZglI5NugPAJJimqWw2q2QyqUgkcuj0u+NmWZaSyaSi0ajrD8QgH985n9FoVNFodMQ9HEypVNLZs2eVTqc7prMeRpC/l4AgajQaHTVdtre3W3/0NJtN1Wq1VgjmWF5elrT/swwAmC2hUIjwC8DIEYBh7pimqfPnzyufz6tcLiuRSLRGHQRBOBxWuVyequMbhqGLFy/KNM0R9ap/lmW5gq5UKuX7aLagfy8BQZROp1tBu7T/c3Tt2rXW449bW1uS1PGHkPMo5MFRYQAAAECvKIKPuZPL5bS0tNRaprimP5w/ToMimUyqXC67ZhQ6c+aMr8fgewmz4A//8A/10ksvdbz/2muv6bXXXhuq7be//e1617ve5XovlUqpXq+rVCopEokoHA7r1q1brZ9Vpyhy+2xgDmc9MC1eeukl/cZv/Ibe8Y53aHFxcdL
"text/plain": [
"<Figure size 1500x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"nbins = 100\n",
"vmax = 80\n",
"\n",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(15, 6))\n",
"\n",
"# ax0.set_aspect(\"equal\")\n",
"\n",
"a0 = ax0.hist2d(\n",
" xx0_test,\n",
" xx0_predicted,\n",
" density=False,\n",
" bins=nbins,\n",
" cmap=plt.cm.jet,\n",
" cmin=1,\n",
" vmax=vmax,\n",
" range=[[0, 0.5], [0, 0.5]],\n",
")\n",
"ax0.plot([0, 0.5], [0, 0.5], marker=\"\", alpha=0.8)\n",
"ax0.set_box_aspect(1)\n",
"ax0.set_xlabel(f\"True $x/X_0$\")\n",
"ax0.set_ylabel(f\"Predicted $x/X_0$\")\n",
"ax0.set_title(f\"found rad_length_frac\")\n",
"plt.colorbar(a0[3], ax=ax0)\n",
"\n",
"ax1.hist(\n",
" xx0_test,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" color=\"darkorange\",\n",
" histtype=\"bar\",\n",
" label=\"test\",\n",
" range=[0, 0.5],\n",
")\n",
"ax1.hist(\n",
" xx0_predicted,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" color=\"blue\",\n",
" histtype=\"bar\",\n",
" label=\"predicted\",\n",
" range=[0, 0.5],\n",
")\n",
"ax1.set_xlim(0, 0.5)\n",
"ax1.set_title(\"radiation length fraction endVelo\")\n",
"ax1.set_xlabel(f\"$x/X_0$\")\n",
"ax1.set_ylabel(\"a.u.\")\n",
"ax1.set_box_aspect(1)\n",
"\n",
"ax1.legend()\n",
"\n",
"# plt.gca().set_aspect(\"equal\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 16,
2024-01-22 16:03:16 +01:00
"metadata": {},
"outputs": [
{
2024-01-23 16:00:16 +01:00
"data": {
2024-01-26 11:34:42 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAj8AAAHLCAYAAAAnR/mlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3qklEQVR4nO3dT2wj+Z3394+yzsjtR+ih1L44wAI7RWAPvqRR1ByezcIyMCz44EsAsXr2ZC9gNAlDhwANrAraS3cfskQRexXgohBkMMhlmtX5c9jDLjkLtxMYyNNibe9lkScJaxZwAD9APFK5obitWa+ZQ29ViyIpUWSRLKreL0CYEYv1q69YJOvbvz/fWuv3+30BAADkxH+27AAAAAAWieQHAADkCskPAADIFZIfAACQKyQ/AAAgV0h+AABArpD8AACAXCH5AQAAuULyg1wLgkDNZnPZYeReFEVqNpsKw3DZoeCG+AxhFZH8IJfCMJRt2yqVSvI8b+Dxzc3NVL/M59HmpIIgkOM4KpVKKpVKCz/+JJrNpj744APVajVFUTRT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v69a9/ndoyUkyHc5EdnIvs4Fxky7yu31Mvda/Vavrggw/0/vvvD/2YpqlSqaS//Mu/TC1QAACANEyd/Hz00UdXbjcMQ57nTds8AADAXEw95+fVq1djt4VhKMdxpm0aAABgbqZOfkzT1Nra2tjt/X5fjUZj2ubngjo/AABky0rV+SkUCnrw4IEKhcLQtnv37sk0zWuHxhaNOj8AAGTLStX5OTo60u7ubpqxAAAAzN3
2024-01-23 16:00:16 +01:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
2024-01-22 16:03:16 +01:00
}
],
"source": [
2024-01-23 16:00:16 +01:00
"plt.hist(\n",
" xx0_test,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" color=\"darkorange\",\n",
" histtype=\"bar\",\n",
" label=\"test\",\n",
2024-01-26 11:34:42 +01:00
" range=[0, 0.5],\n",
2024-01-23 16:00:16 +01:00
")\n",
"plt.hist(\n",
" xx0_predicted,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" color=\"blue\",\n",
" histtype=\"bar\",\n",
" label=\"predicted\",\n",
2024-01-26 11:34:42 +01:00
" range=[0, 0.5],\n",
2024-01-23 16:00:16 +01:00
")\n",
2024-01-26 11:34:42 +01:00
"plt.xlim(0, 0.5)\n",
2024-01-23 16:00:16 +01:00
"# plt.yscale(\"log\")\n",
"plt.title(\"radiation length fraction endVelo\")\n",
"plt.xlabel(f\"$x/X_0$\")\n",
"plt.ylabel(\"a.u.\")\n",
"\n",
"plt.legend()\n",
"plt.show()"
2024-01-22 16:03:16 +01:00
]
},
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 17,
2024-01-22 16:03:16 +01:00
"metadata": {},
"outputs": [
2024-01-23 16:00:16 +01:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"Parameterisation for rad_length_frac:\n",
"intercept= 0.0\n",
2024-01-26 11:34:42 +01:00
"coef= {'1': 0.2484410418213911, 'x': -0.0007601095488043627, 'y': 0.0010569724392146917, 'tx': 0.6185505303064777, 'ty': -0.9394058560136732, 'qop': -9.741031889614183, 'x^2': -0.00016580416280366622, 'x y': 5.149038989659081e-05, 'x tx': 0.22996768886351043, 'x ty': -0.043161009059129354, 'x qop': -0.21658279194428842, 'y^2': 3.9826067539320166e-05, 'y tx': -0.033498957247677735, 'y ty': -0.08085122767618998, 'y qop': 0.06428923004582791, 'tx^2': -83.06687438225835, 'tx ty': 28.76266798578089, 'tx qop': -0.32072666519746007, 'ty^2': 32.80290436519906, 'ty qop': 0.29785759094660047, 'qop^2': 0.7177557091128425, 'x^3': -1.037888276319177e-06, 'x^2 y': 5.744977724613286e-07, 'x^2 tx': 0.0016261562680787358, 'x^2 ty': 0.00819223051446815, 'x^2 qop': 0.014940216048602184, 'x y^2': 1.55836456652794e-06, 'x y tx': -0.009042353485603404, 'x y ty': 0.002769481233443616, 'x y qop': 0.007035099510620806, 'x tx^2': -0.623629094925692, 'x tx ty': -0.5792857627094614, 'x tx qop': 3.819052794399519, 'x ty^2': -1.214138821848195, 'x ty qop': -4.179406422119741, 'x qop^2': -0.11723833703778899, 'y^3': -2.1060731703048674e-07, 'y^2 tx': -0.005136952674035623, 'y^2 ty': 0.0002523550890177065, 'y^2 qop': 0.020199755591199943, 'y tx^2': 0.8881296792413045, 'y tx ty': 2.1057062787476855, 'y tx qop': -4.322557205912296, 'y ty^2': -0.062185778412248593, 'y ty qop': -12.744670929978815, 'y qop^2': 0.10865361350283592, 'tx^3': -0.2772083890350773, 'tx^2 ty': -0.002155259913110253, 'tx^2 qop': 0.01973183125611695, 'tx ty^2': 0.2547275714314975, 'tx ty qop': -0.01267461996128659, 'tx qop^2': -0.0002315355231400779, 'ty^3': 0.12852489701010045, 'ty^2 qop': -0.03229168715651398, 'ty qop^2': 0.0001733290594162183, 'qop^3': -1.1131786479856305e-06, 'x^4': 1.4072631948636172e-09, 'x^3 y': -4.525309382774623e-08, 'x^3 tx': -5.048150129027817e-07, 'x^3 ty': 2.845994251238215e-07, 'x^3 qop': 6.161442924141475e-05, 'x^2 y^2': -1.8614020325102842e-08, 'x^2 y tx': 9.737839179148333e-05, 'x^2 y ty': -1.3038804363763035e-05, 'x^2 y qop': -8.415032085912991e-05, 'x^2 tx^2': -0.0010152847281566686, 'x^2 tx ty': -0.0032259545758118137, 'x^2 tx qop': -0.041785493301881166, 'x^2 ty^2': 0.013227443641328787, 'x^2 ty qop': 0.0035654519670473366, 'x^2 qop^2': 1.2621531315710728, 'x y^3': 3.906278722709544e-08, 'x y^2 tx': 6.858475435222999e-05, 'x y^2 ty': -5.862278080592809e-05, 'x y^2 qop': -0.00016236412225426912, 'x y tx^2': -0.06608751351613794, 'x y tx ty': -0.04864228625905696, 'x y tx qop': 0.06901548261804959, 'x y ty^2': 0.04159526642181612, 'x y ty qop': 0.28489071089527757, 'x y qop^2': 0.2535927965752249, 'x tx^3': 0.5018159233398294, 'x tx^2 ty': 0.9699678165589771, 'x tx^2 qop': 0.4741265130417677, 'x tx ty^2': 10.315681588678894, 'x tx ty qop': -0.22617149043686857, 'x tx qop^2': 0.00898570789717606, 'x ty^3': -12.737405175272935, 'x ty^2 qop': -0.014062351992903526, 'x ty qop^2': 0.005154120346378951, 'x qop^3': -4.609067543005094e-05, 'y^4': 9.455609628616912e-09, 'y^3 tx': -2.99210479094425e-05, 'y^3 ty': -2.583154312318925e-05, 'y^3 qop': 5.980622324156491e-05, 'y^2 tx^2': -0.016833583405836638, 'y^2 tx ty': 0.02458057322196644, 'y^2 tx qop': -0.169419352054439, 'y^2 ty^2': 0.02331391517451325, 'y^2 ty qop': -0.04589466917231106, 'y^2 qop^2': -1.206224538163147, 'y tx^3': 15.19059646701743, 'y tx^2 ty': 5.490478536183617, 'y tx^2 qop': -0.25278933198832354, 'y tx ty^2': -3.577260288354769, 'y tx ty qop': 0.03161480393545275, 'y tx qop^2': 0.005952281392129449, 'y ty^3': -6.821531531863169, 'y ty^2 qop': 0.09776598757839021, 'y ty qop^2': 0.0023614626852912395, 'y qop^3': -1.973415862163393e-05, 'tx^4': -0.05310859403428924, 'tx^3 ty': 0.023505514315239354, 'tx^3 qop': 0.0021762610547612377, 'tx^2 ty^2': 0.04763359558524625, 'tx^2 ty qop': -0.0009428124122745564, 'tx^2 qop^2': 1.2893218326397415e-05, 'tx ty^3': -0.018754843662608302, 'tx ty^2 qop': 4.8170564904883127e-05, 'tx ty qop^2': 1.6878183944633644e-05, 'tx qop^3': -4.12730477319448e-08, 'ty^4': 0.013919613173737298, 'ty^3 qop': 0.00022052138073417403, 'ty^2 qop^2': 9.713683885787424e
"r2 score= 0.01281806793978646\n",
"RMSE = 0.2644569540509028\n",
2024-01-23 16:00:16 +01:00
"\n"
]
},
2024-01-22 16:03:16 +01:00
{
"data": {
2024-01-26 11:34:42 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhoAAAHLCAYAAACOMzExAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABka0lEQVR4nO3dfXyT9b0//le5aSkUCC2KKCK9Aii3kwScczdMm3gvTtrgb9+z23OkGafnu7OvZzayidw4Calu55ztdDNFz3bmdjZJ6gTvaVBxm3PSREQKCPQq94pCGkqhtLS5fn/UxKZN0yTXlVxXktfz8cgDkivXdb1ztU3e+Xw+788nT5IkCUREREQpMEztAIiIiCh7MdEgIiKilGGiQURERCnDRIOIiIhShokGERERpQwTDSIiIkoZJhpERESUMkw0iIiIKGWYaBBlOJ/Ph7q6OrXDUFQgEEBdXR1EUVQ7FCKSiYkGZS2fzwebzQaj0Qij0ah2OIoTRREWiwVGoxFOpzOufTLhmtTV1aG0tBRWqxWBQECRY4Zet8VigV6vR01NjSLHJaKhjVA7AKJUMRgMAICamprw/1NBFEUUFxdDp9Ol7BzRCIIAl8uFvLy8uPdJ1zVJRP/rV1lZiebmZsWSAZ/Ph7K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PCL1w7iT+8ex/KvCPj6dVMH7WJIh24Zt54kzie3kjOahLtOXnvtNdx0001Rtz3xxBOwWCwoLS1FXl4edDodiouLw6s3AkBFRQWeeeaZQY/v8/nCs4Fu2rQJZrMZJpMp/KJDMw32TUYMBgO8Xi9sNhsEQYAoirDZbJzqmIiI4tbVHcRPt36At8XTuN88Ezd
2024-01-22 16:03:16 +01:00
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2024-01-23 16:00:16 +01:00
"rad_length_frac = lost[\"rad_length_frac\"]\n",
"# @ z = 9400.mm or 770.mm\n",
"state = 1\n",
"\n",
"if state == 1:\n",
" slopex = lost[\"ideal_state_770_tx\"]\n",
" slopey = lost[\"ideal_state_770_ty\"]\n",
" x = lost[\"ideal_state_770_x\"]\n",
" y = lost[\"ideal_state_770_y\"]\n",
" qop = lost[\"ideal_state_770_qop\"]\n",
"elif state == 2:\n",
" slopex = lost[\"ideal_state_9410_tx\"]\n",
" slopey = lost[\"ideal_state_9410_ty\"]\n",
" x = lost[\"ideal_state_9410_x\"]\n",
" y = lost[\"ideal_state_9410_y\"]\n",
" qop = lost[\"ideal_state_9410_qop\"]\n",
"\n",
2024-01-26 11:34:42 +01:00
"data = ak.zip(\n",
" {\n",
" \"rad_length_frac\": rad_length_frac,\n",
" \"x\": x,\n",
" \"y\": y,\n",
" \"tx\": slopex,\n",
" \"ty\": slopey,\n",
" \"qop\": qop,\n",
" }\n",
")\n",
2024-01-23 16:00:16 +01:00
"lin_reg, features, xx0_test, xx0_predicted = fit_linear_regression_model(\n",
" data,\n",
" \"rad_length_frac\",\n",
" [\"x\", \"y\", \"tx\", \"ty\", \"qop\"],\n",
" 5,\n",
" include_bias=True,\n",
")\n",
"\n",
2024-01-22 16:03:16 +01:00
"nbins = 100\n",
"vmax = 50\n",
"\n",
"a0 = plt.hist2d(\n",
" xx0_test,\n",
" xx0_predicted,\n",
" density=False,\n",
" bins=nbins,\n",
" cmap=plt.cm.jet,\n",
" cmin=1,\n",
2024-01-23 16:00:16 +01:00
" vmax=vmax * stretch_factor,\n",
" range=[[-0.1, 1.0], [-0.1, 1.0]],\n",
2024-01-22 16:03:16 +01:00
")\n",
2024-01-23 16:00:16 +01:00
"plt.plot([-0.1, 1.0], [-0.1, 1.0], marker=\"\", alpha=0.8)\n",
2024-01-22 16:03:16 +01:00
"plt.xlabel(f\"True $x/X_0$\")\n",
"plt.ylabel(f\"Predicted $x/X_0$\")\n",
2024-01-23 16:00:16 +01:00
"plt.title(f\"lost rad_length_frac\")\n",
2024-01-22 16:03:16 +01:00
"# ax1.set(xlim=(0,4000), ylim=(-1000,1000))\n",
"\n",
"plt.colorbar(a0[3])\n",
"plt.show()"
]
},
2024-01-23 16:00:16 +01:00
{
"cell_type": "code",
2024-01-26 11:34:42 +01:00
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"df = pd.DataFrame({\n",
" \"phi\": phi_found,\n",
" \"eta\": eta_found,\n",
" \"rad_length_frac\": rad_length_found\n",
"})"
]
},
{
"cell_type": "code",
"execution_count": 27,
2024-01-23 16:00:16 +01:00
"metadata": {},
"outputs": [
2024-01-26 11:34:42 +01:00
{
"ename": "RuntimeError",
"evalue": "latex was not able to process the following string:\nb'sale price $'\n\nHere is the full command invocation and its output:\n\nlatex -interaction=nonstopmode --halt-on-error --output-directory=tmpg0jlxahb 82002a6a534310632a0ec6d082310260.tex\n\nThis is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=latex)\n restricted \\write18 enabled.\nentering extended mode\n(./82002a6a534310632a0ec6d082310260.tex\nLaTeX2e <2020-02-02> patch level 5\nL3 programming layer <2020-09-24>\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/article\n.cls\nDocument Class: article 2019/12/20 v1.4l Standard LaTeX document class\n\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/size10.\nclo))\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/mathp\ntmx.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/type1cm/type\n1cm.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/cm-super/typ\ne1ec.sty\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/t1cmr.f\nd))\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/inputen\nc.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/geometry/geo\nmetry.sty\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/graphics/key\nval.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/generic/iftex/ifvt\nex.sty\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/generic/iftex/ifte\nx.sty)))\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/underscore/u\nnderscore.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/textcom\np.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/l3backend/l3\nbackend-dvips.def)\nNo file 82002a6a534310632a0ec6d082310260.aux.\n\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/ot1pt\nm.fd)\n*geometry* driver: auto-detecting\n*geometry* detected driver: dvips\n\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/ot1zt\nmcm.fd)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/omlzt\nmcm.fd)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/omszt\nmcm.fd)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/omxzt\nmcm.fd)\n! Extra }, or forgotten $.\n<recently read> }\n \nl.30 {\\rmfamily sale price $}\n %\nNo pages of output.\nTranscript written on tmpg0jlxahb/82002a6a534310632a0ec6d082310260.log.\n\n\n",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/IPython/core/formatters.py:340\u001b[0m, in \u001b[0;36mBaseFormatter.__call__\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 338\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n\u001b[1;32m 339\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 340\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mprinter\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 341\u001b[0m \u001b[38;5;66;03m# Finally look for special method names\u001b[39;00m\n\u001b[1;32m 342\u001b[0m method \u001b[38;5;241m=\u001b[39m get_real_method(obj, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprint_method)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/IPython/core/pylabtools.py:152\u001b[0m, in \u001b[0;36mprint_figure\u001b[0;34m(fig, fmt, bbox_inches, base64, **kwargs)\u001b[0m\n\u001b[1;32m 149\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mmatplotlib\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mbackend_bases\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m FigureCanvasBase\n\u001b[1;32m 150\u001b[0m FigureCanvasBase(fig)\n\u001b[0;32m--> 152\u001b[0m \u001b[43mfig\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcanvas\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mprint_figure\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbytes_io\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkw\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 153\u001b[0m data \u001b[38;5;241m=\u001b[39m bytes_io\u001b[38;5;241m.\u001b[39mgetvalue()\n\u001b[1;32m 154\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m fmt \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124msvg\u001b[39m\u001b[38;5;124m'\u001b[39m:\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/backend_bases.py:2158\u001b[0m, in \u001b[0;36mFigureCanvasBase.print_figure\u001b[0;34m(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)\u001b[0m\n\u001b[1;32m 2155\u001b[0m \u001b[38;5;66;03m# we do this instead of `self.figure.draw_without_rendering`\u001b[39;00m\n\u001b[1;32m 2156\u001b[0m \u001b[38;5;66;03m# so that we can inject the orientation\u001b[39;00m\n\u001b[1;32m 2157\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mgetattr\u001b[39m(renderer, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_draw_disabled\u001b[39m\u001b[38;5;124m\"\u001b[39m, nullcontext)():\n\u001b[0;32m-> 2158\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfigure\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2159\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m bbox_inches:\n\u001b[1;32m 2160\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m bbox_inches \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtight\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/artist.py:95\u001b[0m, in \u001b[0;36m_finalize_rasterization.<locals>.draw_wrapper\u001b[0;34m(artist, renderer, *args, **kwargs)\u001b[0m\n\u001b[1;32m 93\u001b[0m \u001b[38;5;129m@wraps\u001b[39m(draw)\n\u001b[1;32m 94\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdraw_wrapper\u001b[39m(artist, renderer, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m---> 95\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 96\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m renderer\u001b[38;5;241m.\u001b[39m_rasterizing:\n\u001b[1;32m 97\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstop_rasterizing()\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/artist.py:72\u001b[0m, in \u001b[0;36mallow_rasterization.<locals>.draw_wrapper\u001b[0;34m(artist, renderer)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 70\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstart_filter()\n\u001b[0;32m---> 72\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 74\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/figure.py:3154\u001b[0m, in \u001b[0;36mFigure.draw\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 3151\u001b[0m \u001b[38;5;66;03m# ValueError can occur when resizing a window.\u001b[39;00m\n\u001b[1;32m 3153\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpatch\u001b[38;5;241m.\u001b[39mdraw(renderer)\n\u001b[0;32m-> 3154\u001b[0m \u001b[43mmimage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_draw_list_compositing_images\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 3155\u001b[0m \u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43martists\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msuppressComposite\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3157\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m sfig \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msubfigs:\n\u001b[1;32m 3158\u001b[0m sfig\u001b[38;5;241m.\u001b[39mdraw(renderer)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/image.py:132\u001b[0m, in \u001b[0;36m_draw_list_compositing_images\u001b[0;34m(renderer, parent, artists, suppress_composite)\u001b[0m\n\u001b[1;32m 130\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m not_composite \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m has_images:\n\u001b[1;32m 131\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m a \u001b[38;5;129;01min\u001b[39;00m artists:\n\u001b[0;32m--> 132\u001b[0m \u001b[43ma\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 133\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 134\u001b[0m \u001b[38;5;66;03m# Composite any adjacent images together\u001b[39;00m\n\u001b[1;32m 135\u001b[0m image_group \u001b[38;5;241m=\u001b[39m []\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/artist.py:72\u001b[0m, in \u001b[0;36mallow_rasterization.<locals>.draw_wrapper\u001b[0;34m(artist, renderer)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 70\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstart_filter()\n\u001b[0;32m---> 72\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 74\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/axes/_base.py:3034\u001b[0m, in \u001b[0;36m_AxesBase.draw\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 3031\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m spine \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mspines\u001b[38;5;241m.\u001b[39mvalues():\n\u001b[1;32m 3032\u001b[0m artists\u001b[38;5;241m.\u001b[39mremove(spine)\n\u001b[0;32m-> 3034\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_update_title_position\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3036\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maxison:\n\u001b[1;32m 3037\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m _axis \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_axis_map\u001b[38;5;241m.\u001b[39mvalues():\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/axes/_base.py:2978\u001b[0m, in \u001b[0;36m_AxesBase._update_title_position\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 2976\u001b[0m top \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmax\u001b[39m(top, bb\u001b[38;5;241m.\u001b[39mymax)\n\u001b[1;32m 2977\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m title\u001b[38;5;241m.\u001b[39mget_text():\n\u001b[0;32m-> 2978\u001b[0m \u001b[43max\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43myaxis\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_tightbbox\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# update offsetText\u001b[39;00m\n\u001b[1;32m 2979\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ax\u001b[38;5;241m.\u001b[39myaxis\u001b[38;5;241m.\u001b[39moffsetText\u001b[38;5;241m.\u001b[39mget_text():\n\u001b[1;32m 2980\u001b[0m bb \u001b[38;5;241m=\u001b[39m ax\u001b[38;5;241m.\u001b[39myaxis\u001b[38;5;241m.\u001b[39moffsetText\u001b[38;5;241m.\u001b[39mget_tightbbox(renderer)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/axis.py:1352\u001b[0m, in \u001b[0;36mAxis.get_tightbbox\u001b[0;34m(self, renderer, for_layout_only)\u001b[0m\n\u001b[1;32m 1350\u001b[0m \u001b[38;5;66;03m# take care of label\u001b[39;00m\n\u001b[1;32m 1351\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlabel\u001b[38;5;241m.\u001b[39mget_visible():\n\u001b[0;32m-> 1352\u001b[0m bb \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlabel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_window_extent\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1353\u001b[0m \u001b[38;5;66;03m# for constrained/tight_layout, we want to ignore the label's\u001b[39;00m\n\u001b[1;32m 1354\u001b[0m \u001b[38;5;66;03m# width/height because the adjustments they make can't be improved.\u001b[39;00m\n\u001b[1;32m 1355\u001b[0m \u001b[38;5;66;03m# this code collapses the relevant direction\u001b[39;00m\n\u001b[1;32m 1356\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m for_layout_only:\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/text.py:956\u001b[0m, in \u001b[0;36mText.get_window_extent\u001b[0;34m(self, renderer, dpi)\u001b[0m\n\u001b[1;32m 951\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\n\u001b[1;32m 952\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCannot get window extent of text w/o renderer. You likely \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 953\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwant to call \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfigure.draw_without_rendering()\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m first.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 955\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m cbook\u001b[38;5;241m.\u001b[39m_setattr_cm(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfigure, dpi\u001b[38;5;241m=\u001b[39mdpi):\n\u001b[0;32m--> 956\u001b[0m bbox, info, descent \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_get_layout\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_renderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 957\u001b[0m x, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_unitless_position()\n\u001b[1;32m 958\u001b[0m x, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_transform()\u001b[38;5;241m.\u001b[39mtransform((x, y))\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/text.py:381\u001b[0m, in \u001b[0;36mText._get_layout\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 379\u001b[0m clean_line, ismath \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_preprocess_math(line)\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m clean_line:\n\u001b[0;32m--> 381\u001b[0m w, h, d \u001b[38;5;241m=\u001b[39m \u001b[43m_get_text_metrics_with_cache\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 382\u001b[0m \u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mclean_line\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fontproperties\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 383\u001b[0m \u001b[43m \u001b[49m\u001b[43mismath\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mismath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdpi\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfigure\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdpi\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 384\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 385\u001b[0m w \u001b[38;5;241m=\u001b[39m h \u001b[38;5;241m=\u001b[39m d \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/text.py:69\u001b[0m, in \u001b[0;36m_get_text_metrics_with_cache\u001b[0;34m(renderer, text, fontprop, ismath, dpi)\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Call ``renderer.get_text_width_height_descent``, caching the results.\"\"\"\u001b[39;00m\n\u001b[1;32m 67\u001b[0m \u001b[38;5;66;03m# Cached based on a copy of fontprop so that later in-place mutations of\u001b[39;00m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;66;03m# the passed-in argument do not mess up the cache.\u001b[39;00m\n\u001b[0;32m---> 69\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_get_text_metrics_with_cache_impl\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 70\u001b[0m \u001b[43m \u001b[49m\u001b[43mweakref\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mref\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtext\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfontprop\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcopy\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mismath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdpi\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/text.py:77\u001b[0m, in \u001b[0;36m_get_text_metrics_with_cache_impl\u001b[0;34m(renderer_ref, text, fontprop, ismath, dpi)\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mlru_cache(\u001b[38;5;241m4096\u001b[39m)\n\u001b[1;32m 74\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_get_text_metrics_with_cache_impl\u001b[39m(\n\u001b[1;32m 75\u001b[0m renderer_ref, text, fontprop, ismath, dpi):\n\u001b[1;32m 76\u001b[0m \u001b[38;5;66;03m# dpi is unused, but participates in cache invalidation (via the renderer).\u001b[39;00m\n\u001b[0;32m---> 77\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mrenderer_ref\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_text_width_height_descent\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtext\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfontprop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mismath\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py:213\u001b[0m, in \u001b[0;36mRendererAgg.get_text_width_height_descent\u001b[0;34m(self, s, prop, ismath)\u001b[0m\n\u001b[1;32m 211\u001b[0m _api\u001b[38;5;241m.\u001b[39mcheck_in_list([\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTeX\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mTrue\u001b[39;00m, \u001b[38;5;28;01mFalse\u001b[39;00m], ismath\u001b[38;5;241m=\u001b[39mismath)\n\u001b[1;32m 212\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ismath \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTeX\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m--> 213\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_text_width_height_descent\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mismath\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 215\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ismath:\n\u001b[1;32m 216\u001b[0m ox, oy, width, height, descent, font_image \u001b[38;5;241m=\u001b[39m \\\n\u001b[1;32m 217\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmathtext_parser\u001b[38;5;241m.\u001b[39mparse(s, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdpi, prop)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/backend_bases.py:652\u001b[0m, in \u001b[0;36mRendererBase.get_text_width_height_descent\u001b[0;34m(self, s, prop, ismath)\u001b[0m\n\u001b[1;32m 648\u001b[0m fontsize \u001b[38;5;241m=\u001b[39m prop\u001b[38;5;241m.\u001b[39mget_size_in_points()\n\u001b[1;32m 650\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ismath \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mTeX\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 651\u001b[0m \u001b[38;5;66;03m# todo: handle properties\u001b[39;00m\n\u001b[0;32m--> 652\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_texmanager\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_text_width_height_descent\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 653\u001b[0m \u001b[43m \u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfontsize\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 655\u001b[0m dpi \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpoints_to_pixels(\u001b[38;5;241m72\u001b[39m)\n\u001b[1;32m 656\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ismath:\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/texmanager.py:363\u001b[0m, in \u001b[0;36mTexManager.get_text_width_height_descent\u001b[0;34m(cls, tex, fontsize, renderer)\u001b[0m\n\u001b[1;32m 361\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m tex\u001b[38;5;241m.\u001b[39mstrip() \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 362\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m\n\u001b[0;32m--> 363\u001b[0m dvifile \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmake_dvi\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtex\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfontsize\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 364\u001b[0m dpi_fraction \u001b[38;5;241m=\u001b[39m renderer\u001b[38;5;241m.\u001b[39mpoints_to_pixels(\u001b[38;5;241m1.\u001b[39m) \u001b[38;5;28;01mif\u001b[39;00m renderer \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 365\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m dviread\u001b[38;5;241m.\u001b[39mDvi(dvifile, \u001b[38;5;241m72\u001b[39m \u001b[38;5;241m*\u001b[39m dpi_fraction) \u001b[38;5;28;01mas\u001b[39;00m dvi:\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/texmanager.py:295\u001b[0m, in \u001b[0;36mTexManager.make_dvi\u001b[0;34m(cls, tex, fontsize)\u001b[0m\n\u001b[1;32m 293\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m TemporaryDirectory(\u001b[38;5;28mdir\u001b[39m\u001b[38;5;241m=\u001b[39mcwd) \u001b[38;5;28;01mas\u001b[39;00m tmpdir:\n\u001b[1;32m 294\u001b[0m tmppath \u001b[38;5;241m=\u001b[39m Path(tmpdir)\n\u001b[0;32m--> 295\u001b[0m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_run_checked_subprocess\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 296\u001b[0m \u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mlatex\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m-interaction=nonstopmode\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m--halt-on-error\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 297\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m--output-directory=\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mtmppath\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 298\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mtexfile\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtex\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcwd\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcwd\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 299\u001b[0m (tmppath \u001b[38;5;241m/\u001b[39m Path(dvifile)\u001b[38;5;241m.\u001b[39mname)\u001b[38;5;241m.\u001b[39mreplace(dvifile)\n\u001b[1;32m 300\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m dvifile\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/texmanager.py:258\u001b[0m, in \u001b[0;36mTexManager._run_checked_subprocess\u001b[0;34m(cls, command, tex, cwd)\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\n\u001b[1;32m 255\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mFailed to process string with tex because \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mcommand[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 256\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcould not be found\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mexc\u001b[39;00m\n\u001b[1;32m 257\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m subprocess\u001b[38;5;241m.\u001b[39mCalledProcessError \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[0;32m--> 258\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\n\u001b[1;32m 259\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{prog}\u001b[39;00m\u001b[38;5;124m was not able to process the following string:\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 260\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{tex!r}\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 261\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mHere is the full command invocation and its output:\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 262\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{format_command}\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 263\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{exc}\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\n\u001b[1;32m 264\u001b[0m prog\u001b[38;5;241m=\u001b[39mcommand[\u001b[38;5;241m0\u001b[39m],\n\u001b[1;32m 265\u001b[0m format_command\u001b[38;5;241m=\u001b[39mcbook\u001b[38;5;241m.\u001b[39m_pformat_subprocess(command),\n\u001b[1;32m 266\u001b[0m tex\u001b[38;5;241m=\u001b[39mtex\u001b[38;5;241m.\u001b[39mencode(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124municode_escape\u001b[39m\u001b[38;5;124m'\u001b[39m),\n\u001b[1;32m 267\u001b[0m exc\u001b[38;5;241m=\u001b[39mexc\u001b[38;5;241m.\u001b[39moutput\u001b[38;5;241m.\u001b[39mdecode(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mutf-8\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mbackslashreplace\u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[1;32m 268\u001b[0m ) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 269\u001b[0m _log\u001b[38;5;241m.\u001b[39mdebug(report)\n\u001b[1;32m 270\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m report\n",
"\u001b[0;31mRuntimeError\u001b[0m: latex was not able to process the following string:\nb'sale price $'\n\nHere is the full command invocation and its output:\n\nlatex -interaction=nonstopmode --halt-on-error --output-directory=tmpg0jlxahb 82002a6a534310632a0ec6d082310260.tex\n\nThis is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=latex)\n restricted \\write18 enabled.\nentering extended mode\n(./82002a6a534310632a0ec6d082310260.tex\nLaTeX2e <2020-02-02> patch level 5\nL3 programming layer <2020-09-24>\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/article\n.cls\nDocument Class: article 2019/12/20 v1.4l Standard LaTeX document class\n\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/size10.\nclo))\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/mathp\ntmx.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/type1cm/type\n1cm.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/cm-super/typ\ne1ec.sty\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/t1cmr.f\nd))\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/inputen\nc.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/geometry/geo\nmetry.sty\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/graphics/key\nval.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/generic/iftex/ifvt\nex.sty\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/generic/iftex/ifte\nx.sty)))\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/underscore/u\nnderscore.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/base/textcom\np.sty)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/l3backend/l3\nbackend-dvips.def)\nNo file 82002a6a534310632a0ec6d082310260.aux.\n\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/ot1pt\nm.fd)\n*geometry* driver: auto-detecting\n*geometry* detected driver: dvips\n\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/ot1zt\nmcm.fd)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/omlzt\nmcm.fd)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/omszt\nmcm.fd)\n(/cvmfs/sft.cern.ch/lcg/external/texlive/2020/texmf-dist/tex/latex/psnfss/omxzt\nmcm.fd)\n! Extra }, or forgotten $.\n<recently read> }\n \nl.30 {\\rmfamily sale price $}\n %\nNo pages of output.\nTranscript written on tmpg0jlxahb/82002a6a534310632a0ec6d082310260.log.\n\n\n"
]
},
2024-01-23 16:00:16 +01:00
{
"data": {
"text/plain": [
2024-01-26 11:34:42 +01:00
"<Figure size 900x600 with 2 Axes>"
2024-01-23 16:00:16 +01:00
]
},
"metadata": {},
2024-01-26 11:34:42 +01:00
"output_type": "display_data"
2024-01-23 16:00:16 +01:00
}
],
"source": [
2024-01-26 11:34:42 +01:00
"fig, ax = plt.subplots(figsize=(9, 6))\n",
"\n",
"contour = sns.kdeplot(\n",
" data=df,\n",
" x=\"phi\",\n",
" y=\"eta\",\n",
" cmap=\"Greens\",\n",
" fill=True,\n",
" cbar=True,\n",
" # cbar_kws={\"label\": \"density of two variables (KDE weights)\", \"format\": \"{x:.1e}\"},\n",
")\n",
"\n",
"ax.set_title(f\"Radiation Length Fraction $x/X_0$\", size=14)\n",
"ax.set_xlabel(f\"$\\phi$ [°]\", size=10)\n",
"ax.set_ylabel(f\"$\\eta$\", size=10)\n",
"\n",
"plt.show()"
2024-01-23 16:00:16 +01:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2024-01-22 16:03:16 +01:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "tuner",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}