Projektpraktikum/electron_lost_found.ipynb

404 lines
311 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 16,
"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",
2023-09-14 16:33:27 +02:00
"import seaborn as sns\n",
"from scipy.optimize import curve_fit\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
2023-09-18 12:12:50 +02:00
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
2023-09-14 16:33:27 +02:00
"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",
2023-09-14 16:33:27 +02:00
"#look at particles only from Signal\n",
"allcolumns = file.arrays()\n",
2023-09-14 16:33:27 +02:00
"tracked = allcolumns[(allcolumns.isElectron) & (~allcolumns.lost) & (allcolumns.fromSignal)]\n",
"lost = allcolumns[(allcolumns.isElectron) & (allcolumns.lost) & (allcolumns.fromSignal)] \n",
"\n",
"#ak.num(tracked, axis=0)\n",
"\n"
]
},
{
"cell_type": "code",
2023-09-18 12:12:50 +02:00
"execution_count": 4,
"metadata": {},
2023-09-15 12:33:25 +02:00
"outputs": [],
2023-09-14 16:33:27 +02:00
"source": [
"#lost\n",
"l_eph = lost[\"brem_photons_pe\"]\n",
"ak.nan_to_num(l_eph)\n",
"l_pT = lost[\"pt\"]\n",
"l_sci_x = lost[\"scifi_hit_pos_x\"]\n",
"ak.nan_to_num(l_sci_x)\n",
"\n",
"#found\n",
"f_eph = tracked[\"brem_photons_pe\"]\n",
"ak.nan_to_num(f_eph)\n",
"f_pT = tracked[\"pt\"]\n",
"f_sci_x = tracked[\"scifi_hit_pos_x\"]\n",
2023-09-15 12:33:25 +02:00
"ak.nan_to_num(f_sci_x)\n",
"\n",
"l_sci_x, l_pT = ak.broadcast_arrays(l_sci_x, l_pT)\n",
"f_sci_x, f_pT = ak.broadcast_arrays(f_sci_x, f_pT)\n",
"\n",
"l_sci_x = ak.to_numpy(ak.flatten(l_sci_x))\n",
"l_pT = ak.to_numpy(ak.flatten(l_pT))\n",
"f_sci_x = ak.to_numpy(ak.flatten(f_sci_x))\n",
"f_pT = ak.to_numpy(ak.flatten(f_pT))"
2023-09-14 16:33:27 +02:00
]
},
{
"cell_type": "code",
2023-09-18 12:12:50 +02:00
"execution_count": 5,
2023-09-14 16:33:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-09-15 12:33:25 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABlAAAAIhCAYAAAAxRfejAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzde3wU1f3/8fcSciOEJSEkIRgCWohgABGVmy0gmEAJiFappkawNvAVhSJQL7VqsAWqXMSGipb6BeQitl+FctEYLorlS7iIRo1Q1P4QghKgEMJFSEJyfn/wzcgmu8ku2SVLeD0fj3k8smc/e/bMmdnJnDlz5tiMMUYAAAAAAAAAAACwNKrvAgAAAAAAAAAAAPgbOlAAAAAAAAAAAACqoAMFAAAAAAAAAACgCjpQAAAAAAAAAAAAqqADBQAAAAAAAAAAoAo6UAAAAAAAAAAAAKqgAwUAAAAAAAAAAKAKOlAAAAAAAAAAAACqoAMFAAAAAAAAAACgiiumA2XhwoWy2Wz65ptvfJL/yy+/rIULF3o931GjRqlt27Zez7fSO++8o8zMTJ/lfzmy2WwOdbJr1y5lZmY63Xd8vX3q4oMPPpDNZtMHH3zgtTxd7eeV3/U///M/XvsuX3JVN1lZWfrRj36koKAg2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mvNtGnTrLyrlvvCOpJkHn74YTNv3jxz7bXXmsDAQDNv3jxjjDH//Oc/za233mqaNm1qQkNDTa9evcyaNWuc1vnGjRvNf/3Xf5kWLVqYyMhIc8cdd5hvv/22xvqpLF9YWJjJz883t956q2nSpImJiooyDz/8sDl9+rRD7JkzZ8wTTzxh2rZtawIDA01cXJwZO3asKSoqcojbsGGD6du3r4mMjDQhISEmPj7e3HnnnQ75STLPPvuswzpUXRYsWOBy+7hbloSEBDNkyBDz7rvvmm7dupmQkBCTmJhoXnvtNYe406dPm0mTJpm2bdta+2n37t3NsmXLaqy/999/30gy77//frU6/eqrr8zgwYNNWFiYueqqq8zEiRPN2bNna8yvpv288ruWLVtmfvvb35pWrVqZ8PBwM2DAAPOvf/2rWl7r1q0zt956qwkPDzehoaGmd+/eZv369TV+vzHGlJeXm9///vemQ4cOJiQkxNjtdtO5c2czZ84ch7jdu3ebe+65x0RHR5ugoCATHx9v0tPTrXWsWjd9+/attm4jR4606qy237OruMrf0Ouvv26uvfZaExoaarp06WJWr15da36VZXz99dfNxIkTTVxcnLHZbGb37t3GGPfrcOXKlaZz584mKCjItGvXzsyZM8c8++yzpurhf+7cuebHP/6xadmypWnSpIlJSkoyzz//vCktLXWI69u3r7nuuuvMpk2bTK9evUxoaKj5+c9/bowx5ttvvzV33323adq0qWnWrJkZMWKEyc3NdfjNOFPb78wY947VnuZbuS7bt283t9xyiwkNDTXt2rUz06dPN+Xl5Q55FRcXW7/Dyt/1r3/9a3Pq1CmHuISEBGvfMab27XihvXv3Oi1vZX6V223nzp3mZz/7mWnevLmJjY01xhizY8cO8/Of/9wkJCSYkJAQk5CQYO655x7zzTffOK0Td47LNR0vS0tLTcuWLc19991XbT2KiopMSEiIefTRRz2uv5r+77z88sumS5cuJiwszDRt2tQkJiaaJ5980uHzBw8eNKNHjzatW7c2gYGBpm3btiYzM9OUlZVVK2dVlcfk1atXm+uvv96EhISYa6+91vq9LliwwFx77bWmSZMm5qabbjI7duyolsc//vEP07N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3YEybdo0I8nce++9Zu3ateb11183V199tbHb7ebLL7+04hITE82PfvQ
2023-09-14 16:33:27 +02:00
"text/plain": [
2023-09-15 12:33:25 +02:00
"<Figure size 2000x600 with 4 Axes>"
2023-09-14 16:33:27 +02:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
2023-09-15 12:33:25 +02:00
"ax0.hist2d(l_sci_x, l_pT, bins=100, cmap=plt.cm.jet)\n",
2023-09-14 16:33:27 +02:00
"ax0.set_xlabel(\"scifi x\")\n",
"ax0.set_ylabel(r\"$p_T$\")\n",
"ax0.set_title(\"lost electron positions in the scifi in regard to their transverse momentum\")\n",
2023-09-15 12:33:25 +02:00
"pcm0 = ax0.pcolormesh([l_sci_x,l_pT])\n",
"plt.colorbar(pcm0,ax=ax0)\n",
2023-09-14 16:33:27 +02:00
"\n",
2023-09-15 12:33:25 +02:00
"ax1.hist2d(f_sci_x, f_pT, bins=100, cmap=plt.cm.jet)\n",
2023-09-14 16:33:27 +02:00
"ax1.set_xlabel(\"scifi x\")\n",
"ax1.set_ylabel(r\"$p_T$\")\n",
"ax1.set_title(\"found electron positions in the scifi in regard to their transverse momentum\")\n",
2023-09-15 12:33:25 +02:00
"pcm1 = ax1.pcolormesh([f_sci_x,f_pT])\n",
"plt.colorbar(pcm1,ax=ax1)\n",
2023-09-14 16:33:27 +02:00
"\n",
2023-09-15 12:33:25 +02:00
"\"\"\"\n",
2023-09-18 12:12:50 +02:00
"B:\n",
2023-09-15 12:33:25 +02:00
"we can see that the lost electrons cover a wider spread in the x direction of the scifi tracker,\n",
"while most of those have low pT \n",
2023-09-18 12:12:50 +02:00
"\n",
2023-09-15 12:33:25 +02:00
"\"\"\"\n",
2023-09-14 16:33:27 +02:00
"plt.show()"
]
},
{
"cell_type": "code",
2023-09-18 12:12:50 +02:00
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 6,
2023-09-15 12:33:25 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[4.09e+04], [8.66e+03], [8.07e+04], ..., [5.63e+03], [6.29e+03], [2.26e+03]]\n",
"[4.62e+04, 9.36e+03, 1.34e+05, 5.63e+04, ..., 2.01e+04, 6.94e+03, 7.83e+03]\n",
"8657.132\n",
"9355.866625028413\n"
]
}
],
"source": [
"energy_found = tracked[\"energy\"]\n",
"energy_found = energy_found[tracked[\"brem_photons_pe_length\"]!=0]\n",
"#ak.nan_to_num(energy_found)\n",
"\n",
"e_ph_found = tracked[\"brem_photons_pe\"]\n",
"e_ph_found = e_ph_found[tracked[\"brem_photons_pe_length\"]!=0]\n",
"#ak.nan_to_num(e_ph_found, nan=[0])\n",
"e_ph_found = ak.sum(e_ph_found, axis=-1, keepdims=True)\n",
"print(e_ph_found)\n",
"print(energy_found)\n",
"\n",
"energy_lost = lost[\"energy\"]\n",
"energy_lost = energy_lost[lost[\"brem_photons_pe_length\"]!=0]\n",
"#ak.nan_to_num(energy_lost)\n",
"\n",
"e_ph_lost = lost[\"brem_photons_pe\"]\n",
"e_ph_lost = e_ph_lost[lost[\"brem_photons_pe_length\"]!=0]\n",
"#ak.nan_to_num(e_ph_lost)\n",
"e_ph_lost = ak.sum(e_ph_lost, axis=-1,keepdims=True)\n",
"\n",
"#e_ph_found, energy_found = ak.broadcast_arrays(e_ph_found, energy_found)\n",
"#e_ph_lost, energy_lost = ak.broadcast_arrays(e_ph_lost, energy_lost)\n",
"\n",
"e_ph_found = ak.to_numpy(ak.flatten(e_ph_found))\n",
"energy_found = ak.to_numpy(energy_found)\n",
"\n",
"e_ph_lost = ak.to_numpy(ak.flatten(e_ph_lost))\n",
"energy_lost = ak.to_numpy(energy_lost)\n",
"\n",
"print(e_ph_found[1])\n",
"print(energy_found[1])"
]
},
{
"cell_type": "code",
2023-09-18 12:12:50 +02:00
"execution_count": 7,
"metadata": {},
"outputs": [],
2023-09-15 12:33:25 +02:00
"source": [
"q_e_found = e_ph_found/energy_found\n",
"q_e_lost = e_ph_lost/energy_lost"
]
},
2023-09-14 16:33:27 +02:00
{
"cell_type": "code",
"execution_count": 8,
2023-09-14 16:33:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-09-18 12:12:50 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAHMCAYAAAD7xYOxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA13ElEQVR4nO3de3gU5d3/8c/mnBCygUhCgJRjAiRBVKI0QS1aEUFFW+sRMSqiVioglpNHsPoEaz2gj6BSBPpDhBYBqSIHlSAHEUiCiqAgoAQNBhCSQGqAZH5/WPZxSYDsZHdnNvt+Xdde7czO3POdudLuh/u+Z8ZhGIYhAAAAGwqxugAAAIBTIagAAADbIqgAAADbIqgAAADbIqgAAADbIqgAAADbIqgAAADbIqgAAADbIqgAAADbIqgAAADbIqgAAADbIqgAaLDFixfL4XCc8jNt2jSvHKe6ulqJiYl6/vnn/X5sANYIs7oAAIGvsLBQkvT2228rMTGx1vfp6eleOc5HH32kffv26fe//73fjw3AGgQVAA1WWFiouLg4XX311XI4HD47zrx585SVlaW2bdv6/dgArMHQD4AGKygoUPfu3X0aFAzD0IIFC3Tdddf5/dgArENQAdAgBw4c0O7du9WtWzcdP3681scwDK8cZ+3atSopKXELKv46NgDrEFQANMiJOSKTJ09WeHh4rc+WLVvO2IZhGIqLi9P+/ftPuc28efPUrVs3paamenzsffv26corr1STJk2Ulpam5cuXN+SUAfgRc1QANEhBQYEkaf78+UpJSan1fX0ms27fvl0tWrTQWWeddcpt5s+frzvvvNPUsYcOHaqWLVtq3759ev/993XDDTfo66+/VkJCwhlrA2AtggqABiksLFRUVJQGDBig0NDQU2736quv6l//+pfCw8P1ySefqFWrVvrnP/+p9PR0FRYW6pxzztE999yjuXPnqlWrVlq0aJE6deokSVq/fr12795da35KfY59+PBhLVy4UDt27FBMTIwGDBig7t276+23364VfADYD0M/ABqksLBQmZmZpw0pkrR582Zt2LBBI0aM0A8//KCePXvqkUcekSQVFRVp48aNuuOOO/Tjjz/qvPPO09SpU137vvXWW0pLS1NmZqbHx96+fbtiY2Pdely6deumL774wszpAvAzggoA08rKyrRz50517979jNtu3rxZjzzyiPr27avw8HANHDhQ27Ztk/RzUJkwYYJ+/etfKyQkRB07dnSbCPvWW2/V6k2p77EPHz6suLg4t3VxcXE6fPhwfU8TgIUY+gFgWmFhoQzDUJMmTbRu3bpa37du3drVk/HFF1+4PSW2tLTUNSelqKhIs2bNcn33xRdfqH///pKkTZs2aceOHXUO+9Tn2LGxsSovL3f7rry8XLGxsSbPGoA/0aMCwLQTd928+OKLys7OrvVZtmyZpJ9Dyb59+9yeHLtgwQL169dPxcXFCgsLc/vus88+09lnny3p596Utm3bqkePHqaOnZqaqsOHD2vPnj2ufTdv3qyMjAwfXBEA3uYweNAAAB/74IMP1LdvX73yyivKzc3VP/7xD/3lL3/Rp59+qpUrV+rll1/W0qVLJUmVlZWKj49XWVmZoqOjlZ6ern79+unZZ581ffzrr79eTqdTL730kj744AMNGjRI27dvP+1dRgDsgaEfAD63efNm3XnnnZozZ45GjhypHj16aPny5XI6nSoqKnL1nkg/D/t07NhR0dHRklSv57CcyeTJk5Wbm6uEhAS1bt1ac+fOJaQAAYIeFQA+N2TIEGVlZemee+6xuhQAAYY5KgB8bvPmzerSpYvVZQAIQPSoAPA5p9Opbdu2KSkpyepSAAQYggoAALAthn4AAIBtWRpUjh8/rkceeUTt27dXdHS0OnTooCeeeEI1NTVWlgUAAGzC0tuTn376ab3yyiuaOXOmMjIyXO/6cDqdGj58+Bn3r6mp0ffff6+mTZvK4XD4oWIAANBQhmGooqJCrVq1UkjI6ftMLA0qH3/8sa655hpdeeWVkqR27drpzTff1MaNG+u1//fff1/nq90BAID9F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ABeR1CxsVO9hskwDNeD1u666y7t3LlTgwYN0ueff66srCy99NJL/iwTAACfIajYWHp6uo4fP65PPvnEte7AgQPatm2bunbt6lqXkpKie++9V/Pnz9eDDz6oqVOnSpLrDdTV1dX+LRwAAC8hqNhYamqqrrnmGg0ZMkSrV6/Wp59+qltvvVWtW7fWNddcI0kaMWKEli5dql27dqmwsFAffvihK8S0bdtWDodD77zzjvbt26fDhw9beToAAHgsOCfT2nBW86lMnz5dw4cP11VXXaWjR4/q4osv1uLFixUeHi7p596SoUOHas+ePYqLi9MVV1yh559/XpLUunVrTZgwQWPHjtUdd9yh2267TTNmzLDwbAAA8IzDONVEiABQXl4up9OpsrIyxcXFuX33008/adeuXWrfvr2ioqIsqrDx4zoDQACz6Pbk0/1+n4yhHwAAYFsEFQAAYFsEFQAAYFsEFQAAYFsEFQAAYFsEFQAAYFsEFQAAYFsEFQAAYFsEFQAAYFsEFRsyDEN33323mjdvLofDoU2bNllWS+/evTVixAjLjg8ACG5B+a6f8ePtfawlS5ZoxowZys/PV4cOHXTWWWd5vS4AAAJBUAYVu9uxY4eSk5OVk5NjdSkAgMbi5Pf6BAiGfmzm9ttv1/3336/du3fL4XCoXbt2qqqq0rBhw5SYmKioqChdeOGF2rBhg2ufGTNmKD4+3q2dhQsXyuFwuJbHjx+vc845R//v//0/tWvXTk6nUzfddJMqKipc2xw5ckS33XabYmNjlZycrGeffdbn5wsAwOkQVGxm0qRJeuKJJ9SmTRuVlJRow4YNGj16tN566y3NnDlThYWF6tSpk/r27asff/zRo7Z37NihhQsX6p133tE777y
2023-09-14 16:33:27 +02:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
2023-09-15 12:33:25 +02:00
}
],
"source": [
2023-09-18 12:12:50 +02:00
"plt.hist(q_e_lost, bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=\"lost\")\n",
"plt.hist(q_e_found, bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=\"found\")\n",
2023-09-15 12:33:25 +02:00
"plt.xlabel(r\"$E_\\gamma/E_0$\")\n",
2023-09-18 12:12:50 +02:00
"plt.ylabel(\"counts (normed)\")\n",
"plt.title(r'$E_{ph}/E_0$')\n",
2023-09-15 12:33:25 +02:00
"plt.legend()\n",
"\n",
"\"\"\"\n",
2023-09-18 12:12:50 +02:00
"B:\n",
"we can clearly see that lost electrons are responsible for higher energy photons\n",
2023-09-15 12:33:25 +02:00
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 9,
2023-09-15 12:33:25 +02:00
"metadata": {},
"outputs": [
2023-09-14 16:33:27 +02:00
{
"data": {
2023-09-18 12:12:50 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABmMAAAIlCAYAAAApEIyOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAD5rUlEQVR4nOzdf1xUVf4/8NfIj+GHMIEKOC4KtUYaWIaFSLtoKliin35akiTVohuuLoFbW+0quon5C90v9jtL80dUW7qpRaCVrisgS7or6mpt/iJBXEVQU0A43z9crjPMDDN3uPOT1/PxmEfjnfc959wzd6Y53Ps+RyWEECAiIiIiIiIiIiIiIiKb6OHoBhAREREREREREREREbkzXowhIiIiIiIiIiIiIiKyIV6MISIiIiIiIiIiIiIisiFejCEiIiIiIiIiIiIiIrIhXowhIiIiIiIiIiIiIiKyIV6MISIiIiIiIiIiIiIisiFejCEiIiIiIiIiIiIiIrIhXowhIiIiIiIiIiIiIiKyIV6MISIiIiIiIiIiIiIisiFejKFu6cMPP8Stt94KX19fqFQq7Nu3z9FNMio3NxcqlUqx8lavXg2VSoVjx44pVqaugwcPIjc312blk2tSqVTIzc21Sdk//fQTcnNz8c033yhednp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4u1a9eKHTt2iE8++UTk5ORIvyO//fZbceONN4qhQ4dKv5u+/fbbTtuTkZEhvLy8RE5OjigqKhIbNmw
2023-09-14 16:33:27 +02:00
"text/plain": [
2023-09-15 12:33:25 +02:00
"<Figure size 2000x600 with 4 Axes>"
2023-09-14 16:33:27 +02:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-09-15 12:33:25 +02:00
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
2023-09-18 12:12:50 +02:00
"ax0.hist2d(e_ph_found, energy_found, density=True, bins=200, cmap=plt.cm.jet, range=[[0,100000],[0,100000]])\n",
2023-09-15 12:33:25 +02:00
"ax0.set_xlabel(r\"$E_\\gamma$\")\n",
"ax0.set_ylabel(r\"$E_e$\")\n",
"ax0.set_title(\"found electron energy against photon energy\")\n",
"pcm0 = ax0.pcolormesh([e_ph_found, energy_found])\n",
"plt.colorbar(pcm0,ax=ax0)\n",
"\n",
2023-09-18 12:12:50 +02:00
"ax1.hist2d(e_ph_lost, energy_lost, density=True, bins=200, cmap=plt.cm.jet, range=[[0,100000],[0,100000]])\n",
2023-09-15 12:33:25 +02:00
"ax1.set_xlabel(r\"$E_\\gamma$\")\n",
"ax1.set_ylabel(r\"$E_e$\")\n",
"ax1.set_title(\"lost electron energy against photon energy\")\n",
"pcm1 = ax1.pcolormesh([e_ph_lost, energy_lost])\n",
"plt.colorbar(pcm1,ax=ax1)\n",
"\n",
"\"\"\"\n",
2023-09-18 12:12:50 +02:00
"B:\n",
"concentrated at the E_ph/E_0~1 line especially at lower energies.\n",
"lost E_ph to E_0: fewer entries at lower q_e\n",
2023-09-15 12:33:25 +02:00
"\"\"\"\n",
2023-09-14 16:33:27 +02:00
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [],
2023-09-18 12:12:50 +02:00
"source": [
"brem_vtx_x_found = tracked[\"brem_vtx_x\"]\n",
"brem_vtx_x_found = brem_vtx_x_found[tracked[\"brem_vtx_x_length\"]!=0]\n",
"vtx_x_fit = brem_vtx_x_found[1]\n",
2023-09-18 12:12:50 +02:00
"brem_vtx_x_found = ak.to_numpy(ak.flatten(brem_vtx_x_found))\n",
"\n",
"brem_vtx_z_found = tracked[\"brem_vtx_z\"]\n",
"brem_vtx_z_found = brem_vtx_z_found[tracked[\"brem_vtx_z_length\"]!=0]\n",
"vtx_z_fit = brem_vtx_z_found[1]\n",
2023-09-18 12:12:50 +02:00
"brem_vtx_z_found = ak.to_numpy(ak.flatten(brem_vtx_z_found))\n",
"\n",
"brem_vtx_x_lost = lost[\"brem_vtx_x\"]\n",
"brem_vtx_x_lost = brem_vtx_x_lost[lost[\"brem_vtx_x_length\"]!=0]\n",
"brem_vtx_x_lost = ak.to_numpy(ak.flatten(brem_vtx_x_lost))\n",
"\n",
"brem_vtx_z_lost = lost[\"brem_vtx_z\"]\n",
"brem_vtx_z_lost = brem_vtx_z_lost[lost[\"brem_vtx_z_length\"]!=0]\n",
"brem_vtx_z_lost = ak.to_numpy(ak.flatten(brem_vtx_z_lost))\n",
"\n",
"vtx_x_fit= ak.to_numpy(vtx_x_fit)\n",
"vtx_z_fit = ak.to_numpy(vtx_z_fit)"
2023-09-18 12:12:50 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
2023-09-18 12:12:50 +02:00
"metadata": {},
"outputs": [],
"source": []
2023-09-18 12:12:50 +02:00
},
{
"cell_type": "code",
"execution_count": 14,
2023-09-18 12:12:50 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABkAAAAIlCAYAAACNejRdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADch0lEQVR4nOzdf3wV5Z33//cxCSHQcCRgEiKxsi26VtB6Y0XQe8HyS1akLe5iS8tKS5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jRoxQIpFQIpHQr371K8dw79/97nf6whe+oLKyMhUWFuqcc87R3/3d36mlpcVXm9555x3ddNNNqqysVGFhoc466yxdccUV2r59u+sxAgAAAJxku1/VXTvc+lRu18TdXa+7yUZ/yFxPWH2iqPSHJPspsMLqD0n0iQDEExEgAAKprq7WP//zP2vevHmqqqpSc3Ozbr/9dk2aNEmvvvqqPvKRjzg+t7a2NtA2v/3tb+uyyy7TzTffrFWrVumqq67SoEGDtGPHDk2ZMkUXXXSRNmzYoMLCQt1999269tpr9cgjj+j6668PuJfSddddp+uvv17z58/Xyy+/rFtvvVWS9H/+z/9Jl/nFL36hz3zmMxo3bpw2b96s9vZ2rVmzRkeOHPG1rc997nOaPXu2vva1r+mVV17Rt7/9bb366qt6/vnnVVBQkC43a9Ysff7zn9fXvvY1ffDBB5KkV199VePHj9c555yjH/7whyovL9dTTz2lxYsX689//rNuu+02y7Zmz56tL33pS1qwYIG2bdumNWvW6MSJE9q+fbsWLlyoZcuWadOmTfrGN76hj3/845o1a5Zju2fMmKHS0lI98MADmjRpkuWx2tpa/a//9b900UUXBWpn530dM2aM3nvvPdXU1Oixxx5Lh3Z/4hOfsJ3n9r//+7915ZVXaujQofrud7+rkSNH6vDhw3ryySfV2tqqwsJCz22aO3euXnrpJa1cuVLnnXee3n//fb300kt69913Pb7CAAAAgFUu+lV2vPap3K6Jv/rVrzper7vJZn9ICq9PFJX+kJ0w+0MSfSIAMWUAgE9btmwxJBlr1qyxrH/99dcNScbGjRu7POfqq682Bg4caPuzcuVKz9v+5S9/aUgy/uM//iO97vLLLzdKS0uNo0ePpte1tbUZo0aNMoYPH26cPHkyvf6GG24wPvrRj3ap97bbbjPMb4mpvzvv48KFC43+/ftb6hw7dqxRUVFhNDc3p9c1NTUZJSUlhpe32dS2/vEf/9Gy/uGHH7Ycz1S573znO13qmDZtmjF8+HCjsbHRsv6WW24x+vfvb7z33nuWOn74wx9ayn3yk580JBmPPfZYet2JEyeMs846y5g1a5brPixZssQoKioy3n///f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Xl5evvttx3L+GnT0KFDtW7dOq1bt05vvfWWnnzySX3zm99UfX29tm7dGridAAAA6Hui1K/y06fK5DUx/aFo94ck+kQA4okbIAB8SY1eSSQSuvTSS3PcGmngwIEaO3asHnvsMf3gBz9QUVGRJOnkyZPauHGjhg8frvPOOy9d/txzz1V9fb2OHDmisrIySVJra6ueeuqpwNu/7LLL9Nhjj+n73/9+erTQ0aNHtWXLFl91PfzwwxozZkz67//7f/+v2traNHHixG6fN2DAAF111VX6zW9+o4suukj9+vXzvR9h+MIXvqAlS5aotrZW//M//6Ozzz5bU6dODb2dnaNwnBQVFWnChAn6j//4D61cudJyI6ynbTrnnHN0yy236Be/+IX+67/+y/9OAAAAoE+LUr/Kb58qxema2Ov1emf0h7yJQn9Iok8EID64AQLAl4997GO66qqr9E//9E86duyYxo4dK8MwdPjwYf3yl7/UDTfc4Hq
"text/plain": [
"<Figure size 2000x600 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
"a0 = ax0.hist2d(brem_vtx_z_found, brem_vtx_x_found, density=False, bins=200, cmap=plt.cm.jet, cmin=1)\n",
"ax0.set_xlabel(\"z\")\n",
"ax0.set_ylabel(\"x\")\n",
"ax0.set_title(r\"$e^\\pm$ found brem vertices\")\n",
"\n",
"plt.colorbar(a0[3],ax=ax0)\n",
"\n",
"a1 = ax1.hist2d(brem_vtx_z_lost, brem_vtx_x_lost, density=False, bins=200, cmap=plt.cm.jet, cmin=1)\n",
"ax1.set_xlabel(\"z\")\n",
"ax1.set_ylabel(\"x\")\n",
"ax1.set_title(r\"$e^\\pm$ lost brem vertices\")\n",
"\n",
"plt.colorbar(a1[3], ax=ax1)\n",
"\n",
"\"\"\"\n",
"B:\n",
"vertices of lost e photons are slightly more concentrated around the beampipe, since electrons interact more with matter of the setup there\n",
"\"\"\"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count":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2iVP8/f3F61atXrgPIUQonHjxkKSJBETE6M1vXfv3sLKykrk5OQIIf73e3nmmWe06nJycoStra0YMGCA1vTi4mLRtm1b0aFDB3la2e/w008/1apt166dACC2bNkiTyssLBQODg7ixRdfrLT/W7duCaVSKWbNmqU1ffDgwcLJyUkUFhYKIYT48ccfBQCxefNmrbqoqCgBQKxcuVJrmygUCnH+/Plyy7vfZ6hs++zdu1ee5u3tLby9vUVubu59+w8ICBCNGjUSGo1Ga/qECROEqampSE9PF0IIERgYKNq1a3ff+VQGgBg/frzWtPt95s+ePSsAiHHjxmlNP3LkiACgtZ39/f0FAHHs2DF5WlpamlAoFMLMzExcv35dnh4TEyMAiOXLl1faa1XWs6z3uLi4cr0cOXJEq7Zly5YiICBAfv7OO+8ISZLE6dOnteoCAgLK/f6GDRsmGjduLD+PjIys8PObkJAgzMzMxPTp0yvtu0GDBmLy5MmV1ty7zN9++00AEKtWrdKqW7BggQAgPvroI3la2d+vRYsWadWOGzdOmJqaipKSkgqXWVxcLAoLC8V3330nFAqF/JmrqB/SHQ/hUb3w0ksvlZtWVFSE+fPno2XLllAqlTA2NoZSqcTFixdx9uxZue6PP/5A06ZN0atXrwcu5/jx4+jUqROcnJzw999/o3Hjxg98z549e2BhYYGXX35Za3rZAPp7D5fpolWrVmjbtq3WtKCgIGRlZeH48eNa0+/dRocOHUJ6ejqGDRuGoqIi+VFSUoK+ffsiKioKOTk5Wu+
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# look at singular event and track\n",
"\n",
"def cubic_fit(x, a, b, c, d):\n",
" return (a + b*x + c*x**2 + d*x**3)\n",
"\n",
"popt,pcov = curve_fit(cubic_fit, vtx_z_fit, vtx_x_fit)\n",
"popt\n",
"\n",
"z_coord = np.linspace(vtx_z_fit[0],12000,1000)\n",
"fit = cubic_fit(z_coord, popt[0], popt[1], popt[2], popt[3])\n",
"\n",
"plt.plot(z_coord, fit, \"-\", label=\"fit\")\n",
"plt.plot(vtx_z_fit, vtx_x_fit, \".\", label=\"data\")\n",
"plt.ylim(-4300,4300)\n",
"plt.xlabel(\"z [mm]\")\n",
"plt.ylabel(\"x [mm]\")\n",
"plt.title(\"fit track of brem vertices from single signal\")\n",
"\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"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
}