Projektpraktikum/B_rework.ipynb

1108 lines
388 KiB
Plaintext
Raw Normal View History

2023-09-28 15:50:32 +02:00
{
"cells": [
{
"cell_type": "code",
2023-10-09 12:10:28 +02:00
"execution_count": 58,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-10-05 10:49:35 +02:00
"import uproot\t\n",
2023-09-28 15:50:32 +02:00
"import numpy as np\n",
"import sys\n",
"import os\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"from mpl_toolkits import mplot3d\n",
"import itertools\n",
"import awkward as ak\n",
"from scipy.optimize import curve_fit\n",
2023-09-29 12:21:18 +02:00
"from mpl_toolkits.axes_grid1 import ImageGrid\n",
2023-09-28 15:50:32 +02:00
"%matplotlib inline"
]
},
{
"cell_type": "code",
2023-10-09 12:10:28 +02:00
"execution_count": 59,
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-09 12:10:28 +02:00
"execution_count": 59,
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-09 12:10:28 +02:00
"execution_count": 60,
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-09 12:10:28 +02:00
"execution_count": 61,
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-09 12:10:28 +02:00
"execution_count": 61,
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-09 12:10:28 +02:00
"execution_count": 62,
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-09 12:10:28 +02:00
"execution_count": 63,
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-09 12:10:28 +02:00
"execution_count": 63,
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-09 12:10:28 +02:00
"execution_count": 64,
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-09 12:10:28 +02:00
"execution_count": 64,
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-09 12:10:28 +02:00
"execution_count": 65,
2023-10-05 15:58:17 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"sample size: 322\n",
"eff (cutoff = 0 ) = 0.9379 +/- 0.0135\n",
"sample size: 322\n",
2023-10-09 09:59:35 +02:00
"eff (cutoff = 25 ) = 0.9379 +/- 0.0135\n",
"sample size: 322\n",
2023-10-06 11:41:37 +02:00
"eff (cutoff = 50 ) = 0.9379 +/- 0.0135\n",
"sample size: 322\n",
2023-10-09 09:59:35 +02:00
"eff (cutoff = 75 ) = 0.9379 +/- 0.0135\n",
"sample size: 322\n",
2023-10-06 11:41:37 +02:00
"eff (cutoff = 100 ) = 0.9379 +/- 0.0135\n",
2023-10-09 09:59:35 +02:00
"sample size: 384\n",
"eff (cutoff = 125 ) = 0.9453 +/- 0.0116\n",
2023-10-06 11:41:37 +02:00
"sample size: 433\n",
"eff (cutoff = 150 ) = 0.9423 +/- 0.0112\n",
2023-10-09 09:59:35 +02:00
"sample size: 485\n",
"eff (cutoff = 175 ) = 0.9443 +/- 0.0104\n",
2023-10-06 11:41:37 +02:00
"sample size: 529\n",
"eff (cutoff = 200 ) = 0.949 +/- 0.0096\n",
2023-10-09 09:59:35 +02:00
"sample size: 581\n",
"eff (cutoff = 225 ) = 0.9501 +/- 0.009\n",
2023-10-06 11:41:37 +02:00
"sample size: 644\n",
"eff (cutoff = 250 ) = 0.9519 +/- 0.0084\n",
2023-10-09 09:59:35 +02:00
"sample size: 705\n",
"eff (cutoff = 275 ) = 0.9475 +/- 0.0084\n",
2023-10-06 11:41:37 +02:00
"sample size: 757\n",
"eff (cutoff = 300 ) = 0.9498 +/- 0.0079\n",
2023-10-09 09:59:35 +02:00
"sample size: 802\n",
"eff (cutoff = 325 ) = 0.9451 +/- 0.008\n",
2023-10-06 11:41:37 +02:00
"sample size: 846\n",
"eff (cutoff = 350 ) = 0.9433 +/- 0.008\n",
2023-10-09 09:59:35 +02:00
"sample size: 876\n",
"eff (cutoff = 375 ) = 0.9452 +/- 0.0077\n",
2023-10-06 11:41:37 +02:00
"sample size: 919\n",
"eff (cutoff = 400 ) = 0.9467 +/- 0.0074\n",
2023-10-09 09:59:35 +02:00
"sample size: 972\n",
"eff (cutoff = 425 ) = 0.9475 +/- 0.0072\n",
2023-10-06 11:41:37 +02:00
"sample size: 1019\n",
"eff (cutoff = 450 ) = 0.949 +/- 0.0069\n",
2023-10-09 09:59:35 +02:00
"sample size: 1067\n",
"eff (cutoff = 475 ) = 0.9475 +/- 0.0068\n",
2023-10-06 11:41:37 +02:00
"sample size: 1117\n",
"eff (cutoff = 500 ) = 0.9418 +/- 0.007\n",
2023-10-09 09:59:35 +02:00
"sample size: 1144\n",
"eff (cutoff = 525 ) = 0.9423 +/- 0.0069\n",
2023-10-06 11:41:37 +02:00
"sample size: 1184\n",
"eff (cutoff = 550 ) = 0.9409 +/- 0.0069\n",
2023-10-09 09:59:35 +02:00
"sample size: 1234\n",
"eff (cutoff = 575 ) = 0.9408 +/- 0.0067\n",
2023-10-06 11:41:37 +02:00
"sample size: 1268\n",
"eff (cutoff = 600 ) = 0.9416 +/- 0.0066\n",
2023-10-09 09:59:35 +02:00
"sample size: 1303\n",
"eff (cutoff = 625 ) = 0.9417 +/- 0.0065\n",
2023-10-06 11:41:37 +02:00
"sample size: 1342\n",
"eff (cutoff = 650 ) = 0.9404 +/- 0.0065\n",
2023-10-09 09:59:35 +02:00
"sample size: 1381\n",
"eff (cutoff = 675 ) = 0.9399 +/- 0.0064\n",
2023-10-06 11:41:37 +02:00
"sample size: 1416\n",
"eff (cutoff = 700 ) = 0.9407 +/- 0.0063\n",
2023-10-09 09:59:35 +02:00
"sample size: 1444\n",
"eff (cutoff = 725 ) = 0.9418 +/- 0.0062\n",
2023-10-06 11:41:37 +02:00
"sample size: 1484\n",
"eff (cutoff = 750 ) = 0.942 +/- 0.0061\n",
2023-10-09 09:59:35 +02:00
"sample size: 1523\n",
"eff (cutoff = 775 ) = 0.9402 +/- 0.0061\n",
2023-10-06 11:41:37 +02:00
"sample size: 1557\n",
"eff (cutoff = 800 ) = 0.939 +/- 0.0061\n",
2023-10-09 09:59:35 +02:00
"sample size: 1593\n",
"eff (cutoff = 825 ) = 0.9379 +/- 0.006\n",
2023-10-06 11:41:37 +02:00
"sample size: 1628\n",
"eff (cutoff = 850 ) = 0.9373 +/- 0.006\n",
2023-10-09 09:59:35 +02:00
"sample size: 1656\n",
"eff (cutoff = 875 ) = 0.9384 +/- 0.0059\n",
2023-10-06 11:41:37 +02:00
"sample size: 1690\n",
"eff (cutoff = 900 ) = 0.9385 +/- 0.0058\n",
2023-10-09 09:59:35 +02:00
"sample size: 1721\n",
"eff (cutoff = 925 ) = 0.9378 +/- 0.0058\n",
2023-10-06 11:41:37 +02:00
"sample size: 1745\n",
"eff (cutoff = 950 ) = 0.9381 +/- 0.0058\n",
2023-10-09 09:59:35 +02:00
"sample size: 1769\n",
"eff (cutoff = 975 ) = 0.9378 +/- 0.0057\n",
2023-10-06 11:41:37 +02:00
"sample size: 1796\n",
"eff (cutoff = 1000 ) = 0.9365 +/- 0.0058\n",
2023-10-09 09:59:35 +02:00
"sample size: 1838\n",
"eff (cutoff = 1025 ) = 0.9374 +/- 0.0056\n",
2023-10-06 11:41:37 +02:00
"\n",
"cutoff energy = 350MeV, sample size: 846\n",
"eff = 0.9433 +/- 0.008\n"
]
}
],
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-05 15:58:17 +02:00
"efficiencies_found = ak.ArrayBuilder()\n",
2023-09-28 15:50:32 +02:00
"\n",
"\n",
2023-10-02 16:21:00 +02:00
"\n",
2023-10-05 15:58:17 +02:00
"for cutoff_energy in range(0,1050,25):\n",
2023-10-06 11:41:37 +02:00
"\tnobrem_f = acc_brem_found[ak.all(acc_brem_found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\tnobrem_l = acc_brem_lost[ak.all(acc_brem_lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
2023-10-05 15:58:17 +02:00
"\n",
"\n",
"\n",
2023-09-28 15:50:32 +02:00
"\tprint(\"sample size: \",ak.num(nobrem_f,axis=0)+ak.num(nobrem_l,axis=0))\n",
2023-10-05 15:58:17 +02:00
"\tprint(\"eff (cutoff = \",str(cutoff_energy),\") = \",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-06 11:41:37 +02:00
"nobrem_found = acc_brem_found[ak.all(acc_brem_found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"nobrem_lost = acc_brem_lost[ak.all(acc_brem_lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\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-09 12:10:28 +02:00
"execution_count": 66,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"eff = 0.8535 +/- 0.0036\n"
]
},
{
"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",
"type: 1418 * {\n",
" energy: float64,\n",
" brem_photons_pe: var * float64,\n",
" brem_vtx_z: var * float64\n",
"}</pre>"
],
"text/plain": [
"<Array [{energy: 2.58e+04, ...}, ..., {...}] type='1418 * {energy: float64,...'>"
]
},
2023-10-09 12:10:28 +02:00
"execution_count": 66,
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-06 11:41:37 +02:00
"brem_found = acc_brem_found[ak.any(acc_brem_found[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\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-06 11:41:37 +02:00
"brem_lost = acc_brem_lost[ak.any(acc_brem_lost[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\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-09 12:10:28 +02:00
"execution_count": 67,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mean energyloss relative to initial energy (found): 0.4107345449771658\n",
"mean energyloss relative to initial energy (lost): 0.7300783757368142\n"
]
}
],
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-09 12:10:28 +02:00
"execution_count": 68,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAHMCAYAAAD7xYOxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA/vklEQVR4nO3deXxTZdr/8W/aphulBQqFApV9kUUYQbG4gWNBUNFnHFxQRHAd+YmIjyButC6D6OO4jaKigqMy4sgioyhUpQVEFgs6siiIKMUBS1naQqVNm/P7AxtJ0yVJk5zT9vN+vfKiuc997nOdq4Fc3GezGYZhCAAAwILCzA4AAACgOhQqAADAsihUAACAZVGoAAAAy6JQAQAAlkWhAgAALItCBQAAWBaFCgAAsCwKFQAAYFkUKgAAwLIoVAAAgGVRqACos2XLlslms1X7eu211wKynfLyciUlJenpp58O+bYBmCPC7AAA1H+bNm2SJL3//vtKSkryWN6rV6+AbGfVqlU6cOCA/vSnP4V82wDMQaECoM42bdqk+Ph4XXrppbLZbEHbznvvvaeBAweqQ4cOId82AHNw6AdAneXk5Khfv35BLRQMw9DixYt1xRVXhHzbAMxDoQKgTg4ePKg9e/aob9++Kisr83gZhhGQ7axdu1b79u1zK1RCtW0A5qFQAVAnFeeIvPjii7Lb7R6vbdu21TqGYRiKj49Xfn5+tX3ee+899e3bV926dfN52wcOHNDFF1+sJk2aqHv37srMzKzLLgMIIc5RAVAnOTk5kqRFixYpJSXFY7k3J7Pu3LlTrVq1UsuWLavts2jRIk2YMMGvbU+cOFFt2rTRgQMH9Mknn+jKK6/U999/r8TExFpjA2AuChUAdbJp0yZFR0dr1KhRCg8Pr7bfyy+/rH/961+y2+1av3692rZtq3fffVe9evXSpk2b1L9/f916661asGCB2rZtq6VLl6pr166SpA0bNmjPnj0e56d4s+2jR49qyZIl2rVrl2JjYzVq1Cj169dP77//vkfhA8B6OPQDoE42bdqkPn361FikSNKWLVu0ceNGTZ48Wb/88osGDRqkBx54QJK0efNmffnllxo/frwOHTqk008/XXPmzHGtu3DhQnXv3l19+vTxeds7d+5UXFyc24xL3759tXXrVn92F0CIUagA8FtBQYF++OEH9evXr9a+W7Zs0QMPPKDhw4fLbrfr2muv1Y4dOySdKFQyMjJ01llnKSwsTF26dHE7EXbhwoUesynebvvo0aOKj493a4uPj9fRo0e93U0AJuLQDwC/bdq0SYZhqEmTJlq3bp3H8nbt2rlmMrZu3ep2l9i8vDzXOSmbN2/WW2+95Vq2detWjRw5UpL01VdfadeuXVUe9vFm23FxcSosLHRbVlhYqLi4OD/3GkAoMaMCwG8VV90899xzSk1N9XitWLFC0omi5MCBA253jl28eLFGjBih3NxcRUREuC37z3/+o9NOO03SidmUDh06aMCAAX5tu1u3bjp69Kj27t3rWnfLli3q3bt3EDICINBsBjcaABBkn376qYYPH66XXnpJ48aN0z/+8Q898sgj+vrrr5Wdna0XXnhBy5cvlyQVFxerWbNmKigoUExMjHr16qURI0boqaee8nv7o0ePVkJCgp5//nl9+umnGjt2rHbu3FnjVUYArIFDPwCCbsuWLZowYYLeeecdTZkyRQMGDFBmZqYSEhK0efNm1+yJdOKwT5cuXRQTEyNJXt2HpTYvvviixo0bp8TERLVr104LFiygSAHqCWZUAATdzTffrIEDB+rWW281OxQA9QznqAAIui1btqhnz55mhwGgHmJGBUDQJSQkaMeOHWrdurXZoQCoZ0ydUSkqKtLkyZPVoUMHxcTEaPDgwdq4caOZIQEIgoKCAooUAH4xtVC56aablJmZqTfffFPffPONhg0bpgsvvFA///yzmWEBAACLMO3Qz6+//qqmTZvq/fff18UXX+xq79+/vy655BI9+uijZoQFAAAsxLTLk8vKylReXq7o6Gi39piYGK1Zs6bKdUpKSlRSUuJ673Q6dejQISUmJspmswU1XgAAEBiGYaioqEht27ZVWFgtB3cME6Wmphrnn3++8fPPPxtlZWXGm2++adhsNqN79+5V9p8xY4YhiRcvXrx48eLVAF65ubm11gqmXvWza9cuTZgwQatWrVJ4eLhOP/10de/eXZs2baryJk+VZ1QKCgp0yimnaPfu3WratGnA4nI4HFq5cqWGDh0qu90esHHhjjyHDrkODfIcOuQ6NIKV56KiInXq1ElHjhxRQkJCjX1NvTNtly5dlJ2drWPHjqmwsFDJycm66qqr1KlTpyr7R0VFKSoqyqO9RYsWHk9HrQuHw6HY2FglJibyFyCIyHPokOvQIM+hQ65DI1h5rhjLm9M2LHHDtyZNmig5OV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N2pESfTAgBQwaQbsPlj7ty5uvPOO3XJJZeotLRU5513npYtWya73S7pxGzJxIkTtXfvXsXHx+uiiy7S008/LUlq166dMjIydO+992r8+PG6/vrrNW/ePBP3pnoUKgAA1BNZWVmun5s3b65//OMf1fat7XyUBx98UA8++GCgQgsaDv0AAADLolABAACWRaECAAAsi0IFAABYFoUKAACwLAoVAABgWRQqAADAsihUAACAZVGoAAAAy6JQAQCgnjAMQ7fccotatGghm82mr776yrRYhgwZosmTJwd9O9xCHwCA36SnW3t7H3/8sebNm6esrCx17txZLVu2DEpcVkKhAgBAPbFr1y4lJydr8ODBZocSMqYe+ikrK9MDDzygTp06KSYmRp07d9bDDz8sp9NpZlgAAFjODTfcoDvuuEN79uyRzWZTx44dVVJSokmTJikpKUnR0dE655xztHHjRtc68+bNU7NmzdzGWbJkiWw2m+t9enq6+vfvrzfffFMdO3ZUQkKCrr76ahUVFbn
"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",
"plt.hist(energyloss_lost, bins=200, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=\"lost\")\n",
"plt.hist(energyloss_found, bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=\"found\")\n",
"plt.xticks(np.arange(0,1.1,0.1), minor=True,)\n",
"plt.yticks(np.arange(0,10,1), minor=True)\n",
"plt.xlabel(r\"$E_\\gamma/E_0$\")\n",
"plt.ylabel(\"counts (normed)\")\n",
"plt.title(r'$E_{ph}/E_0$')\n",
"plt.legend()\n",
"plt.grid()\n",
"\n",
"\"\"\"\n",
"\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-09 12:10:28 +02:00
"execution_count": 69,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgA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VKFChVUv359rVmzRtOmTVP79u3VqVMnlStXzqvlDVTjx4/Xxo0b3V5169Z1S/PGG2+oUaNG2rx5sx566CF99NFHWrZsmYYNG6bdu3fruuuu048//ujxvu+55x6lpaVp3rx5Ob6fkpKiJUuWKCkpSRUqVChQ/ZCzDRs26JlnngnKH7eli4Ocx48f16233urrovidYD33W7du1Y033qizZ89q9uzZmj17ttLS0tS2bVtt3Lgxx89Yuf9J0q233qp33nlHY8aM0ccff6zrrrtOPXv2zHbvspoOAAD4j3BfFwAAAMAbPvroI9f/9+3bV61atVLfvn09zmffvn26cOGC7rrrLrVs2TLXdH/++adKlChRkKLabvv27XI6neratatrW7NmzZSenq677rpLX3/9terXr+/V/UdHR+vqq6+WJC1YsED33HOP6tevr8WLFysxMTHbZ2JiYvTss88qMzNTEyZMULFixTR37lzdcccdXiunL5w4cUKZmZkqW7ZsofOqUaOGmjZtmuv7X375pQYNGqQuXbroP//5jyIiIlzvtWnTRoMHD9aiRYsUHR3t8b47d+6sxMREvf322xo0aFC29+fPn6+zZ8/qnnvu8ThvhLb//Oc/aty4sapUqeK1ffjT/TpUHD58WDExMYqLi8v23qhRo1SqVCmtWLHCdV7atWun6tWra8SIETnO3Mjv/iddnD24atUqzZs3Tz179pQktW7dWr/88oseffRR3X777QoLC7OcDgAA+BdmbAAAgICxfv16dejQQU6nU/Hx8erSpYu+//57r+2vb9++uuGGGyRJt99+uxwOh1q1auVaBmX79u3q1q2b4uPjdcUVV7iVs23btoqNjVWJEiXUvHlzLVu2zC3vrDx27typ7t27y+l0qnTp0nrkkUeUnp6u7777Tp06dVJsbKyqVq2qF1980XK5t23bpgYNGmTb/uuvv0qSatWqVYCjIb388staunSpR/sfMWKEevbsqTvvvFPr1q3LcVBDkr799ltde+212r59u/7+97+rf//+GjdunLp06ZLvcjNW24Xd7eemm25S48aNNWPGDF1zzTWKjo5WpUqVNGbMGGVmZub4mZ07d6pixYrq3Lmz3n33XZ06darA+8/P+PHjFRYWpjfeeMNtUOOvunfvnu2cfP/99+rVq5fKly+vyMhI1apVS6+++qpbmrCwMPXp00fbtm3Tt99+my3fmTNnuupZEJ5cQ7t371bPnj3ldDpVoUIF9e/fXykpKbnm/cUXX8jhcGj+/PnZ3nv33XflcDi0devWXD+ftd+vv/5at956q+Li4uR0OnXXXXfp+PHjOX7m6NGj+ZbRap0fffRRSVK1atVcS/B89tlnXjlux48f13333adKlSopMjJS5cqVU4sWLbR69epcj8/u3bvlcDi0aNEi17Zt27bJ4XCoTp06bmm7du3qNrPLGKMlS5botttuyzX/vzp48GC+5yC/+7WV9u7N+7UkLV26VA6HQ2vWrMn23muvvSaHw6Fbb70113Oflpamhg0b6sorr3Q7h0eOHFFCQoJatWqljIwMS2XJbZmngiznlpycrLfeekvt2rXT5Zdfrp9++inHdF9++aVatWrlNtgUGxurG2+8URs2bNDhw4c92m+WJUuWqGTJkurevbvb9n79+unQoUPavHmzR+mkwrcFb7clAABCigEAAAgAY8aMMcWKFTP9+/c3y5YtM//5z39MvXr1TKVKlcypU6e8ss8ffvjBvPrqq0aSGT9+vNm4caPZvXu3GTNmjJFkqlSpYh5//HGzatUqs3TpUmOMMZ999pkpXry4adSokVm4cKFZunSp6dChg3E4HGbBggVu9ZFkatasaZ577jmzatUq89hjjxlJZsiQIebqq682//rXv8yqVatMv379jCSzePHifMv8+++/G0lm6NCh5sKFC+bChQvm6NGj5t133zWxsbHm3nvvLfDx6NWrlylevLhZsmRJvvu//fbbTZs2bUxkZKSZMWNGvnkfPHjQfPjhh8YYYwYPHmxmzpxp0tPTzaxZs8z58+dz/ZzVduGN9lOxYkUTExNjatWqZWbPnm1Wrlxp7rjjDiMp1zqfPXvWzJ0719x0000mIiLCREVFmW7dupnFixebtLQ0S/v99NNPjSRTvnx5ExYWZmJjY02HDh3MF1984UqTnp5uoqOjTbNmzTyq0+7du43T6TT16tUz7777rlm5cqUZPny4KVasmBk7dqxb2u+//944HA4zbNiwbHlIMk888YRH+85SkGto9OjRZtWqVWbKlCkmMjLS9OvXz5Vu5syZRpLZv3+/a1vDhg1NixYtsu37uuuuM9ddd12e5fvr9f/oo4+aTz75xEyZMsXExMSYhg0burVXq2W0WueDBw+aBx980Egy77//vtm4caPZuHGjSUlJsf24GWNMx44dTbly5cybb75pPvvsM7N06VIzevRot/xyUrFiRXPfffe5/j1x4kQTHR1tJJnffvvNGGPMhQsXTFxcnHnsscdc6davX28kmX379tl+DnK6X1tt7966X2e5cOGCKV++vLnzzjuzvXf99deba6+9Ns9zb4wx+/btM7GxsebWW281xhiTkZFh2rRpY8qXL28OHTpkuSxZ+Wa91q5day677DKTkJDg2ldezpw5YxYsWGC6du1qIiIiTHR0tLntttvMokWLzLlz53L8TEREhLn77ruzbe/Zs6eRZD755BPXNiv3vyxNmzbN8XretWuXkWTeeOMNj9IZU/i24O22BABAKGFgAwAA+L0PP/zQSDIvvvii2/Z9+/YZSWbOnDnZPtOpUycTExOT42vcuHGW9531I8qiRYtc27J+mBg9enS29E2bNjXly5d3+7E8PT3d1K1b11x++eUmMzPTLY+XXnrJ7fMNGjRw/XCV5cKFC6ZcuXKuH6zysnLlSiMp2ys8PNw8//zzluudk/T09Hw
"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-06 11:41:37 +02:00
"a0=ax0.hist2d(energyloss_found, energy_found, bins=(np.linspace(0,1,70), np.linspace(0,1.5e5,105)), cmap=plt.cm.jet, cmin=1, vmax=7)\n",
"ax0.set_ylim(0,1.5e5)\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-06 11:41:37 +02:00
"a1=ax1.hist2d(energyloss_lost, energy_lost, bins=(np.linspace(0,1,70), np.linspace(0,1.5e5,105)), cmap=plt.cm.jet, cmin=1, vmax=7) \n",
"ax1.set_ylim(0,1.5e5)\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-09 12:10:28 +02:00
"execution_count": 70,
2023-10-05 15:58:17 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABk4AAAJOCAYAAADxgPt3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADVm0lEQVR4nOzdd3hUxf7H8c+mh5CEUEOQLr03aSogXZooRdBIU1FEQMGCCgFFEJCiYLteBUSaXKQXIVRFkC5X9AoqCCoBVAhFShLm9wdkfywpe5KchE3yfj3PPrpn58x8Z87Zw5zMzhmHMcYIAAAAAAAAAAAA8rrVAQAAAAAAAAAAAHgKBk4AAAAAAAAAAACuY+AEAAAAAAAAAADgOgZOAAAAAAAAAAAArmPgBAAAAAAAAAAA4DoGTgAAAAA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A80DDzxgFi5caC5fvpzsPn5+fuaRRx5Jsr1Hjx5Gkvniiy+c26xc/xI1aNAg2e/zd999ZySZDz74IE3pjMn4uZDZ5xIAAMg4Bk4AAEC2sXz5ciPJTJgwwWX7wYMHjSTz6aefJtmnTZs2JigoKNnX66+/brnsxD/SLFy40Lkt8Q8fI0eOTJK+QYMGpnDhwi5/jI+PjzdVq1Y1t912m7l69apLHpMmTXLZv2bNms4/jCWKi4szhQoVcv5BLDVr1641kpK8fHx8zJgxYyzXOznx8fFuB09uLD8gIMBs3749zeU
"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-06 11:41:37 +02:00
"a0=ax0.hist2d(energyloss_found, residual_found, bins=(np.linspace(0,1,80), np.linspace(0,1e5,80)), cmap=plt.cm.jet, cmin=1, vmax=20)\n",
"ax0.set_ylim(0,1e5)\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-06 11:41:37 +02:00
"a1=ax1.hist2d(energyloss_lost, residual_lost, bins=(np.linspace(0,1,80), np.linspace(0,1e5,80)), cmap=plt.cm.jet, cmin=1, vmax=20) \n",
"ax1.set_ylim(0,1e5)\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",
"execution_count": 14,
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-09 09:59:35 +02:00
"execution_count": 15,
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-09 09:59:35 +02:00
"execution_count": 16,
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'>"
]
},
"execution_count": 16,
"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-09 09:59:35 +02:00
"execution_count": 17,
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-09 09:59:35 +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 * float64</pre>"
],
"text/plain": [
"<Array [101, 101, 101, 101, 101, ..., 101, 101, 101, 0] type='11 * float64'>"
]
},
"execution_count": 18,
"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-09 09:59:35 +02:00
"execution_count": 19,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"image/png": "iV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nUrq9OvXT127dtWnn36q3r17KywsTO3atdPDDz+s8vJyt5+ZM2eO4uPjdc4556hPnz7KycmpElPb/sjIyNBvfvMbSVJ8fLxsNptsNptWrlwpSTp58qRmzZqlSy65RHa7XdHR0brrrru0d+9et/3Pzc3VT3/6U7Vo0UIXXHCBHn/8cZ08ebLW7TfG6Pnnn9fll1+usLAwRUVF6ZZbbtG///3verdTWFioSZMmKT4+XqGhoWrXrp0mTJig48ePu8RVfMcvvPCCOnfuLLvdrldffVWStGbNGvXp00fNmze3vo//+7//c7lc/d5771XLli31v//9r8p2XXvttbr00kur3e7nnntOzZo108GDB61lTz31lGw2m8aOHWstO3nypKKiojRx4kRJp8s2zZo1S4899pji4+Nlt9v1ySef6Morr5Qk3X333db3mZGRUcs3IOXn5+vuu+9Wy5YtFR4ermHDhlXZ/+5U/L3ZtGmTRowYocjISDkcDt155506dOiQS+ybb76p5ORktW3bVmFhYercubN+97vfVflOKi6D3rJli5KTkxUREaEBAwZIkrKzs3XjjTfqvPPOU/PmzXXRRRdp9OjR+u9//+u2X19++aVuvfVWORwOtWzZUunp6SorK9P27dt13XXXKSIiQh07dtSsWbOqbJsnx5DNZtPx48f16quvWvvb+d+kvLw8jR49Wuedd55CQ0MVHx+v6dOnu/wgU9P3CQCAP/vzn/+syy67TM2bN1fLli1100036euvv3aJ+fe//62f//zniouLk91uV0xMjAYMGGBl8nbs2FHbtm3TqlWrrP9L3Y3VnVWM31588UVdfPHFstvt6tKlixYvXuw2/ujRo7r//vvVunVrtWrVSiNGjNC+fftcYjwZ9/br108ffPCBvv/+e6uvzucPP/zwg8aMGaN27dopNDRUF1xwgR566CEVFxe77b8n5xju1HWc60k7O3bsUEpKiqKjo2W329W5c2c999xzLjErV66UzWbT66+/rokTJ6pdu3ay2+367rvvJEkvvfSSy/exaNEil3MvY4w6deqkwYMHV2n/2LFjcjgcLmPgym699dYqY+thw4bJZrPpb3/7m7Xs888/l81m03vvvSfpdNmmrKws3XPPPWrTpo1atGihKVOm1HguVJNt27ZpwIABCg8PV5s2bfTAAw+4PR+orC7nfdOnT1evXr3UsmVLRUZG6oorrtDLL78sY4xLXMeOHTV06FC9/fbb6t69u5o3b67p06dLOnW+cc011yg6Olrh4eFKTEzUrFmzVFpa6rZf69atU9++fRUWFqaOHTvqlVdekXTqXPeKK65QixYtlJiYqKVLl1bZttqOoZUrV9Z6rrJhwwYNHz5cLVu2VPPmzdW9e3f99a9/dWmnuu+z8t8zAAHIADhrfPfdd+a5554zkkxmZqZZt26d2bZtmzHGmIULFxpJJjk52bzzzjvmzTffND169DChoaHm008/tdYxcuRI06FDhyrrnjZtmqn8T4ok07FjR/OTn/zE/PWvfzUffvih6devnwkODjb/+te/rLhly5aZoKAgc/XVV5u3337b/O1vfzNXXnmlOf/886us052kpCTTqlUrExcXZ/74xz+ajz/+2IwfP95IMmPHjrXidu7cafXpuuuuM++884555513TGJioomKijJHjhyxYj3ZH3v27DHjxo0zkszbb79t1q1bZ9atW2cKCgqMMcbcd999RpJ54IEHzNKlS80LL7xg2rRpY9q3b28OHTpUpf+dOnUyL7zwgsnOzjZjxowxksyrr75a6/aPGjXKhISEmIkTJ5qlS5eaRYsWmUsuucTExMSYvLy8Ordz/Phxc/nll5vWrVubOXPmmGXLlplnn33WOBwOc+2115qTJ0+6fMft2rUz3bp1M4sWLTIrVqwwW7duNV988YVp3ry56datm1m8eLF59913zfXXX286duxoJJmdO3caY4z54osvjCTz0ksvuWzTtm3bjCTz3HPPVbvd33zzjZFkFi1aZC277rrrTFhYmOnUqZO1bP369UaS+fDDD12Og3bt2pn+/fubv//97yYrK8t88cUX5pVXXjGSzO9//3vr+9yzZ0+1faiIb9++vbnnnnvMRx99ZP70pz+Z6Oho0759e5Ofn1/jd1fx96ZDhw7mN7/5jfn444/NnDlzTHh4uOnevbspKSmxYv/whz+Yp59+2nzwwQdm5cqV5oUXXjDx8fGmf//+LuscOXKkCQkJMR07djQzZ840y5cvNx9//LExxpj58+ebmTNnmnfffdesWrXKvPrqq+ayyy4zCQkJLm1V9CshIcH84Q9/MNnZ2Wby5MnW8XzJJZeYP/7xjyY7O9vcfffdRpJ56623rM97egytW7fOhIWFmeuvv97a3xX/Ju3fv9+0b9/edOjQwbz44otm2bJl5g9/+IOx2+0mLS3Naqu677PiGAMAwNcqxgvO/zdlZmYaSeYXv/iF+eCDD8xrr71mLrjgAuNwOMy3335rxSUkJJiLLrrIvP7662bVqlXmrbfeMhMnTjSffPKJMcaYzz//3FxwwQWme/fu1v+ln3/+eY39qRi7dOnSxfzlL38x7777rrnuuuuMJPO3v/2tSr8vuOACM27cOPPxxx+b//u//zNRUVFVxh+ejHu3bdtmrrrqKhMbG2v1dd26dcYYY4qKiky3bt1MeHi4mT17tsnKyjIPP/ywCQ4ONtdff32V/ntyjuFOXce5nrSzbds243A4TGJionnttddMVlaWmThxomnWrJnJyMiw4j755BNrzHLLLbeYd99917z//vvm8OHD5sUXXzSSzM0332zef/99s3DhQnPxxRebDh06uJx7Pfvss8Zms7kcI8YY6xyvYhzlzgsvvGAkmX379hljjCktLTUREREmLCzMjBo1yop74oknTHBwsCksLDTGnD4O2rVrZ+677z7z0Ucfmb///e9m165dNZ4LuTNy5EgTGhp
"text/plain": [
"<Figure size 1800x600 with 4 Axes>"
]
},
"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-02 15:10:45 +02:00
"bs_found, vtx_types_found = ak.broadcast_arrays(b_found, vtx_types_found)\n",
"bs_found = ak.to_numpy(ak.ravel(bs_found))\n",
"vtx_types_found = ak.to_numpy(ak.ravel(vtx_types_found))\n",
"\n",
"bs_lost, vtx_types_lost = ak.broadcast_arrays(b_lost, vtx_types_lost)\n",
"bs_lost = ak.to_numpy(ak.ravel(bs_lost))\n",
"vtx_types_lost = ak.to_numpy(ak.ravel(vtx_types_lost))\n",
"\n",
"\n",
2023-09-29 12:21:18 +02:00
"\n",
"\n",
"#Erste Annahme ist Bremsstrahlung\n",
"\n",
2023-10-02 15:58:50 +02:00
"fig = plt.figure(figsize=(18,6))\n",
2023-09-29 12:21:18 +02:00
"axes = ImageGrid(fig, 111, # similar to subplot(111)\n",
" nrows_ncols=(1, 2), # creates 2x2 grid of axes\n",
" axes_pad=1, # pad between axes in inch.\n",
" cbar_mode=\"single\",\n",
" cbar_location=\"right\",\n",
" cbar_pad=0.1,\n",
" aspect=False\n",
" )\n",
"\n",
"\n",
"h0 = axes[0].hist2d(b_found, brem_energy_found, bins=200, cmap=plt.cm.jet, cmin=1,vmax=30)\n",
"axes[0].set_xlim(-1,1)\n",
"axes[0].set_xlabel(\"b parameter [mm]\")\n",
"axes[0].set_ylabel(r\"$E_{ph}$\")\n",
"axes[0].set_title(\"found photon energy wrt b parameter\")\n",
"\n",
"h1 = axes[1].hist2d(b_lost, brem_energy_lost, bins=200, cmap=plt.cm.jet, cmin=1,vmax=30)\n",
"axes[1].set_xlim(-1,1)\n",
"axes[1].set_xlabel(\"b parameter [mm]\")\n",
"axes[1].set_ylabel(r\"$E_{ph}$\")\n",
"axes[1].set_title(\"lost photon energy wrt b parameter\")\n",
"\n",
"fig.colorbar(h0[3], cax=axes.cbar_axes[0], orientation='vertical')\n",
"\n",
"\"\"\"\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-02 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-09 09:59:35 +02:00
"execution_count": 20,
2023-10-02 13:56:58 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABS0AAAIhCAYAAACrEJ+KAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACFBUlEQVR4nOzdeXQUVdrH8V+TnSUNQUlAEEERDCgCRjbZZB9xXAfcEBAXxjiK6KiMC8R3BNEZRKVRcdS4DMsoq4qDoCwqUSObDnFjRGEwEWEgAWRL575/MGnpdCXpht5S/f2cU+fQlVu3blV19324fesphzHGCAAAAAAAAACiRK1INwAAAAAAAAAAjsWgJQAAAAAAAICowqAlAAAAAAAAgKjCoCUAAAAAAACAqMKgJQAAAAAAAICowqAlAAAAAAAAgKjCoCUAAAAAAACAqMKgJQAAAAAAAICowqAlAAAAAAAAgKjCoCVsb+7cuWrbtq1SUlLkcDi0YcOGSDfJ0sSJE+VwOCLdDC8Oh0MTJ04MeLslS5Yc13bV6d27t3r37l1tue+//14Oh0O5ublBb0N1ZsyYEdB+HQ6HbrvtttA1yOZC9V4DAIRPbm6uHA6Hvv/++5DUH2jfHC4rV66Uw+HQypUrA942VMfkb+wX6mtWmV9++UUTJ070+5yVn+M33ngjtA2zAWIqANGIQUvY2s8//6zhw4fr9NNP1z//+U/l5eXpzDPPjHSzbG/JkiXKyckJer0zZszQjBkzgl5vMEXrf4zsKlTvNQCAfdixbw7VMeXl5enGG28Mer3B8ssvvygnJ+e4BnpRNWIqANEoPtINAELpm2++0ZEjR3TdddepV69ekW4OTlBmZmakm1CpX375RbVr1450M0LiyJEjcjgcio+PnS7DztcTAIDKdOnSJdJNsGSM0cGDByPdjJCxc9xh52MDEHrMtIRtjRw5UhdccIEkadiwYXI4HF63Fi9evFhdu3ZV7dq1Va9ePfXv3195eXk+dZx22mk+dVvdyl1+m++rr76qs846S7Vr11b79u311ltv+Wz/9ttv69xzz1VSUpJatGihv/zlLwEd2/Lly9W3b1+lpqaqdu3a6t69u9577z3LNm7atElXX321nE6n0tPTdcMNN6i4uNirbElJiW666SY1bNhQdevW1aBBg/TNN994lVm4cKEcDofPfiTpmWeekcPh0Oeff66RI0fK5XJ5zkn58v3332vOnDlyOByaPn261/YTJkxQXFycli1bVuVxW90e/uOPP2ro0KGqV6+enE6nhg0bpqKioirrKT/m+Ph4Pf744551O3fuVK1ateR0OlVaWupZf/vtt+vkk0+WMcbTjnbt2mn16tXq1q2bateurRtuuEGnnXaaNm3apFWrVnmO2+r9Y+W5557TmWeeqaSkJGVmZmrOnDnVblN+G/xjjz2mRx55RKeeeqqSk5N13nnn+VynzZs3a9SoUWrVqpVq166tU045RRdffLG++OILr3Llt1G9+uqruuuuu3TKKacoKSlJmzdv1s8//6xbb71VmZmZqlu3rho1aqQLL7xQH3zwgWW7Hn/8cU2ZMkWnnXaaUlJS1Lt3b88PCffdd5+aNGkip9Opyy67TDt27PA5vrlz56pr166qU6eO6tatq4EDB2r9+vWev1f1XpOO/gdnxowZOvfcc5WSkqIGDRroyiuv1Hfffee1n8quJwAgsl588UW1b99eycnJSktL02WXXaYvv/zSq8x3332nq666Sk2aNFFSUpLS09PVt29fTzqg4+mbA+0/8vPz1aNHD9WuXVstW7bUo48+qrKyMq+yX331lQYNGqTatWvrpJNO0pgxY7R3716vMmPHjlWdOnVUUlLi06Zhw4YpPT1dR44cqfKYxowZo+TkZK1du9azbVlZmfr27av09HQVFhZWeexWt4d//PHH6t69u5KTk9WkSRONHz9eR44cqbIe6Wi863A4lJ+f71k3b948ORwOXXTRRV5lzznnHF1xxRVe7bjtttv07LPP6qyzzlJSUpJefvllnXzyyZKknJwcz7GPHDmy2rYcPHhQ48aNU0ZGhlJSUtSrVy+vmKIy5bfBL1u2TKNGjVJaWprq1Kmjiy++2Of9sGzZMl1yySVq2rSpkpOTdcYZZ+iWW27Rzp07vcqVx+jr1q3TlVdeqQYNGuj000+XJH322We66qqrPLHTaaedpquvvlo//PCDZbtWrFih3//+9zrppJPUsGFDXX755frxxx99joOYCkCNZQCb2rx5s3G5XEaSmTRpksnLyzObNm0yxhjz97//3UgyAwYMMAsXLjRz5841nTp1MomJieaDDz7w1DFixAjTvHlzn7onTJhgKn58JJnTTjvNnH/++eYf//iHWbJkiendu7eJj483//73vz3lli9fbuLi4swFF1xg5s+fb15//XWTlZVlTj31VJ86rbz66qvG4XCYSy+91MyfP9+8+eabZsiQISYuLs4sX77cp42tW7c2Dz30kFm2bJmZOnWqSUpKMqNGjfKUKysrM3369DFJSUnmkUceMe+++66ZMGGCadmypZFkJkyYYIwx5siRI6ZRo0bm2muv9WnT+eefbzp27Og571deeaWRZPLy8jzLwYMHjTHGjBkzxiQmJpr8/HxjjDHvvfeeqVWrlnnggQeqPfZevXqZXr16eV7/8ssv5qyzzjJOp9M8/fTTZunSpeb222/3nMuXXnqpyvq6dOliBgwY4Hk9Z84ck5ycbBwOh/noo48868866ywzdOhQr3akpaWZZs2amaefftqsWLHCrFq1yqxbt860bNnSdOjQwXPc69atq7INkkyzZs1MZmammT17tlm8eLEZNGiQkWRef/31KrfdsmWLZ/sLLrjAzJs3z/N+SkhIMGvWrPGUXbVqlbnrrrvMG2+8YVatWmUWLFhgLr30UpOSkmK++uorT7kVK1YYSeaUU04xV155pVm8eLF56623zK5du8xXX31lfv/735s5c+aYlStXmrfeesuMHj3a1KpVy6xYscKnXc2bNzcXX3yxeeutt8xrr71m0tPTzZlnnmmGDx9ubrjhBvPOO++YZ5991tStW9dcfPHFXsf2yCOPGIfDYW644Qbz1ltvmfnz55uuXbuaOnXqeD7H1b3XbrrpJpOQkGDuuusu889//tPMmjXLtGnTxqSnp5uioqJqrycAIDxeeuklI8ls2bLFs27SpElGkrn66qvN22+/bV555RXTsmVL43Q6zTfffOMp17p1a3PGGWeYV1991axatcrMmzfP3HXXXZ5+6Xj65kD6j4YNG5pWrVqZZ5991ixbtszceuutRpJ5+eWXPeWKiopMo0aNzCmnnGJeeukls2TJEnPttdd64pXytm7cuNFIMs8//7xXe3bv3m2SkpLMuHHjqj2mAwcOmHPPPde0bNnS7N692xhjzEMPPWRq1apl3n333WqvxbGxnzHGbNq0ydSuXdsTpyxatMgMHDjQ0/Zjr1lFe/fuNQkJCWbSpEmedWPGjDEpKSmmTp065vDhw8YYY3766SfjcDjMjBkzvNpxyimnmHPOOcfMmjXLvP/++2bDhg3mn//8p5FkRo8e7Tn2zZs3V9qG8rimWbNm5pJLLjFvvvmmee2118wZZ5xhUlNTvWJ0K+XvzWbNmnlil5kzZ5pGjRqZZs2aec6xMcY888wzZvLkyWbx4sVm1apV5uWXXzbt27c3rVu39hyrMb/G6M2bNzf33nuvWbZsmVm4cKExxpjXX3/dPPTQQ2bBggVm1apVZs6cOaZXr17m5JNPNj///LNPu1q2bGn+8Ic/mKVLl5q//e1vpkGDBqZPnz5ex0BMBaAmY9AStlYeqBw7+ON2u02TJk3M2Wefbdxut2f93r17TaNGjUy3bt086wIdtExPTzclJSWedUVFRaZWrVpm8uTJnnWdO3c2TZo0MQcOHPCsKykpMWlpadUOWu7fv9+kpaX5DPC43W7Tvn17c/755/u08bHHHvMqe+utt5rk5GRTVlZmjDHmnXfeMZLMk08+6VXukUce8Qlcx40bZ1JSUsyePXs86woKCowk8/TTT3vWZWdnV3osBw8
"text/plain": [
"<Figure size 1800x600 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-10-02 13:56:58 +02:00
"source": [
"fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(18,6))\n",
"\n",
2023-10-02 15:58:50 +02:00
"a0=ax[0].hist2d(bs_found, vtx_types_found, bins=110, density=True, cmap=plt.cm.jet, cmin=1e-20,vmax=2)\n",
"ax[0].set_ylim(0,110)\n",
"ax[0].set_xlim(-1,1)\n",
2023-10-02 13:56:58 +02:00
"ax[0].set_xlabel(\"b\")\n",
"ax[0].set_ylabel(\"endvtx id\")\n",
"ax[0].set_title(\"found endvtx id wrt b parameter\")\n",
2023-10-02 15:58:50 +02:00
"ax[0].set_yticks(np.arange(0,110,1),minor=True)\n",
2023-10-02 13:56:58 +02:00
"\n",
2023-10-02 15:58:50 +02:00
"a1=ax[1].hist2d(bs_lost, vtx_types_lost, bins=110, density=True, cmap=plt.cm.jet, cmin=1e-20,vmax=2)\n",
"ax[1].set_ylim(0,110)\n",
"ax[1].set_xlim(-1,1)\n",
2023-10-02 13:56:58 +02:00
"ax[1].set_xlabel(\"b\")\n",
"ax[1].set_ylabel(\"endvtx id\")\n",
"ax[1].set_title(\"lost endvtx id wrt b paraneter\")\n",
2023-10-02 15:58:50 +02:00
"ax[1].set_yticks(np.arange(0,110,1), minor=True)\n",
2023-10-02 13:56:58 +02:00
"\n",
"\"\"\"\n",
2023-10-02 15:58:50 +02:00
"vtx_id: 101 - Bremsstrahlung\n",
2023-10-02 13:56:58 +02:00
"B:\n",
2023-10-02 16:21:00 +02:00
"wir können nicht wirklich sagen dass bei den lost teilchen jegliche endvertex types überwiegen, im gegensatz zu den found \n",
2023-10-02 13:56:58 +02:00
"\"\"\"\n",
2023-10-02 15:10:45 +02:00
"fig.colorbar(a0[3], ax=ax, orientation='vertical')\n",
2023-10-02 13:56:58 +02:00
"plt.show()"
2023-09-29 12:21:18 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-10-09 09:59:35 +02:00
"execution_count": 21,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-09 09:59:35 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABPEAAANVCAYAAAAZd2vuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA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OjRoxZx+afDb9iwQffff7/q1aunqlWrKisrS7/++qvuu+8+XX/99apatarq16+vAQMGaM+ePRZ95M/rww8/1JNPPqmgoCBVq1ZNAwYM0B9//KFz587pgQceUN26dVW3bl3dd999On/+vEUfhmFo0aJFuvHGG+Xj46NatWppyJAh+t///meOiYiI0Oeff66jR4+aj83fj112draeffZZtWzZUl5eXqpXr57uu+8+/fnnnxZjNWnSRP3799eaNWvUoUMHeXt7a/bs2YW+fgkJCRo4cKAaNGggb29vXXfddXrwwQeVkZFR6DZ/d+DAAd1xxx2qWrWq6tatq/Hjx+vcuXM2Yzdu3KiePXuqRo0aqlq1qm699VZ99dVXFjH575mdO3dqyJAhqlWrlpo1a1bo+BcvXtTjjz+ukJAQeXt7q3bt2urYsaNWrFhhEffdd99pwIABqlOnjry9vdWsWTNNnjzZ/POCSyeaNGmiGTNmSJICAgIslmDYs5zWnvf6+++/r8cee0z169eXl5eXfv31V/3555+aMGGCWrdurWrVqsnf31+33XabtmzZYjVGVlaW5syZo1atWsnb21t16tRRjx49tG3btkLnZRiGpk+fLg8PD7355ptF7gMAAOR55TvPy7dlyxZ17txZPj4+ql+/vmbOnKkrV65cdbucnBxNnTpVgYGBqlq1qrp06aLvv//eZmx6eroefPBBNWjQQJ6engoJCdHs2bOVm5trjjly5IhMJpNeeuklPfvsswoJCZGXl5c2bdpU6Bz+85//qFOnTvLz81PVqlXVtGlT3X///RYxZ86c0WOPPaamTZvKy8tL/v7+6tu3rw4cOGCO+XsuFxsbay5AP/nkkxbvVXuW08bGxuqJJ56QJIWEhJhfz/xLyRT1Oi1cuFDdunWTv7+/fH19dcMNN+ill15STk6O1Tjr169Xz549zfveqlUrzZ07t9B5SdI333yjunXrqn///rpw4UKRsYAjcAoCUM7MnDlTt9xyix5++GE9//zz6tGjh2rUqGEzdu3atRoyZIj8/PzMyxELfus2ffp03XTTTXrrrbd09uxZxcbGKiIiQikpKWratKmkvxKAFi1aaPjw4apdu7bS0tK0ePFi3Xzzzdq3b5/q1q1r0ef999+vfv366f3339eFCxfk4eGh33//XXXq1NELL7ygevXq6dSpU3r33XfVqVMnpaSkqEWLFlbz6tGjh5YtW6YjR47o8ccf14gRI+Tu7q727dtrxYoVSklJ0fTp01W9enUtWLDAvO2DDz6oZcuWadKkSXrxxRd16tQpzZkzR+Hh4dq9e7cCAgK0aNEiPfDAAzp06JDWrl1rMXZeXp4GDhyoLVu2aOrUqQoPD9fRo0c1a9YsRUREaPv27Rbf7O3cuVP79+/XjBkzFBISIl9f30Jfv0OHDiksLExjx46Vn5+fjhw5ovnz56tLly7as2ePPDw8Ct32jz/+UPfu3eXh4aFFixYpICBAH3zwgc1rsC1fvlwjR47UwIED9e6778rDw0NvvPGGevfurS+//NLqG9C7775bw4cP1/jx44tMQKKjo/X+++/r2WefVYcOHXThwgXt3btXJ0+eNMd8+eWXGjBggFq1aqX58+erUaNGOnLkiDZs2FBov2vXrtXChQsVHx+v9evXy8/Pr1hnG9jzXo+JiVFYWJiWLFmiKlWqyN/f35ysz5o1S4GBgTp//rzWrl2riIgIffXVV+Z/OOXm5qpPnz7asmWLJk+erNtuu025ubn69ttvlZqaqvDwcKs5ZWVlafTo0fr888/16aef6o477rB7fwAAlRN5XvnO86S/imvDhw/XtGnTNGfOHH3++ed69tlndfr0ab3++utFbjtu3Di99957evzxx9WrVy/t3btXd999t9UXtunp6brllltUpUoVPf3002rWrJmSk5P17LPP6siRI3rnnXcs4hcsWKDmzZtr3rx5qlGjhq6//nqb4ycnJ2vYsGEaNmyYYmNj5e3traNHj+rrr782x5w7d05dunTRkSNH9OSTT6pTp046f/68Nm/erLS0NLVs2dKq37Fjx6p9+/a6++679cgjj+iee+4p1pmAY8eO1alTp/Taa69pzZo15qW3f1+tUdjrdOjQId1zzz0KCQmRp6endu/ereeee04HDhzQ22+/bd4+Pj5e48aNU/fu3bVkyRL5+/vr559/Nq8UseXf//63Ro4cqfvvv1+vvfaa3Nzc7N4noMQMAOXOpk2bDEnGf/7zH4v2WbNmGQV/rdu0aWN079690D5uuukmIy8vz9x+5MgRw8PDwxg7dmyh4+fm5hrnz583fH19jVdffdXc/s477xiSjJEjR151H3Jzc43s7Gzj+uuvN6ZMmWI1rwEDBljET5482ZBkTJo0yaL9rrvuMmrXrm1+npycbEgyXnnlFYu4Y8eOGT4+PsbUqVPNbf369TMaN25sNbcVK1YYkozVq1dbtP/www+GJGPRokXmtsaNGxtubm7GwYMHr7rPBeXl5Rk5OTnG0aNHDUnGxx9/XGT8k08+aZhMJmPXrl0W7b169TIkGZs2bTIMwzAuXLhg1K5d2+oYXrlyxWjfvr1xyy23mNvy3zNPP/20XXNu27atcddddxUZ06xZM6NZs2bGpUuXCo3Jf68cPnzYai5//vmnRWz37t1tvocLutp7vVu3blftIzc318jJyTF69uxpDBo0yNz+3nvvGZKMN998s8jtJRkPP/ywcfLkSaNLly5G/fr1rV4vAACKQp73f8pbnte9e3ebOd24ceOMKlWqGEePHi102/379xuSLI6
"text/plain": [
"<Figure size 1500x1000 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-09-29 12:21:18 +02:00
"source": [
"fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2, figsize=(15,10))\n",
"\n",
"ax0.hist(scifi_fitpars_found[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$a_x$ found\")\n",
"ax0.hist(scifi_fitpars_lost[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$a_x$ lost\")\n",
"ax0.set_xlabel(\"a\")\n",
"ax0.set_ylabel(\"normed\")\n",
"ax0.set_title(\"fitparameter a der scifi track\")\n",
"ax0.legend()\n",
"\n",
"ax1.hist(scifi_fitpars_found[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$b_x$ found\")\n",
"ax1.hist(scifi_fitpars_lost[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$b_x$ lost\")\n",
2023-10-02 16:21:00 +02:00
"ax1.set_xticks(np.arange(-1,1,0.1),minor=True)\n",
2023-09-29 12:21:18 +02:00
"ax1.set_xlabel(\"b\")\n",
"ax1.set_ylabel(\"normed\")\n",
"ax1.set_title(\"fitparameter b der scifi track\")\n",
"ax1.legend()\n",
"#evtl multiple scattering candidates (lost); findet man einen gewissen endvtx_type (mult scattering)\n",
"#steiler velo winkel (eta)? vertex type? evtl bremsstrahlung?\n",
"\n",
"\n",
"ax2.hist(scifi_fitpars_found[:,2], bins=500, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$c_x$ found\")\n",
"ax2.hist(scifi_fitpars_lost[:,2], bins=500, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$c_x$ lost\")\n",
"ax2.set_xlim([-3e-5,3e-5])\n",
"ax2.set_xticks(np.arange(-3e-5,3.5e-5,1e-5),minor=False)\n",
"ax2.set_xlabel(\"c\")\n",
"ax2.set_ylabel(\"normed\")\n",
"ax2.set_title(\"fitparameter c der scifi track\")\n",
"ax2.legend()\n",
"\n",
"ax3.hist(scifi_fitpars_found[:,3], bins=500, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$d_x$ found\")\n",
"ax3.hist(scifi_fitpars_lost[:,3], bins=500, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$d_x$ lost\")\n",
"ax3.set(xlim=(-5e-8,5e-8))\n",
"ax3.text(-4e-8,3e8,\"d negligible <1e-7\")\n",
"ax3.set_xlabel(\"d\")\n",
"ax3.set_ylabel(\"normed\")\n",
"ax3.set_title(\"fitparameter d der scifi track\")\n",
"ax3.legend()\n",
"\n",
"\"\"\"\n",
"a_x: virtual hit on the reference plane\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
2023-09-28 15:50:32 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-10-05 10:49:35 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-09-28 15:50:32 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "env1",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}