2023-09-22 09:21:27 +02:00
{
"cells": [
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 19,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"import uproot\n",
"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",
"%matplotlib inline"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 20,
2023-09-22 09:21:27 +02:00
"metadata": {},
2023-09-28 15:29:53 +02:00
"outputs": [
{
"data": {
"text/plain": [
"9056"
]
},
2023-10-29 11:51:36 +01:00
"execution_count": 20,
2023-09-28 15:29:53 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-09-22 09:21:27 +02:00
"source": [
"file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n",
"#file = uproot.open(\"tracking_losses_ntuple_Dst0ToD0EE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n",
"\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-09-28 15:29:53 +02:00
"ak.num(found, axis=0)\n",
2023-09-22 09:21:27 +02:00
"#ak.count(found, axis=None)\n"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 21,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.8606728758791105"
]
},
2023-10-29 11:51:36 +01:00
"execution_count": 21,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2023-09-28 15:29:53 +02:00
"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",
2023-09-22 09:21:27 +02:00
"\n",
"t_eff(found, lost)"
]
},
2023-09-28 15:29:53 +02:00
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 22,
2023-09-28 15:29:53 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"sample size: 32\n",
"eff (cutoff = 0 ) = 0.96875\n",
"sample size: 32\n",
"eff (cutoff = 50 ) = 0.96875\n",
"sample size: 32\n",
"eff (cutoff = 100 ) = 0.96875\n",
"sample size: 43\n",
"eff (cutoff = 150 ) = 0.9767441860465116\n",
"sample size: 65\n",
"eff (cutoff = 200 ) = 0.9692307692307692\n",
"sample size: 97\n",
"eff (cutoff = 250 ) = 0.9587628865979382\n",
"sample size: 129\n",
"eff (cutoff = 300 ) = 0.9457364341085271\n",
"sample size: 150\n",
"eff (cutoff = 350 ) = 0.9533333333333334\n",
"sample size: 169\n",
"eff (cutoff = 400 ) = 0.9408284023668639\n",
"sample size: 197\n",
"eff (cutoff = 450 ) = 0.9390862944162437\n",
"sample size: 227\n",
"eff (cutoff = 500 ) = 0.920704845814978\n",
"sample size: 257\n",
"eff (cutoff = 550 ) = 0.9260700389105059\n",
"sample size: 297\n",
"eff (cutoff = 600 ) = 0.9326599326599326\n",
"sample size: 334\n",
"eff (cutoff = 650 ) = 0.9281437125748503\n",
"sample size: 366\n",
"eff (cutoff = 700 ) = 0.9289617486338798\n",
"sample size: 400\n",
"eff (cutoff = 750 ) = 0.925\n",
"sample size: 436\n",
"eff (cutoff = 800 ) = 0.9151376146788991\n",
"sample size: 468\n",
"eff (cutoff = 850 ) = 0.9102564102564102\n",
"sample size: 500\n",
"eff (cutoff = 900 ) = 0.912\n",
"sample size: 533\n",
"eff (cutoff = 950 ) = 0.9136960600375235\n",
"sample size: 562\n",
"eff (cutoff = 1000 ) = 0.9163701067615658\n",
"\n",
"sample size: 150\n"
]
},
{
"data": {
"text/plain": [
"0.9533333333333334"
]
},
2023-10-29 11:51:36 +01:00
"execution_count": 22,
2023-09-28 15:29:53 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"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",
"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",
"\n",
"\n",
"\n",
"for cutoff_energy in range(0,1050,50):\n",
"\tnobrem_f = found[ak.all(found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\tnobrem_l = lost[ak.all(lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\tprint(\"sample size: \",ak.num(nobrem_f,axis=0)+ak.num(nobrem_l,axis=0))\n",
"\tprint(\"eff (cutoff = \",str(cutoff_energy),\") = \",str(t_eff(nobrem_f,nobrem_l)))\n",
"\n",
"\"\"\"\n",
"we see that a cutoff energy of 350MeV is ideal because the efficiency drops significantly for higher values\n",
"\"\"\"\n",
"cutoff_energy = 350.0 #MeV\n",
"\n",
"\"\"\"\n",
"better statistics: cutoff=350MeV - sample size: 150 events and efficiency=0.9533\n",
"\"\"\"\n",
"nobrem_found = found[ak.all(found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"nobrem_lost = lost[ak.all(lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\n",
"print(\"\\nsample size: \",ak.num(nobrem_found,axis=0)+ak.num(nobrem_lost,axis=0))\n",
"t_eff(nobrem_found, nobrem_lost)"
]
},
2023-09-22 09:21:27 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 23,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
2023-09-28 15:29:53 +02:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"31\n"
]
},
2023-09-22 09:21:27 +02:00
{
"data": {
"text/plain": [
"0.96875"
]
},
2023-10-29 11:51:36 +01:00
"execution_count": 23,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2023-09-28 15:29:53 +02:00
"#hier wird ohne rücksicht auf energie der photonen getrennt\n",
2023-09-28 12:12:21 +02:00
"\n",
2023-09-22 09:21:27 +02:00
"nobrem_found = found[found[\"brem_photons_pe_length\"]==0]\n",
"nobrem_lost = lost[lost[\"brem_photons_pe_length\"]==0]\n",
"\n",
"\"\"\"\n",
"die effizienz mit der wir elektronen finden, die keine bremsstrahlung gemacht haben, ist gut mit 0.9688.\n",
"allerdings haben wir hier nur sehr wenige teilchen (<100)\n",
"\"\"\"\n",
2023-09-28 15:29:53 +02:00
"print(ak.num(nobrem_found,axis=0))\n",
2023-09-22 09:21:27 +02:00
"t_eff(nobrem_found, nobrem_lost)\n"
]
},
2023-09-28 15:29:53 +02:00
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 24,
2023-09-28 15:29:53 +02:00
"metadata": {},
"outputs": [],
"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"
]
},
2023-09-22 09:21:27 +02:00
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 25,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.8603431839847474"
]
},
2023-10-29 11:51:36 +01:00
"execution_count": 25,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2023-09-28 15:29:53 +02:00
"#keine rücksicht auf energie der photonen\n",
2023-09-22 09:21:27 +02:00
"brem_found = found[found[\"brem_photons_pe_length\"]!=0]\n",
"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",
"energyloss_found = eph_found/energy_found\n",
"\n",
"\n",
"brem_lost = lost[lost[\"brem_photons_pe_length\"]!=0]\n",
"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",
"energyloss_lost = eph_lost/energy_lost\n",
"\n",
"t_eff(brem_found,brem_lost)"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 26,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mean energyloss relative to initial energy (found): 0.6475128752780828\n",
"mean energyloss relative to initial energy (lost): 0.8241268441538472\n"
]
}
],
"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-29 11:51:36 +01:00
"execution_count": 27,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-10-26 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjMAAAHOCAYAAABttoiYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABIp0lEQV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AI8TJYAZpNFoqFarBQFSr845WVqt1tTfoXK5rFKpJNd1u/oOmevWqHLova6Ya+iga5R5z7bt0OtdRgQzY5ggIp1Od71vLgjmV9gw5XJZrVYr0qtcLstxHNXr9bEXoN5OyuaXxyxmaTUXcM/zguCo1Wp15SnMOpMyN4Dejo9PnjyRND6QnMQ0k7/Zth1coDpvLINqUgYx23bWaEzClHepVFKtVtP6+vpMO6R35jHKhXDUL8EwAem02/eybVvHx8dBbVgymQzd6b335mxuWKlUKkijXC733QgfPnw4cYfsXmbbcZ9B1PNoHkxH9UajIc/z9PDhw9AdoA0zqMHzvKk68pv9Dup0Py+FQkGtVkvtdlvNZlPr6+vyPE+ZTGbsudB5XTGf+aCJFM17juOEXu8yIpgZwff94FdO702580Ix6xuHdPYLplgs6vHjx6ECAlOD1Bl0mV80k148OpkgKZfLqVAoqFQq9V2ow6wTxaBaMens13AqlZo6UEomkyqXy6pWq6rX65E/x97RA6bcJ/1FaS5Eg5oxJA2tncvlcsHFfnNzc6rPexhzIZxkxmJTJoPybQKURCIxt+2HMTfHer0e3NgmKTNzc+4MHM3Mrnt7ewN/cU/
2023-09-22 09:21:27 +02:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-09-28 12:12:21 +02:00
"#in abhängigkeit von der energie der elektronen\n",
"\n",
2023-09-22 09:21:27 +02:00
"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",
2023-10-26 16:21:44 +02:00
"#plt.xticks(np.arange(0,1.1,0.1), minor=True,)\n",
"#plt.yticks(np.arange(0,10,1), minor=True)\n",
2023-09-22 09:21:27 +02:00
"plt.xlabel(r\"$E_\\gamma/E_0$\")\n",
"plt.ylabel(\"counts (normed)\")\n",
2023-10-26 16:21:44 +02:00
"plt.title(r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm\")\n",
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
"#plt.grid()\n",
2023-09-22 09:21:27 +02:00
"\n",
"\"\"\"\n",
"found: elektronen verlieren durchschnittlich 0.65 ihrer anfangsenergie durch bremsstrahlung\n",
"lost: elektronen verlieren durchschnittlich 0.82 ihrer anfangsenergie durch bremsstrahlung\n",
"\n",
"-> wir können sofort erkennen, dass verlorene elektronen im schnitt mehr energie durch bremsstrahlung verlieren als gefundene, \n",
"aber auch die rate der gefundenen elektronen steigt für raten nahe 1, wenn auch wesentlich schwächer als für verlorene elektronen.\n",
"die meisten verlorenen elektronen verlieren >0.8 ihrer anfangsenergie.\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 28,
2023-09-22 09:21:27 +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-29 11:51:36 +01:00
"execution_count": 29,
2023-09-22 09:21:27 +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",
2023-09-28 12:12:21 +02:00
"#should be fulfilled by all candidates\n",
2023-09-22 09:21:27 +02:00
"\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",
"#ak.num(scifi_found[\"energy\"], axis=0)\n",
"#scifi_found.snapshot()"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 30,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"#tx_lost.show()"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 31,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
"source": [
"scifi_fitpars_found = ak.ArrayBuilder()\n",
"\n",
"for i in range(0,ak.num(scifi_found[\"energy\"], 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",
" scifi_fitpars_found.end_list()\n",
"\n",
"scifi_fitpars_lost = ak.ArrayBuilder()\n",
"\n",
"for i in range(0,ak.num(scifi_lost[\"energy\"], 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",
" scifi_fitpars_lost.end_list()\n",
"\n",
"\n",
"scifi_fitpars_lost = scifi_fitpars_lost.to_numpy()\n",
"scifi_fitpars_found = scifi_fitpars_found.to_numpy()\n",
"\n",
"\n",
"\n",
"dtx_found = scifi_fitpars_found[:,1] - tx_found\n",
"dtx_lost = scifi_fitpars_lost[:,1] - tx_lost\n"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 32,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [],
2023-10-29 11:51:36 +01:00
"source": [
"#from methods.adashof import move_sn_y"
]
2023-09-22 09:21:27 +02:00
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 33,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-10-29 11:51:36 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABPMAAANaCAYAAADs1AkGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAADB7ElEQVR4nOz9T2wj+Z3nfX6y2kiNsIkspqrn0IcBqoJ9sU9ZQeXF8wCZ42TYwNzaIjOBnV70YMYi29Ct1lZYmEOpLqZJ15UwgnIverF+Fsgk5cUeZoA2o7orZ54xZifF6OyLG0/3MrL68KAf4OmSwon0auTxmHvIjiiRClIhKvj//QKITDJ+v+Avgv+++sbvz41er9cTAAAAAAAAgLn31qwbAAAAAAAAACAZknkAAAAAAADAgiCZBwAAAAAAACwIknkAAAAAAADAg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rGN76h3/3d3511czAEcR4AABhH4livN6dOTk56knrVarXv8U6n05PUcxxn7HpplRnGNM2R23u9Xu8nP/lJTxI3bty4cePGjduVbz/5yU9GxhmYLeI8bty4cePGjdt1bpfFenM7zPbo6EiSZBhG3+PhcNd2ux071DZJvXDbdcvEPX8QBPI8T48ePRp5fO+++64k6Sc/+Ym+/OUvjyy7tbWlw8PDkWWSWMb9vH79Wvfv39ezZ89069atuWjTsu6Hcz29/XCup7cfzvX09pPmuU7ruNLc17T289d//df6wz/8wyiOwHy6Spw3TJrv80ntM+3
2023-09-22 09:21:27 +02:00
"text/plain": [
"<Figure size 1500x1000 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2, figsize=(15,10))\n",
2023-10-29 11:51:36 +01:00
"#fig.tight_layout()\n",
2023-09-22 09:21:27 +02:00
"\n",
"ax0.hist(scifi_fitpars_found[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$a_x$ found\")\n",
"ax0.hist(scifi_fitpars_lost[:,0], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$a_x$ lost\")\n",
"ax0.set_xlabel(\"a\")\n",
"ax0.set_ylabel(\"normed\")\n",
"ax0.set_title(\"fitparameter a der scifi track\")\n",
"ax0.legend()\n",
"\n",
"ax1.hist(scifi_fitpars_found[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=r\"$b_x$ found\")\n",
"ax1.hist(scifi_fitpars_lost[:,1], bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=r\"$b_x$ lost\")\n",
"ax1.set_xlabel(\"b\")\n",
"ax1.set_ylabel(\"normed\")\n",
"ax1.set_title(\"fitparameter b der scifi track\")\n",
"ax1.legend()\n",
2023-09-28 12:12:21 +02:00
"#evtl multiple scattering candidates (lost); findet man einen gewissen endvtx_type (mult scattering)\n",
"#steiler velo winkel (eta)? vertex type? evtl bremsstrahlung?\n",
"\n",
2023-09-22 09:21:27 +02:00
"\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",
2023-10-29 11:51:36 +01:00
"\n",
"\n",
"#locs = move_sn_y(offs=-.05, side=\"right\")\n",
"\n",
2023-09-22 09:21:27 +02:00
"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-25 11:05:16 +02:00
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 34,
2023-09-25 11:05:16 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found\n",
"a = -0.6718207391527037\n",
"b = 0.0013778237292529144\n",
"c = 3.3126998287416195e-08\n",
"d = -1.0330674442255529e-10\n",
"lost\n",
"a = -36.98764338200992\n",
"b = -0.015685137956233643\n",
"c = -8.265859479503501e-07\n",
"d = -1.541510766903436e-11\n"
]
}
],
"source": [
"print(\"found\")\n",
"print(\"a = \", str(np.mean(scifi_fitpars_found[:,0])))\n",
"print(\"b = \", str(np.mean(scifi_fitpars_found[:,1])))\n",
"print(\"c = \", str(np.mean(scifi_fitpars_found[:,2])))\n",
"print(\"d = \", str(np.mean(scifi_fitpars_found[:,3])))\n",
"\n",
"print(\"lost\")\n",
"print(\"a = \", str(np.mean(scifi_fitpars_lost[:,0])))\n",
"print(\"b = \", str(np.mean(scifi_fitpars_lost[:,1])))\n",
"print(\"c = \", str(np.mean(scifi_fitpars_lost[:,2])))\n",
"print(\"d = \", str(np.mean(scifi_fitpars_lost[:,3])))"
]
},
2023-09-22 09:21:27 +02:00
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 35,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-4.6785491318157854e-07"
]
},
2023-10-29 11:51:36 +01:00
"execution_count": 35,
2023-09-22 09:21:27 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.min(scifi_fitpars_found[:,3])"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 36,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-10-26 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABQYAAAImCAYAAAABqFcVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd5wd5WHv/8/pvZ89Z3sv0q7qripCgBrdFCOBwXbsxLGIr3OdOM5FdpL7S7+2cHq7RnZyE9vYgGRMB6EVqKCu3VXZ3vvu2dN7n/n9oUhGIEBgQBLM+/XihfacmWeemWdW89UzM88jE0VRRCKRSCQSiU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FDcvHmzuHHjRnHr1q3i1q1bxba2treVtX37dtFqtYpWq1V85JFHRFEUxerqavGRRx4R29raxLa2NrG5uVkExOrqanHPnj1iMBi8aPvbt2+/UN5jjz0mVldXi4DY3NwsDg0NXShvaGjoPfetublZtFqt4tatW0VRFMWdO3deKK+6ulp87LHHLlr+scceE61W64VtiKIobt269aL9OV/O+f1obm6+6Hi9+bvq6mpx586dF8o5v4+bN28Wh4aGxI0bN17Y1iOPPCJu3rxZDAaD77lfl9Mml9Oul3I5dXq3/W9raxM3b958UXsGg0ExGAyKjzzyyNs+37Nnz9vOiUvZuXOnaLVaL2yzra3tbefO+fPsUts/763nxOXus0QikUgkn1RvzQxvvXZeTg68nGvppa7B70TKcO8vw12t+e38dqUMJ5FcG2SiKIofTZejRCKRSCQSiUQikUg
2023-09-22 09:21:27 +02:00
"text/plain": [
"<Figure size 1500x600 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(15,6))\n",
"\n",
"for i in range(0,ak.num(scifi_found[\"energy\"], axis=0)):\n",
" z_coord = np.linspace(scifi_z_found[i,0],12000,300)\n",
" fit = scifi_track(z_coord, *scifi_fitpars_found[i])\n",
" ax0.plot(z_coord, fit, \"-\", lw=0.5)\n",
" ax0.errorbar(ak.to_numpy(scifi_z_found[i,:]),ak.to_numpy(scifi_x_found[i,:]),fmt=\".\",ms=2)\n",
"\n",
"#ax0.legend()\n",
"ax0.set_xlabel(\"z [mm]\")\n",
"ax0.set_ylabel(\"x [mm]\")\n",
"ax0.set_title(\"found tracks of scifi hits\")\n",
"ax0.set(xlim=(7e3,12000), ylim=(-4000,4000))\n",
"ax0.grid()\n",
"\n",
"for i in range(0,ak.num(scifi_lost[\"energy\"], axis=0)):\n",
" z_coord = np.linspace(scifi_z_lost[i,0],12000,300)\n",
" fit = scifi_track(z_coord, *scifi_fitpars_lost[i])\n",
" ax1.plot(z_coord, fit, \"-\", lw=0.5)\n",
" ax1.errorbar(ak.to_numpy(scifi_z_lost[i,:]),ak.to_numpy(scifi_x_lost[i,:]),fmt=\".\",ms=2)\n",
"\n",
"#ax1.legend()\n",
"ax1.set_xlabel(\"z [mm]\")\n",
"ax1.set_ylabel(\"x [mm]\")\n",
"ax1.set_title(\"lost tracks of scifi hits\")\n",
"ax1.set(xlim=(7e3,12000), ylim=(-4000,4000))\n",
"ax1.grid()\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 37,
2023-09-22 09:21:27 +02:00
"metadata": {},
2023-09-25 11:39:04 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found \n",
"zmag = 5215.5640412342\n",
"lost \n",
"zmag = 5450.484726770035\n"
]
}
],
2023-09-22 09:21:27 +02:00
"source": [
"#vergleich der zmag werte\n",
"zmag_found = z_mag(xv_found, zv_found, tx_found, scifi_fitpars_found[:,0], scifi_fitpars_found[:,1])\n",
"zmag_lost = z_mag(xv_lost, zv_lost, tx_lost, scifi_fitpars_lost[:,0], scifi_fitpars_lost[:,1])\n",
"zmag_lost = zmag_lost[~np.isnan(zmag_lost)]\n",
2023-09-25 11:39:04 +02:00
"zmag_found = zmag_found[~np.isnan(zmag_found)]\n",
"\n",
"print(\"found \\nzmag = \", str(np.mean(zmag_found)))\n",
"print(\"lost \\nzmag = \", str(np.mean(zmag_lost)))"
2023-09-22 09:21:27 +02:00
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 38,
2023-09-22 09:21:27 +02:00
"metadata": {},
"outputs": [
{
"data": {
2023-10-26 16:21:44 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAksAAAHKCAYAAAATuQ/iAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABJ0UlE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WG/61UKlGX/fBEwrh2MQwj+gAXi8Xo5pzP55XL5aIbV9pzTDM8adn3fTWbTR0dHUWvtdvt6K/o4XSO4+jo6Ciqz7Nnz8aCA9M0o7/+Jt1kJ7XtpPRp67PIzTycND+pp84wjOh30ev1VCgUVCgUNBgMdHh4KMdxogm/0uWN9+HDh6pWq1HwNdwT4ft+NG8iPP7w4cOJN+w075G0n6d5y5e+64GybTvawyZ8P/V6vcSezrT1i3t/pPncXk3T6/XkeV50Ds/zZvqchGUWCoWRIepSqRQF8bOY1PZXX59270n6/KZt46v3klDa/Ivc9xe5B6fNO+n6pOn3rcxa8Wo8LCDc70JSYBhGtHQ13D9E3y6/7ff7I/ttGIYRLX9tNpvRktxwOWelUhlZ3hnu/xKWOfxjmmZwdnYW9Pv9aNmqaZpBt9uNln6HaYeXhzqOE5VpmubYctwguFyiahjG1OXj7XZ75NxhOwyfu1QqBX/8x38ctUFYn3Cp69VyLMsa2ecl7TmSljEPL6e1LCsolUpBqVQa24MnCC6XC4fLsCuVSlCpVMaW6xYKhej3VqvVglKpFF1Pv99PvNarbTst/bT6zPr7v6pSqUTv5eGl55VKJWrrsL3C816t//DtzLKskfdUpVIZe/8
2023-09-22 09:21:27 +02:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.hist(zmag_found, bins=5000, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=\"found\")\n",
2023-10-26 16:21:44 +02:00
"plt.hist(zmag_lost, bins=400, density=True, alpha=0.5, histtype=\"bar\",color=\"darkorange\", label=\"lost\")\n",
"plt.xlabel(r\"$\\bf{z_{mag}}$ [mm]\")\n",
2023-09-22 09:21:27 +02:00
"plt.ylabel(\"normed\")\n",
"plt.title(\"magnet kick position $z_{mag}$ calculated w fitparameters\")\n",
2023-10-26 16:21:44 +02:00
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
"#plt.xticks(np.arange(5100,5800,5), minor=True)\n",
"#plt.yticks(np.arange(0,0.015,0.001), minor=True)\n",
"plt.xlim(5050,5750)\n",
2023-09-22 09:21:27 +02:00
"\n",
"\"\"\"\n",
"wir können einen radikalen unterschied für den z_mag wert erkennen, zwischen den found and lost elektronen.\n",
"\"\"\"\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-10-29 11:51:36 +01:00
"execution_count": 39,
2023-09-22 09:21:27 +02:00
"metadata": {},
2023-10-26 16:21:44 +02:00
"outputs": [],
2023-09-25 10:22:31 +02:00
"source": [
2023-09-29 12:21:18 +02:00
"\n",
2023-10-26 16:21:44 +02:00
"#file.show()"
2023-09-25 10:22:31 +02:00
]
2023-09-22 09:21:27 +02:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "env1",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2023-10-26 16:21:44 +02:00
"version": "3.10.12"
2023-09-22 09:21:27 +02:00
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}