2023-09-28 15:50:32 +02:00
{
"cells": [
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 1,
2023-09-28 15:50:32 +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",
2023-09-29 12:21:18 +02:00
"from mpl_toolkits.axes_grid1 import ImageGrid\n",
2023-09-28 15:50:32 +02:00
"%matplotlib inline"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 2,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"9056"
]
},
2023-10-02 13:56:58 +02:00
"execution_count": 2,
2023-09-28 15:50:32 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\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)"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 3,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.8606728758791105"
]
},
2023-10-02 13:56:58 +02:00
"execution_count": 3,
2023-09-28 15:50:32 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def t_eff(found, lost, axis = 0):\n",
" sel = ak.num(found, axis=axis)\n",
" des = ak.num(lost, axis=axis)\n",
" return sel/(sel + des)\n",
"\n",
"t_eff(found, lost)"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 4,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"sample size: 32\n",
"eff (cutoff = 0 ) = 0.96875\n",
"sample size: 32\n",
"eff (cutoff = 50 ) = 0.96875\n",
"sample size: 32\n",
"eff (cutoff = 100 ) = 0.96875\n",
"sample size: 43\n",
"eff (cutoff = 150 ) = 0.9767441860465116\n",
"sample size: 65\n",
"eff (cutoff = 200 ) = 0.9692307692307692\n",
"sample size: 97\n",
"eff (cutoff = 250 ) = 0.9587628865979382\n",
"sample size: 129\n",
"eff (cutoff = 300 ) = 0.9457364341085271\n",
"sample size: 150\n",
"eff (cutoff = 350 ) = 0.9533333333333334\n",
"sample size: 169\n",
"eff (cutoff = 400 ) = 0.9408284023668639\n",
"sample size: 197\n",
"eff (cutoff = 450 ) = 0.9390862944162437\n",
"sample size: 227\n",
"eff (cutoff = 500 ) = 0.920704845814978\n",
"sample size: 257\n",
"eff (cutoff = 550 ) = 0.9260700389105059\n",
"sample size: 297\n",
"eff (cutoff = 600 ) = 0.9326599326599326\n",
"sample size: 334\n",
"eff (cutoff = 650 ) = 0.9281437125748503\n",
"sample size: 366\n",
"eff (cutoff = 700 ) = 0.9289617486338798\n",
"sample size: 400\n",
"eff (cutoff = 750 ) = 0.925\n",
"sample size: 436\n",
"eff (cutoff = 800 ) = 0.9151376146788991\n",
"sample size: 468\n",
"eff (cutoff = 850 ) = 0.9102564102564102\n",
"sample size: 500\n",
"eff (cutoff = 900 ) = 0.912\n",
"sample size: 533\n",
"eff (cutoff = 950 ) = 0.9136960600375235\n",
"sample size: 562\n",
"eff (cutoff = 1000 ) = 0.9163701067615658\n",
"\n",
"sample size: 150\n"
]
},
{
"data": {
"text/plain": [
"0.9533333333333334"
]
},
2023-10-02 13:56:58 +02:00
"execution_count": 4,
2023-09-28 15:50:32 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#finden wir die elektronen die keine bremsstrahlung gemacht haben mit hoher effizienz?\n",
"#von energie der photonen abmachen\n",
"#scan ab welcher energie der photonen die effizienz abfällt\n",
"\n",
"#abhängigkeit vom ort der emission untersuchen <- noch nicht gemacht\n",
"\n",
"\n",
"\n",
"#idea: we make an event cut st all events that contain a photon of energy > cutoff_energy are not included\n",
"\"\"\"\n",
"ph_e = found[\"brem_photons_pe\"]\n",
"event_cut = ak.all(ph_e<cutoff_energy,axis=1)\n",
"ph_e = ph_e[event_cut]\n",
"\"\"\"\n",
"\n",
"\n",
"\n",
"for cutoff_energy in range(0,1050,50):\n",
"\tnobrem_f = found[ak.all(found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\tnobrem_l = lost[ak.all(lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\tprint(\"sample size: \",ak.num(nobrem_f,axis=0)+ak.num(nobrem_l,axis=0))\n",
"\tprint(\"eff (cutoff = \",str(cutoff_energy),\") = \",str(t_eff(nobrem_f,nobrem_l)))\n",
"\n",
"\"\"\"\n",
"we see that a cutoff energy of 350MeV is ideal because the efficiency drops significantly for higher values\n",
"\"\"\"\n",
"cutoff_energy = 350.0 #MeV\n",
"\n",
"\"\"\"\n",
"better statistics: cutoff=350MeV - sample size: 150 events and efficiency=0.9533\n",
"\"\"\"\n",
"nobrem_found = found[ak.all(found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"nobrem_lost = lost[ak.all(lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\n",
"print(\"\\nsample size: \",ak.num(nobrem_found,axis=0)+ak.num(nobrem_lost,axis=0))\n",
"t_eff(nobrem_found, nobrem_lost)"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 5,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [],
"source": [
"def weird_div(n,d):\n",
" return n/d if d else 0"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 6,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.8593328191284226"
]
},
2023-10-02 13:56:58 +02:00
"execution_count": 6,
2023-09-28 15:50:32 +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",
"#if any photon of an electron has an energy higher the cutoff then it is included\n",
"cutoff_energy=350\n",
"\n",
"brem_found = found[ak.any(found[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\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",
"brem_lost = lost[ak.any(lost[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\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-10-02 13:56:58 +02:00
"execution_count": 7,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mean energyloss relative to initial energy (found): 0.6551043170507098\n",
"mean energyloss relative to initial energy (lost): 0.8273131179948844\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-10-02 13:56:58 +02:00
"execution_count": 8,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjMAAAHMCAYAAAAgfimTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA51klEQVR4nO3deXhU9d3+8XuSTDZCAgTCmrIGNAFBASngglZQUbFPfVyKIiJuNT8hxbK5JlYakaooD0JBlC5SaRWQKgqpkgAiWwhWDAIClaDQsCaBSBgy5/cHZkrINnMy20ner+vKFebMWT7zadq5+z3fc47NMAxDAAAAFhUS6AIAAADqgzADAAAsjTADAAAsjTADAAAsjTADAAAsjTADAAAsjTADAAAsjTADAAAsjTADAAAsjTADAAAsjTADAAAsjTADwC9WrFghm81W48+CBQu8cpzy8nIlJCTolVde8fuxAQRGWKALANA4bN26VZL0/vvvKyEhocr7ycnJXjnOmjVrdPjwYf3iF7/w+7EBBAZhBoBfbN26VbGxsbrllltks9l8dpx3331X/fr1U8eOHf1+bACBwWkmAH6Rm5ur3r17+zRMGIahpUuX6rbbbvP7sQEEDmEGgM8dPXpU+/fvV69evXT27NkqP4ZheOU469ev18GDByuFGX8dG0DgEGYA+FzFnJXXX39ddru9yk9+fn6d+zAMQ7GxsTpy5EiN67z77rvq1auXkpKSPD724cOHddNNN6lJkybq3r27srKy6vORAfgRc2YA+Fxubq4kacmSJUpMTKzyvjsTcHfv3q1WrVqpZcuWNa6zZMkS3X///aaOnZqaqjZt2ujw4cP65z//qTvuuEPffPON4uPj66wNQGARZgD43NatWxUZGakRI0YoNDS0xvX+8Ic/6O9//7vsdrs2btyodu3a6W9/+5uSk5O1detW9enTRw8//LAWL16sdu3aafny5erWrZskadOmTdq/f3+V+TLuHPvkyZNatmyZ9uzZo+joaI0YMUK9e/fW+++/XyUcAQg+nGYC4HNbt25Vz549aw0ykrR9+3Zt3rxZaWlp+s9//qMB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Wfny+73a7U1FSdOXNGa9asUZMmTZSfn6+YmBglJibqvffe02233aadO3cqNjbWdV8YAEAjVDHFIoDTH8wgzFhcRYj57LPPNGjQIEnS22+/rcTERC1btky333679u/fr9tuu029evWSJHXp0sW1fYsWLSRJCQkJzJkBAFgSp5ksbseOHQoLC9OAAQNcy+Lj49WjRw/t2LFDkjRu3Dg9//zzGjx4sJ599ln961//ClS5AAB4HWHG4mp6HIRhGK6b1T3wwAPau3evRo0apS+//FL9+vXTrFmz/FkmAAA+Q5ixuOTkZJ09e1YbN250LTt69Kh27dqliy++2LUsMTFRjzzyiJYsWaLHH39c8+fPlySFh4dLOvecKgAArIgwY3FJSUm69dZb9eCDD2rdunX64osvdM8996h9+/a69dZbJUlpaWlauXKl9u3bp61bt+rTTz91BZ2OHTvKZrPpgw8+0OHDh3Xy5MlAfhwAADzGBOCanDeT23A6dbq4WOGxsbIF4VOz33rrLY0fP14333yzzpw5o6uuukorVqyQ3W6XdG7UJTU1VQcOHFBsbKxuuOEGvfLKK5Kk9u3bKyMjQ1OmTNGYMWN07733auHChQH8NAAAeIYwY1HZ2dmufzdv3lx/+tOfaly3rvkxTz/9tJ5++mlvlQYAgF8F3zADAACABwgzAADA0ggzAADA0pgzAwAAalbxiIMKQfioA0ZmAACApRFmAACApRFmAACApRFmAACApRFmAAC
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#in abhängigkeit von der energie der elektronen\n",
"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",
"plt.xticks(np.arange(0,1.1,0.1), minor=True,)\n",
"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",
"\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 9,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABjYAAAIhCAYAAADtvIOUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADbq0lEQVR4nOzde1xVVf7/8fcR5IgIJ7wAHsNLjZEKVqOFaDNoCuiIzkxTViRJF3PCyQydym5eJsFMyflqWTlOmpds+jb6rSwCrTRHUfLSiDlak9cUsUJQU1BYvz/6sesIKthBDsfX8/HYjzx7f87aa+9zoPVh7bWWzRhjBAAAAAAAAAAA0AA0qu8KAAAAAAAAAAAA1BQdGwAAAAAAAAAAoMGgYwMAAAAAAAAAADQYdGwAAAAAAAAAAIAGg44NAAAAAAAAAADQYNCxAQAAAAAAAAAAGgw6NgAAAAAAAAAAQINBxwYAAAAAAAAAAGgw6NgAAAAAAAAAAAANBh0bQD1544031KVLF/n7+8tms2nLli31XaVqTZgwQTabrb6r4TFSUlLUvn37+q5GnXvvvfc0YcIEt5c7b9482Ww27d692+1lS9Lnn3+uCRMm1Fn5AAAA8Bx13bZ88cUXNW/evDopuyFr3769UlJS6rsada6uPv+6zinrKpcDAE9DxwZQDw4fPqzk5GRdeeWVysrK0rp163TVVVfVd7UAy3vvvaeJEyfWdzVq7fPPP9fEiRPp2AAAAMDPRsfGpa2hfv4NNZcDgNqiYwOoBzt37tSpU6c0dOhQxcbGqkePHmratGl9V8urfP/99/VdhQbpUrtvl9r1/tSJEydkjKnvagAAAKAOGGN04sSJ+q5Gg3Qp5QiX+vfkUvqsAW9ExwZwkaWkpOjGG2+UJN12222y2Wzq3bu3dfztt99WTEyMmjZtqsDAQMXFxWndunVVyqhu6Gp100bZbDb96U9/0oIFC9SpUyc1bdpU11xzjd59990q71++fLmuvfZa2e12dejQQdOmTavVta1YsUJ9+/ZVUFCQmjZtql69emnlypXV1nHbtm2644475HA4FBoaqnvuuUfFxcUuscYYvfjii7r22mvl7++v4OBg3XLLLfrqq69c4nr37q3IyEitXr1aPXv2VNOmTXXPPfdIkvbv369bbrlFgYGBuuyyy3TnnXcqLy9PNpvNevpmwYIFstlsVe6zJE2aNEmNGzfWgQMHznrdJ0+e1Lhx49ShQwf5+fmpTZs2GjlypI4cOeIS9+GHH6p3795q0aKF/P391bZtW/3hD39waUzNnj1b11xzjZo1a6bAwEBdffXVevzxx89536+//noNHDjQZV9UVJRsNpvy8vKsff/85z9ls9m0detWST9+Fps2bdItt9yi4OBgXXnllUpJSdELL7wg6YfvT+V2vlEQNfn8f+57//Of/+iOO+5QaGio7Ha72rZtq7vuukulpaWaN2+ebr31VklSnz59rHpXfs7n+p7s3btXQ4cOVUhIiOx2uzp16qTp06eroqLCOvfu3btls9k0bdo0ZWZmqkOHDmrWrJliYmKUm5tbo+ssKCjQiBEjdPnll8vPz08dOnTQxIkTdfr06Qs+z6effqrBgwerefPmatKkia677jr94x//cImpnKYhOztb99xzj1q1aqWmTZuqtLRUxhilp6erXbt2atKkibp3766cnBz17t3b+t107NgxXXbZZRoxYkSV8+/evVs+Pj567rnnanQPAAAA6trf//53XXPNNWrSpImaN2+u3//+99q+fbtLzFdffaXbb79dTqdTdrtdoaGh6tu3rzVFcPv27bVt2zatWrXKaleeb/qg2uYveXl5+tWvfqWmTZvqiiuu0JQpU1zan5JUUlKisWPHuuQao0eP1vHjx13iKvO+l156SZ06dZLdbtf8+fMlSWvWrFFMTIyaNGmiNm3a6KmnntLf/vY3lzb+vffeq+bNm1f7h96bbrpJXbp0Oee116Q9LZ0/3/n++++t6638/Lp3767XX3/9rOcuKSmRr6+vS3v0m2++UaNGjeRwOFza2qNGjVKrVq2sB3zOliPU5ef/c9+blZWlvn37yuFwqGnTpurUqZMyMjIk6by53Pm+J3379lVgYKCaNm2qnj17avny5S7nrswrPvroIz3wwANq2bKlWrRooZtvvvmcOfNP1SZ/qel53njjDcXExCggIEDNmjVTQkKCNm/e7BKTkpKiZs2aaevWrYqPj1dgYKD69u0rSTpy5Ij1M9CsWTMNHDhQX331lWw2mzWt1yeffCKbzVbtd/G1116rkn8DuAgMgIvqyy+/NC+88IKRZNLT0826devMtm3bjDHGLFq0yEgy8fHxZtmyZeaNN94w3bp1M35+fuaTTz6xyhg2bJhp165dlbLHjx9vzvyxlmTat29vbrjhBvOPf/zDvPfee6Z3797G19fX/Pe//7XiVqxYYXx8fMyNN95o/vnPf5o333zTXH/99aZt27ZVyqzOggULjM1mM7/73e/MP//5T/POO++YxMRE4+PjY1asWFGljhEREebpp582OTk5JjMz09jtdnP33Xe7lDl8+HDTuHFjM2bMGJOVlWUWL15srr76ahMaGmoKCgqsuNjYWNO8eXMTHh5uZs6caT766COzatUqc+zYMfOLX/zCNG/e3Lzwwgvmgw8+MA8//LDp0KGDkWReffVVY4wxpaWlJiwszNx5550u5z916pRxOp3m1ltvPeu9r6ioMAkJCcbX19c89dRTJjs720ybNs0EBASY6667zpw8edIYY8yuXbtMkyZNTFxcnFm2bJn5+OOPzaJFi0xycrIpKioyxhjz+uuvG0nmwQcfNNnZ2WbFihXmpZdeMqNGjTrnvX/sscdMs2bNTFlZmTHGmIKCAiPJ+Pv7m8mTJ1txDzzwgAkNDa3yWbRr1848+uijJicnxyxbtsx8+eWX5pZbbjGSzLp166yt8lqqU9PP/9VXXzWSzK5du2r93i1btphmzZqZ9u3bm5deesmsXLnSLFy40AwZMsSUlJSYwsJCk56ebiSZF154wap3YWGhMebs35PCwkLTpk0b06pVK/PSSy+ZrKws86c//clIMg888IB1/l27dlk/T/379zfLli0zy5YtM1FRUSY4ONgcOXLknJ/TwYMHTXh4uGnXrp15+eWXzYoVK8xf/vIXY7fbTUpKygWd58MPPzR+fn7mV7/6lXnjjTdMVlaWSUlJcfl+//S+t2nTxtx///3m/fffN//7v/9rTp8+bcaNG2ckmfvvv99kZWWZOXPmmLZt25rWrVub2NhYq4yHH37YBAQEVLnOP//5z6ZJkybmm2++Oef1AwAAuFt1bcvK9uAdd9xhli9fbl577TVzxRVXGIfDYXbu3GnFRUREmF/84hdmwYIFZtWqVeatt94yY8aMMR999JExxphNmzaZK664wlx33XVWu3LTpk3nrE9t8pcWLVqYjh07mpdeesnk5OSY1NRUI8nMnz/fijt+/Li59tprTcuWLU1mZqZZsWKF+etf/2ocDoe56aabTEVFhRVb2dbr2rWrWbx4sfnwww9Nfn6++eyzz0yTJk1M165dzZIlS8zbb79tfvOb35j27du73LvPPvvMSDJz5sxxuaZt27ZZ7etK7dq1M8OGDbNe17Q9XZN8Z8SIEaZp06YmMzPTfPTRR+bdd981U6ZMMTNnzjznve/Ro4eJj4+3Xi9ZssQ0adLE2Gw2869//cva36lTJzNkyBCXz6K6HKEuP//q8vmavvdvf/ubsdlspnfv3mbx4sVmxYoV5sUXXzSpqanGGHPeXO5s35OPP/7YNG7c2HTr1s288cYbZtmyZSY+Pt7YbDazZMkS6/yVP3NXXHGFefDBB80HH3xg/va3v5ng4GDTp0+fc94fY2qfv9TkPJMnTzY2m83cc8895t133zX//Oc/TUxMjAkICLD+1lJ53xs3bmzat29vMjIyzMqVK80HH3xgysvLzY033miaNGlipkyZYrKzs83EiRNNx44djSQzfvx4q4zrrrvO9OrVq8p1XX/99eb6668/7/UDcC86NoB68NFHHxlJ5s0337T2lZe
"text/plain": [
"<Figure size 2000x600 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#energyloss in abh von der energie der elektronen\n",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
"a0=ax0.hist2d(energyloss_found, energy_found, bins=200, cmap=plt.cm.jet, cmin=1)\n",
"ax0.set_xlabel(\"energyloss\")\n",
"ax0.set_ylabel(r\"$E_0$\")\n",
"ax0.set_title(\"found energyloss wrt electron energy\")\n",
"plt.colorbar(a0[3],ax=ax0)\n",
"\n",
"a1=ax1.hist2d(energyloss_lost, energy_lost, bins=200, cmap=plt.cm.jet, cmin=1) \n",
"ax1.set_xlabel(\"energyloss\")\n",
"ax1.set_ylabel(r\"$E_0$\")\n",
"ax1.set_title(\"lost energyloss wrt electron energy\")\n",
"plt.colorbar(a1[3],ax=ax1)\n",
"\n",
"\"\"\"\n",
"\"\"\"\n",
"plt.show()"
]
},
2023-09-29 12:21:18 +02:00
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 10,
2023-09-29 12:21:18 +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-10-02 13:56:58 +02:00
"execution_count": 11,
2023-09-29 12:21:18 +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",
"#should be fulfilled by all candidates\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",
"sf_energy_found = ak.to_numpy(scifi_found[\"energy\"])\n",
"sf_eph_found = ak.to_numpy(ak.sum(scifi_found[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
"sf_vtx_type_found = ak.to_numpy(scifi_found[\"endvtx_type\"])\n",
"brem_vtx_type_found = scifi_found[scifi_found[\"endvtx_type\"]==101]\n",
"\n",
"sf_energy_lost = ak.to_numpy(scifi_lost[\"energy\"])\n",
"sf_eph_lost = ak.to_numpy(ak.sum(scifi_lost[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
"sf_vtx_type_lost = ak.to_numpy(scifi_lost[\"endvtx_type\"])\n",
"brem_vtx_type_lost = scifi_lost[scifi_lost[\"endvtx_type\"]==101]\n",
"\n",
"\n",
"\n",
"#ak.num(scifi_found[\"energy\"], axis=0)\n",
"#scifi_found.snapshot()"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 12,
2023-09-29 12:21:18 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"9056"
]
},
2023-10-02 13:56:58 +02:00
"execution_count": 12,
2023-09-29 12:21:18 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2023-10-02 13:56:58 +02:00
"ak.num(scifi_found[\"energy\"], axis=0)\n",
"scifi_found[\"\"]"
2023-09-29 12:21:18 +02:00
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 13,
2023-09-29 12:21:18 +02:00
"metadata": {},
"outputs": [],
"source": [
"scifi_fitpars_found = ak.ArrayBuilder()\n",
"\n",
"for i in range(0,ak.num(scifi_found, 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",
" #[:,4] -> energy \n",
" scifi_fitpars_found.real(sf_energy_found[i])\n",
" #[:,5] -> photon energy\n",
" scifi_fitpars_found.real(sf_eph_found[i])\n",
" #[:,6] -> endvtx_type\n",
" scifi_fitpars_found.real(sf_vtx_type_found[i])\n",
" scifi_fitpars_found.end_list()\n",
"\n",
"scifi_fitpars_lost = ak.ArrayBuilder()\n",
"\n",
"for i in range(0,ak.num(scifi_lost, 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",
" #[:,4] -> energy \n",
" scifi_fitpars_lost.real(sf_energy_lost[i])\n",
" #[:,5] -> photon energy\n",
" scifi_fitpars_lost.real(sf_eph_lost[i])\n",
" #[:,6] -> endvtx_type\n",
" scifi_fitpars_lost.real(sf_vtx_type_lost[i])\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"
]
},
{
"cell_type": "code",
"execution_count": 101,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(2)"
]
},
"execution_count": 101,
"metadata": {},
"output_type": "execute_result"
}
],
2023-10-02 13:56:58 +02:00
"source": []
2023-09-29 12:21:18 +02:00
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 14,
2023-09-29 12:21:18 +02:00
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABpQAAAIhCAYAAABAEVl4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAC0qklEQVR4nOzde3wU1d3H8e+SyxJisoZLEoIIUSGCBEWwELQGBAIoYIu3NhqJWqSCUARKC9YarARFRC0oWh8rqFBsq1ivmAACUggGFAWqiC0IFAIUQwI05LKc5w+aMZtkNxty2Ql83q/XvJ7szG/mnJld+szxN78zDmOMEQAAAAAAAAAAAOBFs0B3AAAAAAAAAAAAAPZGQgkAAAAAAAAAAAA+kVACAAAAAAAAAACATySUAAAAAAAAAAAA4BMJJQAAAAAAAAAAAPhEQgkAAAAAAAAAAAA+kVACAAAAAAAAAACATySUAAAAAAAAAAAA4BMJJQAAAAAAAAAAAPhEQgmAbbz++uu67LLLFBYWJofDoS1btgS6S9XKyMiQw+Got+Pt3r1bDodDc+bMqbdjrl+/XhkZGTp69Gi9HROBs3//fmVkZPj9b2LhwoVyOBzatGlTw3bsLJaZmam33nor0N0AAAA2UH5vtXv37gY5/nPPPaeFCxfW+3Eb4p5wyZIlevrpp+vteAis2o4b09PTdd555zVsp85itR3XAYAdkVACYAuHDx9WWlqaLr74Yi1fvlwbNmxQ586dA92tJmv9+vWaMWMGCaWzxP79+zVjxgwGHo2IhBIAAGgsDZVQaggklM4ujBsbF+M6AGeD4EB3AAAk6euvv1ZpaanuuOMOJScnB7o7OMsYY3Ty5EmFhYUFuiu14na7VVZWFuhuNJj//ve/atGiRaC70WjKv0+n0xnorgAAAKAelJaWyuFwKDi4af3ntaKiIjVv3jzQ3WgwRUVFTW7sVxfl32d9zqQCAN5QoQQg4NLT03XNNddIkm677TY5HA7169fP2v72228rKSlJLVq0UEREhAYNGqQNGzZUOUbHjh2rHLu66ekcDofuv/9+vfrqq+rSpYtatGihyy+/XO+++26V/d977z1dccUVcjqdio+Pr9W0dP369VO3bt308ccfq0+fPgoLC1O7du300EMPye12V7vP3LlzFR8fr/POO09JSUnKycmpElPT9cjIyNAvf/lLSVJ8fLwcDoccDodWr14tSTp16pRmz56tSy+9VE6nU9HR0brzzju1b9++avufm5urH/7wh2rRooUuuugiPfbYYzp16lSN52+M0XPPPacrrrhCYWFhioqK0s0336x//etfZ9xOYWGhpkyZovj4eIWGhqpdu3aaOHGiTpw44RFX/h0///zz6tKli5xOpxYtWiRJWrdunZKSktS8eXPr+/i///s/j2lM7rnnHrVs2VL//e9/q5zXddddp8suu8zreT/77LNq1qyZDh06ZK178skn5XA4NG7cOGvdqVOnFBUVpcmTJ0v6furD2bNn69FHH1V8fLycTqc++ugjXXXVVZKku+66y/o+MzIyavgGpPz8fN11111q2bKlwsPDNXz48CrXvzrl/24+++wzjRw5UpGRkXK5XLrjjjt0+PBhj9jXX39dKSkpatu2rcLCwtSlSxf9+te/rvKdlE+PsXXrVqWkpCgiIkIDBgyQJGVnZ+vGG2/UBRdcoObNm+uSSy7RmDFj9J///Kfafn3xxRe65ZZb5HK51LJlS02aNEllZWXasWOHhgwZooiICHXs2FGzZ8+ucm7+/IYcDodOnDihRYsWWde74v8m5eXlacyYMbrgggsUGhqq+Ph4zZgxwyP55+v7BAAAZ4c//vGPuvzyy9W8eXO1bNlSP/7xj/Xll196xPzrX//ST37yE8XFxcnpdComJkYDBgywKhQ6duyo7du3a82aNdZ9R3XjmorK73VfeOEFde7cWU6nU127dtXSpUurjT927Jjuu+8+tW7dWq1atdLIkSO1f/9+jxh/xgj9+vXTe++9p2+//dbqa8Wx1nfffaexY8eqXbt2Cg0N1UUXXaQHH3xQxcXF1fbfn/FYdWo7JvCnnZ07dyo1NVXR0dFyOp3q0qWLnn32WY+Y1atXy+Fw6NVXX9XkyZPVrl07OZ1OffPNN5KkF1980eP7WLJkicc41RijTp06afDgwVXaP378uFwul8d4obJbbrmlyjhk+PDhcjgc+stf/mKt+/TTT+VwOPTOO+9I+n7qw6ysLN19991q06aNWrRooWnTpvkcN/qyfft2DRgwQOHh4WrTpo3uv//+asdOldVmjDxjxgz17t1bLVu2VGRkpK688kq99NJLMsZ4xHXs2FHDhg3Tm2++qR49eqh58+aaMWOGpNNjs2uvvVbR0dEKDw9XYmKiZs+erdLS0mr7tWHDBvXt21dhYWHq2LGjXn75ZUmn/7vAlVdeqRYtWigxMVHLly+vcm41/YZWr15d47hu06ZNGjFihFq2bKnmzZurR48e+vOf/+zRjrfvs/K/MwBoMAYAAuybb74xzz77rJFkMjMzzYYNG8z27duNMcYsXrzYSDIpKSnmrbfeMq+//rrp2bOnCQ0NNR9//LF1jFGjRpkOHTpUOfbDDz9sKv9PnSTTsWNH84Mf/MD8+c9/Nu+//77p16+fCQ4ONv/85z+tuBUrVpigoCBzzTXXmDfffNP85S9/MVdddZW58MILqxyzOsnJyaZVq1YmLi7O/P73vzcffvihmTBhgpFkxo0bZ8Xt2rXL6tOQIUPMW2+9Zd566y2TmJhooqKizNGjR61Yf67H3r17zfjx440k8+abb5oNGzaYDRs2mIKCAmOMMffee6+RZO6//36zfPly8/zzz5s2bdqY9u3bm8OHD1fpf6dOnczzzz9vsrOzzdixY40ks2jRohrPf/To0SYkJMRMnjzZLF++3CxZssRceumlJiYmxuTl5dW6nRMnTpgrrrjCtG7d2sydO9esWLHCPPPMM8blcpnrrrvOnDp1yuM7bteunenevbtZsmSJWbVqldm2bZv5/PPPTfPmzU337t3N0qVLzdtvv22uv/5607FjRyPJ7Nq1yxhjzOeff24kmRdffNHjnLZv324kmWeffdbreX/11VdGklmyZIm1bsiQISYsLMx06tTJWrdx40Yjybz//vsev4N27dqZ/v37m7/+9a8mKyvLfP755+bll182ksxvfvMb6/vcu3ev1z6Ux7dv397cfffd5oMPPjB/+MMfTHR0tGnfvr3Jz8/3+d2V/7vp0KGD+eUvf2k+/PBDM3fuXBMeHm569OhhSkpKrNjf/e535qmnnjLvvfeeWb16tXn++edNfHy86d+/v8cxR40aZUJCQkzHjh3NrFmzzMqVK82HH35ojDFmwYIFZtasWebtt982a9asMYsWLTKXX365SUhI8GirvF8JCQnmd7/7ncnOzjZTp061fs+XXnqp+f3vf2+ys7PNXXfdZSSZN954w9rf39/Qhg0bTFhYmLn++uut613+v0kHDhww7du3Nx06dDAvvPCCWbFihfnd735nnE6nSU9Pt9ry9n2W/8YAAEDTUX5vVfH/j2dmZhpJ5qc//al57733zCuvvGIuuugi43K5zNdff23FJSQkmEsuucS8+uqrZs2aNeaNN94wkydPNh999JExxphPP/3UXHTRRaZHjx7Wfcenn37qsz/l93ldu3Y1f/rTn8zbb79thgwZYiSZv/zlL1X6fdFFF5nx48ebDz/80Pzf//2fiYqKqnKv5s8YYfv27ebqq682sbGxVl83bNhgjDGmqKjIdO/e3YSHh5s5c+aYrKws89BDD5ng4GBz/fXXV+m/P+Ox6tR2TOBPO9u3bzcul8skJiaaV155xWRlZZnJkyebZs2amYyMDCvuo48+su7vbr75ZvP222+bd9991xw5csS88MILRpK56aabzLvvvmsWL15sOnfubDp06OAxTn3mmWeMw+Hw+I0YY6zxcPk9Z3Wef/55I8ns37/fGGNMaWmpiYiIMGFhYWb06NFW3OOPP26Cg4NNYWGhMeb730G7du3Mvffeaz744APz17/+1ezevdv
"text/plain": [
"<Figure size 2000x600 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#b parameter des fits [:,1] hat für lost eine breitere Verteilung. Warum?\n",
"#evtl multiple scattering candidates (lost); findet man einen gewissen endvtx_type (mult scattering)\n",
"#steiler velo winkel (eta)? vertex type? evtl bremsstrahlung?\n",
"\n",
"#isolate b parameters for analysis\n",
"b_found = scifi_fitpars_found[:,1]\n",
"b_lost = scifi_fitpars_lost[:,1]\n",
"\n",
"brem_energy_found = scifi_fitpars_found[:,5]\n",
"brem_energy_lost = scifi_fitpars_lost[:,5]\n",
"\n",
"\n",
"vtx_type_found = scifi_fitpars_found[:,6]\n",
"vtx_type_lost = scifi_fitpars_lost[:,6]\n",
"\n",
"\n",
"#Erste Annahme ist Bremsstrahlung\n",
"\n",
"fig = plt.figure(figsize=(20,6))\n",
"axes = ImageGrid(fig, 111, # similar to subplot(111)\n",
" nrows_ncols=(1, 2), # creates 2x2 grid of axes\n",
" axes_pad=1, # pad between axes in inch.\n",
" cbar_mode=\"single\",\n",
" cbar_location=\"right\",\n",
" cbar_pad=0.1,\n",
" aspect=False\n",
" )\n",
"\n",
"\n",
"h0 = axes[0].hist2d(b_found, brem_energy_found, bins=200, cmap=plt.cm.jet, cmin=1,vmax=30)\n",
"axes[0].set_xlim(-1,1)\n",
"axes[0].set_xlabel(\"b parameter [mm]\")\n",
"axes[0].set_ylabel(r\"$E_{ph}$\")\n",
"axes[0].set_title(\"found photon energy wrt b parameter\")\n",
"\n",
"h1 = axes[1].hist2d(b_lost, brem_energy_lost, bins=200, cmap=plt.cm.jet, cmin=1,vmax=30)\n",
"axes[1].set_xlim(-1,1)\n",
"axes[1].set_xlabel(\"b parameter [mm]\")\n",
"axes[1].set_ylabel(r\"$E_{ph}$\")\n",
"axes[1].set_title(\"lost photon energy wrt b parameter\")\n",
"\n",
"fig.colorbar(h0[3], cax=axes.cbar_axes[0], orientation='vertical')\n",
"\n",
"\"\"\"\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-02 13:56:58 +02:00
"execution_count": 24,
2023-09-29 12:21:18 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-10-02 13:56:58 +02:00
"array([], dtype=float64)"
2023-09-29 12:21:18 +02:00
]
},
2023-10-02 13:56:58 +02:00
"execution_count": 24,
2023-09-29 12:21:18 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2023-10-02 13:56:58 +02:00
"vtx_type_found[vtx_type_found!=0]"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABTkAAAIhCAYAAACFVb4YAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABsmElEQVR4nO3deXQUZdbH8V+TnZA0hJDEQNgUWWSRRSEoAgYCjrgrKBgQkQERnQiOwusCOAqCM8go4orisAjjCIjKsCkyIqDI4oKKMqKgEFEMCQhk6TzvH5gem3SSbqwmXZ3v55w6h1Tfevqp6op9vblV5TDGGAEAAAAAAACATdWo6gkAAAAAAAAAwO9BkRMAAAAAAACArVHkBAAAAAAAAGBrFDkBAAAAAAAA2BpFTgAAAAAAAAC2RpETAAAAAAAAgK1R5AQAAAAAAABgaxQ5AQAAAAAAANgaRU4AAAAAAAAAtkaRE9XaokWLdM455ygmJkYOh0Pbt2+v6il5NXHiRDkcjqqehgeHw6GJEyf6vd3y5ctPabvK9OjRQz169Kg07ptvvpHD4dCcOXMsn0NlZs2a5df7OhwOjR49OnATCnGBOtcAAKfXnDlz5HA49M033wRkfH+/n0+Xd955Rw6HQ++8847f2wZqn3zN/wL9mZXn6NGjmjhxos/HrPQY/+tf/wrsxEIAeRUAO6DIiWrrxx9/VFZWls4880ytWLFCGzdu1Nlnn13V0wp5y5cv16RJkywfd9asWZo1a5bl41opWP8nKlQF6lwDAISWUPx+DtQ+bdy4Ubfccovl41rl6NGjmjRp0ikVhlEx8ioAdhBe1RMAqsqXX36poqIi3XjjjerevXtVTwe/U6tWrap6CuU6evSoatasWdXTCIiioiI5HA6Fh1efr5NQ/jwBAKhIly5dqnoKXhljdPz48aqeRsCEcu4RyvsG4PSjkxPV0k033aQLL7xQkjRgwAA5HA6PS52XLVum9PR01axZU3Fxcerdu7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QgwYNFB0drbPOOksjRozQTz/95BFXmqdv3bpV1157rerUqaMzzzxTkvThhx/q+uuvd+dPjRs31g033KBvv/3W67zWrl2rW2+9VYmJiapbt66uvvpq7du3r8x+kFcBCBkGqIZ27dplnnzySSPJTJ482WzcuNHs2LHDGGPM/PnzjSSTmZlpli5dahYtWmQ6duxoIiMjzbvvvuseY8iQIaZRo0Zlxp4wYYI5+VdLkmncuLE5//zzzT//+U+zfPly06NHDxMeHm7++9//uuPWrFljwsLCzIUXXmgWL15sXnnlFXPeeeeZhg0blhnTm7lz5xqHw2GuvPJKs3jxYvP666+bfv36mbCwMLNmzZoyc2zevLl54IEHzOrVq8306dNNVFSUGTp0qDuupKTE9OzZ00RFRZmHH37YrFq1ykyYMME0bdrUSDITJkwwxhhTVFRkkpKSzKBBg8rM6fzzzzcdOnRwH/drr73WSDIbN250L8ePHzfGGDNy5EgTGRlpNm/ebIwx5q233jI1atQw9913X6X73r17d9O9e3f3z0ePHjUtW7Y0TqfTPPHEE2blypXmjjvucB/LF198scLxunTpYjIzM90/L1y40ERHRxuHw2Hee+899/qWLVua/v37e8wjISHBpKWlmSeeeMKsXbvWrFu3zmzdutU0bdrUtG/f3r3fW7durXAOkkxaWppp1aqVefnll82yZctM3759jSTzyiuvVLjt7t273dtfeOGF5tVXX3WfTxEREWbDhg3u2HXr1pmxY8eaf/3rX2bdunVmyZIl5sorrzQxMTHmiy++cMetXbvWSDL169c31157rVm2bJl54403zMGDB80XX3xhbr31VrNw4ULzzjvvmDfeeMMMGzbM1KhRw6xdu7bMvBo1amQuu+wy88Ybb5h58+aZ5ORkc/bZZ5usrCxz8803m3//+9/m6aefNrVq1TKXXXaZx749/PDDxuFwmJtvvtm88cYbZvHixSY9Pd3Exsa6f48rO9eGDx9uIiIizNixY82KFSvMggULTIsWLUxycrLJycmp9PMEAJw+L774opFkdu/e7V43efJkI8nccMMN5s033zT/+Mc/TNOmTY3T6TRffvmlO6558+bmrLPOMnPnzjXr1q0zr776qhk7dqz7u+lUvp/9+Q6pW7euadasmXn66afN6tWrzahRo4wk89JLL7njcnJyTFJSkqlfv7558cUXzfLly82gQYPcOUvpXD/66CMjyTz33HMe88nNzTVRUVFmzJgxle7TsWPHzLnnnmuaNm1qcnNzjTHGPPDAA6ZGjRpm1apVlX4Wv83/jDFmx44dpmbNmu5c5bXXXjN9+vRxz/23n9nJDh8+bCIiIszkyZPd60aOHGliYmJMbGysKSwsNMYY88MPPxiHw2FmzZrlMY/69eubtm3bmgULFpi3337bbN++3axYscJIMsOGDXPv+65du8qdQ2luk5aWZq644grz+uuvm3nz5pmzzjrLxMfHe+Tp3pSem2lpae785dlnnzVJSUkmLS3NfYyNMeapp54yU6ZMMcuWLTPr1q0zL730kmnXrp1p3ry5e1+N+V+e3qhRI3PPPfeY1atXm6VLlxpjjHnllVfMAw88YJYsWWLWrVtnFi5caLp3727q1atnfvzxxzLzatq0qbn99tvNypUrzfPPP2/q1Kljevbs6bEP5FUAQglFTlRbpUnNb4tFLpfLpKammjZt2hiXy+Vef/jwYZOUlGS6du3qXudvkTM5Odnk5+e71+Xk5JgaNWqYKVOmuNd17tzZpKammmPHjrnX5efnm4SEhEqLnL/88otJSEgoUxByuVymXbt25vzzzy8zx2nTpnnEjho1ykRHR5uSkhJjjDH//ve/jSTz97//3SPu4YcfLpPkjhkzxsTExJhDhw6513322WdGknniiSfc62677bZy9+X48eOmffv2pkmTJuazzz4
"text/plain": [
"<Figure size 1800x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(18,6))\n",
"\n",
"a0=ax[0].hist2d(b_found, vtx_type_found, bins=50, cmap=plt.cm.jet, cmin=1)\n",
"ax[0].set_xlabel(\"b\")\n",
"ax[0].set_ylabel(\"endvtx id\")\n",
"ax[0].set_title(\"found endvtx id wrt b parameter\")\n",
"\n",
"a1=ax[1].hist2d(b_lost, vtx_type_lost, bins=50, cmap=plt.cm.jet, cmin=1) \n",
"ax[1].set_xlabel(\"b\")\n",
"ax[1].set_ylabel(\"endvtx id\")\n",
"ax[1].set_title(\"lost endvtx id wrt b paraneter\")\n",
"\n",
"\"\"\"\n",
"B:\n",
"\n",
"\"\"\"\n",
"fig.colorbar(a0[3], ax=ax.ravel().tolist(), orientation='vertical')\n",
"plt.show()"
2023-09-29 12:21:18 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABPEAAANVCAYAAAAZd2vuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAD1JklEQVR4nOzdeVyU5f7/8ffI7oYrmyuau2mGpZALZmJumelRq4NaapGZKZWJaaItZpmHLJcsyspSzzlqq5lYgnqkTiqa5lJ5VMwgww1XFrl/f/Rjvg0z4IADM8Dr+XjMo+bic1/Xdd8zDB8/c1/3bTIMwxAAAAAAAAAAl1XF2RMAAAAAAAAAUDSKeAAAAAAAAICLo4gHAAAAAAAAuDiKeAAAAAAAAICLo4gHAAAAAAAAuDiKeAAAAAAAAICLo4gHAAAAAAAAuDiKeAAAAAAAAICLo4gHAAAAAAAAuDiKeEA5tXr1arVr104+Pj4ymUzavXu3YmNjZTKZLOIWL16s5cuXO2eSLu6jjz5SXFycs6dx3RITE2UymZSYmOjsqdht+fLlMplMOnr0qEX7jBkz1LhxY7m7u6tWrVqSpPDwcIWHh1+zT1d4r5tMJk2cONGpcwAAlH/kedfPGXleeHi42rdv7/B+mzZtqjFjxji839JkMpkUGxtr0fb111+rc+fOqlatmkwmkz7++ONCc8KCtm/frtjYWJ09e7bU5nwtY8aMUfXq1Z02PiBRxAPKpT/++EORkZFq3ry5NmzYoOTkZLVs2VLjxo1TcnK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ECeV77zvHxbt25V165d5ePjowYNGmjmzJm6evXqNbfLycnR1KlTFRAQoKpVq6pbt27673//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",
"#evtl multiple scattering candidates (lost); findet man einen gewissen endvtx_type (mult scattering)\n",
"#steiler velo winkel (eta)? vertex type? evtl bremsstrahlung?\n",
"\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-28 15:50:32 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"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
}