2023-09-28 15:50:32 +02:00
{
"cells": [
{
"cell_type": "code",
2023-10-27 19:35:49 +02:00
"execution_count": 1,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-26 16:21:44 +02:00
"outputs": [],
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-27 19:35:49 +02:00
"execution_count": 2,
2023-10-26 10:59:21 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/lhcb/cetin/.config/matplotlib/matplotlibrc'"
]
},
2023-10-27 19:35:49 +02:00
"execution_count": 2,
2023-10-26 10:59:21 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"matplotlib.matplotlib_fname()"
]
},
{
"cell_type": "code",
2023-10-27 19:35:49 +02:00
"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-27 19:35:49 +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)"
]
},
2023-10-27 19:35:49 +02:00
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"10 10\n",
"10 10\n",
"10 10\n",
"15 15\n",
"7 7\n",
"7 7\n",
"8 8\n",
"3 3\n",
"5 5\n",
"15 15\n"
]
}
],
"source": [
"for i in range(10):\n",
"\tprint(found[\"brem_vtx_x_length\"][i], found[\"brem_vtx_z_length\"][i])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-09-28 15:50:32 +02:00
{
"cell_type": "code",
2023-10-26 16:21:44 +02:00
"execution_count": 5,
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 16:21:44 +02:00
"execution_count": 6,
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",
2023-10-27 19:35:49 +02:00
" brem_vtx_z: [162, 187, 387, 487, ..., 9.49e+03, 1.21e+04, 1.21e+04, 1.21e+04],\n",
" brem_vtx_x: [-5.37, -7, -20, -26.5, ..., -1.24e+03, -1.24e+03, -1.25e+03]}\n",
2023-10-06 11:41:37 +02:00
"-------------------------------------------------------------------------------\n",
"type: {\n",
" energy: float64,\n",
" photon_length: int64,\n",
" brem_photons_pe: var * float64,\n",
2023-10-27 19:35:49 +02:00
" brem_vtx_z: var * float64,\n",
" brem_vtx_x: var * float64\n",
2023-10-06 11:41:37 +02:00
"}</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 16:21:44 +02:00
"execution_count": 6,
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",
2023-10-27 19:35:49 +02:00
"brem_x_f = found[\"brem_vtx_x\"]\n",
2023-10-05 15:58:17 +02:00
"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",
2023-10-27 19:35:49 +02:00
" brem_f.field(\"brem_vtx_x\").append(brem_x_f[itr])\n",
2023-10-05 15:58:17 +02:00
" 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",
2023-10-27 19:35:49 +02:00
"brem_x_l = lost[\"brem_vtx_x\"]\n",
2023-10-06 11:41:37 +02:00
"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",
2023-10-27 19:35:49 +02:00
" brem_l.field(\"brem_vtx_x\").append(brem_x_l[itr])\n",
2023-10-06 11:41:37 +02:00
" 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 16:21:44 +02:00
"execution_count": 7,
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-27 19:35:49 +02:00
" acc_brem_found.field(\"brem_vtx_x\")\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_x\",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",
2023-10-27 19:35:49 +02:00
" acc_brem_lost.field(\"brem_vtx_x\")\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_x\",jentry])\n",
" acc_brem_lost.end_list()\n",
" \n",
2023-10-06 11:41:37 +02:00
" acc_brem_lost.end_record()\n",
"\n",
"acc_brem_lost = ak.Array(acc_brem_lost)\n"
]
},
{
"cell_type": "code",
2023-10-26 16:21:44 +02:00
"execution_count": 8,
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 16:21:44 +02:00
"execution_count": 8,
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 16:21:44 +02:00
"execution_count": 9,
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 16:21:44 +02:00
"execution_count": 9,
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 16:21:44 +02:00
"execution_count": 10,
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 16:21:44 +02:00
"for cutoff_energy in range(0,30050,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 16:21:44 +02:00
"execution_count": 11,
2023-10-10 16:17:10 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-10-26 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAHKCAYAAADrWfQVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA+o0lEQVR4nO3dTYwjaX7n91+OG1OTUKk6Mnswa3kt7XRQu0DLht0IVkP2AkYD00HMYe2LkqwCvAJ0WBVpgYf19oFUHoTuhgAlghd7YRMCWTrIQC/gKnIO9loGBLIg9EFYy53klBawBphdRs1K9so7VmdGlcrIqcF6wofqJ4YvQWaQwUySGd8PkOguRjwRDx8+jPjzeYu9MAxDAQAAZMhXNp0BAACA60YABAAAMocACAAAZA4BEAAAyBwCIAAAkDkEQAAAIHMIgAAAQOYQAAEAgMwhAAKuyHA43HQWrlUQBGq32/J9f9NZuXF831e73VYQBJvOCjYsa9eVq0QAtIIgCNRoNLS3t6e9vT0dHByoVCqpUCgol8up0WhsOouRdrutXC4X5b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ujF9XzGcetzimec1xnMT7ZREB0JKCIIh+TU3fyMcvLuu+2UivfynV63U9efIkURBhWqrGAzXzy2nZC844E1iVy2XVajV5njdzcU+yzyriWt+k17+6XddNHVzl83m1Wi11Oh31er2VP8fpWRem3Jf95WouXnFdLJLmtgKWy+XoBvHgwYNUn/c85uK5zMrVpkzi8m2Cmlwud2Xp5zE31F6vF90Mlykzc0MfDzbNCr+NRiP2l/2y3V9
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 16:21:44 +02:00
"x_ = np.arange(0,30050,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",
2023-10-26 16:21:44 +02:00
"plt.xlim([-1000,31000])\n",
2023-10-26 10:59:21 +02:00
"\"\"\"\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 16:21:44 +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
"eff = 0.8545 +/- 0.0036\n"
2023-10-06 11:41:37 +02:00
]
},
{
"data": {
"text/html": [
2023-10-27 19:35:49 +02:00
"<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",
2023-10-06 11:41:37 +02:00
" ...,\n",
2023-10-27 19:35:49 +02:00
" {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",
2023-10-27 19:35:49 +02:00
" brem_vtx_z: var * float64,\n",
" brem_vtx_x: var * float64\n",
2023-10-06 11:41:37 +02:00
"}</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 16:21:44 +02:00
"execution_count": 12,
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 16:21:44 +02:00
"execution_count": 13,
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 16:21:44 +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 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAHOCAYAAAC2DSK6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXB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sn6ZubysHBwcB1wV/fXzcK//PvP+b+m0SU82hW/PPQLxvHcQaC24tECU6GaTabqtfrQfDTr3vOkXa7PfF3qFKpqFgsynGcnr46/nVrVDn0X1f8a+iwa5T/nmmaoddbVEsbqPgBQjqd7nnf/7L7v57OU6lU1G63I70qlYosy1Kj0bjw4tLf4df/xTCN2UP9i7PrukHg0263e/IUZp1x+Rf3/k6ET548kXRxkDiOSSYuM00zuPh03zSG1YAM42/bXRMxDr+8i8Wi6vW6NjY2ptq5uzuPUS5yo37BhQk2J92+n2maevbsWVCLlUwmQ3cg77/x+jejVCoVpFGpVAZucvv7+2N3bu7nb3vRZxD1PJoFv9N3s9mU67ra398P3ZnY5w8QcF13ok7x/n6HdWCflUKhoHa7Lc/z1Gq1tLGxIdd1lclkLjwXuq8r/mc+bBJA/z3LskKvt6iWMlDpdDrBr5P+G273RWDaNwXp7JeHbdt69OhRqJu9X/PTHVD5v0TGvTB08wOgXC6nQqGgYrE4cBEOs04Uw2qzpLNfsalUauIgKJlMqlKpqFarqdFoRP4c+3vZ++U+7i9B/yIzrGlB0rm1arlcLriQb29vT/R5n8e/yI0zk65fJsPy7QcfiURiZtufx7/xNRqN4KY1Tpn5N97uoNC
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",
2023-10-26 16:21:44 +02:00
"#plt.xticks(np.arange(0,1.1,0.1), minor=True,)\n",
"#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",
2023-10-26 16:21:44 +02:00
"plt.title(r'$B\\rightarrow K^\\ast ee$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm')\n",
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
"#plt.grid()\n",
2023-09-28 15:50:32 +02:00
"\n",
"\"\"\"\n",
"\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-26 16:21:44 +02:00
"execution_count": 15,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-27 19:35:49 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAksAAAHRCAYAAAB6qP26AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABVC0lEQVR4nO3dT4zbWJ4n+G/szLYnsYbNiOxLXXYqqJpDn9pJhc+JLpPIWwNdITkGmAbmkiFWVtwSnWLGAAvbWKCUVPvqrqIiG5hDXSJIJ/ayC1STnkHuaQEHWS5g0QN0lRiuxmJrD22J6fXCHdVVxT1EPVp/KIqipBAV8f0Agh0i+fj0RIk/Pb7340YcxzGIiIiIKNV/t+oKEBEREZUZgyUiIiKiDAyWiIiIiDIwWCIiIiLKwGCJiIiIKAODJSIiIqIMDJaIiIiIMvzrVVdgXem6jkqlglevXuHu3buo1WqrrtLSXcfXTERExGCpgHq9DlmW0Ww2AQDVahWSJEFV1RXXbHmu42smIiICgA1m8J5NGIaoVCrodruQZRkA0G634bouXNddce2WY1mv2fM8bG1tQVGURVWViIho4ThmaUZBEABAEjQAgKIo8DwPURStqFbLtazXHEURer3evNUjIiJaKgZLM3r+/DkkSRp6bmtrCwCuxInfMAyEYTj03FV/zVeJCGyviyiK0Ol0xo5Zml8Yhuh0Olf2RyDld92+V9IwWMLFF2673cbGxgY2Njawubm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Z6WJYFRVHgum6uL5fRgeril8uysxyLL+8wDJPArNvtzv2FuKxyZyFOMKMDW58/fw5g/mB60DzHmSzLyRfg4IkrrScojdh
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"both_eloss = np.append(energyloss_found,energyloss_lost)\n",
"plt.hist(both_eloss, bins=100, density=True, histtype='bar', color=\"cornflowerblue\", label=\"all\")\n",
"plt.vlines(ak.mean(both_eloss),0,1.75,colors=\"red\", label=\"mean\")\n",
"plt.xlabel(r\"Energyloss Ratio $E_\\gamma/E_0$\")\n",
"plt.ylabel(\"counts (normed)\")\n",
"plt.title(r'$B^0\\rightarrow K^{\\ast 0} e^+e^-$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm')\n",
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"brem_z_found = ak.to_numpy(ak.flatten(acc_brem_found[\"brem_vtx_z\"]))\n",
"brem_x_found = ak.to_numpy(ak.flatten(acc_brem_found[\"brem_vtx_x\"]))\n",
"\n",
"brem_z_lost = ak.to_numpy(ak.flatten(acc_brem_lost[\"brem_vtx_z\"]))\n",
"brem_x_lost = ak.to_numpy(ak.flatten(acc_brem_lost[\"brem_vtx_x\"]))"
]
},
{
"cell_type": "code",
2023-10-29 16:31:00 +01:00
"execution_count": 17,
2023-10-27 19:35:49 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"7935"
]
},
2023-10-29 16:31:00 +01:00
"execution_count": 17,
2023-10-27 19:35:49 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x_lost=np.array([])\n",
"z_lost=np.array([])\n",
"\n",
"for i in range(4):\n",
" x_lost = np.append(x_lost, brem_x_lost)\n",
" z_lost = np.append(z_lost, brem_z_lost)\n",
"\n",
"len(brem_z_lost)"
]
},
{
"cell_type": "code",
2023-10-29 16:31:00 +01:00
"execution_count": 21,
2023-10-27 19:35:49 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-10-29 16:31:00 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABjcAAAJLCAYAAACrEcSWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACs20lEQVR4nOz9f5Aj933ff76wS2k9zoqLHSWp2FeySQx1RzpXCtlYxf4mdtExgciuRBeTM7Nrae18U3cmcC4olUQnDbRKybt0Eo0xUiXO9zTfb4B1XeUcr+jlYEh/j/4mlgE5ZjlfV2wOQFpfS+Q34oCy9Q2T2OIMuFx7teTO9v0xBLZ/fAA0gEajgXk+qqYG3f3p7nf/ANCNT3/en4Rt27YAAAAAAAAAAABmxLFpBwAAAAAAAAAAADAMKjcAAAAAAAAAAMBMoXIDAAAAAAAAAADMFCo3AAAAAAAAAADATKFyAwAAAAAAAAAAzBQqNwAAAAAAAAAAwEyhcgMAAAAAAAAAAMwUKjcAAAAAAAAAAMBMoXIDAAAAAAAAAADMlLumHQAAAMCktdttFYtF7e3tdYfL5bJSqdSUI5sd7EMAAAAAQJzQcgMAAMy9dDotSdra2tLW1pZWV1eVzWbVbrenG9gMYR8CAAAAAOIkYdu2Pe0gAAAAJqVYLGpjY0P7+/tKJpPd8UtLS7IsS1tbW9MLbkZMYx9WKhWlUillMpnQlw0AAAAAmH203AAAAHOtUqnIsizXj/KSlMlkVK1WaXkQwDT2Ybvd5tgAAAAAAHqicgMAAMytZrOpdrutM2fO+KZ10iw99dRTUYcVS+12W61WyzeefQgAAAAAiCMqNwAAwNza2dmRJF+LA0laXFyUJO3u7kYZUmw99dRTKpVKvvHsQ4yqWq1OOwRgbPV6Xfl8XqdPnx76nG61WqpUKspmsxOKDgAA4GijcgMAAMRes9ns/riUSCRcf6dPn9bp06eVTqdVLBZdqYw6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VrNdUxyuZy9trZmW5Zlr62tuTo5L5fL3fOpU64TT6/97D2H9/f37VQqZa+srIxcdn9/v2cH88Pso852OzucXltb69nJtXOZlmXZmUzGtQ+8y3Lu4850L+c5aDrHOnE730+dY9uZr1Qq2SsrK7ZlWXYulxsYj20fdqbtPGadz3Lv37BGfU8FPV+DHt9+50ij0XCd873ei7u7u91zvbMfndvn/fwa9nNomPcGAADoj8oNAAAwE5w/6HTs7u52f2zq/Mjf68f2XC7X/etXbtJSqVQoP+w6f5DqVGqkUqmeP2gNsr+/P7BSZNh92Gg07FQqZWcymW5cnR8QB/1gPGrlxjjrjFrnh7q1tTV7bW3NLpVKdqPRsMvlsuvHy3F1Kk06lRyjniMm+/v7rkqZfhUczulhvP86PzZ6z1vnj5u9Klps213ZYjo3Oj9eh6Vf5YbzR+tUKmV8Lzq3K5VKdWMulUrdyrtR9km/SqdOBUcymfT98Or8sdd7PDvnsHd8rVbzLWeYsv1+uA66jzoVDt7j0Nke0/FxLtO7XlMlhHMb+lUW9Dv/nJ8PXs5zyTnv/v5+d5rps6PzWeg9zp2HAzrfIaN+Rgz7nhr2fA1yfAedI7btPq9NLMsyVjR0tm+cbRjmfAcAAINRuQEAAGaC84dR55Oa/X4MjKPOj13jxut8qjrI07pR62xnJpNxje/8ODRo+0ep3Bh3nVHrHLeVlRVfbM4fG8PifFJ/bW0t9HOlVqu53pvebXK+Zwetu9O6xVmh1vnr/KDZqdQz6VQU9Gsl4fzh2XvO2LYdeosX575JJpO+z7FBlTHOZfRqiTTKPumca6Z94NxHpmPWicf7Xu3XCsK7jcOUDfLD9aB91Nkm7xP1zmV7t7V
2023-10-27 19:35:49 +02:00
"text/plain": [
"<Figure size 2000x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"nbins = 150\n",
"nmax = 30\n",
"\n",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
2023-10-29 16:31:00 +01:00
"a0 = ax0.hist2d(brem_z_found[:18000], brem_x_found[:18000], bins=nbins, density=False, cmap=plt.cm.jet, cmin=2, vmax=nmax)\n",
2023-10-27 19:35:49 +02:00
"ax0.set_xlabel(\"z [mm]\")\n",
"ax0.set_ylabel(\"x [mm]\")\n",
"ax0.set_title(r\"\\bf{}found\")\n",
"\n",
"#a1 = ax1.hist2d(z_lost, x_lost, bins=nbins, density=False, cmap=plt.cm.jet, cmin=2, vmax=nmax)\n",
"a1 = ax1.hist2d(brem_z_lost, brem_x_lost, bins=nbins, density=False, cmap=plt.cm.jet, cmin=1, vmax=nmax)\n",
"ax1.set_xlabel(\"z [mm]\")\n",
"ax1.set_ylabel(\"x [mm]\")\n",
"ax1.set_title(r\"\\bf{}lost\")\n",
"#ax1.set(xlim=(0,4000), ylim=(-1000,1000))\n",
"\n",
"plt.suptitle(r\"$B^0\\rightarrow K^{\\ast 0}e^+e^-$, $p>5$GeV, Bremsstrahlung Vertices\")\n",
"plt.colorbar(a1[3], ax=ax1)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
2023-10-26 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABCgAAAIjCAYAAADBfyoFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACZrElEQVR4nO39fYwkZ2Lfef6SzWFPyzSZ3T0+iHOLsRi18u40jdVcZpPA4mwRAjPt1c0217tdVbRsa0ckxEwbJRvwYFTptg4YzmJ9pawbnBeGylZmG82RBePcldlYmw3tGsqkdikbu7fDzvRobfbYvqmkRvZxdB5OVw7NU7PJ7o77ozq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69qfX09cJmn91uvnOMJNpJm3rHP5/Oj7R5lvcclUW+O42h7e3viFQFbnybjHMdRoVDwfQXJe9VOOnj83etfZ5yXUBTU9HpPb4PDzvFB9/m4z+9+ZR6vs6tXr/qm5Pjxjut2u616vR7pFb3xc+Wrr74q6eB49ttXvFjQYrGolZUV7e3tBd4/xuXz+dHrf+N1772OI5mvDX7nwCCvlQ2Hw8DjTZd1XNjtn+T+A+AhGigARNZsNtXtdnX58mXl83k1m03VarWJSMQ0Td882N659X5sJJ2X7t18jd84FgqF0Y/wIDfx3vvjUT6NRmP0vv5hjSHjnXmOd9A47/u0QfaTJPclL9Ju/EeQt93HbyzDWl1dVa/Xm/hhFLaz01KppEKhMCrP+I9g276Zz+cnYl+
2023-10-06 11:41:37 +02:00
"text/plain": [
2023-10-26 16:21:44 +02:00
"<Figure size 1280x550 with 3 Axes>"
2023-10-06 11:41:37 +02:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-09-28 15:50:32 +02:00
"source": [
"#energyloss in abh von der energie der elektronen\n",
2023-10-26 16:21:44 +02:00
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(12.8,5.5))\n",
2023-09-28 15:50:32 +02:00
"\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-27 19:35:49 +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 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABCoAAAIjCAYAAADFivo4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACiF0lEQVR4nO39f5Aj6X3feX4wPepmy+NpdDV1azFieTNZpCPE0FlUoofyckOaoQfwzYQYJ8td1c3p2ZB9PnVBjprwrmipoJaDJukJqYhaeX3rmAoJaDuOId90uxtoKXSmg7MEmpyRdhn2TQMaabWkbbEwpO4sOUxOFWZuVs1uTnfeHzWJxo/nATKBRCIBvF8RiO5KJJ588ufz4EHm95vyPM8TAAAAAABAAjww6woAAAAAAAD4GKgAAAAAAACJwUAFAAAAAABIDAYqAAAAAABAYjBQAQAAAAAAEoOBCgAAAAAAkBgMVAAAAAAAgMRgoALATLTb7VlXAQAAAEACMVABYCbq9brq9fqsqwEAAAAgYRioAAAAAAAAicFABQ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MR7K3DaZrYJDHzdrtduD5+uvaLez+n+bxA+A+BioATKxcLqter+vSpUtKp9Mql8sqFAo9qRTj1N+JGPZMrv+lY9r51v1OWHcH0nXdzpfxIJ15//nycV6lUqnzPP+oQZHuoJ/dgRwnfd42yHEyzWPJT4XX/WXI3+/dHcyw1tbW1Gg0er4ghQ2Kms1m5bpupz7dX4aHHZvpdLonXax0/3ivVCo
2023-10-06 11:41:37 +02:00
"text/plain": [
2023-10-26 16:21:44 +02:00
"<Figure size 1280x550 with 3 Axes>"
2023-10-06 11:41:37 +02:00
]
},
"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",
2023-10-26 16:21:44 +02:00
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(12.8,5.5))\n",
2023-10-05 15:58:17 +02:00
"\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-27 19:35:49 +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-27 19:35:49 +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-27 19:35:49 +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-27 19:35:49 +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-27 19:35:49 +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-27 19:35:49 +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-27 19:35:49 +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-27 19:35:49 +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 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABBMAAAIRCAYAAAAY3vVsAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACPF0lEQVR4nO39f5Ab533n+34gKmSYqEjM0D57k3OvY2G8pyqpU4oC0Ju92nJMR4BNnfisV8sZ6oi6uUntjQa7NbrZE0cehHbJsqyyJ5h1Nme3PBUDPLnluntERgS4Km+cEiNAJTrOUW0iAlFUe+2bjQdKUjfO7lqaAbnKoUhz2PePYYPoH2h0N7qBBub9qpoiu/H000//fBoP+vk+KcMwDAEAAAAAAPh016QLAAAAAAAApguNCQAAAAAAIBAaEwAAAAAAQCA0JgAAAAAAgEBoTAAAAAAAAIHQmAAAAAAAAAKhMQEAAAAAAARCYwIAAAAAAAiExgQAAABMjW63q2q1qk6nM+miYMp1Oh1Vq1V1u91JFwWYSjQmAAAA7EHtdlulUkm5XE65XG7SxfGlWq3q3nvvVbFY5AsgRrK+vq6FhQUVi0VtbW1NujjAVKIxAQAAYA/KZrN65JFH1G63Y11Pp9OJ7Iv/8vKylpeXI8mrX5RlxOT5OZ6rq6taXFwcT4FmCNcK+tGYAAAAsEdls9nY17G0tBTpL79HjhyJLC9T1GXEZPk9nvPz82MozWzhWkE/GhMAAAAQi6WlpdjffBjVNJQR/nE848O+hR2NCQAAAHDodrsqFosqlUoqFAoqFApqNpsD0xSLRS0sLKharUqS6vV674tHsVj0/CJiBlXM5XJqNpu9/8/NzWlpacn1teqtra1eulQqpaWlpcDbMKyMw5bvL3e9Xlez2fQsj5d2u62lpSUVCgUtLCyoVCqFXo9XXuZ2m9tSrVY1NzenYrFo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mv33NGct+3UZxzmGKTHk4CAAAA49dqtXpD4+n2UHH9w8Btb28bi4uLvXHql5eXHcO/5fN5I5PJGKurq8bq6qqxuLhoycMwdoeNS6fTjmHr7PqHjstms8bi4qKxuLhoGZ6vVqv1hpwzh6Pb3t62bEf/0HN+tsGrjMOWb7VaveH3MpmM0Wg0HOWxD+Xotf3mkISZTMYy5GDQ9XjlVavVBn5mGLtDNpqf2/8ymYzj+Jr7aZSvFeVy2XFcWq2W6xCTw8pvGP7Pue3tbWN1ddXI5/OWY+y2jW5lHna+GoZhVCqV3nCX5rm5vLzcG1Z12PYMW77VavWGo0yn070hKSuVSu+4LS4uGq1Wy9jc3DQWFxd7afvX5XXO+Nm3o5xzmF4pwzCMMbRZAAAAAAOtr6+rVCqp0WhYfg3FeLXbbT3//PM6ffq0tra2LL9812o1LSwsOPrvN5tN1Wo1z+E2Zw3nK8DQkAAAAAB0Z+SA7e3t3pCE/TKZjGtAvUqlotOnT4+plACSgpgJmBlmxOGodLtdVatVhrrByMzhsugnCABIMvOZ5/HHH7fESDDrsf5hGs3hIM1/vYI0AphNNCbAl3a7rVKppKWlJS0sLGh9fX3SRerpdDpaWlpSLpeL7PW6arWqe++9tzc0ERDW+vq6FhYWVCwWI4u8DACzptvtqtFoSJLvwHeIXj6fV7lcVrPZVC6XUyqVUiqV0tLSkjKZTG/0jmazqUKhoIWFBRUKhT13zDhfgV3ETMBQ7XZbDz74oLa3tyXtRuw1o9UmSSqVUjabVavViiS/Uqmk9fV1tVqtyFrbO52O5ufnQw2dhGTyc0yXlpZUr9e1ublpiVSNwbhWgL3F7UcKe798jJcZK2FQvVUqldTpdHT69Ok991YC5yuwi5gJGGptba03NI1kHVN6lh05ciTyPM1xm/mCNDv8HNP
2023-10-09 09:59:35 +02:00
"text/plain": [
2023-10-26 16:21:44 +02:00
"<Figure size 1280x550 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-26 16:21:44 +02:00
"fig, axes = plt.subplots(nrows=1,ncols=2,figsize=(12.8,5.5))\n",
2023-10-10 16:17:10 +02:00
"\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-27 19:35:49 +02:00
"execution_count": 22,
2023-10-02 13:56:58 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
2023-10-26 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9MAAAH/CAYAAABU/I4hAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABdkUlEQVR4nO3dfZAj+X3f98/c3nG59OoWM6QcU0ooLiA5puIq3zXmoliOtFYOIJOi5VQ0mF2XnyS7eI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UrVcLtf/IjqoPkFfQgbtgyDOceb/sca5X3Fc7g7zbNtWrVbTtWvXJD26lK7ZbKper6ter/f3kWma/fFUB23TuOsPOu6C/nfOY+fvuMd20L4dd91h/zPgJBs33t24ccNzLnI6s3LOi+Oe25Y9Vs0qTknEqmGWOU75t3Wc41ciJgEDLbo7cUzPPXagHg7X4x+64fbt2/3hKvL5fC+fzweOJ1mpVHqJRMIzbEgymeyPUdjpdPpDjCSTyV6r1erdvn3b8/7uYRhqtVp/OAnDMHp7e3v98sYZoqJSqfTXTyaTnuEmZl0Xp6xhDMPoJRKJ/nKtVquXTCZ7mUymPySEs++dOvmHzHDrdDqeZSuVimdoimn3Z693tE/9//tOpxNYL/f4kP79P2gfDHL79u3e1tZWL5PJeI5D9/aNqrceDq1hGEYvl8v1crncsWO9Vqv1h1FxjuF8Pt8/pkdt06j1nTE1JfUSiUR/qBNnLFs9HNal0+l4xvpMJBKe9xp2bI/at8PWHed/BsSZP+b5z5PjxLtMJtP/jG9tbfVyudyxc9G457Zeb7ljVdRxytkmYlVwnZclToU55sa
2023-10-09 09:59:35 +02:00
"text/plain": [
2023-10-26 16:21:44 +02:00
"<Figure size 1280x550 with 3 Axes>"
2023-10-09 09:59:35 +02:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-10-02 13:56:58 +02:00
"source": [
2023-10-26 16:21:44 +02:00
"fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(12.8,5.5))\n",
2023-10-02 13:56:58 +02:00
"\n",
2023-10-26 16:21:44 +02:00
"a0=ax[0].hist2d(bs_found, vtxs_types_found, bins=110, density=True, cmap=plt.cm.jet, cmin=1e-20,vmax=2)\n",
2023-10-02 15:58:50 +02:00
"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-26 16:21:44 +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-26 16:21:44 +02:00
"a1=ax[1].hist2d(bs_lost, vtxs_types_lost, bins=110, density=True, cmap=plt.cm.jet, cmin=1e-20,vmax=2)\n",
2023-10-02 15:58:50 +02:00
"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-26 16:21:44 +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-26 16:21:44 +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-27 19:35:49 +02:00
"execution_count": 23,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-26 16:21:44 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABCgAAALACAYAAABRr0MpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAACPkUlEQVR4nOz9X2wj+X3n/X7kzWlZcaOb0vgmdzPFYAH7ZmeKamDXC6QbbtID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udTCaD7ezt7bXS6fS131qtVgvONdM0286XZrMZfD9Xz89xz9tuOr/DSc+/Yfbr6jTDMIJz1B/ezT9HO4ciA4BFRbyxGPGG/z0lk8lWMplsZbPZVjabHSlOJubojZgDUVhrtVqt8NIdi8uvMZHL5WRZVtAMY5C1tTVls9m2rHi1WlUul+s6tNHa2pqSyeTQ68f0lMvlgUNQAQAATIJ4AwCGxzCjv+InDTKZTNCMYlx+3xO9qk8xji8AAAAAAO1Wug+Kq2zbluM4qtVqfTvOHIbfAUxnXxP+e7+3ZgAAAAAAcIkEhT5u3tFoNJROp3t2nDmsWCwm0zSvNePwe6t96623JiovJud5XvD9DOpECQAAYBzEGwAwmpXvg+JqcuKqer0+sC8Kz/O0ubl5rQ8K6bK32kQioZOTk6BJRzweVy6XW/nRN+ZBtx6A+V4AAECYiDcAYDQrnaDwPE+7u7s9M9r1el1Pnz7tOtSo4ziyLEvValWxWEyHh4dKJpNtQ4s6jqNisSjDMOS6rlKplLLZ7LR2BwAAAACAhbXSCQo
"text/plain": [
"<Figure size 1280x800 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-09-29 12:21:18 +02:00
"source": [
2023-10-26 16:21:44 +02:00
"fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2, figsize=(12.8,8))\n",
2023-09-29 12:21:18 +02:00
"\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
}