Projektpraktikum/B_tasks.ipynb

860 lines
1.4 MiB
Plaintext
Raw Normal View History

2023-09-22 09:21:27 +02:00
{
"cells": [
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 40,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"import uproot\n",
"import numpy as np\n",
"import sys\n",
"import os\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"from mpl_toolkits import mplot3d\n",
"import itertools\n",
"import awkward as ak\n",
"from scipy.optimize import curve_fit\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 41,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n",
"#file = uproot.open(\"tracking_losses_ntuple_Dst0ToD0EE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n",
"\n",
"\n",
"#selektiere nur elektronen von B->K*ee und nur solche mit einem momentum von ueber 5 GeV \n",
"allcolumns = file.arrays()\n",
"found = allcolumns[(allcolumns.isElectron) & (~allcolumns.lost) & (allcolumns.fromSignal) & (allcolumns.p > 5e3)] #B: 9056\n",
"lost = allcolumns[(allcolumns.isElectron) & (allcolumns.lost) & (allcolumns.fromSignal) & (allcolumns.p > 5e3)] #B: 1466\n",
"\n",
"#ak.num(found, axis=0)\n",
"#ak.count(found, axis=None)\n"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 42,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.8606728758791105"
]
},
2023-09-25 11:39:04 +02:00
"execution_count": 42,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def t_eff(found, lost):\n",
" sel = found[\"energy\"]\n",
" des = lost[\"energy\"]\n",
" return ak.count(sel,axis=None)/(ak.count(sel,axis=None)+ak.count(des,axis=None))\n",
"\n",
"t_eff(found, lost)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 43,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.96875"
]
},
2023-09-25 11:39:04 +02:00
"execution_count": 43,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#finden wir die elektronen die keine bremsstrahlung gemacht haben mit hoher effizienz?\n",
"nobrem_found = found[found[\"brem_photons_pe_length\"]==0]\n",
"nobrem_lost = lost[lost[\"brem_photons_pe_length\"]==0]\n",
"\n",
"\"\"\"\n",
"die effizienz mit der wir elektronen finden, die keine bremsstrahlung gemacht haben, ist gut mit 0.9688.\n",
"allerdings haben wir hier nur sehr wenige teilchen (<100)\n",
"\"\"\"\n",
"\n",
"t_eff(nobrem_found, nobrem_lost)\n"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 44,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.8603431839847474"
]
},
2023-09-25 11:39:04 +02:00
"execution_count": 44,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#wie viel energie relativ zur anfangsenergie verlieren die elektronen durch bremstrahlung und hat das einen einfluss darauf ob wir sie finden oder nicht?\n",
"brem_found = found[found[\"brem_photons_pe_length\"]!=0]\n",
"energy_found = ak.to_numpy(brem_found[\"energy\"])\n",
"eph_found = ak.to_numpy(ak.sum(brem_found[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
"energyloss_found = eph_found/energy_found\n",
"\n",
"\n",
"brem_lost = lost[lost[\"brem_photons_pe_length\"]!=0]\n",
"energy_lost = ak.to_numpy(brem_lost[\"energy\"])\n",
"eph_lost = ak.to_numpy(ak.sum(brem_lost[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
"energyloss_lost = eph_lost/energy_lost\n",
"\n",
"t_eff(brem_found,brem_lost)"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 45,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mean energyloss relative to initial energy (found): 0.6475128752780828\n",
"mean energyloss relative to initial energy (lost): 0.8241268441538472\n"
]
}
],
"source": [
"mean_energyloss_found = ak.mean(energyloss_found)\n",
"mean_energyloss_lost = ak.mean(energyloss_lost)\n",
"print(\"mean energyloss relative to initial energy (found): \", mean_energyloss_found)\n",
"print(\"mean energyloss relative to initial energy (lost): \", mean_energyloss_lost)"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 46,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjMAAAHMCAYAAAAgfimTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5jUlEQVR4nO3de3gU5d3/8c8m2ZwICRAIJJByDEgCQgWkgNpoRRQVfeqDWhBR8VTzE1MsJ9EarBbRqqhFEUSxT6XSiiBVVFJLAohySIIVg4BAJSg0HJNgJFmy8/uDZkvIaXcze5jk/bquXHHvnbnnu19T99OZe2dthmEYAgAAsKiQQBcAAADQFIQZAABgaYQZAABgaYQZAABgaYQZAABgaYQZAABgaYQZAABgaYQZAABgaYQZAABgaYQZAABgaYQZAABgaYQZAH6xevVq2Wy2en8WL15synGqqqqUkJCg5557zu/HBhAYYYEuAEDLkJ+fL0l69913lZCQUOv51NRUU46zbt06HT58WD//+c/9fmwAgUGYAeAX+fn5io2N1bXXXiubzeaz47z99tsaPHiwunbt6vdjAwgMLjMB8Iu8vD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0FtvvaUpU6Zo0KBBys7OVlxcnAoKClxnYaQzl5h69uypqKgoSXLrPjWNeemllzRx4kTFx8erc+fOWrZsGUEGsAjOzAAICnfddZcGDx6se+65J9ClALAY1swACArbt2/XeeedF+gyAFgQZ2YABIW4uDjt2rVLHTt2DHQpACyGMAMAACwtoJeZ1q1bp2uvvVZJSUmy2WxauXJljecNw1BWVpaSkpIUFRWl9PR07sgJAABqCGiY+f777zVgwAD94Q9/qPP5p556Ss8++6z+8Ic/aMuWLerUqZNGjhypsrIyP1cKAACCVdBcZrLZbFqxYoWuv/56SWfOyiQlJSkzM1PTp0+XJFVUVKhjx46aO3eu2594cDqd+u6779S6dWvZbDZflQ8AAExkGIbKysqUlJSkkJCGz70E7X1m9u3bp0OHDumKK65wjUVEROinP/2pNm7cWG+YqaioUEVFhevxt99+q9TUVJ/XCwAAzFdUVKQuXbo0uE3QhplDhw5JUq1PNnTs2FHffPNNvfvNmTNHs2fPrjX+6quvKjo62twiAQCAT5SXl+vOO+9U69atG902aMNMtXMvDRmG0eDlopkzZ2rKlCmux6WlpUpOTtb1119f61txveVwOJSdna2RI0fKbrebMifqRq/9gz77D732D/rsP77qdWlpqe688063logEbZjp1KmTpDNnaBITE13jxcXFDd6HIiIiQhEREbXG7Xa76X/QvpgTdaPX/kGf/Yde+wd99h+ze+3JXEF7B+Du3burU6dOys7Odo1VVlYqNzdXw4cPD2BlAAAgmAT0zMzJkyf19ddfux7v27dP27ZtU7t27fSjH/1ImZmZ+t3vfqeUlBSlpKTod7/7naKjozVu3LgAVg0AAIJJQMPM1q1bdemll7oeV691mThxopYsWaJp06bphx9+0H333afjx49r6NChWrNmjVuLgTxVVVUlh8Ph1rYOh0NhYWE6deqUqqqqTK+lObHb7QoNDQ10GQCAZiygYSY9PV0N3ebGZrMpKytLWVlZPqvBMAwdOnRIJ06c8GifTp06qaioiHvXuKFNmzbq1KkTvQIA+ETQLgD2l+ogk5CQoOjoaLfecJ1Op06ePKmYmJhGb+TTkhmGofLych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du1ks9m0bdu2gNWSnp6uzMzMgB0fANCy8dHsemRl1f+cYdhUURGpiAibbDbfHqs+H374oZYsWaKcnBz16NFD7du3b3ohAABYEGHGovbs2aPExEQNHz4
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.hist(energyloss_lost, bins=200, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=\"lost\")\n",
"plt.hist(energyloss_found, bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=\"found\")\n",
2023-09-22 10:52:24 +02:00
"plt.xticks(np.arange(0,1.1,0.1), minor=True,)\n",
2023-09-22 09:21:27 +02:00
"plt.yticks(np.arange(0,10,1), minor=True)\n",
"plt.xlabel(r\"$E_\\gamma/E_0$\")\n",
"plt.ylabel(\"counts (normed)\")\n",
"plt.title(r'$E_{ph}/E_0$')\n",
"plt.legend()\n",
"plt.grid()\n",
"\n",
"\"\"\"\n",
"found: elektronen verlieren durchschnittlich 0.65 ihrer anfangsenergie durch bremsstrahlung\n",
"lost: elektronen verlieren durchschnittlich 0.82 ihrer anfangsenergie durch bremsstrahlung\n",
"\n",
"-> wir können sofort erkennen, dass verlorene elektronen im schnitt mehr energie durch bremsstrahlung verlieren als gefundene, \n",
"aber auch die rate der gefundenen elektronen steigt für raten nahe 1, wenn auch wesentlich schwächer als für verlorene elektronen.\n",
"die meisten verlorenen elektronen verlieren >0.8 ihrer anfangsenergie.\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 47,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"#ist die shape der teilspur im scifi anders? (koenntest du zum beispiel durch vergleich der verteilungen der fit parameter studieren,\n",
"#in meiner thesis findest du das fitmodell -- ist einfach ein polynom dritten grades)\n",
"z_ref=8520 #mm\n",
"\n",
"def scifi_track(z, a, b, c, d):\n",
" return a + b*(z-z_ref) + c*(z-z_ref)**2 + d*(z-z_ref)**3\n",
"\n",
"def z_mag(xv, zv, tx, a, b):\n",
" \"\"\" optical centre of the magnet is defined as the intersection between the trajectory tangents before and after the magnet\n",
"\n",
" Args:\n",
" xv (double): velo x track\n",
" zv (double): velo z track\n",
" tx (double): velo x slope\n",
" a (double): ax parameter of track fit\n",
" b (double): bx parameter of track fit\n",
"\n",
" Returns:\n",
" double: z_mag\n",
" \"\"\"\n",
" return (xv-tx*zv-a+b*z_ref)/(b-tx)"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 48,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"scifi_found = found[found[\"scifi_hit_pos_x_length\"]>3]\n",
"scifi_lost = lost[lost[\"scifi_hit_pos_x_length\"]>3]\n",
"\n",
"scifi_x_found = scifi_found[\"scifi_hit_pos_x\"]\n",
"scifi_z_found = scifi_found[\"scifi_hit_pos_z\"]\n",
"\n",
"tx_found = scifi_found[\"velo_track_tx\"]\n",
"\n",
"scifi_x_lost = scifi_lost[\"scifi_hit_pos_x\"]\n",
"scifi_z_lost = scifi_lost[\"scifi_hit_pos_z\"]\n",
"\n",
"tx_lost = scifi_lost[\"velo_track_tx\"]\n",
"\n",
"xv_found = scifi_found[\"velo_track_x\"]\n",
"zv_found = scifi_found[\"velo_track_z\"]\n",
"\n",
"xv_lost = scifi_lost[\"velo_track_x\"]\n",
"zv_lost = scifi_lost[\"velo_track_z\"]\n",
"\n",
"\n",
"\n",
"#ak.num(scifi_found[\"energy\"], axis=0)\n",
"#scifi_found.snapshot()"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 49,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"#tx_lost.show()"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 50,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"scifi_fitpars_found = ak.ArrayBuilder()\n",
"\n",
"for i in range(0,ak.num(scifi_found[\"energy\"], axis=0)):\n",
" popt, pcov = curve_fit(scifi_track,ak.to_numpy(scifi_z_found[i,:]),ak.to_numpy(scifi_x_found[i,:]))\n",
" scifi_fitpars_found.begin_list()\n",
" scifi_fitpars_found.real(popt[0])\n",
" scifi_fitpars_found.real(popt[1])\n",
" scifi_fitpars_found.real(popt[2])\n",
" scifi_fitpars_found.real(popt[3])\n",
" scifi_fitpars_found.end_list()\n",
"\n",
"scifi_fitpars_lost = ak.ArrayBuilder()\n",
"\n",
"for i in range(0,ak.num(scifi_lost[\"energy\"], axis=0)):\n",
" popt, pcov = curve_fit(scifi_track,ak.to_numpy(scifi_z_lost[i,:]),ak.to_numpy(scifi_x_lost[i,:]))\n",
" scifi_fitpars_lost.begin_list()\n",
" scifi_fitpars_lost.real(popt[0])\n",
" scifi_fitpars_lost.real(popt[1])\n",
" scifi_fitpars_lost.real(popt[2])\n",
" scifi_fitpars_lost.real(popt[3])\n",
" scifi_fitpars_lost.end_list()\n",
"\n",
"\n",
"scifi_fitpars_lost = scifi_fitpars_lost.to_numpy()\n",
"scifi_fitpars_found = scifi_fitpars_found.to_numpy()\n",
"\n",
"\n",
"\n",
"dtx_found = scifi_fitpars_found[:,1] - tx_found\n",
"dtx_lost = scifi_fitpars_lost[:,1] - tx_lost\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 51,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABPEAAANVCAYAAAAZd2vuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAD1JklEQVR4nOzdeVyU5f7/8ffI7oYrmyuau2mGpZALZmJumelRq4Naap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CBB9SiRQtVrVpVDRo00KBBg7R3716LPvLn9dFHH+npp59WYGCgqlevrkGDBun333/X+fPn9dBDD6levXqqV6+eHnjgAV24cMGiD8MwtHjxYt10003y8fFR7dq1NWzYMP3vf/8zx4SHh+uLL77QsWPHzMfmr8cuOztbzz//vFq3bi0vLy/Vr19fDzzwgP744w+LsZo2baqBAwdq7dq16tSpk7y9vTV79uxCX7+EhAQNHjxYDRs2lLe3t2644QY9/PDDysjIKHSbvzp48KDuvPNOVa1aVfXq1VNUVJTOnz9vM3bTpk3q3bu3atasqapVq+q2227T119/bRGT/57ZtWuXhg0bptq1a6t58+aFjn/p0iU9+eSTCg4Olre3t+rUqaPOnTtr5cqVFnHfffedBg0apLp168rb21vNmzfX5MmTzT8vuHSiadOmmjFjhiTJ39/fYgmGPctp7Xmvf/DBB3riiSfUoEEDeXl56ZdfftEff/yhCRMmqG3btqpevbr8/Px0++23a+vWrVZjZGVlac6cOWrTpo28vb1Vt25d9erVS9u3by90XoZhaPr06fLw8NBbb71V5D4AAECeV77zvHxbt25V165d5ePjowYNGmjmzJm6evXqNbfLycnR1KlTFRAQoKpVq6pbt27673//azM2PT1dDz/8sBo2bChPT08FBwdr9uzZys3NNcccPXpUJpNJL7/8sp5//nkFBwfLy8tLmzdvLnQO//rXv9SlSxf5+vqqatWqatasmR588EGLmLNnz+qJJ55Qs2bN5OXlJT8/P/Xv318HDx40x/w1l4uNjTUXoJ9++mmL96o9y2ljY2P11FNPSZKCg4PNr2f+pWSKep0WLVqkHj16yM/PT9WqVdONN96ol19+WTk5OVbjbNiwQb179zbve5s2bTR37txC5yVJ//nPf1SvXj0NHDhQFy9eLDIWcAROQQDKmZkzZ+rWW2/Vo48+qhdffFG9evVSzZo1bcauW7dOw4YNk6+vr3k5YsFv3aZPn66bb75Zb7/9ts6dO6fY2FiFh4crJSVFzZo1k/RnAtCqVSuNHDlSderUUVpampYsWaJbbrlF+/fvV7169Sz6fPDBBzVgwAB98MEHunjxojw8PPTbb7+pbt26eumll1S/fn2dPn1a7733nrp06aKUlBS1atXKal69evXS8uXLdfToUT355JO699575e7uro4dO2rlypVKSUnR9OnTVaNGDS1cuNC87cMPP6zly5dr0qRJmjdvnk6fPq05c+YoLCxMe/bskb+/vxYvXqyHHnpIhw8f1rp16yzGzsvL0+DBg7V161ZNnTpVYWFhOnbsmGbNmqXw8HDt2LHD4pu9Xbt26cCBA5oxY4aCg4NVrVq1Ql+/w4cPKzQ0VOPGjZOvr6+OHj2qBQsWqFu3btq7d688PDwK3fb3339Xz5495eHhocWLF8vf318ffvihzWuwrVixQqNGjdLgwYP13nvvycPDQ2+++ab69u2rr776yuob0HvuuUcjR45UVFRUkQlIdHS0PvjgAz3//PPq1KmTLl68qH379unUqVPmmK+++kqDBg1SmzZttGDBAjVu3FhHjx7Vxo0bC+133bp1WrRokeLj47Vhwwb5+voW62wDe97rMTExCg0N1dKlS1WlShX5+fmZk/VZs2YpICBAFy5c0Lp16xQeHq6vv/7a/A+n3Nxc9evXT1u3btXkyZN1++23Kzc3V99++61SU1MVFhZmNaesrCyNGTNGX3zxhT777DPdeeeddu8PAKByIs8r33me9GdxbeTIkZo2bZrmzJmjL774Qs8//7zOnDmjN954o8htx48fr/fff19PPvmk+vTpo3379umee+6x+sI2PT1dt956q6pUqaJnn31WzZs3V3Jysp5//nkdPXpU7777rkX8woUL1bJlS82fP181a9ZUixYtbI6fnJysESNGaMSIEYqNjZW3t7eOHTumb775xhxz/vx5devWTUePHtXTTz+tLl266MKFC9qyZYvS0tLUunVrq37HjRunjh076p577tFjjz2m++67r1hnAo4bN06nT5/W66+/rrVr15qX3v51tUZhr9Phw4d13333KTg4WJ6entqzZ49eeOEFHTx4UO+88455+/j4eI0fP149e/bU0qVL5efnp59++sm8UsSWf/7znxo1apQefPBBvf7663Jzc7N7n4ASMwCUO5s3bzYkGf/6178s2mfNmmUU/LVu166d0bNnz0L7uPnmm428vDxz+9GjRw0PDw9j3LhxhY6fm5trXLhwwahWrZrx2muvmdvfffddQ5IxatSoa+5Dbm6ukZ2dbbRo0cKYMmWK1bwGDRpkET958mRDkjFp0iSL9rvvvtuoU6eO+XlycrIhyXj11Vct4o4fP274+PgYU6dONbcNGDDAaNKkidXcVq5caUgy1qxZY9H+/fffG5KMxYsXm9uaNGliuLm5GYcOHbrmPheUl5dn5OTkGMeOHTMkGZ988kmR8U8//bRhMpmM3bt3W7T36dPHkGRs3rzZMAzDuHjxolGnTh2rY3j16lWjY8eOxq233mpuy3/PPPvss3bNuX379sbdd99dZEzz5s2N5s2bG5cvXy40Jv+9cuTIEau5/PHHHxaxPXv2tPkeLuha7/UePXpcs4/c3FwjJyfH6N27tzFkyBBz+/vvv29IMt56660it5dkPProo8apU6eMbt26GQ0aNLB6vQAAKAp53v8pb3lez549beZ048ePN6pUqWIcO3as0G0PHDhgSLI
"text/plain": [
"<Figure size 1500x1000 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2, figsize=(15,10))\n",
"\n",
"ax0.hist(scifi_fitpars_found[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$a_x$ found\")\n",
"ax0.hist(scifi_fitpars_lost[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$a_x$ lost\")\n",
"ax0.set_xlabel(\"a\")\n",
"ax0.set_ylabel(\"normed\")\n",
"ax0.set_title(\"fitparameter a der scifi track\")\n",
"ax0.legend()\n",
"\n",
"ax1.hist(scifi_fitpars_found[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$b_x$ found\")\n",
"ax1.hist(scifi_fitpars_lost[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$b_x$ lost\")\n",
"ax1.set_xlabel(\"b\")\n",
"ax1.set_ylabel(\"normed\")\n",
"ax1.set_title(\"fitparameter b der scifi track\")\n",
"ax1.legend()\n",
"\n",
"ax2.hist(scifi_fitpars_found[:,2], bins=500, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$c_x$ found\")\n",
"ax2.hist(scifi_fitpars_lost[:,2], bins=500, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$c_x$ lost\")\n",
"ax2.set_xlim([-3e-5,3e-5])\n",
"ax2.set_xticks(np.arange(-3e-5,3.5e-5,1e-5),minor=False)\n",
"ax2.set_xlabel(\"c\")\n",
"ax2.set_ylabel(\"normed\")\n",
"ax2.set_title(\"fitparameter c der scifi track\")\n",
"ax2.legend()\n",
"\n",
"ax3.hist(scifi_fitpars_found[:,3], bins=500, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$d_x$ found\")\n",
"ax3.hist(scifi_fitpars_lost[:,3], bins=500, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$d_x$ lost\")\n",
"ax3.set(xlim=(-5e-8,5e-8))\n",
"ax3.text(-4e-8,3e8,\"d negligible <1e-7\")\n",
"ax3.set_xlabel(\"d\")\n",
"ax3.set_ylabel(\"normed\")\n",
"ax3.set_title(\"fitparameter d der scifi track\")\n",
"ax3.legend()\n",
"\n",
"\"\"\"\n",
"a_x: virtual hit on the reference plane\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
2023-09-25 11:05:16 +02:00
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 52,
2023-09-25 11:05:16 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found\n",
"a = -0.6718207391527037\n",
"b = 0.0013778237292529144\n",
"c = 3.3126998287416195e-08\n",
"d = -1.0330674442255529e-10\n",
"lost\n",
"a = -36.98764338200992\n",
"b = -0.015685137956233643\n",
"c = -8.265859479503501e-07\n",
"d = -1.541510766903436e-11\n"
]
}
],
"source": [
"print(\"found\")\n",
"print(\"a = \", str(np.mean(scifi_fitpars_found[:,0])))\n",
"print(\"b = \", str(np.mean(scifi_fitpars_found[:,1])))\n",
"print(\"c = \", str(np.mean(scifi_fitpars_found[:,2])))\n",
"print(\"d = \", str(np.mean(scifi_fitpars_found[:,3])))\n",
"\n",
"print(\"lost\")\n",
"print(\"a = \", str(np.mean(scifi_fitpars_lost[:,0])))\n",
"print(\"b = \", str(np.mean(scifi_fitpars_lost[:,1])))\n",
"print(\"c = \", str(np.mean(scifi_fitpars_lost[:,2])))\n",
"print(\"d = \", str(np.mean(scifi_fitpars_lost[:,3])))"
]
},
2023-09-22 09:21:27 +02:00
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 53,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-4.6785491318157854e-07"
]
},
2023-09-25 11:39:04 +02:00
"execution_count": 53,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.min(scifi_fitpars_found[:,3])"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 54,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABQEAAAIhCAYAAAD+cXzUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd5xddZ34/9e5vc5tc+/M3OkzmZZk0kkPaQRIoUeqFEHRRV1Z0dXVnwrqFxTX1XUVdVcRROnSQ0tI75OeSab3envv5fz+YBkNCRBcEYLn+Xjkj/nczznnc+7nTu573udTBFEURSQSiUQikUgkEolEIpFIJBLJx5bsw26ARCKRSCQSiUQikUgkEolEIvlgSUlAiUQikUgkEolEIpFIJBKJ5GNOSgJKJBKJRCKRSCQSiUQikUgkH3NSElAikUgkEolEIpFIJBKJRCL5mJOSgBKJRCKRSCQSiUQikUgkEsnHnJQElEgkEolEIpFIJBKJRCKR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u56rsrJSvPnmm08pA8TPf/7zp5S99dnbsmXLu57vd7/7nQiId9xxxynl999/vwiIY2NjE2VLly4Vly5dOvGzx+MRAfE73/nOaec1GAzinXfe+a7XlkgkEonk4+yt79i+vj5RFEUxEAiIWq1WXLNmzSn1BgcHRbVaLV5//fWiKIqi1+sVAfGnP/3pu55/ypQpp3wvvxe9Xn9aDPGX7bz
"text/plain": [
"<Figure size 1500x600 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(15,6))\n",
"\n",
"for i in range(0,ak.num(scifi_found[\"energy\"], axis=0)):\n",
" z_coord = np.linspace(scifi_z_found[i,0],12000,300)\n",
" fit = scifi_track(z_coord, *scifi_fitpars_found[i])\n",
" ax0.plot(z_coord, fit, \"-\", lw=0.5)\n",
" ax0.errorbar(ak.to_numpy(scifi_z_found[i,:]),ak.to_numpy(scifi_x_found[i,:]),fmt=\".\",ms=2)\n",
"\n",
"#ax0.legend()\n",
"ax0.set_xlabel(\"z [mm]\")\n",
"ax0.set_ylabel(\"x [mm]\")\n",
"ax0.set_title(\"found tracks of scifi hits\")\n",
"ax0.set(xlim=(7e3,12000), ylim=(-4000,4000))\n",
"ax0.grid()\n",
"\n",
"for i in range(0,ak.num(scifi_lost[\"energy\"], axis=0)):\n",
" z_coord = np.linspace(scifi_z_lost[i,0],12000,300)\n",
" fit = scifi_track(z_coord, *scifi_fitpars_lost[i])\n",
" ax1.plot(z_coord, fit, \"-\", lw=0.5)\n",
" ax1.errorbar(ak.to_numpy(scifi_z_lost[i,:]),ak.to_numpy(scifi_x_lost[i,:]),fmt=\".\",ms=2)\n",
"\n",
"#ax1.legend()\n",
"ax1.set_xlabel(\"z [mm]\")\n",
"ax1.set_ylabel(\"x [mm]\")\n",
"ax1.set_title(\"lost tracks of scifi hits\")\n",
"ax1.set(xlim=(7e3,12000), ylim=(-4000,4000))\n",
"ax1.grid()\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 55,
2023-09-22 09:21:27 +02:00
"metadata": {},
2023-09-25 11:39:04 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found \n",
"zmag = 5215.5640412342\n",
"lost \n",
"zmag = 5450.484726770035\n"
]
}
],
2023-09-22 09:21:27 +02:00
"source": [
"#vergleich der zmag werte\n",
"zmag_found = z_mag(xv_found, zv_found, tx_found, scifi_fitpars_found[:,0], scifi_fitpars_found[:,1])\n",
"zmag_lost = z_mag(xv_lost, zv_lost, tx_lost, scifi_fitpars_lost[:,0], scifi_fitpars_lost[:,1])\n",
"zmag_lost = zmag_lost[~np.isnan(zmag_lost)]\n",
2023-09-25 11:39:04 +02:00
"zmag_found = zmag_found[~np.isnan(zmag_found)]\n",
"\n",
"print(\"found \\nzmag = \", str(np.mean(zmag_found)))\n",
"print(\"lost \\nzmag = \", str(np.mean(zmag_lost)))"
2023-09-22 09:21:27 +02:00
]
},
{
"cell_type": "code",
2023-09-25 11:39:04 +02:00
"execution_count": 56,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAloAAAHNCAYAAADG0NWMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABUSklEQVR4nO3deVxVdf4/8NeVVRAQQTYXQE0FkUwwBMWlFNTc0lGcDLUcGyZckMZxSXPJxNRKTdChwS0n9ddXTTIy0QQ1r0sIuEDqGIYhhKCBS7J+fn84nOHKBe+9cLgsr+fjcR9xP+d9PudzPt5z77vPOedzFEIIASIiIiKqcy303QAiIiKipoqJFhEREZFMmGgRERERyYSJFhEREZFMmGgRERERyYSJFhEREZFMmGgRERERyYSJFhEREZFMmGgRERERyYSJFhEREZFMmGgRERERyY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V5eHlq3bg0AsLa2hkKhUHttha4HgrW1tTQqEhoaqjbG1dVVp7orHD58GEFBQfD398exY8fg7OxcbWybNm1gYGCAX3/9VZb6n5aTk4N27dpJ70tLS5Gfnw8bGxtYW1ujRYsWyM7OrrLe7du3AQC2trbSf9evX4/169cjMzMTsbGxWLBgAXJzc3H48GGN21MdbdpSFz744AMsW7YMW7duxZQpU6osv3jxIs6dO4f9+/dj69at8PPzw8svv4wNGzbg448/xquvvort27dj6dKluH//PhYuXAhfX1/cvn0b/fv3x7FjxzB
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.hist(zmag_found, bins=5000, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=\"found\")\n",
"plt.hist(zmag_lost, bins=300, density=True, alpha=0.5, histtype=\"bar\",color=\"darkorange\", label=\"lost\")\n",
"plt.xlabel(\"$z_{mag}$ [mm]\")\n",
"plt.ylabel(\"normed\")\n",
"plt.title(\"magnet kick position $z_{mag}$ calculated w fitparameters\")\n",
"plt.legend()\n",
"plt.xticks(np.arange(5100,5800,5), minor=True)\n",
"plt.yticks(np.arange(0,0.015,0.001), minor=True)\n",
"plt.xlim(5100,5800)\n",
"\n",
"\"\"\"\n",
"wir können einen radikalen unterschied für den z_mag wert erkennen, zwischen den found and lost elektronen.\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-09-25 10:22:31 +02:00
"execution_count": 25,
2023-09-22 09:21:27 +02:00
"metadata": {},
2023-09-25 10:22:31 +02:00
"outputs": [
{
"data": {
"text/plain": [
"{'all_endvtx_types_length': 12,\n",
" 'all_endvtx_types': [101.0,\n",
" 101.0,\n",
" 101.0,\n",
" 101.0,\n",
" 104.0,\n",
" 101.0,\n",
" 101.0,\n",
" 101.0,\n",
" 101.0,\n",
" 101.0,\n",
" 101.0,\n",
" 110.0],\n",
" 'all_endvtx_x_length': 12,\n",
" 'all_endvtx_x': [-3.31820011138916,\n",
" -3.4500999450683594,\n",
" -20.166799545288086,\n",
" -120.83049774169922,\n",
" -150.31619262695312,\n",
" -155.7082977294922,\n",
" -187.58470153808594,\n",
" -195.8394012451172,\n",
" -196.60830688476562,\n",
" -196.72889709472656,\n",
" -197.48280334472656,\n",
" -202.9868927001953],\n",
" 'all_endvtx_y_length': 12,\n",
" 'all_endvtx_y': [-4.850500106811523,\n",
" -5.047299861907959,\n",
" -29.993200302124023,\n",
" -196.2998046875,\n",
" -270.5392150878906,\n",
" -285.7712097167969,\n",
" -380.3049011230469,\n",
" -405.302490234375,\n",
" -407.66009521484375,\n",
" -408.0318908691406,\n",
" -410.36138916015625,\n",
" -434.51611328125],\n",
" 'all_endvtx_z_length': 12,\n",
" 'all_endvtx_z': [184.35940551757812,\n",
" 190.19970703125,\n",
" 929.2517700195312,\n",
" 5855.25390625,\n",
" 8055.12451171875,\n",
" 8506.958984375,\n",
" 11310.3232421875,\n",
" 12051.8232421875,\n",
" 12121.9033203125,\n",
" 12132.9287109375,\n",
" 12201.8427734375,\n",
" 12703.953125],\n",
" 'brem_photons_pe_length': 10,\n",
" 'brem_photons_pe': [1881.1756591796875,\n",
" 17914.712890625,\n",
" 479.9449768066406,\n",
" 3987.47119140625,\n",
" 4792.82421875,\n",
" 19725.302734375,\n",
" 2376.974853515625,\n",
" 6870.6201171875,\n",
" 19237.05859375,\n",
" 3409.642822265625],\n",
" 'brem_photons_px_length': 10,\n",
" 'brem_photons_px': [-42.470001220703125,\n",
" -404.0400085449219,\n",
" -10.8100004196167,\n",
" -61.459999084472656,\n",
" -56.58000183105469,\n",
" -220.60000610351562,\n",
" -26.079999923706055,\n",
" -75.06999969482422,\n",
" -210.25999450683594,\n",
" -37.400001525878906],\n",
" 'brem_photons_py_length': 10,\n",
" 'brem_photons_py': [-63.31999969482422,\n",
" -603.0599975585938,\n",
" -16.190000534057617,\n",
" -134.4499969482422,\n",
" -161.4499969482422,\n",
" -664.5800170898438,\n",
" -79.8499984741211,\n",
" -231.4499969482422,\n",
" -648.0399780273438,\n",
" -115.2300033569336],\n",
" 'brem_photons_pz_length': 10,\n",
" 'brem_photons_pz': [1879.6300048828125,\n",
" 17900.0,\n",
" 479.54998779296875,\n",
" 3984.72998046875,\n",
" 4789.77001953125,\n",
" 19712.869140625,\n",
" 2375.489990234375,\n",
" 6866.31005859375,\n",
" 19224.990234375,\n",
" 3407.489990234375],\n",
" 'brem_vtx_x_length': 10,\n",
" 'brem_vtx_x': [-3.31820011138916,\n",
" -3.4500999450683594,\n",
" -20.166799545288086,\n",
" -120.83049774169922,\n",
" -155.7082977294922,\n",
" -187.58470153808594,\n",
" -195.8394012451172,\n",
" -196.60830688476562,\n",
" -196.72889709472656,\n",
" -197.48280334472656],\n",
" 'brem_vtx_y_length': 10,\n",
" 'brem_vtx_y': [-4.850500106811523,\n",
" -5.047299861907959,\n",
" -29.993200302124023,\n",
" -196.2998046875,\n",
" -285.7712097167969,\n",
" -380.3049011230469,\n",
" -405.302490234375,\n",
" -407.66009521484375,\n",
" -408.0318908691406,\n",
" -410.36138916015625],\n",
" 'brem_vtx_z_length': 10,\n",
" 'brem_vtx_z': [184.35940551757812,\n",
" 190.19970703125,\n",
" 929.2517700195312,\n",
" 5855.25390625,\n",
" 8506.958984375,\n",
" 11310.3232421875,\n",
" 12051.8232421875,\n",
" 12121.9033203125,\n",
" 12132.9287109375,\n",
" 12201.8427734375],\n",
" 'endvtx_type': 0,\n",
" 'endvtx_x': nan,\n",
" 'endvtx_y': nan,\n",
" 'endvtx_z': nan,\n",
" 'energy': 134321.90632702777,\n",
" 'eta': 3.8988255511590677,\n",
" 'event_count': 2,\n",
" 'fromB': True,\n",
" 'fromD': False,\n",
" 'fromDecay': True,\n",
" 'fromHadInt': False,\n",
" 'fromPV': False,\n",
" 'fromPairProd': False,\n",
" 'fromSignal': True,\n",
" 'fromStrange': False,\n",
" 'isElectron': True,\n",
" 'isKaon': False,\n",
" 'isMuon': False,\n",
" 'isPion': False,\n",
" 'isProton': False,\n",
" 'lost': False,\n",
" 'lost_in_track_fit': False,\n",
" 'match_fraction': 1.0,\n",
" 'mcp_idx': 5524,\n",
" 'mother_id': 511,\n",
" 'mother_key': 5479,\n",
" 'originvtx_type': 2,\n",
" 'originvtx_x': -0.0663,\n",
" 'originvtx_y': -0.0023,\n",
" 'originvtx_z': 40.3966,\n",
" 'p': 134321.90632605576,\n",
" 'phi': -2.1616595746843887,\n",
" 'pid': 11,\n",
" 'pt': 5442.019481892728,\n",
" 'px': -3031.63,\n",
" 'py': -4519.38,\n",
" 'pz': 134211.62,\n",
" 'scifi_hit_pos_x_length': 13,\n",
" 'scifi_hit_pos_x': [-147.52284240722656,\n",
" -148.3743133544922,\n",
" -149.227783203125,\n",
" -150.07235717773438,\n",
" -155.70518493652344,\n",
" -155.71279907226562,\n",
" -156.53173828125,\n",
" -157.3567352294922,\n",
" -158.170166015625,\n",
" -163.65866088867188,\n",
" -164.45834350585938,\n",
" -165.2606201171875,\n",
" -166.0580291748047],\n",
" 'scifi_hit_pos_y_length': 13,\n",
" 'scifi_hit_pos_y': [-262.7794494628906,\n",
" -265.13543701171875,\n",
" -267.5039367675781,\n",
" -269.8581237792969,\n",
" -285.7621765136719,\n",
" -285.7840270996094,\n",
" -288.1278991699219,\n",
" -290.49371337890625,\n",
" -292.84771728515625,\n",
" -308.8764343261719,\n",
" -311.22991943359375,\n",
" -313.5960998535156,\n",
" -315.9485168457031],\n",
" 'scifi_hit_pos_z_length': 13,\n",
" 'scifi_hit_pos_z': [7825.15283203125,\n",
" 7894.94482421875,\n",
" 7965.13671875,\n",
" 8034.9287109375,\n",
" 8506.689453125,\n",
" 8507.3388671875,\n",
" 8576.8623046875,\n",
" 8647.0537109375,\n",
" 8716.845703125,\n",
" 9191.9873046875,\n",
" 9261.779296875,\n",
" 9331.970703125,\n",
" 9401.7626953125],\n",
" 'track_p': 111183.03747794438,\n",
" 'track_pt': 4503.0812830108725,\n",
" 'tx': -0.022588431612702388,\n",
" 'ty': -0.03367353735838968,\n",
" 'ut_hit_pos_x_length': 4,\n",
" 'ut_hit_pos_x': [-51.275360107421875,\n",
" -52.504058837890625,\n",
" -57.51994705200195,\n",
" -58.743045806884766],\n",
" 'ut_hit_pos_y_length': 4,\n",
" 'ut_hit_pos_y': [-76.70736694335938,\n",
" -78.56417083740234,\n",
" -86.16027069091797,\n",
" -88.01727294921875],\n",
" 'ut_hit_pos_z_length': 4,\n",
" 'ut_hit_pos_z': [2313.153564453125,\n",
" 2368.153564453125,\n",
" 2593.153564453125,\n",
" 2648.153564453125],\n",
" 'velo_hit_pos_x_length': 12,\n",
" 'velo_hit_pos_x': [-2.809859037399292,\n",
" -3.374659538269043,\n",
" -3.9390575885772705,\n",
" -4.503256320953369,\n",
" -5.067859172821045,\n",
" -6.197760581970215,\n",
" -7.8953633308410645,\n",
" -10.159163475036621,\n",
" -12.452364921569824,\n",
" -13.584664344787598,\n",
" -14.716963768005371,\n",
" -15.848661422729492],\n",
" 'velo_hit_pos_y_length': 12,\n",
" 'velo_hit_pos_y': [-4.092668056488037,\n",
" -4.934769153594971,\n",
" -5.776969909667969,\n",
" -6.6197710037231445,\n",
" -7.463074207305908,\n",
" -9.150375366210938,\n",
" -11.682275772094727,\n",
" -15.058876037597656,\n",
" -18.47857666015625,\n",
" -20.166975021362305,\n",
" -21.85477638244629,\n",
" -23.543376922607422],\n",
" 'velo_hit_pos_z_length': 12,\n",
" 'velo_hit_pos_z': [161.85899353027344,\n",
" 186.85899353027344,\n",
" 211.85899353027344,\n",
" 236.85899353027344,\n",
" 261.8590087890625,\n",
" 311.8590087890625,\n",
" 386.8590087890625,\n",
" 486.8590087890625,\n",
" 588.1409912109375,\n",
" 638.1409912109375,\n",
" 688.1409912109375,\n",
" 738.1409912109375],\n",
" 'velo_track_idx': 90,\n",
" 'velo_track_tx': -0.022649554535746574,\n",
" 'velo_track_ty': -0.033734168857336044,\n",
" 'velo_track_x': -16.569623947143555,\n",
" 'velo_track_y': -24.62316131591797,\n",
" 'velo_track_z': 770.0}"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n"
]
2023-09-22 09:21:27 +02:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "env1",
"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.11.5"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}