Projektpraktikum/B_rework.ipynb

1113 lines
282 KiB
Plaintext
Raw Normal View History

2023-09-28 15:50:32 +02:00
{
"cells": [
{
"cell_type": "code",
2023-10-26 10:59:21 +02:00
"execution_count": 1,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-26 10:59:21 +02:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Bad value in file '/home/lhcb/cetin/.config/matplotlib/matplotlibrc', line 267 ('font.size: large'): Key font.size: Could not convert 'large' to float\n"
]
}
],
2023-09-28 15:50:32 +02:00
"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-26 10:59:21 +02:00
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/lhcb/cetin/.config/matplotlib/matplotlibrc'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"matplotlib.matplotlib_fname()"
]
},
{
"cell_type": "code",
"execution_count": 3,
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-26 10:59:21 +02:00
"execution_count": 3,
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-26 10:59:21 +02:00
"execution_count": 4,
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-26 10:59:21 +02:00
"execution_count": 5,
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-26 10:59:21 +02:00
"execution_count": 5,
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-26 10:59:21 +02:00
"execution_count": 6,
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-26 10:59:21 +02:00
"execution_count": 7,
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-26 10:59:21 +02:00
"execution_count": 7,
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-26 10:59:21 +02:00
"execution_count": 8,
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-26 10:59:21 +02:00
"execution_count": 8,
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-26 10:59:21 +02:00
"execution_count": 25,
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-26 10:59:21 +02:00
"for cutoff_energy in range(0,100050,1000):\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-26 10:59:21 +02:00
"execution_count": 26,
2023-10-10 16:17:10 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-10-26 10:59:21 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnMAAAHWCAYAAAAciQ/OAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABDR0lEQVR4nO3db4wjZ2Lf+R9leUd9GY+qezebs51sVtWOgd073CnFEfYCXE7Aqoh9kQR3cJMaIDbgF+cmz+gXQfSC5X5hSIIBN9gv7hLkCIOcfeEXMnA95L7IxXlhkANDPgOOoWatNgG8wMascWyffbe2ukvjObRm4ajuxeip5Z8iu/ivyeJ8PwAhTbGq+LAesvjrp57nqVwURZEAAACQSS+suwAAAACYH2EOAAAgwwhzAAAAGUaYAwAAyDDCHAAAQIYR5gAAADKMMAcAAJBhhDkAAIAMI8wBW8D3/XUX4UaFYahms6kgCNZdlK0TBIGazabCMFx3UbBmz9t5JcsIcxsuDEOdnp4ql8spl8tpd3dXpVJJhUJB+/v7Oj09XXcRY81mU/v7+3FZC4WCut2upGcnhUKhED83Wm7P8/hhTqlUKsX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29e1dBEKhYLF77WRg8r5g6T5pI2ixzHCf1elg+wtwGC8Mw/it3NJQMniiX/cMpPfsL1vM8PXz4MFUgMi2Ig6HT/EU768lzkAmJ5XJZ1WpVtVpt7IcqzTrzSGoVlZ61hriuu3BQzOfzajQaarVa6nQ6c9fj6Ogxc9xnbVEwJ+Kky3iSJrbOlsvl+Mfu8PBwofqexPwQzHLHCnNMksptAtr+/v7Ktp/EhIN
2023-10-10 16:17:10 +02:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-10-26 10:59:21 +02:00
"x_ = np.arange(0,100050,step=1000)\n",
2023-10-10 16:17:10 +02:00
"\n",
2023-10-26 10:59:21 +02:00
"plt.errorbar(x_,efficiencies_found, yerr=deff_found, ls=\"\", fmt=\".\", label=\"$\\epsilon(E_{\\gamma,tot})$ \") #, capsize=1)\t\n",
2023-10-10 16:17:10 +02:00
"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",
2023-10-26 10:59:21 +02:00
"plt.ylim([0,1.1])\n",
"#plt.xlim([0,10100])\n",
"\"\"\"\n",
"plt.yticks(np.arange(0,1.04,step=0.02),minor=True)\n",
"plt.xticks(np.arange(-200,10400,step=200),minor=True)\n",
"\n",
"plt.tick_params(left=True, bottom=True, top=True, right=True,\n",
"\t\t\t\tlabelleft=True, labelbottom=True, labeltop=False, labelright=False,\n",
"\t\t\t\twhich=\"major\",direction=\"in\", length=12, labelsize=\"large\")\n",
"plt.tick_params(left=True, bottom=True, top=True, right=True,\n",
"\t\t\t\tlabelleft=True, labelbottom=True, labeltop=False, labelright=False,\n",
"\t\t\t\twhich=\"minor\",direction=\"in\", length=6)\n",
"\"\"\"\n",
"plt.legend()\n",
2023-10-10 16:17:10 +02:00
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-10-26 10:59:21 +02:00
"execution_count": 11,
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-26 10:59:21 +02:00
"execution_count": 11,
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-26 10:59:21 +02:00
"execution_count": 12,
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-26 10:59:21 +02:00
"execution_count": 13,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
2023-10-26 10:59:21 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHVCAYAAAB8NLYkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5H0lEQVR4nO3dX2wb9533+w9TxW7gNBopvckBzvNEw2b3YoFNPJS2aZ/zANuY3GCxV41IaXEWWAd9IjKBgXPRrcmoOBe+eNYyVSN3RkPKBRIgPQuJTBZ7sVhsSWcNHCBBj8RJcnNwtl2NXPjgZB+gkcZuitSJap4LLxnL/C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BrmJmZ0czMTMv2q1evhmpZsbbeuzDqCg737QujrgAAAAyJ52D34Ycfqlqtant7u2Xf7u6uqtVq+IMdAABAgHgKdq+++qp+9KMftYyIvV+7aVBwPNm2rfX1dVWrVUksGwcAQFB5GhVbLBY1Pz+vWq2mvb29lte//du/aX5+3u9aMSKWZWlxcVG2bQ/0Oo7jyHXdgV4DAIAw89RjNz09rdXVVT355JNt909OTiqfz/dTFwLGsqyBXyOVSqlUKh2YJxEAAPTOU49dJpM5dGWJW7dueSoI4ymVSg28RxAAgLDzFOzOnz+vUqmkX/3qV7p9+3bL68aNG1pZWfG7VgSU67rKZDLK5XJKJBJKJBLN5/HaHZPJZBSNRlUsFiXdW3u4EeoymQwhDwAAjzzdir19+7a2t7dZNgyybVtnzpzRtWvXmrdri8WiEomE8vm8stmsJGlpaUm
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-26 10:59:21 +02:00
"execution_count": 14,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
2023-10-26 10:59:21 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAB3EAAAJRCAYAAABbdk1MAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACuYElEQVR4nOz9f5AbaZ7f+X2S7B0updY0yJ6L0IzD0jaoVfhI+XYO6FnFhq1trxt1cpxE6iwC1fKdR6uilwVZJSvC496CKP3BpsNrLhh9doR8dVoUI6pWNyfbTYAXJ1bsOUKFXt2cFDqfmsgdWSJX0m1hdle+ntVplsS02uL0NIvpP6qBrh8AKp9vZT5IAO9XBKKbyHzy+f1kPngqM4MoiiIBAAAAAAAAAAAAADLh1KQTAAAAAAAAAAAAAAD4HIu4AAAAAAAAAAAAAJAhLOICAAAAAAAAAAAAQIawiAsAAAAAAAAAAAAAGcIiLgAAAAAAAAAAAABkCIu4AAAAAAAAAAAAAJAhLOICAAAAAAAAAAAAQIawiAsAAAAAAAAAAAAAGcIiLgAAADCH1tfX1ev1Jp0MAAAAAAAADMEiLgAAAAAAAAAAAABkCIu4AAAAAOBRt9tVq9WadDImptfrzcVd4GEYpnbsXq+nVqs11+1omF6vp/X1dcolw+al/wMAAABJYBEXAAAAmBN37twZfJrNpm7fvj34d5xFj263qzt37qharapYLE78h/h2u60LFy4oCAItLCyoVqsN/utTt9tVpVJREAQ6d+6c1tfXJe0t4l24cEHnzp3TnTt3JEnVanVQbnfu3FG32/Wa1klotVoKgmDwee2115TL5Q7s0263ValUtLCwoEqlokqlomq1qmq1GqtttlotnTt3btAWDi+g9rdfuHAh1cVVaa/ei8WiisVianE8fPhQlUpF29vbqcWRZbVaTdVq9cj37XZb1WpVH3zwwQRSNZ+q1apqtdrgc9hx/b9/Tun/97DjtgMAAACz7KVJJwAAAACAH6urq4P/z+VyWlxcPLKYNk6xWFSn01E+n1e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hNSSPfoVgoFEZuO3yM/nfjHmnZbrdVLpe1uroqae99jBcuXJCkoY8y7u8T9x2rkvTkyRO99tprQ9/Z2tdsNpXL5bS9va1z587p+vXrg3fkuhhXd0nU6/b2tgqFwoHHo3a73QOPo46jXC6rXC6r3W7rwoULYx+5ul8+n1e9XlelUhn8W9LQ93/2971z547K5bJKpZLu3LmjQqGger0+2G////ctLy+rVqupXq9reXlZ9Xp9ZHsYJk77Pdw247wDt/9u0Nu3b6tcLg/eOTzO4eO+/vrrIx9PvP9do5Y+mFS+V1dXVa1W1Ww2Rz4yvK9cLiuXy2l9fV2rq6uDttRoNNRoNLS9vX2g7prN5uC90+PsH09yudyBPIwas+K0rWHH3/9dnEfw5nK5wfue+//tPwZ8nNXVVTUajaFxH+f69euDftTXf+x13P57WC6XU6fT0fXr11UsFvX6668P0jbseIf7f3+sPuzJkyfK5/PHbh+VpmHfjauXk9QlAAAAkDYWcQEAAIAZ0W63Bz88nz9/Xtvb2xNNT6/XO/AD+bDFE6v+gsz+d9/m83nlcjndu3dv5KKdy2KepME7QMctmPYXkyXp7t27qlQqarVasRab9h9jVN0lVa/tdvvAgm0Yhur1eqZF/jt37mh7e1v1et1pAWj/vv3/H7V42NdfKPzd3/3dkQuYhy0vL+vOnTuD95qOW0gcJY32W6vVBu8b/eCDDwZ/gBCXa/yWPJw03/V6ffAu1mKxqPfff39sG1lcXNR7772n5eVl5XI53bhxQ9evX1etVjsS771790x/IHH+/PmxbcClbSWhWq0O3hF7uLxH6e/XarX
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-26 10:59:21 +02:00
"execution_count": 15,
2023-10-05 15:58:17 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
2023-10-26 10:59:21 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAB3EAAAJRCAYAAABbdk1MAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC5eklEQVR4nOz9bZBbWX7fef4us0SK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Yf7OV7uyy+/3PPyxIfvNTrMORjWca+trSmfz6tcLve8ZHhbLpdTKpXS9va21tbWOn2pVCqpVCqpWq0eabtyudy573Q/h8eTVCp15Bh6jVkufatb+Ycfc7kEbyqV6tzvuf2/7cuA97O2tqZSqdT1vQe5evVq5zxqa1/22vX8PS6VSqler+vq1avKZDJ6+eWXO7l1K+/4+d8eq4/b3d2V7/sDn++VU7fH+rXLKG0JAAAARI1FXAAAAGBK1Gq1zj88LywsqFqtTjSfVqt15B/Iuy2eDKu9IHP43re+7yuVSuntt9/uuWhnWcyT1LkHaL8F0/ZisiTduHFDy8vLqlQqTotNh8vo1XZhtWutVjuyYNtoNNRqtYZa5N/c3FS1WlWxWDQtAB2Obf//XouHbe2Fwu985zs9FzCPW1lZ0ebmZue+pv0WEnuJov8WCoXO/Ubfe++9zg8QXFnff5hjGPW4i8Vi516smUxG9+7d69tHLl26pNu3b2tlZUWpVErr6+u6evWqCoXCifd9++23h/qBxMLCQt8+YOlbYcjn8517xB6v717acZVKRbVazfm8zefzarVaunHjxpH
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-26 10:59:21 +02:00
"execution_count": 16,
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-26 10:59:21 +02:00
"execution_count": 17,
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-26 10:59:21 +02:00
"execution_count": 18,
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-26 10:59:21 +02:00
"execution_count": 18,
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-26 10:59:21 +02:00
"execution_count": 19,
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-26 10:59:21 +02:00
"execution_count": 20,
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-26 10:59:21 +02:00
"execution_count": 20,
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-26 10:59:21 +02:00
"execution_count": 21,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
2023-10-26 10:59:21 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABrwAAAJOCAYAAADlOafTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACc+klEQVR4nOz9f5Bd130YeH4fwABmzAIaTXl37KnY0oO2ZuPaouVu2ZnilCJq2JDBsrIaBt1kSCWV7MwQ7Vlok40sowOpZIpmSXBjlPFkSr1xN5Mt1XhEmkLTLI3lFaxuDiErw1ovgWeaOxNtxsKT7ZnYyYjqbiLMQIDQePsH9JoA+t1z+7377vvVn0/VK4nv3PPjnvvjnYPT934rjUajEQAAAAAAADCk9vS7AQAAAAAAAFCEBS8AAAAAAACGmgUvAAAAAAAAhpoFLwAAAAAAAIaaBS8AAAAAAACGmgUvAAAAAAAAhpoFLwAAAAAAAIaaBS8AAAAAAACGmgUvgF2iVqvF0tJS18rb2NiIpaWlqNfrXSuT3aler8fS0lJsbGz0uykAAIwgcxe6xdwFYLBZ8ALoglqtFnNzczEzMxOHDx+OM2fO9LtJW+r1eszMzMTk5GQsLi52pcylpaV417veFbOzswb6FHLmzJk4fPhwzM7OxtraWr+bAwBAQnPeMzk5GZ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W0tBSrq6tb+ZeWlmJ5eTkZH6B5rB999NEd7fetpqamYmxsbGsC2jQ9Pb01gb9Tah+yjumdmsfwzkXfZkyHnUqds83XhCwvL8f
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-26 10:59:21 +02:00
"execution_count": 22,
2023-10-02 13:56:58 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
2023-10-26 10:59:21 +02:00
{
"ename": "ValueError",
"evalue": "cannot convert to RegularArray because subarray lengths are not regular (in compiled code: https://github.com/scikit-hep/awkward/blob/awkward-cpp-24/awkward-cpp/src/cpu-kernels/awkward_ListOffsetArray_toRegularArray.cpp#L22)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m/work/cetin/Projektpraktikum/B_rework.ipynb Cell 26\u001b[0m line \u001b[0;36m3\n\u001b[1;32m <a href='vscode-notebook-cell://ssh-remote%2Blhcba2/work/cetin/Projektpraktikum/B_rework.ipynb#X33sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0'>1</a>\u001b[0m fig, ax \u001b[39m=\u001b[39m plt\u001b[39m.\u001b[39msubplots(nrows\u001b[39m=\u001b[39m\u001b[39m1\u001b[39m, ncols\u001b[39m=\u001b[39m\u001b[39m2\u001b[39m, figsize\u001b[39m=\u001b[39m(\u001b[39m18\u001b[39m,\u001b[39m6\u001b[39m))\n\u001b[0;32m----> <a href='vscode-notebook-cell://ssh-remote%2Blhcba2/work/cetin/Projektpraktikum/B_rework.ipynb#X33sdnNjb2RlLXJlbW90ZQ%3D%3D?line=2'>3</a>\u001b[0m a0\u001b[39m=\u001b[39max[\u001b[39m0\u001b[39;49m]\u001b[39m.\u001b[39;49mhist2d(bs_found, vtx_types_found, bins\u001b[39m=\u001b[39;49m\u001b[39m110\u001b[39;49m, density\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m, cmap\u001b[39m=\u001b[39;49mplt\u001b[39m.\u001b[39;49mcm\u001b[39m.\u001b[39;49mjet, cmin\u001b[39m=\u001b[39;49m\u001b[39m1e-20\u001b[39;49m,vmax\u001b[39m=\u001b[39;49m\u001b[39m2\u001b[39;49m)\n\u001b[1;32m <a href='vscode-notebook-cell://ssh-remote%2Blhcba2/work/cetin/Projektpraktikum/B_rework.ipynb#X33sdnNjb2RlLXJlbW90ZQ%3D%3D?line=3'>4</a>\u001b[0m ax[\u001b[39m0\u001b[39m]\u001b[39m.\u001b[39mset_ylim(\u001b[39m0\u001b[39m,\u001b[39m110\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell://ssh-remote%2Blhcba2/work/cetin/Projektpraktikum/B_rework.ipynb#X33sdnNjb2RlLXJlbW90ZQ%3D%3D?line=4'>5</a>\u001b[0m ax[\u001b[39m0\u001b[39m]\u001b[39m.\u001b[39mset_xlim(\u001b[39m-\u001b[39m\u001b[39m1\u001b[39m,\u001b[39m1\u001b[39m)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/__init__.py:1465\u001b[0m, in \u001b[0;36m_preprocess_data.<locals>.inner\u001b[0;34m(ax, data, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1462\u001b[0m \u001b[39m@functools\u001b[39m\u001b[39m.\u001b[39mwraps(func)\n\u001b[1;32m 1463\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39minner\u001b[39m(ax, \u001b[39m*\u001b[39margs, data\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs):\n\u001b[1;32m 1464\u001b[0m \u001b[39mif\u001b[39;00m data \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m-> 1465\u001b[0m \u001b[39mreturn\u001b[39;00m func(ax, \u001b[39m*\u001b[39;49m\u001b[39mmap\u001b[39;49m(sanitize_sequence, args), \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[1;32m 1467\u001b[0m bound \u001b[39m=\u001b[39m new_sig\u001b[39m.\u001b[39mbind(ax, \u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n\u001b[1;32m 1468\u001b[0m auto_label \u001b[39m=\u001b[39m (bound\u001b[39m.\u001b[39marguments\u001b[39m.\u001b[39mget(label_namer)\n\u001b[1;32m 1469\u001b[0m \u001b[39mor\u001b[39;00m bound\u001b[39m.\u001b[39mkwargs\u001b[39m.\u001b[39mget(label_namer))\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/matplotlib/axes/_axes.py:7191\u001b[0m, in \u001b[0;36mAxes.hist2d\u001b[0;34m(self, x, y, bins, range, density, weights, cmin, cmax, **kwargs)\u001b[0m\n\u001b[1;32m 7098\u001b[0m \u001b[39m@_preprocess_data\u001b[39m(replace_names\u001b[39m=\u001b[39m[\u001b[39m\"\u001b[39m\u001b[39mx\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m\"\u001b[39m\u001b[39my\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m\"\u001b[39m\u001b[39mweights\u001b[39m\u001b[39m\"\u001b[39m])\n\u001b[1;32m 7099\u001b[0m \u001b[39m@_docstring\u001b[39m\u001b[39m.\u001b[39mdedent_interpd\n\u001b[1;32m 7100\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mhist2d\u001b[39m(\u001b[39mself\u001b[39m, x, y, bins\u001b[39m=\u001b[39m\u001b[39m10\u001b[39m, \u001b[39mrange\u001b[39m\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m, density\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m, weights\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m,\n\u001b[1;32m 7101\u001b[0m cmin\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m, cmax\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs):\n\u001b[1;32m 7102\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 7103\u001b[0m \u001b[39m Make a 2D histogram plot.\u001b[39;00m\n\u001b[1;32m 7104\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 7188\u001b[0m \u001b[39m `.colors.PowerNorm`.\u001b[39;00m\n\u001b[1;32m 7189\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 7191\u001b[0m h, xedges, yedges \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39;49mhistogram2d(x, y, bins\u001b[39m=\u001b[39;49mbins, \u001b[39mrange\u001b[39;49m\u001b[39m=\u001b[39;49m\u001b[39mrange\u001b[39;49m,\n\u001b[1;32m 7192\u001b[0m density\u001b[39m=\u001b[39;49mdensity, weights\u001b[39m=\u001b[39;49mweights)\n\u001b[1;32m 7194\u001b[0m \u001b[39mif\u001b[39;00m cmin \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 7195\u001b[0m h[h \u001b[39m<\u001b[39m cmin] \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n",
"File \u001b[0;32m<__array_function__ internals>:200\u001b[0m, in \u001b[0;36mhistogram2d\u001b[0;34m(*args, **kwargs)\u001b[0m\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/highlevel.py:1445\u001b[0m, in \u001b[0;36mArray.__array_function__\u001b[0;34m(self, func, types, args, kwargs)\u001b[0m\n\u001b[1;32m 1431\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m__array_function__\u001b[39m(\u001b[39mself\u001b[39m, func, types, args, kwargs):\n\u001b[1;32m 1432\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 1433\u001b[0m \u001b[39m Intercepts attempts to pass this Array to those NumPy functions other\u001b[39;00m\n\u001b[1;32m 1434\u001b[0m \u001b[39m than universal functions that have an Awkward equivalent.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1443\u001b[0m \u001b[39m See also #__array_ufunc__.\u001b[39;00m\n\u001b[1;32m 1444\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 1445\u001b[0m \u001b[39mreturn\u001b[39;00m ak\u001b[39m.\u001b[39;49m_connect\u001b[39m.\u001b[39;49mnumpy\u001b[39m.\u001b[39;49marray_function(\n\u001b[1;32m 1446\u001b[0m func, types, args, kwargs, behavior\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_behavior\n\u001b[1;32m 1447\u001b[0m )\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/_connect/numpy.py:94\u001b[0m, in \u001b[0;36marray_function\u001b[0;34m(func, types, args, kwargs, behavior)\u001b[0m\n\u001b[1;32m 91\u001b[0m unique_backends \u001b[39m=\u001b[39m \u001b[39mfrozenset\u001b[39m(_find_backends(all_arguments))\n\u001b[1;32m 92\u001b[0m backend \u001b[39m=\u001b[39m common_backend(unique_backends)\n\u001b[0;32m---> 94\u001b[0m rectilinear_args \u001b[39m=\u001b[39m \u001b[39mtuple\u001b[39;49m(_to_rectilinear(x, backend) \u001b[39mfor\u001b[39;49;00m x \u001b[39min\u001b[39;49;00m args)\n\u001b[1;32m 95\u001b[0m rectilinear_kwargs \u001b[39m=\u001b[39m {k: _to_rectilinear(v, backend) \u001b[39mfor\u001b[39;00m k, v \u001b[39min\u001b[39;00m kwargs\u001b[39m.\u001b[39mitems()}\n\u001b[1;32m 96\u001b[0m result \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39mrectilinear_args, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mrectilinear_kwargs)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/_connect/numpy.py:94\u001b[0m, in \u001b[0;36m<genexpr>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 91\u001b[0m unique_backends \u001b[39m=\u001b[39m \u001b[39mfrozenset\u001b[39m(_find_backends(all_arguments))\n\u001b[1;32m 92\u001b[0m backend \u001b[39m=\u001b[39m common_backend(unique_backends)\n\u001b[0;32m---> 94\u001b[0m rectilinear_args \u001b[39m=\u001b[39m \u001b[39mtuple\u001b[39m(_to_rectilinear(x, backend) \u001b[39mfor\u001b[39;00m x \u001b[39min\u001b[39;00m args)\n\u001b[1;32m 95\u001b[0m rectilinear_kwargs \u001b[39m=\u001b[39m {k: _to_rectilinear(v, backend) \u001b[39mfor\u001b[39;00m k, v \u001b[39min\u001b[39;00m kwargs\u001b[39m.\u001b[39mitems()}\n\u001b[1;32m 96\u001b[0m result \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39mrectilinear_args, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mrectilinear_kwargs)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/_connect/numpy.py:70\u001b[0m, in \u001b[0;36m_to_rectilinear\u001b[0;34m(arg, backend)\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[39m# Otherwise, cast to layout and convert\u001b[39;00m\n\u001b[1;32m 68\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 69\u001b[0m layout \u001b[39m=\u001b[39m ak\u001b[39m.\u001b[39mto_layout(arg, allow_record\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m, allow_other\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m---> 70\u001b[0m \u001b[39mreturn\u001b[39;00m layout\u001b[39m.\u001b[39;49mto_backend(backend)\u001b[39m.\u001b[39;49mto_backend_array(allow_missing\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m)\n\u001b[1;32m 71\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(arg, \u001b[39mtuple\u001b[39m):\n\u001b[1;32m 72\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mtuple\u001b[39m(_to_rectilinear(x, backend) \u001b[39mfor\u001b[39;00m x \u001b[39min\u001b[39;00m arg)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/contents/content.py:1077\u001b[0m, in \u001b[0;36mContent.to_backend_array\u001b[0;34m(self, allow_missing, backend)\u001b[0m\n\u001b[1;32m 1075\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 1076\u001b[0m backend \u001b[39m=\u001b[39m regularize_backend(backend)\n\u001b[0;32m-> 1077\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_to_backend_array(allow_missing, backend)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/contents/listoffsetarray.py:2060\u001b[0m, in \u001b[0;36mListOffsetArray._to_backend_array\u001b[0;34m(self, allow_missing, backend)\u001b[0m\n\u001b[1;32m 2058\u001b[0m \u001b[39mreturn\u001b[39;00m buffer\u001b[39m.\u001b[39mview(np\u001b[39m.\u001b[39mdtype((\u001b[39m\"\u001b[39m\u001b[39mS\u001b[39m\u001b[39m\"\u001b[39m, max_count)))\n\u001b[1;32m 2059\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m-> 2060\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mto_RegularArray()\u001b[39m.\u001b[39m_to_backend_array(allow_missing, backend)\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/contents/listoffsetarray.py:277\u001b[0m, in \u001b[0;36mListOffsetArray.to_RegularArray\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 272\u001b[0m _size \u001b[39m=\u001b[39m Index64\u001b[39m.\u001b[39mempty(\u001b[39m1\u001b[39m, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_backend\u001b[39m.\u001b[39mindex_nplike)\n\u001b[1;32m 273\u001b[0m \u001b[39massert\u001b[39;00m (\n\u001b[1;32m 274\u001b[0m _size\u001b[39m.\u001b[39mnplike \u001b[39mis\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_backend\u001b[39m.\u001b[39mindex_nplike\n\u001b[1;32m 275\u001b[0m \u001b[39mand\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_offsets\u001b[39m.\u001b[39mnplike \u001b[39mis\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_backend\u001b[39m.\u001b[39mindex_nplike\n\u001b[1;32m 276\u001b[0m )\n\u001b[0;32m--> 277\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_backend\u001b[39m.\u001b[39;49mmaybe_kernel_error(\n\u001b[1;32m 278\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_backend[\n\u001b[1;32m 279\u001b[0m \u001b[39m\"\u001b[39;49m\u001b[39mawkward_ListOffsetArray_toRegularArray\u001b[39;49m\u001b[39m\"\u001b[39;49m,\n\u001b[1;32m 280\u001b[0m _size\u001b[39m.\u001b[39;49mdtype\u001b[39m.\u001b[39;49mtype,\n\u001b[1;32m 281\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_offsets\u001b[39m.\u001b[39;49mdtype\u001b[39m.\u001b[39;49mtype,\n\u001b[1;32m 282\u001b[0m ](\n\u001b[1;32m 283\u001b[0m _size\u001b[39m.\u001b[39;49mdata,\n\u001b[1;32m 284\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_offsets\u001b[39m.\u001b[39;49mdata,\n\u001b[1;32m 285\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_offsets\u001b[39m.\u001b[39;49mlength,\n\u001b[1;32m 286\u001b[0m )\n\u001b[1;32m 287\u001b[0m )\n\u001b[1;32m 288\u001b[0m size \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_backend\u001b[39m.\u001b[39mindex_nplike\u001b[39m.\u001b[39mindex_as_shape_item(_size[\u001b[39m0\u001b[39m])\n\u001b[1;32m 289\u001b[0m length \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_offsets\u001b[39m.\u001b[39mlength \u001b[39m-\u001b[39m \u001b[39m1\u001b[39m\n",
"File \u001b[0;32m/work/cetin/LHCb/reco_tuner/env/tuner_env/envs/tuner/lib/python3.10/site-packages/awkward/_backends/backend.py:72\u001b[0m, in \u001b[0;36mBackend.maybe_kernel_error\u001b[0;34m(self, error)\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[39mreturn\u001b[39;00m\n\u001b[1;32m 71\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m---> 72\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mformat_kernel_error(error))\n",
"\u001b[0;31mValueError\u001b[0m: cannot convert to RegularArray because subarray lengths are not regular (in compiled code: https://github.com/scikit-hep/awkward/blob/awkward-cpp-24/awkward-cpp/src/cpu-kernels/awkward_ListOffsetArray_toRegularArray.cpp#L22)"
]
},
2023-10-09 09:59:35 +02:00
{
"data": {
2023-10-26 10:59:21 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABv4AAAJNCAYAAAD54gLgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA1lUlEQVR4nO3dP28bd54/8I8WRrwCDB9jBAek3PED2ID0XrkulqpSSjqXe43JgsAVKUyoSlIZcnkAC8lNuoNPunIrKYXviivWHGQfgLjlNgeZZxhQnGZ+xYL6xRFl86848+XrBRALz/BLfsibE/XOm5rZKIqiCAAAAAAAAKDSfrXqAQAAAAAAAID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AAAAAJUPwBAAAAAABAAhR/AAAAAAAAkADFHwAAAAAAACTg1iyLut1uDAaDiIgYDodxcHAQWZZNtHYwGES324179+699+9msznLKAAAACyQvAcAAFBdUxd/jUYjsiyLo6OjiIg4PT2NRqMR33//fdTr9Q+uHQwGV+47GAzi/v37cXJyIgwCAACskLwHAABQbVOd6rPb7Uae5/H8+fPLbc1mM7Isi8ePH390/cHBQdy7d++9wJhlWTSbzdjf359mFAAAABZI3gMAAKi+qYq/w8PDyLIsarXae9sfPXoUeZ5HnucfXD8YDGIwGMRwOLyy/ZePCQAAwM2R9wAAAKpv4uIvz/MYDodjT+8y2vbixYsPPsbW1lZEROzu7r73uIPBIPb29iYdBQAAgAWS9wAAANIw8TX+Xr16FRFxeZH2n/v5hds/pNVqxdHR0eV1Ivb29qLb7cb
2023-10-09 09:59:35 +02:00
"text/plain": [
2023-10-26 10:59:21 +02:00
"<Figure size 1800x600 with 2 Axes>"
2023-10-09 09:59:35 +02:00
]
},
"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-26 10:59:21 +02:00
"execution_count": null,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-26 10:59:21 +02:00
"outputs": [],
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-26 10:59:21 +02:00
"version": "3.10.12"
2023-09-28 15:50:32 +02:00
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}