Projektpraktikum/B_rework.ipynb

1065 lines
414 KiB
Plaintext
Raw Normal View History

2023-09-28 15:50:32 +02:00
{
"cells": [
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 50,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-10-05 10:49:35 +02:00
"import uproot\t\n",
2023-09-28 15:50:32 +02:00
"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-10 16:17:10 +02:00
"execution_count": 51,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-10-05 10:49:35 +02:00
"10522"
2023-09-28 15:50:32 +02:00
]
},
2023-10-10 16:17:10 +02:00
"execution_count": 51,
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",
2023-10-05 10:49:35 +02:00
"ak.num(found, axis=0) + ak.num(lost, axis=0)\n",
2023-09-28 15:50:32 +02:00
"#ak.count(found, axis=None)"
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 52,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
2023-10-05 10:49:35 +02:00
"name": "stdout",
"output_type": "stream",
"text": [
"eff all = 0.8606728758791105 +/- 0.003375885792719708\n"
]
2023-09-28 15:50:32 +02:00
}
],
"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",
2023-10-05 10:49:35 +02:00
"def eff_err(found, lost):\n",
" n_f = ak.num(found, axis=0)\n",
" n_all = ak.num(found, axis=0) + ak.num(lost,axis=0)\n",
" return 1/n_all * np.sqrt(np.abs(n_f*(1-n_f/n_all)))\n",
"\n",
"\n",
"print(\"eff all = \", t_eff(found, lost), \"+/-\", eff_err(found, lost))"
2023-09-28 15:50:32 +02:00
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 53,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [
{
2023-10-05 15:58:17 +02:00
"data": {
2023-10-06 11:41:37 +02:00
"text/html": [
"<pre>{energy: 4.62e+04,\n",
" photon_length: 10,\n",
" brem_photons_pe: [3.26e+03, 4.45e+03, 178, ..., 825, 8.99e+03, 3.48e+03],\n",
" brem_vtx_z: [162, 187, 387, 487, ..., 9.49e+03, 1.21e+04, 1.21e+04, 1.21e+04]}\n",
"-------------------------------------------------------------------------------\n",
"type: {\n",
" energy: float64,\n",
" photon_length: int64,\n",
" brem_photons_pe: var * float64,\n",
" brem_vtx_z: var * float64\n",
"}</pre>"
],
2023-10-05 15:58:17 +02:00
"text/plain": [
2023-10-06 11:41:37 +02:00
"<Record {energy: 4.62e+04, ...} type='{energy: float64, photon_length: int6...'>"
2023-10-05 15:58:17 +02:00
]
},
2023-10-10 16:17:10 +02:00
"execution_count": 53,
2023-10-05 15:58:17 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#try excluding all photons that originate from a vtx @ z>9500mm\n",
2023-10-06 11:41:37 +02:00
"#ignore all brem vertices @ z>9500mm \n",
"\n",
"#found\n",
2023-10-05 15:58:17 +02:00
"\n",
"brem_e_f = found[\"brem_photons_pe\"]\n",
"brem_z_f = found[\"brem_vtx_z\"]\n",
"e_f = found[\"energy\"]\n",
2023-10-06 11:41:37 +02:00
"length_f = found[\"brem_vtx_z_length\"]\n",
2023-10-05 15:58:17 +02:00
"\n",
"brem_f = ak.ArrayBuilder()\n",
"\n",
2023-10-06 11:41:37 +02:00
"for itr in range(ak.num(found,axis=0)):\n",
2023-10-05 15:58:17 +02:00
" brem_f.begin_record()\n",
2023-10-06 11:41:37 +02:00
" #[:,\"energy\"] energy\n",
2023-10-05 15:58:17 +02:00
" brem_f.field(\"energy\").append(e_f[itr])\n",
2023-10-06 11:41:37 +02:00
" #[:,\"photon_length\"] number of vertices\n",
" brem_f.field(\"photon_length\").integer(length_f[itr])\n",
" #[:,\"brem_photons_pe\",:] photon energy \n",
2023-10-05 15:58:17 +02:00
" brem_f.field(\"brem_photons_pe\").append(brem_e_f[itr])\n",
2023-10-06 11:41:37 +02:00
" #[:,\"brem_vtx_z\",:] brem vtx z\n",
2023-10-05 15:58:17 +02:00
" brem_f.field(\"brem_vtx_z\").append(brem_z_f[itr])\n",
" brem_f.end_record()\n",
"\n",
"brem_f = ak.Array(brem_f)\n",
2023-10-06 11:41:37 +02:00
"\n",
"#lost\n",
"\n",
"brem_e_l = lost[\"brem_photons_pe\"]\n",
"brem_z_l = lost[\"brem_vtx_z\"]\n",
"e_l = lost[\"energy\"]\n",
"length_l = lost[\"brem_vtx_z_length\"]\n",
"\n",
"brem_l = ak.ArrayBuilder()\n",
"\n",
"for itr in range(ak.num(lost,axis=0)):\n",
" brem_l.begin_record()\n",
" #[:,\"energy\"] energy\n",
" brem_l.field(\"energy\").append(e_l[itr])\n",
" #[:,\"photon_length\"] number of vertices\n",
" brem_l.field(\"photon_length\").integer(length_l[itr])\n",
" #[:,\"brem_photons_pe\",:] photon energy \n",
" brem_l.field(\"brem_photons_pe\").append(brem_e_l[itr])\n",
" #[:,\"brem_vtx_z\",:] brem vtx z\n",
" brem_l.field(\"brem_vtx_z\").append(brem_z_l[itr])\n",
" brem_l.end_record()\n",
"\n",
"brem_l = ak.Array(brem_l)\n",
"\n",
"\n",
"\n",
"\n",
"brem_f[0]"
2023-10-05 15:58:17 +02:00
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 54,
2023-10-06 11:41:37 +02:00
"metadata": {},
"outputs": [],
"source": [
"acc_brem_found = ak.ArrayBuilder()\n",
"\n",
"for itr in range(ak.num(brem_f, axis=0)):\n",
" acc_brem_found.begin_record()\n",
" acc_brem_found.field(\"energy\").real(brem_f[itr,\"energy\"])\n",
" \n",
" acc_brem_found.field(\"brem_photons_pe\")\n",
" acc_brem_found.begin_list()\n",
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
" if brem_f[itr, \"brem_vtx_z\", jentry]>9500:\n",
" continue\n",
" else:\n",
" acc_brem_found.real(brem_f[itr,\"brem_photons_pe\", jentry])\n",
" \n",
" #acc_brem_found.field(\"brem_vtx_z\").real(brem_f[itr, \"brem_vtx_z\",jentry])\n",
" acc_brem_found.end_list()\n",
" \n",
" acc_brem_found.field(\"brem_vtx_z\")\n",
" acc_brem_found.begin_list()\n",
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
" if brem_f[itr, \"brem_vtx_z\", jentry]>9500:\n",
" continue\n",
" else:\n",
" acc_brem_found.real(brem_f[itr, \"brem_vtx_z\",jentry])\n",
" acc_brem_found.end_list()\n",
" \n",
2023-10-09 09:59:35 +02:00
"\n",
2023-10-06 11:41:37 +02:00
" \n",
" acc_brem_found.end_record()\n",
"\n",
"acc_brem_found = ak.Array(acc_brem_found)\n",
"\n",
"\n",
"\n",
"acc_brem_lost = ak.ArrayBuilder()\n",
"\n",
"for itr in range(ak.num(brem_l, axis=0)):\n",
" acc_brem_lost.begin_record()\n",
" acc_brem_lost.field(\"energy\").real(brem_l[itr,\"energy\"])\n",
" \n",
" acc_brem_lost.field(\"brem_photons_pe\")\n",
" acc_brem_lost.begin_list()\n",
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
" if brem_l[itr, \"brem_vtx_z\", jentry]>9500:\n",
" continue\n",
" else:\n",
" acc_brem_lost.real(brem_l[itr,\"brem_photons_pe\", jentry])\n",
" \n",
" #acc_brem_found.field(\"brem_vtx_z\").real(brem_f[itr, \"brem_vtx_z\",jentry])\n",
" acc_brem_lost.end_list()\n",
" \n",
" acc_brem_lost.field(\"brem_vtx_z\")\n",
" acc_brem_lost.begin_list()\n",
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
" if brem_l[itr, \"brem_vtx_z\", jentry]>9500:\n",
" continue\n",
" else:\n",
" acc_brem_lost.real(brem_l[itr, \"brem_vtx_z\",jentry])\n",
" acc_brem_lost.end_list()\n",
" \n",
" acc_brem_lost.end_record()\n",
"\n",
"acc_brem_lost = ak.Array(acc_brem_lost)\n"
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 55,
2023-10-05 15:58:17 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-10-06 11:41:37 +02:00
"9056"
2023-10-05 15:58:17 +02:00
]
},
2023-10-10 16:17:10 +02:00
"execution_count": 55,
2023-10-05 15:58:17 +02:00
"metadata": {},
"output_type": "execute_result"
2023-09-28 15:50:32 +02:00
}
],
2023-10-05 15:58:17 +02:00
"source": [
2023-10-06 11:41:37 +02:00
"ak.num(acc_brem_found,axis=0)"
2023-10-05 15:58:17 +02:00
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 56,
2023-10-05 15:58:17 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"text/plain": [
"'\\nph_e = found[\"brem_photons_pe\"]\\nevent_cut = ak.all(ph_e<cutoff_energy,axis=1)\\nph_e = ph_e[event_cut]\\n'"
]
},
2023-10-10 16:17:10 +02:00
"execution_count": 56,
2023-10-09 09:59:35 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-10-05 15:58:17 +02:00
"source": [
"\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",
2023-10-06 11:41:37 +02:00
"\n"
2023-10-05 15:58:17 +02:00
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 72,
2023-10-05 15:58:17 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
2023-10-09 16:32:56 +02:00
"cutoff energy = 350MeV, sample size: 693\n",
"eff = 0.9481 +/- 0.0084\n"
2023-10-06 11:41:37 +02:00
]
}
],
2023-09-28 15:50:32 +02:00
"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",
2023-10-06 11:41:37 +02:00
"ph_e = acc_brem_found[\"brem_photons_pe\"]\n",
2023-09-28 15:50:32 +02:00
"event_cut = ak.all(ph_e<cutoff_energy,axis=1)\n",
"ph_e = ph_e[event_cut]\n",
"\"\"\"\n",
"\n",
2023-10-10 16:17:10 +02:00
"efficiencies_found = []\n",
"deff_found = []\n",
2023-09-28 15:50:32 +02:00
"\n",
"\n",
2023-10-10 16:17:10 +02:00
"for cutoff_energy in range(0,10050,200):\n",
2023-10-09 16:32:56 +02:00
"\tnobrem_f = acc_brem_found[ak.sum(acc_brem_found[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
"\tnobrem_l = acc_brem_lost[ak.sum(acc_brem_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
2023-10-05 15:58:17 +02:00
"\n",
2023-10-09 16:32:56 +02:00
"\tif ak.num(nobrem_f,axis=0)+ak.num(nobrem_l,axis=0)==0:\n",
2023-10-10 16:17:10 +02:00
"\t\tefficiencies_found.append(0)\n",
"\t\tdeff_found.append(0)\n",
2023-10-09 16:32:56 +02:00
"\t\tcontinue\n",
2023-10-10 16:17:10 +02:00
"\t\n",
"\teff = t_eff(nobrem_f, nobrem_l)\n",
"\tdeff = eff_err(nobrem_f,nobrem_l)\n",
"\tefficiencies_found.append(eff)\n",
"\tdeff_found.append(deff)\n",
"\t#print(\"cutoff = \",str(cutoff_energy) ,\"MeV, sample size: \",ak.num(nobrem_f,axis=0)+ak.num(nobrem_l,axis=0))\n",
"\t#print(\"eff = \",np.round(t_eff(nobrem_f,nobrem_l),4), \"+/-\", np.round(eff_err(nobrem_f, nobrem_l),4))\n",
2023-09-28 15:50:32 +02:00
"\n",
"\"\"\"\n",
2023-10-06 11:41:37 +02:00
"we see that a cutoff energy of xxxMeV is ideal because the efficiency drops significantly for higher values\n",
2023-09-28 15:50:32 +02:00
"\"\"\"\n",
"cutoff_energy = 350.0 #MeV\n",
"\n",
"\"\"\"\n",
2023-10-06 11:41:37 +02:00
"better statistics: cutoff=xxxMeV - sample size: xxx events and efficiency=xxxx\n",
2023-09-28 15:50:32 +02:00
"\"\"\"\n",
2023-10-09 16:32:56 +02:00
"nobrem_found = acc_brem_found[ak.sum(acc_brem_found[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
"nobrem_lost = acc_brem_lost[ak.sum(acc_brem_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
2023-09-28 15:50:32 +02:00
"\n",
2023-10-05 10:49:35 +02:00
"print(\"\\ncutoff energy = 350MeV, sample size:\",ak.num(nobrem_found,axis=0)+ak.num(nobrem_lost,axis=0))\n",
2023-10-05 13:19:49 +02:00
"print(\"eff = \",np.round(t_eff(nobrem_found, nobrem_lost),4), \"+/-\", np.round(eff_err(nobrem_found, nobrem_lost),4))"
2023-09-28 15:50:32 +02:00
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 80,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlEAAAHICAYAAABu/b/IAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABr80lEQVR4nO3deVyU1f4H8M8wDMMi4oIiKgJaKoUrpgKaYQqaa2WBmSuYhKlIWfBzNxO1G5fbAuWCXpfU1LSNa2JpqWAoouaSS2p0bRBFBYyEAc7vDy8T4www8zDDjPp5v16+ap75Puc5Zw6MX885z3lkQggBIiIiIjKKjaUrQERERHQ/YhJFREREJAGTKCIiIiIJmEQRERERScAkioiIiEgCJlFEREREEjCJIiIiIpKASRQRERGRBEyiiIiIiCRgEkW1OnHiBHJycixdDSIiIqvCJIpqtWLFCnz//feWrgYREZFVYRJFev3444+YPHky8vLyNMdOnz6N5557DlevXrVgzYiIiKwDk6h6kJqaCplMpvWnYcOG8PPzw2effVYv1163bp3W8Zs3b2Lw4MGws7PDhx9+qHOen58f3Nzc0LlzZ3z33Xf48MMPMXDgQAwaNAjNmjUza53vJ/v27dPp28o/hw4d0nvOiRMnEB4ejnbt2sHBwQEODg549NFHMWXKFBw5csToOjz77LNwcHDArVu3qo0ZM2YMFAqFWRPgBQsWQCaT4fr16yYpLz09HQsWLKixXfe78vJyNG/eHP/85z+rjTH153q/eJD7PzMzEyEhIXB2dkaDBg0QFBSEgwcP6sQZ+/1y+/ZtREdHo2XLlrC3t0fXrl2xefNmyXFUO1tLV+BhcPToUQDAF198gebNm0MIgZycHMyfPx+jR49Gx44d0blzZ7Ne28/PT3PsxIkTePbZZ/Hnn3/i+++/R58+fXTOc3JywqJFi1BRUYH4+Hj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zGD58uLCzsxMODg7i+eefF1u3bq32H6p2dnZi3LhxOsdHjx4tAIhvv/1Wc8zQ7xchhOjdu7d44okndI5XJvqffPKJUXFC1P1nwdw/S9aASZSZ7d69W++/cmxtbcXixYsll1tWVlZrIlX12vb29uLQoUOSr1ebr776SgAQy5cv1zp+7tw5AUBs2LDBqDhj/Pe//xUARNu2bbX+ZVpaWipatGghhg4dWmsZN2/eFCkpKSI4OFjY2toKFxcXMWHCBPHtt9/W+K/ao0ePihkzZogdO3aIH3/8UaSkpAgfHx8hl8vFrl27NHG5ubkCgAgLC9Mpo6ysTJNgq9VqUVFRoXkvJCREtG7dWucL/bXXXhP29vbixo0bmmP9+vUTrq6uWn+pVo4+Sh3lq/wSnDlzptbxjRs36vRXZey9fRsVFSXs7e017erdu7do3ry5VsJcVlYmfH19RevWrTVxNU3nGFqGoXUS4u4Iwb1JqCFefvll0bZtW83rAQMGiMmTJ4vGjRuLf//730IIIQ4ePCgAiN27d2vioqOjRadOnWotX0ofzJs3T6ccQ3+WKst47733tOK6du2qSWoqqdVq0axZM00yY6iYmBjh4OCg9ft6+vRpAUB88MEHQojap/O2bNkiAIjExEQxb948YWNjo/X5GqusrEyMGDFCNGjQQGRlZVUbV1paKr7++mvx0ksvCScnJ2FnZyeGDh0qNmzYYNA/Art27Srat2+vNUKuVqtF27ZtdabZDP1+EUKIRx99VISEhOhc748//hAAxJIlS4yKE6LuPwv18bNkaUyizCw+Pl7zw3L48GFx+PBhsWvXLjFixAhhY2OjN+u+du1ajcPM9/5RKBQiNze32muPHTtW718kptStWzfRrl07UVJSopUQqNVq4eDgIBYtWmR
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"x_ = np.arange(0,10050,step=200)\n",
"\n",
"plt.errorbar(x_,efficiencies_found, yerr=deff_found, ls=\"\", capsize=1,fmt=\".\")\t\n",
"plt.xlabel(\"cutoff energy [MeV]\")\n",
"plt.ylabel(r\"$\\epsilon$\")\n",
"plt.title(r'$B\\rightarrow K^\\ast ee$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm')\n",
"plt.ylim([0.8,1])\n",
"plt.xlim([0,10100])\n",
"plt.yticks(np.arange(0.8,1.01,step=0.02),minor=False)\n",
"plt.xticks(np.arange(0,10100,step=200),minor=True)\n",
"plt.grid()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 25,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2023-10-09 16:32:56 +02:00
"eff = 0.8545 +/- 0.0036\n"
2023-10-06 11:41:37 +02:00
]
},
{
"data": {
"text/html": [
"<pre>[{energy: 2.58e+04, brem_photons_pe: [9.97e+03, ...], brem_vtx_z: [...]},\n",
" {energy: 8.03e+04, brem_photons_pe: [4.91e+03, ...], brem_vtx_z: [...]},\n",
" {energy: 5.6e+03, brem_photons_pe: [320, ..., 392], brem_vtx_z: [...]},\n",
" {energy: 6.36e+03, brem_photons_pe: [273, ...], brem_vtx_z: [...]},\n",
" {energy: 4.67e+04, brem_photons_pe: [8.96e+03, ...], brem_vtx_z: [...]},\n",
" {energy: 7.16e+04, brem_photons_pe: [544, ..., 142], brem_vtx_z: [...]},\n",
" {energy: 5.15e+04, brem_photons_pe: [384, ...], brem_vtx_z: [...]},\n",
" {energy: 4.07e+04, brem_photons_pe: [2.7e+04, ...], brem_vtx_z: [...]},\n",
" {energy: 2.77e+04, brem_photons_pe: [2.24e+03, ...], brem_vtx_z: [...]},\n",
" {energy: 6.4e+04, brem_photons_pe: [686, ..., 796], brem_vtx_z: [...]},\n",
" ...,\n",
" {energy: 5.59e+03, brem_photons_pe: [901, ...], brem_vtx_z: [...]},\n",
" {energy: 2.13e+04, brem_photons_pe: [787, ...], brem_vtx_z: [...]},\n",
" {energy: 9.34e+03, brem_photons_pe: [762, ...], brem_vtx_z: [...]},\n",
" {energy: 5.08e+04, brem_photons_pe: [711, ...], brem_vtx_z: [...]},\n",
" {energy: 6.41e+04, brem_photons_pe: [4.17e+03, ...], brem_vtx_z: [...]},\n",
" {energy: 1.01e+04, brem_photons_pe: [220, ..., 156], brem_vtx_z: [...]},\n",
" {energy: 1.96e+04, brem_photons_pe: [1.66e+03, ...], brem_vtx_z: [...]},\n",
" {energy: 2.98e+04, brem_photons_pe: [8.32e+03, ...], brem_vtx_z: [...]},\n",
" {energy: 3.97e+04, brem_photons_pe: [9.36e+03, ...], brem_vtx_z: [...]}]\n",
"-------------------------------------------------------------------------\n",
2023-10-09 16:32:56 +02:00
"type: 1430 * {\n",
2023-10-06 11:41:37 +02:00
" energy: float64,\n",
" brem_photons_pe: var * float64,\n",
" brem_vtx_z: var * float64\n",
"}</pre>"
],
"text/plain": [
2023-10-09 16:32:56 +02:00
"<Array [{energy: 2.58e+04, ...}, ..., {...}] type='1430 * {energy: float64,...'>"
2023-10-06 11:41:37 +02:00
]
},
2023-10-10 16:17:10 +02:00
"execution_count": 25,
2023-10-06 11:41:37 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-09-28 15:50:32 +02:00
"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",
2023-10-09 16:32:56 +02:00
"brem_found = acc_brem_found[ak.sum(acc_brem_found[\"brem_photons_pe\"],axis=-1,keepdims=False)>=cutoff_energy]\n",
2023-09-28 15:50:32 +02:00
"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",
2023-10-05 15:58:17 +02:00
"residual_found = energy_found - eph_found\n",
2023-09-28 15:50:32 +02:00
"energyloss_found = eph_found/energy_found\n",
"\n",
2023-10-09 16:32:56 +02:00
"brem_lost = acc_brem_lost[ak.sum(acc_brem_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)>=cutoff_energy]\n",
2023-09-28 15:50:32 +02:00
"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",
2023-10-05 15:58:17 +02:00
"residual_lost = energy_lost - eph_lost\n",
2023-09-28 15:50:32 +02:00
"energyloss_lost = eph_lost/energy_lost\n",
"\n",
2023-10-05 15:58:17 +02:00
"print(\"eff = \", np.round(t_eff(brem_found,brem_lost),4), \"+/-\", np.round(eff_err(brem_found, brem_lost),4))\n",
"brem_lost"
2023-09-28 15:50:32 +02:00
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 26,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2023-10-09 16:32:56 +02:00
"mean energyloss relative to initial energy (found): 0.40459562244424735\n",
"mean energyloss relative to initial energy (lost): 0.7244570697471976\n"
2023-10-06 11:41:37 +02:00
]
}
],
2023-09-28 15:50:32 +02:00
"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-10 16:17:10 +02:00
"execution_count": 27,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
2023-10-10 11:00:25 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAHMCAYAAAD7xYOxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3iElEQVR4nO3deXhU5d3G8XuSTDZCAgQCAVJk17CEymbABa2oYMW+tWqLpai4talIsaCI1lDlRWqtVYsbonSRSiuL1KKSWhI22QIuEBREWoIFQ1iyEEmGzHn/8M3UyYQkczIz50zm+7muXDpnzjznNz8Dc/uc55xxGIZhCAAAwIairC4AAADgbAgqAADAtggqAADAtggqAADAtggqAADAtggqAADAtggqAADAtggqAADAtggqAADAtggqAADAtggqAADAtggqAFps9erVcjgcZ/1ZtGhRQI5TW1urtLQ0PfnkkyE/NgBrxFhdAIDwt2PHDknSG2+8obS0NJ/nMzMzA3KcdevW6ejRo/rud78b8mMDsAZBBUCL7dixQ8nJybrmmmvkcDiCdpzXX39dw4YNU48ePUJ+bADW4NQPgBYrLCxUVlZWUIOCYRhasWKFrrvuupAfG4B1CCoAWuTYsWM6ePCgBg0apDNnzvj8GIYRkONs2rRJhw8f9goqoTo2AOsQVAC0SN0akWeffVZOp9Pnp6ioqMkxDMNQcnKySktLz7rP66+/rkGDBqlv375+H/vo0aO6+uqr1aZNG/Xr1095eXktecsAQog1KgBapLCwUJK0fPlyZWRk+DzfnMWs+/btU6dOndSxY8ez7rN8+XLdeuutpo6dk5OjLl266OjRo/rHP/6hG264QZ9++qlSU1ObrA2AtQgqAFpkx44dio+P14QJExQdHX3W/V544QX99a9/ldPp1JYtW9S1a1f95S9/UWZmpnbs2KEhQ4bozjvv1NKlS9W1a1etWrVKffr0kSRt3bpVBw8e9Fmf0pxjV1ZWauXKldq/f78SExM1YcIEZWVl6Y033vAJPgDsh1M/AFpkx44dGjhwYKMhRZJ27dqlbdu2adq0afriiy80cuRIPfjgg5KknTt3avv27brlllt0/PhxnX/++Vq4cKHntcuWLVO/fv00cOBAv4+9b98+JSUlec24DBo0SLt37zbzdgGEGEEFgGllZWX67LPPlJWV1eS+u3bt0oMPPqgrr7xSTqdTN910k/bu3Svpq6AyZ84cXXDBBYqKilLv3r29FsIuW7bMZzaluceurK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tXr1ajmdTklfzZbk5OTo0KFDSk5O1lVXXaUnn3xSktStWzfNmTNH999/v2655Rb96Ec/0uLFiy18NwAA+Ccyg4rN5efne/69ffv2+sMf/nDWfZtaj/LQQw/poYceClRpAACEFKd+AACAbRFUAACAbRFUAACAbRFUAACAbRFUAACAbRFUAACAbRFUAACAbRFUAACAbRFUAACAbRFUbMgwDN1xxx3q0KGDHA6H3n//fctqGTNmjKZNm2bZ8QEAkS0ib6Gfm9v484bhUHV1vOLiHHI4gnushrz99ttavHix8vPz1atXL3Xs2LFlRQAAEKYiMqjY3f79+5Wenq5Ro0ZZXQoAAJYKy1M/CxYsUGZmpoYPH251KQF388036+6779bBgwflcDh0zjnnqLq6WlOnTlVaWpri4+N14YUXatu2bZ7XLF68WO3atfMaZ+XKlXJ8bTooNzdXQ4YM0R//+Eedc845SklJ0fe//31VVFR49jl16pR+9KMfKSkpSenp6XriiSeC/n4BAGhMWAaVnJwcFRUVeX1YtxZPPfWUfvnLX6p79+46fPi
2023-10-06 11:41:37 +02:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-09-28 15:50:32 +02:00
"source": [
"#in abhängigkeit von der energie der elektronen\n",
2023-10-09 16:32:56 +02:00
"plt.hist(energyloss_lost, bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=\"lost\")\n",
2023-09-28 15:50:32 +02:00
"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",
2023-10-10 11:00:25 +02:00
"plt.yticks(np.arange(0,5.5,0.5), minor=True)\n",
2023-09-28 15:50:32 +02:00
"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-10 16:17:10 +02:00
"execution_count": 28,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
2023-10-10 16:17:10 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABjYAAAJOCAYAAAAUHj4bAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADLAUlEQVR4nOzdd3hUVcLH8d8lIYWQDL0E6SJSBUGpSm9LcVVAQRGCHRVRsJfAKkVs7KKIogQFKbIoC6IIiGIDpYgouFYUUJoSEkBawnn/4M0sQ8qcIXeYGfh+nmce5c6Z0++Zc+fk3OsYY4wAAAAAAAAAAAAiQJFQZwAAAAAAAAAAAMAWCxsAAAAAAAAAACBisLABAAAAAAAAAAAiBgsbAAAAAAAAAAAgYrCwAQAAAAAAAAAAIgYLGwAAAAAAAAAAIGKwsAEAAAAAAAAAACIGCxsAAAAAAAAAACBisLABAAAAAAAAAAAiBgsbAAAAAAAAAAAgYrCwAQAAItqgQYM0bdq0UGcDljZs2KAtW7aEOhsAAAAAgAjGwgYAAABOm5deeknLly8PdTYAAAAAABGMhQ0AAHBWmzNnjurVq6f4+Hg5jqP169eHOksFeuedd+Q4js8rKSlJTZo00RtvvHHa0n/ttdd8jqenp6tbt26KiYnRc8895/PeRx99pBtvvFG7du3yHtu0aZOuuOIK7dy5M+h5jiQffvhhrvbNea1atSpX+A0bNuj6669XzZo1FR8fr/j4eNWqVUs333yz1qxZc0p5uPzyyxUfH6+9e/fmG+aaa65R0aJFQ95+06ZNk+M4+uWXX0572iNHjpTjOPrjjz9ci/Ozzz7TyJEjC6z7SJadna1y5crp2WefzTdMMOo1EpzJbf/FF1+oS5cuSkxMVPHixdWuXTt9+umnucIFOv7t379fw4YNU3JysuLi4tSoUSPN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o1atQo1/Ft27ZJkurUqXMKtSE9++yzmj9/fkDpjxgxQv369dM111yjFStW5LmoIUlff/21LrzwQq1bt05/+9vfNHjwYI0ePVrdu3f3e7sZ237hdv/p2bOnmjZtqilTpuiCCy5QfHy8KleurNTUVB07dizPz2zYsEEVK1ZUt27d9Nprr2nfvn2nnL4/Y8aMUVRUlF588UWfRY0T9enTJ1eb/PDDD+rfv7/KlSun2NhY1alTR88//7xPmKioKA0cOFBr167V119/nSvetLQ0bzlPRSDn0MaNG9WvXz95PB6VL19egwcPVkZGRr5xf/zxx3IcR7Nmzcr13muvvSbHcbR69ep8P5+T7pdffqkrrrhCSUlJ8ng8uvbaa7V79+48P7Nz506/ebQt8z333CNJql69uvcWPB9++GFQ6m337t266aabVLlyZcXGxqps2bJq1aqVli1blm/9bNy4UY7jaO7cud5ja9euleM4qlevnk/YXr16+ezsMsborbfe0pVXXplv/CfaunWr3zbwN17b9PdgjteSNH/+fDmOo/fffz/Xey+88IIcx9EVV1yRb9sfOnRIjRs31rnnnuvThjt27FCFChXUtm1bZWdnW+Ulv9s8ncrt3NLT0/XKK6+oY8eOOuecc/Tzzz/nGe7TTz9V27ZtfRabEhMTdemll+qzzz7T9u3bA0o3x1tvvaXixYurT58+PsdTUlL0+++/6/PPPw8onFT4vhDsvgQAAE5iAAAAQiw1NdUUKVLEDB482CxatMj8+9//Ng0aNDCVK1c2+/btC0qaP/74o3n++eeNJDNmzBizcuVKs3HjRpOammokmapVq5r77rvPLF261MyfP98YY8yHH35oihYtapo0aWLmzJlj5s+fbzp37mwcxzGzZ8/2KY8kU7t2bfPYY4+ZpUuXmnvvvddIMrfffrs5//zzzb/+9S+zdOlSk5KSYiSZefPm+c3zH3/8YSSZoUOHmqNHj5qjR4+anTt3mtdee80kJiaaG2644ZTro3///qZo0aLmrbfe8pv+VVddZdq3b29iY2PNlClT/Ma9detWs3DhQmOMMbfddptJS0szWVlZZtq0aebIkSP5fs62XwSj/1SsWNEkJCSYOnXqmOnTp5slS5aYq6++2kjKt8wHDx40r7/+uunZs6eJiYkxcXFxpnfv3mbevHnm0KFDVul+8MEHRpIpV66ciYqKMomJiaZz587m448/9obJysoy8fHxpkWLFgGVaePGjcbj8ZgGDRqY1157zSxZssQMHz7cFClSxIwcOdIn7A8//GAcxzHDhg3LFYckc//99weUdo5TOYceffRRs3TpUvPMM8+Y2NhYk5KS4g2XlpZmJJnNmzd7jzVu3Ni0atUqV9oXXXSRueiiiwrM34nn/z333GPee+8988wzz5iEhATTuHFjn/5qm0fbMm/dutXccccdRpJ58803zcqVK83KlStNRkaG6/VmjDFdunQxZcuWNS+99JL58MMPzfz5882jjz7qE19eKlasaG666Sbvv8eNG2fi4+ONJPPbb78ZY4w5evSoSUpKMvfee6833CeffGIkme+//971NshrvLbt78Ear3McPXrUlCtXzlxzzTW53rv44ovNhRdeWGDbG2PM999/bxITE80VV1xhjDEmOzvbtG/f3pQrV878/vvv1nnJiTfntXz5clOpUiVToUIFb1oFOXDggJk9e7bp1auXiYmJMfHx8ebKK680c+fONYcPH87zMzExMea6667Ldbxfv35Gknnvvfe8x2zGvxzNmzfP83z+5ptvjCTz4osvBhTOmML3hWD3JQAA4IuFDQAAEFILFy40ksz48eN9jn///fdGkpkxY0auz3Tt2tUkJCTk+Ro9erR12jk/osydO9d7LOeHiUcffTRX+ObNm5ty5cr5/FielZVl6tevb8455xxz7Ngxnziefvppn883atTI+8NVjqNHj5qyZct6f7AqyJIlS4ykXK/o6Gjz+OOPW5c7L1lZWX4XN05MPy4
2023-10-06 11:41:37 +02:00
"text/plain": [
"<Figure size 2000x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-09-28 15:50:32 +02:00
"source": [
"#energyloss in abh von der energie der elektronen\n",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
2023-10-10 16:17:10 +02:00
"a0=ax0.hist2d(energyloss_found, energy_found, bins=(np.linspace(0,1,70), np.linspace(0,5e4,70)), cmap=plt.cm.jet, cmin=1, vmax=10)\n",
"ax0.set_ylim(0,5e4)\n",
2023-10-05 15:58:17 +02:00
"ax0.set_xlim(0,1)\n",
"ax0.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
2023-09-28 15:50:32 +02:00
"ax0.set_ylabel(r\"$E_0$\")\n",
"ax0.set_title(\"found energyloss wrt electron energy\")\n",
"\n",
2023-10-10 16:17:10 +02:00
"a1=ax1.hist2d(energyloss_lost, energy_lost, bins=(np.linspace(0,1,70), np.linspace(0,5e4,70)), cmap=plt.cm.jet, cmin=1, vmax=10) \n",
"ax1.set_ylim(0,5e4)\n",
2023-10-05 15:58:17 +02:00
"ax1.set_xlim(0,1)\n",
"ax1.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
2023-09-28 15:50:32 +02:00
"ax1.set_ylabel(r\"$E_0$\")\n",
"ax1.set_title(\"lost energyloss wrt electron energy\")\n",
2023-10-05 15:58:17 +02:00
"\n",
"fig.colorbar(a1[3],ax=ax1)\n",
2023-10-06 11:41:37 +02:00
"fig.suptitle(r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, only photons w/ brem_vtx_z$<9500$mm\")\n",
2023-10-05 15:58:17 +02:00
"\n",
"\"\"\"\n",
"we can see that high energy electrons are often found even though they emit a lot of their energy through bremsstrahlung\n",
"\"\"\"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 29,
2023-10-05 15:58:17 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
2023-10-10 16:17:10 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABjgAAAJOCAYAAAAK1w6oAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADYe0lEQVR4nOzdeZxN9ePH8fcxuz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+vWrbruuusUGRkpl8ulW265RQcPHsxyn/3793vNo90yP/jgg5Kk6tWrux/N88UXXxRIvR08eFB33HGHKleurJCQEJUrV06tW7fWqlWrsq2f7du3y7Isffjhh+5tmzdvlmVZatCggUfYnj17esz0MsZo4cKFuv7667ON/1x79uzx2gbeztd2+ntBnq8ladGiRbIsS59//nmm915//XVZlqXrrrsu27Y/deqUmjZtqosvvtijDRMTExUTE6O2bdsqLS3NVl6ye/xTXh7zlpSUpHfeeUcdOnTQRRddpN9//z3LcN98843atm3rMegUERGhq666SuvWrdO+fftylW6GhQsXqlSpUurbt6/H9kGDBumvv/7St99+m6twUv77QkH3JQAAcB4DAADgJxISEkyJEiXM4MGDzdKlS82//vUv06hRI1O5cmVz7NixAknzt99+M6+++qqRZMaPH2/Wr19vtm/fbhISEowkU7VqVfPwww+blStXmkWLFhljjPniiy9MUFCQadasmXn//ffNokWLTKdOnYxlWWb+/Pke5ZFk6tSpY55++mmzcuVK89BDDxlJ5p577jF169Y1L7/8slm5cqUZNGiQkWQWLFjgNc9///23kWSGDx9uUlJSTEpKitm/f7957733TEREhLntttvyXB/9+/c3QUFBZuHChV7Tv/HGG83VV19tQkJCzLRp07zGvWfPHrN48WJjjDF33323mT59uklNTTUzZswwZ86cyXY/u/2iIPpPxYoVTXh4uKlXr56ZNWuWWbFihbnpppuMpGzLfPLkSTNnzhzTo0cPExwcbEJDQ02fPn3MggULzKlTp2ylu2bNGiPJlC9f3gQEBJiIiAjTqVMn89VXX7nDpKammrCwMNOyZctclWn79u3G5XKZRo0amffee8+sWLHCjBw50pQoUcKMGTPGI+yvv/5qLMsyI0aMyBSHJPPII4/kKu0MeTmGRo8ebVauXGleeOEFExISYgYNGuQON336dCPJ7Ny5072tadOmpnXr1pnSvuyyy8xll12WY/7OPf4ffPBB89lnn5kXXnjBhIeHm6ZNm3r0V7t5tFvmPXv2mHvvvddIMh999JFZv369Wb9+vUlOTna83owxpnPnzqZcuXLmrbfeMl988YVZtGiRGT16tEd8WalYsaK544473H8/++yzJiwszEgyf/75pzHGmJSUFBMZGWkeeughd7ivv/7aSDI7duxwvA2yOl/b7e8Fdb7OkJKSYsqXL29uvvnmTO9dfvnl5pJLLsmx7Y0xZseOHSYiIsJcd911xhhj0tLSzNVXX23Kly9v/vrrL9t5yYg347V69WpTqVIlExMT404rJydOnDDz5883PXv2NMHBwSYsLMxcf/315sMPPzSnT5/Ocp/g4GBz6623Ztrer18/I8l89tln7m12zn8ZWrRokeXx/OOPPxpJ5s0338xVOGPy3xcKui8BAABPDHAAAAC/sHjxYiPJTJw40WP7jh07jCQze/bsTPt06dLFhIeHZ/l65plnbKed8WXKhx9+6N6W8QXF6NGjM4Vv0aKFKV++vMeX5qmpqaZhw4bmoosuMunp6R5xTJ482WP/Jk2auL/AypCSkmLKlSvn/uIqJytWrDCSMr0CAwPNuHHjbJc7K6mpqV4HOc5NPzQ01GzYsCH
2023-10-06 11:41:37 +02:00
"text/plain": [
"<Figure size 2000x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-10-05 15:58:17 +02:00
"source": [
"#plot residual energy against energyloss and try to find a good split (eg energyloss before and after the magnet)\n",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
2023-10-10 16:17:10 +02:00
"a0=ax0.hist2d(energyloss_found, residual_found, bins=(np.linspace(0,1,80), np.linspace(0,6e4,80)), cmap=plt.cm.jet, cmin=1, vmax=15)\n",
"ax0.set_ylim(0,6e4)\n",
2023-10-05 15:58:17 +02:00
"ax0.set_xlim(0,1)\n",
"ax0.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
"ax0.set_ylabel(r\"$E_0-E_\\gamma$\")\n",
"ax0.set_title(\"found energyloss wrt residual electron energy\")\n",
"\n",
2023-10-10 16:17:10 +02:00
"a1=ax1.hist2d(energyloss_lost, residual_lost, bins=(np.linspace(0,1,80), np.linspace(0,6e4,80)), cmap=plt.cm.jet, cmin=1, vmax=15) \n",
"ax1.set_ylim(0,6e4)\n",
2023-10-05 15:58:17 +02:00
"ax1.set_xlim(0,1)\n",
"ax1.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
"ax1.set_ylabel(r\"$E_0-E_\\gamma$\")\n",
"ax1.set_title(\"lost energyloss wrt residual electron energy\")\n",
"\n",
"fig.colorbar(a1[3],ax=ax1)\n",
2023-10-06 11:41:37 +02:00
"fig.suptitle(r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, only photons w/ brem_vtx_z$<9500$mm\")\n",
2023-09-28 15:50:32 +02:00
"\n",
"\"\"\"\n",
"\"\"\"\n",
"plt.show()"
]
},
2023-10-09 09:59:35 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 30,
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-10 16:17:10 +02:00
"execution_count": 31,
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",
2023-10-02 15:10:45 +02:00
"sf_vtx_type_found = scifi_found[\"all_endvtx_types\"]\n",
"\n",
"\n",
2023-09-29 12:21:18 +02:00
"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",
2023-10-02 15:10:45 +02:00
"sf_vtx_type_lost = scifi_lost[\"all_endvtx_types\"]\n",
2023-09-29 12:21:18 +02:00
"\n",
"\n",
"\n",
"#ak.num(scifi_found[\"energy\"], axis=0)\n",
"#scifi_found.snapshot()"
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 32,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"text/html": [
"<pre>[101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 0]\n",
"------------------\n",
"type: 11 * float32</pre>"
],
"text/plain": [
"<Array [101, 101, 101, 101, 101, ..., 101, 101, 101, 0] type='11 * float32'>"
]
},
2023-10-10 16:17:10 +02:00
"execution_count": 32,
2023-10-09 09:59:35 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-09-29 12:21:18 +02:00
"source": [
2023-10-02 13:56:58 +02:00
"ak.num(scifi_found[\"energy\"], axis=0)\n",
2023-10-02 15:10:45 +02:00
"scifi_found[\"all_endvtx_types\"][1,:]"
2023-09-29 12:21:18 +02:00
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 40,
2023-09-29 12:21:18 +02:00
"metadata": {},
"outputs": [],
"source": [
"scifi_fitpars_found = ak.ArrayBuilder()\n",
2023-10-02 15:10:45 +02:00
"vtx_types_found = ak.ArrayBuilder()\n",
2023-09-29 12:21:18 +02:00
"\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",
" scifi_fitpars_found.end_list()\n",
2023-10-02 15:10:45 +02:00
" \n",
" vtx_types_found.begin_list()\n",
" #[:,0] -> endvtx_type\n",
" vtx_types_found.extend(sf_vtx_type_found[i,:])\n",
" vtx_types_found.end_list()\n",
" \n",
2023-09-29 12:21:18 +02:00
"\n",
"scifi_fitpars_lost = ak.ArrayBuilder()\n",
2023-10-02 15:10:45 +02:00
"vtx_types_lost = ak.ArrayBuilder()\n",
2023-09-29 12:21:18 +02:00
"\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",
" scifi_fitpars_lost.end_list()\n",
2023-10-02 15:10:45 +02:00
" \n",
" vtx_types_lost.begin_list()\n",
2023-10-05 10:49:35 +02:00
" #endvtx_type\n",
2023-10-02 15:10:45 +02:00
" vtx_types_lost.extend(sf_vtx_type_lost[i,:])\n",
" vtx_types_lost.end_list()\n",
" \n",
"\n",
2023-09-29 12:21:18 +02:00
"\n",
2023-10-02 15:10:45 +02:00
"scifi_fitpars_lost = ak.to_numpy(scifi_fitpars_lost)\n",
"scifi_fitpars_found = ak.to_numpy(scifi_fitpars_found)\n",
2023-09-29 12:21:18 +02:00
"\n",
2023-10-02 15:10:45 +02:00
"vtx_types_lost = ak.Array(vtx_types_lost)\n",
"vtx_types_found = ak.Array(vtx_types_found)\n",
2023-09-29 12:21:18 +02:00
"\n"
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 34,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"text/html": [
"<pre>[101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 101,\n",
" 0]\n",
"------------------\n",
"type: 11 * float64</pre>"
],
"text/plain": [
"<Array [101, 101, 101, 101, 101, ..., 101, 101, 101, 0] type='11 * float64'>"
]
},
2023-10-10 16:17:10 +02:00
"execution_count": 34,
2023-10-09 09:59:35 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-10-02 15:10:45 +02:00
"source": [
"vtx_types_found[0]"
]
2023-09-29 12:21:18 +02:00
},
{
"cell_type": "code",
2023-10-02 15:58:50 +02:00
"execution_count": null,
2023-10-02 15:10:45 +02:00
"metadata": {},
"outputs": [],
"source": [
"\n",
"\n"
]
},
{
"cell_type": "code",
2023-10-10 16:17:10 +02:00
"execution_count": 49,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
2023-10-10 16:17:10 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABbEAAAIhCAYAAABwh/ftAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACuWElEQVR4nOzde3xUxf3/8feSkBAiWRMwhCgCKiIIKEWL4AUQuSlitWprFMG2SouIKKhVi4IKFEXUivef9crF9qt4QUVQAaWgIogUa7W2iFRFLAkJUExIMr8/aFaXnDns5WT3bPb1fDz28ZA558zMuezu7Dj5fALGGCMAAAAAAAAAAHyoSbI7AAAAAAAAAACADZPYAAAAAAAAAADfYhIbAAAAAAAAAOBbTGIDAAAAAAAAAHyLSWwAAAAAAAAAgG8xiQ0AAAAAAAAA8C0msQEAAAAAAAAAvsUkNgAAAAAAAADAt5jEBgAAAAAAAAD4FpPYAPTMM8/o6KOPVk5OjgKBgNatW5fsLjmaPHmyAoGAZ/V9/vnnCgQCmjlzpmd1rly5UpMnT9b27ds9qxPJ89VXX2ny5MkRvycef/xxBQIBvf/++w3bsUZs2rRpev7555PdDQBAGqj73v78888bpP77779fjz/+uOf1NsR4Y+7cubr77rs9qw/JFe1vklGjRumAAw5o2E41YtH+ZgAQGyaxgTT37bffasSIETr88MO1aNEirVq1SkceeWSyu5WyVq5cqSlTpjCJ3Uh89dVXmjJlCgPSBGISGwDQWDTUJHZDYBK7ceE3SWLxmwFIjMxkdwBAcn366afas2ePLrroIvXt2zfZ3UEjY4zRd999p5ycnGR3JSo1NTWqrq5OdjcazH//+181b9482d1ImLr7mZ2dneyuAACAFLBnzx4FAgFlZqbWlMnu3bvVrFmzZHejwezevTvlflfEo+5+evnXyEAqYyU2kMZGjRqlk046SZL0s5/9TIFAQP369Qttf/HFF9W7d281b95cLVq00MCBA7Vq1ap6dbRv375e3U6hPwKBgMaOHaunnnpKnTt3VvPmzXXMMcdo4cKF9Y5/+eWXdeyxxyo7O1sdOnSIKuRHv3791LVrV7399ts64YQTlJOTo4MPPliTJk1STU2N4zGzZs1Shw4ddMABB6h3795655136u2zv+sxefJkXXPNNZKkDh06KBAIKBAIaNmyZZKk2tpa3X777TrqqKOUnZ2twsJCXXzxxfr3v//t2P/Vq1fr5JNPVvPmzXXYYYfp97//vWpra/d7/sYY3X///Tr22GOVk5Oj/Px8nXvuufrXv/4VczsVFRWaOHGiOnTooKysLB188MEaP368du3aFbZf3T1+8MEH1blzZ2VnZ+uJJ56QJK1YsUK9e/dWs2bNQvfj//2//xf2Z7y//OUvVVBQoP/+97/1zuvUU0/V0UcfbT3v++67T02aNNHWrVtDZXfeeacCgYAuv/zyUFltba3y8/M1YcIESd+Hlbn99tt12223qUOHDsrOztbSpUt1/PHHS5IuueSS0P2cPHnyfu6AVFZWpksuuUQFBQXKzc3VmWeeWe/6O6l733zwwQc655xzlJeXp2AwqIsuukjffvtt2L7PPPOMBg0apDZt2ignJ0edO3fWb3/723r3pO7PQ//6179q0KBBatGihQYMGCBJWrJkic466ywdcsghatasmY444giNHj1a//nPfxz7tX79ep133nkKBoMqKCjQ1Vdfrerqan3yyScaMmSIWrRoofbt2+v222+vd26RPEOBQEC7du3SE088EbreP/xM2rJli0aPHq1DDjlEWVlZ6tChg6ZMmRL2Pxzc7icAAJH44x//qGOOOUbNmjVTQUGBzj77bH388cdh+/zrX//Sz3/+cxUXFys7O1utW7fWgAEDQisx27dvr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3M3fuXPPmm2+aDRs2mA8//NA0a9bMdO/e3cyfP9+8+OKL5vTTTzft27c3kszGjRuNMcZ8+OGHRpJ55JFHws7po48+MpLMfffdZz3vv//970aSmTt3bqhsyJAhJicnx3Ts2DFU9u677xpJ5pVXXgl7Dg4++GDTv39/83//939m8eLF5sMPPzSPPfaYkWR+97vfhe7n5s2brX2o279t27bmF7/4hXn11VfNww8/bAoLC03btm1NWVmZ672re9+0a9fOXHPNNea1114zs2bNMrm5uaZHjx6mqqoqtO+tt95q7rrrLvPyyy+bZcuWmQcffNB06NDB9O/fP6zOkSNHmqZNm5r27dub6dOnmzfeeMO89tprxhhjHnjgATN9+nTz4osvmuXLl5snnnjCHHPMMaZTp05hbdX1q1OnTubWW281S5YsMddee23oeT7qqKPMH/7wB7NkyRJzySWXGEnm2WefDR0f6TO0atUqk5OTY04//fTQ9a77TPr6669N27ZtTbt27cxDDz1kXn/9dXPrrbea7OxsM2rUqFBbtvtZ94wBAFCn7nv7h98R06ZNM5LMBRdcYF5++WXz5JNPmsMOO8wEg0Hz6aefhvbr1KmTOeKII8xTTz1lli9fbp599lkzYcIEs3TpUmOMMWvXrjWHHXaY6dGjR+g7be3ata79qRtDdOnSxcybN8+8+OKLZsiQIUaS+fOf/1yv34cddpi54oorzGuvvWb+3//7fyY/P7/eOCCS8edHH31kTjzxRFNUVBTq66pVq4wxxuzevdt0797d5ObmmpkzZ5rFixebSZMmmczMTHP66afX638kY30n0Y43I2nno48+MsFg0HTr1s08+eSTZvHixWbChAmmSZMmZvLkyaH9li5dGho7nHvuuebFF180CxcuNNu2bTMPPfSQkWR++tOfmoULF5o5c+aYI4880rRr1y7sN9A999xjAoFA2DNijAn91qobzzh58MEHjSTz1VdfGWOM2bNnj2nRooXJyckxl156aWi/GTNmmMzMTFNRUWGM+f45OPjgg81
2023-10-09 09:59:35 +02:00
"text/plain": [
2023-10-10 16:17:10 +02:00
"<Figure size 1800x600 with 3 Axes>"
2023-10-09 09:59:35 +02:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-09-29 12:21:18 +02:00
"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",
2023-10-10 16:17:10 +02:00
"bs_found, vtxs_types_found = ak.broadcast_arrays(b_found, vtx_types_found)\n",
2023-10-02 15:10:45 +02:00
"bs_found = ak.to_numpy(ak.ravel(bs_found))\n",
2023-10-10 16:17:10 +02:00
"vtxs_types_found = ak.to_numpy(ak.ravel(vtxs_types_found))\n",
2023-10-02 15:10:45 +02:00
"\n",
2023-10-10 16:17:10 +02:00
"bs_lost, vtxs_types_lost = ak.broadcast_arrays(b_lost, vtx_types_lost)\n",
2023-10-02 15:10:45 +02:00
"bs_lost = ak.to_numpy(ak.ravel(bs_lost))\n",
2023-10-10 16:17:10 +02:00
"vtxs_types_lost = ak.to_numpy(ak.ravel(vtxs_types_lost))\n",
2023-10-02 15:10:45 +02:00
"\n",
"\n",
2023-09-29 12:21:18 +02:00
"\n",
"\n",
"#Erste Annahme ist Bremsstrahlung\n",
"\n",
2023-10-10 16:17:10 +02:00
"fig, axes = plt.subplots(nrows=1,ncols=2,figsize=(18,6))\n",
"\n",
2023-09-29 12:21:18 +02:00
"\n",
2023-10-10 16:17:10 +02:00
"n_bins = (np.linspace(-1,1,100), np.linspace(0,1e5,100))\n",
2023-09-29 12:21:18 +02:00
"\n",
2023-10-10 16:17:10 +02:00
"h0 = axes[0].hist2d(b_found, brem_energy_found, bins=n_bins, cmap=plt.cm.jet, cmin=1,vmax=15)\n",
2023-09-29 12:21:18 +02:00
"axes[0].set_xlim(-1,1)\n",
2023-10-10 16:17:10 +02:00
"axes[0].set_ylim(0,1e5)\n",
2023-09-29 12:21:18 +02:00
"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",
2023-10-10 16:17:10 +02:00
"h1 = axes[1].hist2d(b_lost, brem_energy_lost, bins=n_bins, cmap=plt.cm.jet, cmin=1,vmax=15)\n",
2023-09-29 12:21:18 +02:00
"axes[1].set_xlim(-1,1)\n",
2023-10-10 16:17:10 +02:00
"axes[1].set_ylim(0,1e5)\n",
2023-09-29 12:21:18 +02:00
"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",
2023-10-10 16:17:10 +02:00
"fig.colorbar(h1[3], ax=axes[1])\n",
2023-09-29 12:21:18 +02:00
"\n",
"\"\"\"\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-02 15:58:50 +02:00
"execution_count": null,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-02 15:58:50 +02:00
"outputs": [],
2023-10-02 15:10:45 +02:00
"source": []
2023-10-02 13:56:58 +02:00
},
{
"cell_type": "code",
2023-10-10 11:00:25 +02:00
"execution_count": 20,
2023-10-02 13:56:58 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABS0AAAIhCAYAAACrEJ+KAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACFBUlEQVR4nOzdeXQUVdrH8V+TnSUNQUlAEEERDCgCRjbZZB9xXAfcEBAXxjiK6KiMC8R3BNEZRKVRcdS4DMsoq4qDoCwqUSObDnFjRGEwEWEgAWRL575/MGnpdCXpht5S/f2cU+fQlVu3blV19324fesphzHGCAAAAAAAAACiRK1INwAAAAAAAAAAjsWgJQAAAAAAAICowqAlAAAAAAAAgKjCoCUAAAAAAACAqMKgJQAAAAAAAICowqAlAAAAAAAAgKjCoCUAAAAAAACAqMKgJQAAAAAAAICowqAlAAAAAAAAgKjCoCVsb+7cuWrbtq1SUlLkcDi0YcOGSDfJ0sSJE+VwOCLdDC8Oh0MTJ04MeLslS5Yc13bV6d27t3r37l1tue+//14Oh0O5ublBb0N1ZsyYEdB+HQ6HbrvtttA1yOZC9V4DAIRPbm6uHA6Hvv/++5DUH2jfHC4rV66Uw+HQypUrA942VMfkb+wX6mtWmV9++UUTJ070+5yVn+M33ngjtA2zAWIqANGIQUvY2s8//6zhw4fr9NNP1z//+U/l5eXpzDPPjHSzbG/JkiXKyckJer0zZszQjBkzgl5vMEXrf4zsKlTvNQCAfdixbw7VMeXl5enGG28Mer3B8ssvvygnJ+e4BnpRNWIqANEoPtINAELpm2++0ZEjR3TdddepV69ekW4OTlBmZmakm1CpX375RbVr1450M0LiyJEjcjgcio+PnS7DztcTAIDKdOnSJdJNsGSM0cGDByPdjJCxc9xh52MDEHrMtIRtjRw5UhdccIEkadiwYXI4HF63Fi9evFhdu3ZV7dq1Va9ePfXv3195eXk+dZx22mk+dVvdyl1+m++rr76qs846S7Vr11b79u311ltv+Wz/9ttv69xzz1VSUpJatGihv/zlLwEd2/Lly9W3b1+lpqaqdu3a6t69u9577z3LNm7atElXX321nE6n0tPTdcMNN6i4uNirbElJiW666SY1bNhQdevW1aBBg/TNN994lVm4cKEcDofPfiTpmWeekcPh0Oeff66RI0fK5XJ5zkn58v3332vOnDlyOByaPn261/YTJkxQXFycli1bVuVxW90e/uOPP2ro0KGqV6+enE6nhg0bpqKioirrKT/m+Ph4Pf744551O3fuVK1ateR0OlVaWupZf/vtt+vkk0+WMcbTjnbt2mn16tXq1q2bateurRtuuEGnnXaaNm3apFWrVnmO2+r9Y+W5557TmWeeqaSkJGVmZmrOnDnVblN+G/xjjz2mRx55RKeeeqqSk5N13nnn+VynzZs3a9SoUWrVqpVq166tU045RRdffLG++OILr3Llt1G9+uqruuuuu3TKKacoKSlJmzdv1s8//6xbb71VmZmZqlu3rho1aqQLL7xQH3zwgWW7Hn/8cU2ZMkWnnXaaUlJS1Lt3b88PCffdd5+aNGkip9Opyy67TDt27PA5vrlz56pr166qU6eO6tatq4EDB2r9+vWev1f1XpOO/gdnxowZOvfcc5WSkqIGDRroyiuv1Hfffee1n8quJwAgsl588UW1b99eycnJSktL02WXXaYvv/zSq8x3332nq666Sk2aNFFSUpLS09PVt29fTzqg4+mbA+0/8vPz1aNHD9WuXVstW7bUo48+qrKyMq+yX331lQYNGqTatWvrpJNO0pgxY7R3716vMmPHjlWdOnVUUlLi06Zhw4YpPT1dR44cqfKYxowZo+TkZK1du9azbVlZmfr27av09HQVFhZWeexWt4d//PHH6t69u5KTk9WkSRONHz9eR44cqbIe6Wi863A4lJ+f71k3b948ORwOXXTRRV5lzznnHF1xxRVe7bjtttv07LPP6qyzzlJSUpJefvllnXzyyZKknJwcz7GPHDmy2rYcPHhQ48aNU0ZGhlJSUtSrVy+vmKIy5bfBL1u2TKNGjVJaWprq1Kmjiy++2Of9sGzZMl1yySVq2rSpkpOTdcYZZ+iWW27Rzp07vcqVx+jr1q3TlVdeqQYNGuj000+XJH322We66qqrPLHTaaedpquvvlo//PCDZbtWrFih3//+9zrppJPUsGFDXX755frxxx99joOYCkCNZQCb2rx5s3G5XEaSmTRpksnLyzObNm0yxhjz97//3UgyAwYMMAsXLjRz5841nTp1MomJieaDDz7w1DFixAjTvHlzn7onTJhgKn58JJnTTjvNnH/++eYf//iHWbJkiendu7eJj483//73vz3lli9fbuLi4swFF1xg5s+fb15//XWTlZVlTj31VJ86rbz66qvG4XCYSy+91MyfP9+8+eabZsiQISYuLs4sX77cp42tW7c2Dz30kFm2bJmZOnWqSUpKMqNGjfKUKysrM3369DFJSUnmkUceMe+++66ZMGGCadmypZFkJkyYYIwx5siRI6ZRo0bm2muv9WnT+eefbzp27Og571deeaWRZPLy8jzLwYMHjTHGjBkzxiQmJpr8/HxjjDHvvfeeqVWrlnnggQeqPfZevXqZXr16eV7/8ssv5qyzzjJOp9M8/fTTZunSpeb222/3nMuXXnqpyvq6dOliBgwY4Hk9Z84ck5ycbBwOh/noo48868866ywzdOhQr3akpaWZZs2amaefftqsWLHCrFq1yqxbt860bNnSdOjQwXPc69atq7INkkyzZs1MZmammT17tlm8eLEZNGiQkWRef/31KrfdsmWLZ/sLLrjAzJs3z/N+SkhIMGvWrPGUXbVqlbnrrrvMG2+8YVatWmUWLFhgLr30UpOSkmK++uorT7kVK1YYSeaUU04xV155pVm8eLF56623zK5du8xXX31lfv/735s5c+aYlStXmrfeesuMHj3a1KpVy6xYscKnXc2bNzcXX3yxeeutt8xrr71m0tPTzZlnnmmGDx9ubrjhBvPOO++YZ5991tStW9dcfPHFXsf2yCOPGIfDYW644Qbz1ltvmfnz55uuXbuaOnXqeD7H1b3XbrrpJpOQkGDuuusu889//tPMmjXLtGnTxqSnp5uioqJqrycAIDxeeuklI8ls2bLFs27SpElGkrn66qvN22+/bV555RXTsmVL43Q6zTfffOMp17p1a3PGGWeYV1991axatcrMmzfP3HXXXZ5+6Xj65kD6j4YNG5pWrVqZZ5991ixbtszceuutRpJ5+eWXPeWKiopMo0aNzCmnnGJeeukls2TJEnPttdd64pXytm7cuNFIMs8//7xXe3bv3m2SkpLMuHHjqj2mAwcOmHPPPde0bNnS7N692xhjzEMPPWRq1apl3n333WqvxbGxnzHGbNq0ydSuXdsTpyxatMgMHDjQ0/Zjr1lFe/fuNQkJCWbSpEmedWPGjDEpKSmmTp065vDhw8YYY3766SfjcDjMjBkzvNpxyimnmHPOOcfMmjXLvP/++2bDhg3mn//8p5FkRo8e7Tn2zZs3V9qG8rimWbNm5pJLLjFvvvmmee2118wZZ5xhUlNTvWJ0K+XvzWbNmnlil5kzZ5pGjRqZZs2aec6xMcY888wzZvLkyWbx4sVm1apV5uWXXzbt27c3rVu39hyrMb/G6M2bNzf33nuvWbZsmVm4cKExxpjXX3/dPPTQQ2bBggVm1apVZs6cOaZXr17m5JNPNj///LNPu1q2bGn+8Ic/mKVLl5q//e1vpkGDBqZPnz5ex0BMBaAmY9AStlYeqBw7+ON2u02TJk3M2Wefbdxut2f93r17TaNGjUy3bt086wIdtExPTzclJSWedUVFRaZWrVpm8uTJnnWdO3c2TZo0MQcOHPCsKykpMWlpadUOWu7fv9+kpaX5DPC43W7Tvn17c/755/u08bHHHvMqe+utt5rk5GRTVlZmjDHmnXfeMZLMk08+6VXukUce8Qlcx40bZ1JSUsyePXs86woKCowk8/TTT3vWZWdnV3osBw8
"text/plain": [
"<Figure size 1800x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-10-02 13:56:58 +02:00
"source": [
"fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(18,6))\n",
"\n",
2023-10-02 15:58:50 +02:00
"a0=ax[0].hist2d(bs_found, vtx_types_found, bins=110, density=True, cmap=plt.cm.jet, cmin=1e-20,vmax=2)\n",
"ax[0].set_ylim(0,110)\n",
"ax[0].set_xlim(-1,1)\n",
2023-10-02 13:56:58 +02:00
"ax[0].set_xlabel(\"b\")\n",
"ax[0].set_ylabel(\"endvtx id\")\n",
"ax[0].set_title(\"found endvtx id wrt b parameter\")\n",
2023-10-02 15:58:50 +02:00
"ax[0].set_yticks(np.arange(0,110,1),minor=True)\n",
2023-10-02 13:56:58 +02:00
"\n",
2023-10-02 15:58:50 +02:00
"a1=ax[1].hist2d(bs_lost, vtx_types_lost, bins=110, density=True, cmap=plt.cm.jet, cmin=1e-20,vmax=2)\n",
"ax[1].set_ylim(0,110)\n",
"ax[1].set_xlim(-1,1)\n",
2023-10-02 13:56:58 +02:00
"ax[1].set_xlabel(\"b\")\n",
"ax[1].set_ylabel(\"endvtx id\")\n",
"ax[1].set_title(\"lost endvtx id wrt b paraneter\")\n",
2023-10-02 15:58:50 +02:00
"ax[1].set_yticks(np.arange(0,110,1), minor=True)\n",
2023-10-02 13:56:58 +02:00
"\n",
"\"\"\"\n",
2023-10-02 15:58:50 +02:00
"vtx_id: 101 - Bremsstrahlung\n",
2023-10-02 13:56:58 +02:00
"B:\n",
2023-10-02 16:21:00 +02:00
"wir können nicht wirklich sagen dass bei den lost teilchen jegliche endvertex types überwiegen, im gegensatz zu den found \n",
2023-10-02 13:56:58 +02:00
"\"\"\"\n",
2023-10-02 15:10:45 +02:00
"fig.colorbar(a0[3], ax=ax, orientation='vertical')\n",
2023-10-02 13:56:58 +02:00
"plt.show()"
2023-09-29 12:21:18 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-10-10 11:00:25 +02:00
"execution_count": 21,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABPEAAANVCAYAAAAZd2vuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAD1n0lEQVR4nOzdeVyU5f7/8ffILiqubK5ouacZlkIumIm5ZabHpQ5qqWVmplQmpom22GIeslyyKCtLPeeorWZiCWrSoqJpLpVHxQwy3HBlkfv3Rz/m2zADDjgwA7yej8c8ai4+93Vd9z3D8PEz93XfJsMwDAEAAAAAAABwWVWcPQEAAAAAAAAARaOIBwAAAAAAALg4ingAAAAAAACAi6OIBwAAAAAAALg4ingAAAAAAACAi6OIBwAAAAAAALg4ingAAAAAAACAi6OIBwAAAAAAALg4ingAAAAAAACAi6OIB5RTq1atUps2beTj4yOTyaRdu3YpNjZWJpPJIm7RokVatmyZcybp4j788EPFxcU5exrXLDExUSaTSYmJic6eit2WLVsmk8mkI0eOWLTPmDFDjRo1kru7u2rWrClJioiIUERExFX7dIX3uslk0sSJE506BwBA+Ueed+2ckedFRESobdu2Du+3SZMmGj16tMP7LU0mk0mxsbEWbV999ZU6duwoX19fmUwmffTRR4XmhAVt27ZNsbGxOnPmTKnN+WpGjx6tatWqOW18QKKIB5RLf/75p6KiotSsWTOtX79eycnJat68ucaOHavk5GSLWJK7wlWUIl551K9fPyUnJysoKMjc9vHHH+u5557TyJEjlZSUpI0bN0r66z28aNGiq/bJex0AUBGQ5zkGeZ5zJScna+zYsebnhmFo6NCh8vDw0CeffKLk5GR1797dZk5oy7Zt2zR79mynFvEAV+Du7AkAKL6ff/5ZOTk5+uc//6nu3bub26tWraoGDRo4cWbWLl26JG9vb6tvjiuyS5cuycfHx9nTKLGLFy+qatWqpTpGvXr1VK9ePYu2vXv3SpImTZokf39/c3vr1q0dPn5OTo5MJpPc3fkzCABwLeR5rq2853lXrlxRbm6uvLy8SnWczp07Wzz//fffderUKQ0aNEg9e/a0+FnBnNARyvvrBBSGM/GAcmb06NHq0qWLJGnYsGEymUzmpYYFl1k0adJEP/30k5KSkmQymWQymdSkSRNJ/7cEc/ny5YqOjlZgYKB8fHzUvXt3paSkWIy5fft2DR8+XE2aNJGPj4+aNGmiESNG6OjRoxZx+afDb9iwQffff7/q1aunqlWrKisrS7/++qvuu+8+XX/99apatarq16+vAQMGaM+ePRZ95M/rww8/1JNPPqmgoCBVq1ZNAwYM0B9//KFz587pgQceUN26dVW3bl3dd999On/+vEUfhmFo0aJFuvHGG+Xj46NatWppyJAh+t///meOiYiI0Oeff66jR4+aj83fj112draeffZZtWzZUl5eXqpXr57uu+8+/fnnnxZjNWnSRP3799eaNWvUoUMHeXt7a/bs2YW+fgkJCRo4cKAaNGggb29vXXfddXrwwQeVkZFR6DZ/d+DAAd1xxx2qWrWq6tatq/Hjx+vcuXM2Yzdu3KiePXuqRo0aqlq1qm699VZ99dVXFjH575mdO3dqyJAhqlWrl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rDw0NvvPGGevfurS+//NLqG9C7775bw4cP1/jx44tMQKKjo/X+++/r2WefVYcOHXThwgXt3btXJ0+eNMd8+eWXGjBggFq1aqX58+erUaNGOnLkiDZs2FBov2vXrtXChQsVHx+v9evXy8/Pr1hnG9jzXo+JiVFYWJiWLFmiKlWqyN/f35ysz5o1S4GBgTp//rzWrl2riIgIffXVV+Z/OOXm5qpPnz7asmWLJk+erNtuu025ubn69ttvlZqaqvDwcKs5ZWVlafTo0fr888/16aef6o477rB7fwAAlRN5XvnO86S/imvDhw/XtGnTNGfOHH3++ed69tlndfr0ab3++utFbjtu3Di99957evzxx9WrVy/t3btXd999t9UXtunp6brllltUpUoVPf3002rWrJmSk5P17LPP6siRI3rnnXcs4hcsWKDmzZtr3rx5qlGjhq6//nqb4ycnJ2vYsGEaNmyYYmNj5e3traNHj+rrr782x5w7d05dunTRkSNH9OSTT6pTp046f/68Nm/erLS0NLVs2dKq37Fjx6p9+/a6++679cgjj+iee+4p1pmAY8eO1alTp/Taa69pzZo15qW3f1+tUdjrdOjQId1zzz0KCQmRp6endu/ereeee04HDhzQ22+/bd4+Pj5e48aNU/fu3bVkyRL5+/vr559/Nq8UseXf//63Ro4cqfvvv1+vvfaa3Nzc7N4noMQMAOXOpk2bDEnGf/7zH4v2WbNmGQV/rdu0aWN079690D5uuukmIy8vz9x+5MgRw8PDwxg7dmyh4+fm5hrnz583fH19jVdffdXc/s477xiSjJEjR151H3Jzc43s7Gzj+uuvN6ZMmWI1rwEDBljET5482ZBkTJo0yaL9rrvuMmrXrm1+npycbEgyXnnlFYu4Y8eOGT4+PsbUqVPNbf369TMaN25sNbcVK1YYkozVq1dbtP/www+GJGPRokXmtsaNGxtubm7GwYMHr7rPBeXl5Rk5OTnG0aNHDUnGxx9/XGT8k08+aZhMJmPXrl0W7b169TIkGZs2bTIMwzAuXLhg1K5d2+oYXrlyxWjfvr1xyy23mNvy3zNPP/20XXNu27atcddddxUZ06xZM6NZs2bGpUuXCo3Jf68cPnzYai5//vmnRWz37t1tvocLutp7vVu3blftIzc318jJyTF69uxpDBo0yNz+3nvvGZKMN998s8jtJRkPP/ywcfLkSaNLly5G/fr1rV4vAACKQp73f8pbnte9e3ebOd24ceOMKlWqGEePHi102/379xuSLI6
"text/plain": [
"<Figure size 1500x1000 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-09-29 12:21:18 +02:00
"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",
2023-10-02 16:21:00 +02:00
"ax1.set_xticks(np.arange(-1,1,0.1),minor=True)\n",
2023-09-29 12:21:18 +02:00
"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": []
},
2023-10-05 10:49:35 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-09-28 15:50:32 +02:00
{
"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",
2023-10-23 15:19:57 +02:00
"version": "3.9.12"
2023-09-28 15:50:32 +02:00
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}