Projektpraktikum/B_rework.ipynb

1011 lines
198 KiB
Plaintext
Raw Normal View History

2023-09-28 15:50:32 +02:00
{
"cells": [
{
"cell_type": "code",
2023-10-06 11:41:37 +02:00
"execution_count": 1,
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-06 11:41:37 +02:00
"execution_count": 2,
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-06 11:41:37 +02:00
"execution_count": 2,
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-06 11:41:37 +02:00
"execution_count": 3,
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-06 11:41:37 +02:00
"execution_count": 36,
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-06 11:41:37 +02:00
"execution_count": 36,
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-06 11:41:37 +02:00
"execution_count": 37,
"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",
" \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",
"execution_count": 38,
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-06 11:41:37 +02:00
"execution_count": 38,
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",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-10-06 11:41:37 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-10-05 15:58:17 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"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",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-10-06 11:41:37 +02:00
"execution_count": 44,
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",
"eff (cutoff = 50 ) = 0.9379 +/- 0.0135\n",
"sample size: 322\n",
"eff (cutoff = 100 ) = 0.9379 +/- 0.0135\n",
"sample size: 433\n",
"eff (cutoff = 150 ) = 0.9423 +/- 0.0112\n",
"sample size: 529\n",
"eff (cutoff = 200 ) = 0.949 +/- 0.0096\n",
"sample size: 644\n",
"eff (cutoff = 250 ) = 0.9519 +/- 0.0084\n",
"sample size: 757\n",
"eff (cutoff = 300 ) = 0.9498 +/- 0.0079\n",
"sample size: 846\n",
"eff (cutoff = 350 ) = 0.9433 +/- 0.008\n",
"sample size: 919\n",
"eff (cutoff = 400 ) = 0.9467 +/- 0.0074\n",
"sample size: 1019\n",
"eff (cutoff = 450 ) = 0.949 +/- 0.0069\n",
"sample size: 1117\n",
"eff (cutoff = 500 ) = 0.9418 +/- 0.007\n",
"sample size: 1184\n",
"eff (cutoff = 550 ) = 0.9409 +/- 0.0069\n",
"sample size: 1268\n",
"eff (cutoff = 600 ) = 0.9416 +/- 0.0066\n",
"sample size: 1342\n",
"eff (cutoff = 650 ) = 0.9404 +/- 0.0065\n",
"sample size: 1416\n",
"eff (cutoff = 700 ) = 0.9407 +/- 0.0063\n",
"sample size: 1484\n",
"eff (cutoff = 750 ) = 0.942 +/- 0.0061\n",
"sample size: 1557\n",
"eff (cutoff = 800 ) = 0.939 +/- 0.0061\n",
"sample size: 1628\n",
"eff (cutoff = 850 ) = 0.9373 +/- 0.006\n",
"sample size: 1690\n",
"eff (cutoff = 900 ) = 0.9385 +/- 0.0058\n",
"sample size: 1745\n",
"eff (cutoff = 950 ) = 0.9381 +/- 0.0058\n",
"sample size: 1796\n",
"eff (cutoff = 1000 ) = 0.9365 +/- 0.0058\n",
"\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-02 16:21:00 +02:00
"execution_count": null,
2023-09-28 15:50:32 +02:00
"metadata": {},
"outputs": [],
2023-10-02 16:21:00 +02:00
"source": []
2023-09-28 15:50:32 +02:00
},
{
"cell_type": "code",
2023-10-06 11:41:37 +02:00
"execution_count": 41,
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,...'>"
]
},
"execution_count": 41,
"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-06 11:41:37 +02:00
"execution_count": 42,
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-06 11:41:37 +02:00
"execution_count": 43,
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+hQ65DI1h5rhjLm9M2LHHDtyZNmig5OVmHDx/W8uXLddlll5kdEgAAsABTZ1SWL18uwzDUo0cPff/997rnnnvUo0cPjR8/3sywAACARZg6o1JQUKCJEyeqZ8+euv7663XOOedoxYoVTOMBAABJJs+oXHnllbryyivNDAEA0IiVl5fL4XCYHYZlORwORURE6Pjx4yovL/d6PbvdrvDw8IDEYGqhAgCAGQzD0P79+3XkyBGzQ7E0wzDUpk0b5ebm+ny/smbNmqlNmzZ1vs8ZhQoAoNGpKFKSkpIUGxvLTUOr4XQ6dfToUcXFxdV+Y7bfGIah4uJi5eXlSZKSk5PrFAOFCgCgUSkvL3cVKYmJiWaHY2lOp1OlpaWKjo72ulCRTtxlXpLy8vKUlJRUp8NAlrg8GQCAUKk4JyU2NtbkSBq2ivzW9RwgChUAQKPE4Z7gClR+KVQAAIBlUagAAFBPDBkyRJMnTzY7jJDiZFoAACqsTQ/t9gaHeHu/ycrK0tChQ3X48GE1a9bMlBi8xYwKAACwLAoVAADqocOHD+v6669X8+bNFRsbqxEjRmjnzp2u5T/99JMuvfRSNW/eXE2aNFHv3r21bNky/fjjjxo6dKgkqXnz5rLZbLrhhhtM2ovacegHAIB66IYbbtDOnTu1dOlSxcfHa9q0aRo5cqS2bdsmu92uiRMnqrS0VKtWrVKTJk20bds2xcXFKSUlRQsXLtQVV1yh7777TvHx8a77nlgRhQoAAPVMRYHy+eefa/DgwZKkt99+WykpKVqyZIlGjx6tPXv26IorrlDfvn0lSZ07d3at36JFC0lSUlIS56gAAIDA2r59uyIiIjRo0CBXW2Jionr06KHt27dLkiZNmqRHH31UZ599tmbMmKH//Oc/ZoVbJxQqAADUM4ZhVNtecaO1m266ST/88IPGjh2rb775RgMHDtTzzz8fyjADgkIFAIB6plevXiorK9P69etdbQcPHtSOHTt06qmnutpSUlJ02223adGiRbr77rs1Z84cSVJkZKSkE889sjoKFQAA6plu3brpsssu080336w1a9bo66+/1nXXXad27drpsssukyRNnjxZy5cv1+7du7Vp0yZ99tlnriKmQ4cOstls+uCDD3TgwAEdPXrUzN2pESfTAgBQwaQbsPlj7ty5uvPOO3XJJZeotLRU5513npYtWya73S7pxGzJxIkTtXfvXsXHx+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-06 11:41:37 +02:00
"execution_count": 58,
2023-09-28 15:50:32 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABjYAAAJOCAYAAAAUHj4bAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADYY0lEQVR4nOzdd3xUxf7/8feSkEJIllBDlKqIVEFQmld6u0SuBVBQpCiigIiCBZVioSiI3gti4SooXS7CVUGkKYpUQUTKFQsKSlVCAkiAJPP7g1/265J2Njmbba/n47EP5ezsnJlz5pyds5OZj8MYYwQAAAAAAAAAABAAivm6AAAAAAAAAAAAAFYxsAEAAAAAAAAAAAIGAxsAAAAAAAAAACBgMLABAAAAAAAAAAACBgMbAAAAAAAAAAAgYDCwAQAAAAAAAAAAAgYDGwAAAAAAAAAAIGAwsAEAAAAAAAAAAAIGAxsAAAAAAAAAACBgMLABAAAAAAAAAAACBgMbAAAg6PXt21ezZs3ydTFg0c6dO3XgwAFfFwMAAAAA4KcY2AAAAIBfefPNN7V27VpfFwMAAAAA4KcY2AAAAMjHwoULVadOHUVHR8vhcGjHjh2+LlKeli9fLofD4faKi4tTo0aN9N577xXZ/t9991237cnJyercubMiIiI0bdo0t/c+//xzDRgwQMeOHXNt27Nnj2699VYdPXrU62UOJJ999lm285v12rRpU7b0O3fu1D333KMrrrhC0dHRio6OVo0aNTRw4EB99dVXBSrDLbfcoujoaJ08eTLXNHfeeaeKFy/u8/M3a9YsORwO/fzzz0W+77Fjx8rhcOj333+3Lc8NGzZo7NixeR77QJaRkaHy5cvr5ZdfzjWNN45rIAjmc79lyxZ17NhRsbGxKlmypFq3bq0vv/wyWzpP73+nT5/WsGHDlJiYqKioKDVo0EALFiwocDoAAOA/GNgAAABBKSkpSaVKlVKpUqU0b948DRo0yPXviRMnWs7n+PHj6t27t6644gqtWLFCGzdu1FVXXeXFkhfe9u3bJUn//e9/tXHjRm3YsEEzZszQmTNn1LNnT+3cubNI9t+oUSPXtp07d6px48b6+uuvtXbtWg0ZMsTtM40aNVKFChVUv359rVmzRtOmTVP79u3VqVMnlStXzqvlDVTjx4/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-06 11:41:37 +02:00
"execution_count": 67,
2023-10-05 15:58:17 +02:00
"metadata": {},
2023-10-06 11:41:37 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABk4AAAJOCAYAAADxgPt3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADVm0lEQVR4nOzdd3hUxf7H8c+mh5CEUEOQLr03aSogXZooRdBIU1FEQMGCCgFFEJCiYLteBUSaXKQXIVRFkC5X9AoqCCoBVAhFShLm9wdkfywpe5KchE3yfj3PPrpn58x8Z87Zw5zMzhmHMcYIAAAAAAAAAAAA8rrVAQAAAAAAAAAAAHgKBk4AAAAAAAAAAACuY+AEAAAAAAAAAADgOgZOAAAAAAAAAAAArmPgBAAAAAAAAAAA4DoGTgAAAAAAAAAAAK5j4AQAAAAAAAAAAOA6Bk4AAAAAAAAAAACuY+AEAAAAAAAAAADgOgZOAAAAAAAAAAAArmPgBAAA5Bq9e/fWzJkzb3UYsGj//v06evTorQ4DAAAAAJDLMHACAAAAj/Svf/1LGzZsuNVhAAAAAAByGQZOAAAALFqwYIGqVKmiwMBAORwO7du371aHlKpVq1bJ4XC4vEJCQlSnTh199tlnWVb+J5984rL99OnTatu2rfz8/DR9+nSXz7Zs2aLHHntMJ0+edG77/vvvdf/99+vEiROZHnN2smnTpiTHN/G1ffv2JOn379+vfv36qWzZsgoMDFRgYKDKlSun/v37a9euXemKoXPnzgoMDNSZM2dSTPPQQw/J19f3lh+/mTNnyuFw6MiRI1le9qhRo+RwOPTnn3/alufXX3+tUaNGpdr22VlCQoIKFy6sKVOmpJgmM9o1O8jJx37Hjh1q3bq1goODlTdvXjVr1kxbt25Nki6t17/z589ryJAhioiIUEBAgGrWrKn58+enOx0AAMj5GDgBAAA5Wvv27ZUvXz7ly5dPc+fO1YABA5zv33jjDcv5nDp1SpGRkSpbtqzWrFmjbdu2qXz58pkYecbt2bNHkrR06VJt27ZNX3/9tT788ENduHBBPXr00P79+7Ok/Dp16ji37d+/X3Xr1tXevXu1YcMGDRw40GWfOnXqqEiRIqpevbrWr1+v6dOnq2XLlmrTpo0KFSqUqfFmV2PHjtW2bdtcXlWrVnVJ88EHH6hOnTr65ptvNHjwYK1YsUIrV67UkCFDdODAAdWrV08///xzmsvu16+fLl26pLlz5yb7eWxsrBYvXqz27durSJEi6aofkvf1119r9OjROfKP59K1QdRTp07p/vvvv9WheJyceux37typu+++WxcvXtTs2bM1e/ZsXbp0Sc2bN9e2bduS3cfK9U+S7r//fs2aNUtRUVFavXq16tWrpx49eiS5dllNBwAAcj6fWx0AAABAZlqxYoXz/3v37q2mTZuqd+/eac7n4MGDiouL08MPP6wmTZqkmO6ff/5Rnjx50hOq7fbs2aPQ0FB17NjRua1hw4aKj4/Xww8/rL1796p69eqZWn5gYKAqVqwoSZo/f7769eun6tWra9GiRYqIiEiyT1BQkF599VVdvXpV48aNk5eXl+bMmaMHH3ww0+K8Ff7++29dvXpVBQsWzHBe5cqVU4MGDVL8fOvWrRowYIDatWun//znP/Lz83N+ds899+ipp57SwoULFRgYmOay27Ztq4iICH388ccaMGBAks/nzZunixcvql+/fmnOG7nbf/7zH9WtW1clS5bMtDI86XqdWxw/flxBQUEKCQlJ8tmIESOUL18+rVmzxnlcWrRooTJlymjYsGHJzjxxd/2Trs1+XLdunebOnasePXpIkpo1a6Zff/1Vzz33nLp37y5vb2/L6QAAQO7AjBMAAJDtfPXVV2rVqpVCQ0MVFhamdu3a6dChQ5lWXu/evXXnnXdKkrp37y6Hw6GmTZs6HxOzZ88edenSRWFhYSpbtqxLnM2bN1dwcLDy5MmjRo0aaeXKlS55J+axf/9+de3aVaGhocqfP7+effZZxcfH68cff1SbNm0UHBysUqVKacKECZbj3r17t2rWrJlk+2+//SZJqlSpUjpaQ5oyZYqWLFmSpvKHDRumHj166KGHHtLmzZuTHTSRpP/+97+qXbu29uzZo3vvvVd9+/bV66+/rnbt2rl9HI/V88Lu86dDhw6qW7euPvzwQ9WoUUOBgYEqXry4oqKidPXq1WT32b9/v4oWLaq2bdvqk08+0blz59Jdvjtjx46Vt7e3PvjgA5dBkxt17do1yTE5dOiQevbsqcKFC8vf31+VKlXSO++845LG29tbvXr10u7du/Xf//43Sb4zZsxw1jM90vIdOnDggHr06KHQ0FAVKVJEffv2VWxsbIp5f/nll3I4HJo3b16Szz755BM5HA7t3Lkzxf0Ty927d6/uv/9+hYSEKDQ0VA8//LBOnTqV7D4nTpxwG6PVOj/33HOSpNKlSzsfUbRp06ZMabdTp07p8ccfV/HixeXv769ChQqpcePGio6OTrF9Dhw4IIfDoYULFzq37d69Ww6HQ1WqVHFJ27FjR5eZacYYLV68WA888ECK+d/o2LFjbo+Bu+u1lfM9M6/XkrRkyRI5HA6tX78+yWfvvfeeHA6H7r///hSP/aVLl1SrVi3dfvvtLscwJiZG4eHhatq0qRISEizFktJjsNLzuLvTp0/ro48+UosWLXTbbbfpl19+STbd1q1b1bRpU5fBrODgYN199936+uuvdfz48TSVm2jx4sXKmzevunbt6rK9T58++uOPP/TNN9+kKZ2U8XMhs88lAABgAwMAAJCNREVFGS8vL9O3b1+zcuVK85///MdUq1bNFC9e3Jw7dy5Tyvzpp5/MO++8YySZsWPHmm3btpkDBw6YqKgoI8mULFnSvPDCC2bdunVmyZIlxhhjNm3aZHx9fU2dOnXMggULzJIlS0yrVq2Mw+Ew8+fPd6mPJFOhQgXz2muvmXXr1pnnn3/eSDIDBw40FStWNG+//bZZt26d6dOnj5FkFi1a5DbmP//800gygwYNMnFxcSYuLs6cOHHCfPLJJyY4ONg8+uij6W6Pnj17Gl9fX7N48WK35Xfv3t3cc889xt/f33z44Ydu8z527JhZvny5McaYp556ysyYMcPEx8ebmTNnmitXrqS4n9XzIjPOn6JFi5qgoCBTqVIlM3v2bLN27Vrz4IMPGkkp1vnixYtmzpw5pkOHDsbPz88EBASYLl26mEWLFplLly5ZKnfjxo1GkilcuLDx9vY2wcHBplWrVubLL790pomPjzeBgYGmYcOGaarTgQMHTGhoqKlWrZr55JNPzNq1a83QoUONl5eXGTVqlEvaQ4cOGYfDYYYMGZIkD0nmxRdfTFPZidLzHRo5cqRZt26dmTx5svH39zd9+vRxppsxY4aRZA4fPuzcVqtWLdO4ceMkZderV8/Uq1cv1fhu/P4/99xz5osvvjCTJ082QUFBplatWi7nq9UYrdb52LFj5umnnzaSzOeff262bdtmtm3bZmJjY21vN2OMad26tSlUqJD517/+ZTZt2mSWLFliRo4c6ZJfcooWLWoef/xx5/s33njDBAYGGknm999/N8YYExcXZ0JCQszzzz/vTPfVV18ZSebgwYO2H4PkrtdWz/fMul4niouLM4ULFzYPPfRQks/uuOMOU7t27VSPvTHGHDx40AQHB5v777/fGGNMQkKCueeee0zhwoXNH3/8YTmWxHwTXxs2bDDFihUz4eHhzrJSc+HCBTN//nzTsWNH4+fnZwIDA80DDzxgFi5caC5fvpzsPn5+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-09-29 12:21:18 +02:00
{
"cell_type": "code",
2023-10-05 15:58:17 +02:00
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#try to find a split between energy lost before and after the magnet"
]
},
{
"cell_type": "code",
2023-10-06 11:41:37 +02:00
"execution_count": 68,
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)"
]
},
2023-10-06 11:41:37 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"###"
]
},
2023-09-29 12:21:18 +02:00
{
"cell_type": "code",
2023-10-05 15:58:17 +02:00
"execution_count": null,
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
"brem_vtx_type_found = scifi_found[scifi_found[\"endvtx_type\"]==101]\n",
"\n",
"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
"brem_vtx_type_lost = scifi_lost[scifi_lost[\"endvtx_type\"]==101]\n",
"\n",
"\n",
"\n",
"#ak.num(scifi_found[\"energy\"], axis=0)\n",
"#scifi_found.snapshot()"
]
},
{
"cell_type": "code",
2023-10-05 15:58:17 +02:00
"execution_count": null,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-05 15:58:17 +02:00
"outputs": [],
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-05 15:58:17 +02:00
"execution_count": null,
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-05 15:58:17 +02:00
"execution_count": null,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-05 15:58:17 +02:00
"outputs": [],
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-05 15:58:17 +02:00
"execution_count": null,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-05 15:58:17 +02:00
"outputs": [],
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-05 15:58:17 +02:00
"execution_count": null,
2023-10-02 13:56:58 +02:00
"metadata": {},
2023-10-05 15:58:17 +02:00
"outputs": [],
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-05 15:58:17 +02:00
"execution_count": null,
2023-09-29 12:21:18 +02:00
"metadata": {},
2023-10-05 15:58:17 +02:00
"outputs": [],
2023-09-29 12:21:18 +02:00
"source": [
"fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2, figsize=(15,10))\n",
"\n",
"ax0.hist(scifi_fitpars_found[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$a_x$ found\")\n",
"ax0.hist(scifi_fitpars_lost[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$a_x$ lost\")\n",
"ax0.set_xlabel(\"a\")\n",
"ax0.set_ylabel(\"normed\")\n",
"ax0.set_title(\"fitparameter a der scifi track\")\n",
"ax0.legend()\n",
"\n",
"ax1.hist(scifi_fitpars_found[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$b_x$ found\")\n",
"ax1.hist(scifi_fitpars_lost[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$b_x$ lost\")\n",
2023-10-02 16:21:00 +02:00
"ax1.set_xticks(np.arange(-1,1,0.1),minor=True)\n",
2023-09-29 12:21:18 +02:00
"ax1.set_xlabel(\"b\")\n",
"ax1.set_ylabel(\"normed\")\n",
"ax1.set_title(\"fitparameter b der scifi track\")\n",
"ax1.legend()\n",
"#evtl multiple scattering candidates (lost); findet man einen gewissen endvtx_type (mult scattering)\n",
"#steiler velo winkel (eta)? vertex type? evtl bremsstrahlung?\n",
"\n",
"\n",
"ax2.hist(scifi_fitpars_found[:,2], bins=500, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$c_x$ found\")\n",
"ax2.hist(scifi_fitpars_lost[:,2], bins=500, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$c_x$ lost\")\n",
"ax2.set_xlim([-3e-5,3e-5])\n",
"ax2.set_xticks(np.arange(-3e-5,3.5e-5,1e-5),minor=False)\n",
"ax2.set_xlabel(\"c\")\n",
"ax2.set_ylabel(\"normed\")\n",
"ax2.set_title(\"fitparameter c der scifi track\")\n",
"ax2.legend()\n",
"\n",
"ax3.hist(scifi_fitpars_found[:,3], bins=500, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$d_x$ found\")\n",
"ax3.hist(scifi_fitpars_lost[:,3], bins=500, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$d_x$ lost\")\n",
"ax3.set(xlim=(-5e-8,5e-8))\n",
"ax3.text(-4e-8,3e8,\"d negligible <1e-7\")\n",
"ax3.set_xlabel(\"d\")\n",
"ax3.set_ylabel(\"normed\")\n",
"ax3.set_title(\"fitparameter d der scifi track\")\n",
"ax3.legend()\n",
"\n",
"\"\"\"\n",
"a_x: virtual hit on the reference plane\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
2023-09-28 15:50:32 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-10-05 10:49:35 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-09-28 15:50:32 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "env1",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}