171 lines
59 KiB
Plaintext
171 lines
59 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"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",
|
||
|
"from mpl_toolkits.axes_grid1 import ImageGrid\n",
|
||
|
"%matplotlib inline"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 45,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"10522"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 45,
|
||
|
"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) + ak.num(lost, axis=0)\n",
|
||
|
"#ak.count(found, axis=None)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 46,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"#plot minimal energy of photon abhängigkeit von eta und phi\n",
|
||
|
"#materialpeak (beampipe)\n",
|
||
|
"\n",
|
||
|
"#minimal photon energy\n",
|
||
|
"energy_found = ak.to_numpy(ak.min(found[\"brem_photons_pe\"],axis=-1))\n",
|
||
|
"energy_lost = ak.to_numpy(ak.min(lost[\"brem_photons_pe\"],axis=-1))\n",
|
||
|
"\n",
|
||
|
"eta_found = ak.to_numpy(found[\"eta\"])\n",
|
||
|
"eta_lost = ak.to_numpy(lost[\"eta\"])\n",
|
||
|
"\n",
|
||
|
"phi_found = ak.to_numpy(found[\"phi\"])\n",
|
||
|
"phi_lost = ak.to_numpy(lost[\"phi\"])\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 51,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABZIAAAIhCAYAAADU7U8+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACjf0lEQVR4nOzdeZgU1dn38V/NAMOATCsqDCDg4ILKpnFhMyCCKC5xg7hExSwucYkIeUiIGiCLKEaDUaOSxV0xgjuJjyBbhDEPgvsWfRmFKKNGZUYRB2Y47x8w3VXdVdXV09XT2/dzXX1RVV116lT1MjfVd93HMsYYAQAAAAAAAADgoSTbHQAAAAAAAAAA5DYuJAMAAAAAAAAAfHEhGQAAAAAAAADgiwvJAAAAAAAAAABfXEgGAAAAAAAAAPjiQjIAAAAAAAAAwBcXkgEAAAAAAAAAvriQDAAAAAAAAADwxYVkAAAAAAAAAIAvLiQDReThhx9Wv379VF5eLsuy9PLLL2e7S65mzJghy7JCa2/VqlWaMWOGNm3aFFqbmfLHP/5Rd999d+jt3n333bIsSy+++GJobT744IOaM2dOaO0BAABkQnMc9P7772ek/UzFb/kSa3399deaMWOGli1bFnrb559/vnbZZZdQ27z22mv1+OOPh9omABQLLiQDReLTTz/Vueeeq3322UfPPPOMqqurtf/++2e7W61i1apVmjlzZlFfSM6EfPnPDQAAQCZxIflrzZw5MyMXkjOBC8kA0HJtst0BAK3j3//+t7Zt26ZzzjlHI0eOzHZ3EOfrr79Whw4dst0NpGHbtm2yLEtt2vCnFQAAFD5jjL755ptsdwNp4v8hAFJBRjJQBM4//3wdeeSRkqQzzjhDlmXpqKOOij7/5JNPaujQoerQoYM6deqkY445RtXV1Qlt7L333gltu5WhsCxLl112me677z4deOCB6tChgwYNGqSnn346YfuFCxfq4IMPVllZmaqqqvS73/0upWNbvHixRo8erYqKCnXo0EHDhw/Xc8895+jf//zP/0iSqqqqZFmWLMuKZkw8/PDDGjt2rLp166by8nIdeOCB+vnPf67Nmzf77re+vl5t2rTRDTfcEF323//+VyUlJYpEImpsbIwu/8lPfqI999xTxhhJ0lFHHaX+/ftrxYoVGjZsmDp06KAf/OAH2nvvvfXGG29o+fLl0X66nXO75nN95513av/991dZWZkOOuggzZs3z3X9L7/8Uj/+8Y+1xx57aPfdd9dpp52mjz76yLHO9u3bNXv2bB1wwAEqKytTly5ddN555+k///lPdJ2jjjpKCxcu1AcffBDtq/198Pnnn+uSSy5Rjx491K5dO/Xp00dXXXWVGhoaXPsf5L3ipr6+Xj/96U9VVVWldu3aqUePHpo0aVLC65fKft59912dffbZ6tKli8rKynTggQfqtttuc6yzbNkyWZal++67T1OmTFGPHj1UVlam9957T5L0pz/9yfF6PPjgg47PkDFG++23n4499tiE/X/11VeKRCK69NJLA50DAADQMn/96181aNAgtW/fXp07d9app56qt956y7HOunXrdOaZZ6p79+4qKytT165dNXr06GiJuJbEb8YY/fGPf9TBBx+s8vJy7bbbbho/frzWrVsXXSdZrDVz5kwNHjxYnTt3VkVFhb71rW/pL3/5SzTe9LJw4UJZlqXVq1dHly1YsECWZemEE05wrDtw4ECdfvrp0fnmeOqOO+7QgQceqLKyMt1zzz3ac889o31q7uf555/v2YfmOOr+++/X5MmTVVlZqfLyco0cOVIvvfSS6zbvvfeejj/+eO2yyy7q2bOnpkyZkhBXBok/LcvS5s2bdc8990T7av9/0euvv66TTz5Zu+22m9q3b6+DDz5Y99xzj2v/H3roIV111VXq3r27KioqNGbMGL3zzjuex22XSrwZdD/J/l8kxf7vtnbtWo0fP1677bab9tlnH0lSQ0ODpkyZosrKSnXo0EEjRozQmjVrtPfee0dfz/fff19t2rTRrFmzEva/YsUKWZalRx55JNA5AJCnDICC995775nbbrvNSDLXXnutqa6uNm+88YYxxpgHHnjASDJjx441jz/+uHn44YfNoYceatq1a2f++c9/RtuYOHGi6d27d0Lb06dPN/FfJZLM3nvvbY444gjzt7/9zfz97383Rx11lGnTpo35f//v/0XXW7x4sSktLTVHHnmkefTRR80jjzxiDj/8cNOrV6+ENt3cd999xrIsc8opp5hHH33UPPXUU+bEE080paWlZvHixcYYYzZs2GAuv/xyI8k8+uijprq62lRXV5u6ujpjjDG//vWvze9//3uzcOFCs2zZMnPHHXeYqqoqM2rUqKT7HzJkiBk7dmx0ft68eaZ9+/bGsiyzcuXK6PIDDzzQfPe7343Ojxw50nTu3Nn07NnT3HLLLWbp0qVm+fLlZu3ataZPnz7mkEMOifZz7dq1vn2QZHr27GkOOugg89BDD5knn3zSHHfccUaSeeSRR6Lr3XXXXUaS6dOnj7n88svN//7v/5o///nPZrfddks41gsvvNBIMpdddpl55plnzB133GH23HNP07NnT/Ppp58aY4x54403zPDhw01lZWW0r9XV1cYYY7Zs2WIGDhxoOnbsaH73u9+ZZ5991lxzzTWmTZs25vjjj0/of5D3ipvNmzebgw8+2Oyxxx7mpptuMosXLzY333yziUQi5uijjzbbt29PeT9vvPGGiUQiZsCAAebee+81zz77rJkyZYopKSkxM2bMiK63dOlSI8n06NHDjB8/3jz55JPm6aefNp999pm58847jSRz+umnm6effto88MADZv/99ze9e/d2fIZuvvlmY1mW+fe//+04rubPavNnFAAApKc5DqqpqYkuu/baa40kc9ZZZ5mFCxeae++91/Tp08dEIhHH3+a+ffuafffd19x3331m+fLlZsGCBWbKlClm6dKlxhjTovjtggsuMG3btjVTpkwxzzzzjHnwwQfNAQccYLp27Wpqa2uNMf6xljHGnH/++eYvf/mLWbRokVm0aJH59a9/bcrLy83MmTN99/3ll1+atm3bmmuvvTa67OKLLzbl5eWmY8eOZuvWrcYYYz7++GNjWZb54x//GF2vOfYZOHCgefDBB82SJUvMyy+/bJ555hkjyfzwhz+M9vO9997z7ENzHNWzZ09z8sknm6eeesrcf//9Zt999zUVFRWO2GzixImmXbt25sADDzS/+93vzOLFi80vf/lLY1mW41iDxp/V1dWmvLzcHH/88dG+Nsdcb7/9tunUqZPZZ599zL333msWLlxozjrrLCPJXH/99Qn933vvvc33vvc9s3DhQvPQQw+ZXr16mf322880Njb6vgapxptB9hPk/0XGxP7v1rt3b/Ozn/3MLFq0yDz++OPGGGPOOussU1JSYn7+85+bZ5991syZM8f07NnTRCIRM3HixGgbp556qunVq1fCcU6YMMF0797dbNu2zff4AeQ3LiQDRaI5ELFfXGxqajLdu3c3AwYMME1NTdHlX375penSpYsZNmxYdFmqF5K7du1q6uvro8tqa2tNSUmJmTVrVnTZ4MGDTffu3c2WLVuiy+rr603nzp2TXkjevHmz6dy5sznppJMcy5uamsygQYPMEUccEV12ww03JPznwc327dvNtm3bzPLly40k88orr/iuf/XVV5vy8nLzzTffGGOM+dGPfmSOO+44M3DgwGhg++GHHxpJZu7cudHtRo4caSSZ5557LqHNfv36mZEjR/ru106SKS8vj/6nwxhjGhsbzQEHHGD23Xff6LLm/0Bdcsklju1nz55tJJmNGzcaY4x56623XNf717/+ZSSZX/ziF9FlJ5xwgut74o477jCSzN/+9jfH8uuvv95IMs8++6yj/0HeK25mzZplSkpKzOrVqx3L58+fbySZv//97ynv59hjjzV77bVX9IeGZpdddplp3769+fzzz40xsc/TiBEjHOs1NTWZyspKM3jwYMfyDz74wLRt29Zxvurr602nTp3MFVdc4Vj3oIMOCvRDBgAACCb+QvI
|
||
|
"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(energy_found, eta_found, bins=200, cmap=plt.cm.jet, cmin=1, range=[[0,0.3e4],[1,6]], vmax=20)\n",
|
||
|
"ax[0].set_xlabel(\"minimal photon energy\")\n",
|
||
|
"ax[0].set_ylabel(r\"$E_{ph}$\")\n",
|
||
|
"ax[0].set_title(\"found eta wrt photon energy\")\n",
|
||
|
"\n",
|
||
|
"a1=ax[1].hist2d(energy_lost, eta_lost, bins=200, cmap=plt.cm.jet, cmin=1, range=[[0,0.3e4],[1,6]], vmax=20)\n",
|
||
|
"ax[1].set_xlabel(\"minimal photon energy\")\n",
|
||
|
"ax[1].set_ylabel(r\"$E_{ph}$\")\n",
|
||
|
"ax[1].set_title(\"lost eta wrt photon energy\")\n",
|
||
|
"\n",
|
||
|
"\"\"\"\n",
|
||
|
"\"\"\"\n",
|
||
|
"fig.colorbar(a0[3],ax=ax[1])\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"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": []
|
||
|
},
|
||
|
{
|
||
|
"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"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|