2024-02-04 16:56:05 +01:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-05 15:44:27 +01:00
|
|
|
"execution_count": 1,
|
2024-02-04 16:56:05 +01: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",
|
|
|
|
"import mplhep\n",
|
|
|
|
"from mpl_toolkits import mplot3d\n",
|
|
|
|
"import itertools\n",
|
|
|
|
"import awkward as ak\n",
|
|
|
|
"from scipy.optimize import curve_fit\n",
|
|
|
|
"from utils.components import unique_name_ext_re\n",
|
|
|
|
"mplhep.style.use([\"LHCbTex2\"])\n",
|
|
|
|
"plt.rcParams[\"savefig.dpi\"] = 600\n",
|
|
|
|
"%matplotlib inline"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-05 15:44:27 +01:00
|
|
|
"execution_count": 2,
|
2024-02-04 16:56:05 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"50501"
|
|
|
|
]
|
|
|
|
},
|
2024-02-05 15:44:27 +01:00
|
|
|
"execution_count": 2,
|
2024-02-04 16:56:05 +01:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"file = uproot.open(\n",
|
|
|
|
" \"/work/cetin/Projektpraktikum/tracking_losses_ntuple_B_rad_length_endVelo2endUT.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\"\n",
|
|
|
|
")\n",
|
|
|
|
"\n",
|
|
|
|
"# selektiere nur elektronen von B->K*ee\n",
|
|
|
|
"allcolumns = file.arrays()\n",
|
|
|
|
"electrons = allcolumns[(allcolumns.isElectron) & (allcolumns.fromB)]\n",
|
|
|
|
"\n",
|
|
|
|
"ak.num(electrons, axis=0)\n",
|
|
|
|
"# ak.count(found, axis=None)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-05 15:44:27 +01:00
|
|
|
"execution_count": 3,
|
2024-02-04 16:56:05 +01:00
|
|
|
"metadata": {},
|
2024-02-05 15:44:27 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"50501 * {\n",
|
|
|
|
" all_endvtx_types_length: int32,\n",
|
|
|
|
" all_endvtx_types: var * float32,\n",
|
|
|
|
" all_endvtx_x_length: int32,\n",
|
|
|
|
" all_endvtx_x: var * float32,\n",
|
|
|
|
" all_endvtx_y_length: int32,\n",
|
|
|
|
" all_endvtx_y: var * float32,\n",
|
|
|
|
" all_endvtx_z_length: int32,\n",
|
|
|
|
" all_endvtx_z: var * float32,\n",
|
|
|
|
" brem_photons_pe_length: int32,\n",
|
|
|
|
" brem_photons_pe: var * float32,\n",
|
|
|
|
" brem_photons_px_length: int32,\n",
|
|
|
|
" brem_photons_px: var * float32,\n",
|
|
|
|
" brem_photons_py_length: int32,\n",
|
|
|
|
" brem_photons_py: var * float32,\n",
|
|
|
|
" brem_photons_pz_length: int32,\n",
|
|
|
|
" brem_photons_pz: var * float32,\n",
|
|
|
|
" brem_vtx_x_length: int32,\n",
|
|
|
|
" brem_vtx_x: var * float32,\n",
|
|
|
|
" brem_vtx_y_length: int32,\n",
|
|
|
|
" brem_vtx_y: var * float32,\n",
|
|
|
|
" brem_vtx_z_length: int32,\n",
|
|
|
|
" brem_vtx_z: var * float32,\n",
|
|
|
|
" endvtx_type: int32,\n",
|
|
|
|
" endvtx_x: float64,\n",
|
|
|
|
" endvtx_y: float64,\n",
|
|
|
|
" endvtx_z: float64,\n",
|
|
|
|
" energy: float64,\n",
|
|
|
|
" eta: float64,\n",
|
|
|
|
" event_count: int32,\n",
|
|
|
|
" fromB: bool,\n",
|
|
|
|
" fromD: bool,\n",
|
|
|
|
" fromDecay: bool,\n",
|
|
|
|
" fromHadInt: bool,\n",
|
|
|
|
" fromPV: bool,\n",
|
|
|
|
" fromPairProd: bool,\n",
|
|
|
|
" fromSignal: bool,\n",
|
|
|
|
" fromStrange: bool,\n",
|
|
|
|
" ideal_state_770_qop: float64,\n",
|
|
|
|
" ideal_state_770_tx: float64,\n",
|
|
|
|
" ideal_state_770_ty: float64,\n",
|
|
|
|
" ideal_state_770_x: float64,\n",
|
|
|
|
" ideal_state_770_y: float64,\n",
|
|
|
|
" ideal_state_770_z: float64,\n",
|
|
|
|
" ideal_state_9410_qop: float64,\n",
|
|
|
|
" ideal_state_9410_tx: float64,\n",
|
|
|
|
" ideal_state_9410_ty: float64,\n",
|
|
|
|
" ideal_state_9410_x: float64,\n",
|
|
|
|
" ideal_state_9410_y: float64,\n",
|
|
|
|
" ideal_state_9410_z: float64,\n",
|
|
|
|
" isElectron: bool,\n",
|
|
|
|
" isKaon: bool,\n",
|
|
|
|
" isMuon: bool,\n",
|
|
|
|
" isPion: bool,\n",
|
|
|
|
" isProton: bool,\n",
|
|
|
|
" lost: bool,\n",
|
|
|
|
" lost_in_track_fit: bool,\n",
|
|
|
|
" match_fraction: float32,\n",
|
|
|
|
" mc_chi2: float32,\n",
|
|
|
|
" mc_dSlope: float32,\n",
|
|
|
|
" mc_dSlopeY: float32,\n",
|
|
|
|
" mc_distX: float32,\n",
|
|
|
|
" mc_distY: float32,\n",
|
|
|
|
" mc_teta2: float32,\n",
|
|
|
|
" mc_zMag: float32,\n",
|
|
|
|
" mcp_idx: int32,\n",
|
|
|
|
" mother_id: int32,\n",
|
|
|
|
" mother_key: int32,\n",
|
|
|
|
" originvtx_type: int32,\n",
|
|
|
|
" originvtx_x: float64,\n",
|
|
|
|
" originvtx_y: float64,\n",
|
|
|
|
" originvtx_z: float64,\n",
|
|
|
|
" p: float64,\n",
|
|
|
|
" p_end_scifi: float64,\n",
|
|
|
|
" p_end_ut: float64,\n",
|
|
|
|
" p_end_velo: float64,\n",
|
|
|
|
" phi: float64,\n",
|
|
|
|
" pid: int32,\n",
|
|
|
|
" pt: float64,\n",
|
|
|
|
" px: float64,\n",
|
|
|
|
" py: float64,\n",
|
|
|
|
" pz: float64,\n",
|
|
|
|
" quality: int32,\n",
|
|
|
|
" rad_length_frac: float64,\n",
|
|
|
|
" scifi_hit_pos_x_length: int32,\n",
|
|
|
|
" scifi_hit_pos_x: var * float32,\n",
|
|
|
|
" scifi_hit_pos_y_length: int32,\n",
|
|
|
|
" scifi_hit_pos_y: var * float32,\n",
|
|
|
|
" scifi_hit_pos_z_length: int32,\n",
|
|
|
|
" scifi_hit_pos_z: var * float32,\n",
|
|
|
|
" track_p: float64,\n",
|
|
|
|
" track_pt: float64,\n",
|
|
|
|
" tx: float64,\n",
|
|
|
|
" ty: float64,\n",
|
|
|
|
" ut_hit_pos_x_length: int32,\n",
|
|
|
|
" ut_hit_pos_x: var * float32,\n",
|
|
|
|
" ut_hit_pos_y_length: int32,\n",
|
|
|
|
" ut_hit_pos_y: var * float32,\n",
|
|
|
|
" ut_hit_pos_z_length: int32,\n",
|
|
|
|
" ut_hit_pos_z: var * float32,\n",
|
|
|
|
" velo_hit_pos_x_length: int32,\n",
|
|
|
|
" velo_hit_pos_x: var * float32,\n",
|
|
|
|
" velo_hit_pos_y_length: int32,\n",
|
|
|
|
" velo_hit_pos_y: var * float32,\n",
|
|
|
|
" velo_hit_pos_z_length: int32,\n",
|
|
|
|
" velo_hit_pos_z: var * float32,\n",
|
|
|
|
" velo_track_idx: int32,\n",
|
|
|
|
" velo_track_tx: float64,\n",
|
|
|
|
" velo_track_ty: float64,\n",
|
|
|
|
" velo_track_x: float64,\n",
|
|
|
|
" velo_track_y: float64,\n",
|
|
|
|
" velo_track_z: float64\n",
|
|
|
|
"}\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2024-02-04 16:56:05 +01:00
|
|
|
"source": [
|
2024-02-05 15:44:27 +01:00
|
|
|
"electrons.type.show()"
|
2024-02-04 16:56:05 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-05 15:44:27 +01:00
|
|
|
"execution_count": 17,
|
2024-02-04 16:56:05 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-05 15:44:27 +01:00
|
|
|
"cut_prop: bool = electrons.p_end_velo > 3e3\n",
|
|
|
|
"found = electrons[~electrons.lost & cut_prop]\n",
|
|
|
|
"lost = electrons[electrons.lost & cut_prop]\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
|
|
|
"eloss_found = (found[\"p\"] - found[\"p_end_scifi\"]) / found[\"p\"]\n",
|
|
|
|
"eloss_lost = (lost[\"p\"] - lost[\"p_end_scifi\"]) / lost[\"p\"]\n",
|
|
|
|
"\n",
|
2024-02-05 15:44:27 +01:00
|
|
|
"eloss = (electrons[\"p\"] - electrons[\"p_end_scifi\"]) / electrons[\"p\"]\n",
|
|
|
|
"eloss_magnet_found = ak.to_numpy(\n",
|
|
|
|
" (found[\"p_end_velo\"] - found[\"p_end_scifi\"]) / found[\"p_end_velo\"]\n",
|
|
|
|
")\n",
|
|
|
|
"eloss_magnet_lost = ak.to_numpy(\n",
|
|
|
|
" (lost[\"p_end_velo\"] - lost[\"p_end_scifi\"]) / lost[\"p_end_velo\"]\n",
|
|
|
|
")"
|
2024-02-04 16:56:05 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 34,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# eloss_upstream_found = (found[\"p\"] - found[\"p_end_ut\"]) / found[\"p\"]\n",
|
|
|
|
"# eloss_upstream_lost = (lost[\"p\"] - lost[\"p_end_ut\"]) / lost[\"p\"]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-05 15:44:27 +01:00
|
|
|
"execution_count": 18,
|
2024-02-04 16:56:05 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-05 15:44:27 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABpjklEQVR4nO39z29jaZof+D6KSnsKsK2iooACBGnRQbV3BtxNRfZmNlMZlP8BixHLXoXYy4HQFjP9B3QW2d0C7l0YJqM3tXMkZXs1gG+TkTmzmAHGGaK7AQN3YetULUKXQAMZYsluuMZ2i3eRJovUT0qieEidzwcQIEqH73kOySOJXz3ve5b6/X4/AAAAAOCRe5J2AQAAAAAwC4IwAAAAADJBEAYAAABAJgjCAAAAAMgEQRgAAAAAmSAIAwAAACATBGEAAAAAZIIgDAAAAIBMEIQBAAAAkAmCMAAAAAAyQRAGAAAAQCYIwgAAAADIBEEYAAAAAJkgCAMAAAAgEwRhAAAAAGSCIAwAAACATBCEAQAAAJAJgjAAAAAAMkEQBgAAAEAmCMIAAAAAyARBGAAAAACZIAgDAAAAIBMEYQAAAABkgiAMAAAAgEwQhAEAAACQCYIwAAAAADJBEAYAAABAJgjCAAAAAMiET9IugNv7O3/n78Svf/3r+MEPfhA/+clP0i4HAAAAYGJ/9Vd/FX/zN38TP/zhD+Ov//qvZ7rvpX6/35/pHrm3H/zgB3F2dpZ2GQAAAAB39uTJk/ibv/mbme5TR9gCGgRhT548idXV1bTLubVut7vQ9Uc4hnnhGOaDY5gPjmE+OIb54Bjmx2M4DscwHxzD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uY
|
2024-02-04 16:56:05 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"nbins = 50\n",
|
|
|
|
"plt.hist(\n",
|
2024-02-05 15:44:27 +01:00
|
|
|
" ak.to_numpy(eloss_magnet_lost),\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" bins=nbins,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"#F05342\",\n",
|
|
|
|
" label=\"lost\",\n",
|
|
|
|
" range=[0.001, 1],\n",
|
|
|
|
")\n",
|
|
|
|
"# #2A9D8F another teal color\n",
|
|
|
|
"plt.hist(\n",
|
2024-02-05 15:44:27 +01:00
|
|
|
" ak.to_numpy(eloss_magnet_found),\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" bins=nbins,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"#107E7D\",\n",
|
|
|
|
" label=\"found\",\n",
|
|
|
|
" range=[0.001, 1],\n",
|
|
|
|
")\n",
|
|
|
|
"\n",
|
2024-02-05 15:44:27 +01:00
|
|
|
"plt.xlabel(r\"$E_\\gamma/E_{VELO}$\")\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.ylabel(\"a.u.\")\n",
|
|
|
|
"# plt.title(r'$B\\rightarrow K^\\ast ee$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm')\n",
|
|
|
|
"plt.legend(title=\"LHCb Simulation\")\n",
|
2024-02-05 15:44:27 +01:00
|
|
|
"plt.show()\n",
|
|
|
|
"# plt.savefig(\n",
|
|
|
|
"# \"/work/cetin/Projektpraktikum/thesis/emitted_energy_endVelo2endT.pdf\",\n",
|
|
|
|
"# format=\"PDF\")"
|
2024-02-04 16:56:05 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 27,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# magnet kick position\n",
|
|
|
|
"input_tree = uproot.open(\n",
|
|
|
|
" {\n",
|
|
|
|
" \"/work/cetin/Projektpraktikum/param_data_B_default.root\": \"PrParameterisationData_2ece6184.PrDebugTrackingTool/Tuple;1\"\n",
|
|
|
|
" }\n",
|
|
|
|
")\n",
|
|
|
|
"array = input_tree.arrays()\n",
|
|
|
|
"array = array[array.isElectron & (array.fromB)]\n",
|
|
|
|
"array[\"dSlope_fringe\"] = array[\"tx_ref\"] - array[\"tx\"]\n",
|
|
|
|
"array[\"z_mag_x_fringe\"] = (\n",
|
|
|
|
" array[\"x\"]\n",
|
|
|
|
" - array[\"x_ref\"]\n",
|
|
|
|
" - array[\"tx\"] * array[\"z\"]\n",
|
|
|
|
" + array[\"tx_ref\"] * array[\"z_ref\"]\n",
|
|
|
|
") / array[\"dSlope_fringe\"]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 28,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"(exptext: Custom Text(0.05, 0.95, 'LHCb'),\n",
|
|
|
|
" expsuffix: Custom Text(0.05, 0.955, 'Simulation'))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 28,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMIAAAOWCAYAAAANzz7PAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcn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FarSZLGxsZkmqbi8bhisZhCoZDPFQMAAAAAACAIAn9YPt59HJYPP9XrdYXDYb/LAC7Vz/70R0/m+cuvfuvJPAAAABhufuYAA7M1EgC8Ytu2MpmMRkdHNT8/73c5AAAAAIA+GbitkZ1YWlrSnTt39NOf/tTvUgBckG3bevr0qWzbbm17bnZtmaapsbExWZbV2v58VDKZlOM4qlQqra/V63WVy2U9ffpU5XJZ9Xq9j+8IAAAAABAUA9cR9vz5c929e1c3b97U8+fPTxwTjUY1NTWljz/+WD/88EOfK8SwKxQKrZs3XOQRjUY9Wb+btUdHR0+dL5lMdjVnuVzuuOZ6va5MJtP6OeRyOZXLZTmO0wqt6vW6bNtWuVxWLpdTPB5vjc9kMioUCkomk1pbWzs2//z8vB4+fKi1tTVCMAAAAAAYYgMThP3hD3/Q1atXlUwmVSgUZNt264D8oxKJhBzH0XfffSfTNPXVV1/1uVoMs1Qqpb29PVUqFSUSiTPHxmIxlUql1ngvuK6rarWqfD5/5tlXpmkqn8+rWq1qb2/v1HHFYlF7e3sqlUondmAdtri4qEqlor29vXPHNjW3KOZyubavJxIJFYvF1nzN91UqlZRKpVrvzbZt5XI5pdPpVgh2NOxqzuO6rkzT7KguAAAAAMC7J/BB2Nu3b3X9+nVlMpnWH8OdnO8fDodVqVR048YNJRIJffnll32oFjgQDodlWZaKxaJSqdS
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"fig = plt.figure()\n",
|
2024-02-05 15:44:27 +01:00
|
|
|
"plt.hist(array[\"z_mag_x_fringe\"],\n",
|
|
|
|
" bins=50,\n",
|
|
|
|
" range=[5150, 5300],\n",
|
|
|
|
" color=\"#2A9D8F\",\n",
|
|
|
|
" density=True)\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.xlabel(r\"z$_{Mag}$ [mm]\")\n",
|
|
|
|
"plt.ylabel(\"Number of Tracks (normalised)\")\n",
|
2024-02-05 15:44:27 +01:00
|
|
|
"mplhep.lhcb.text(\"Simulation\")\n",
|
|
|
|
"mplhep."
|
2024-02-04 16:56:05 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 29,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"50501"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 29,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"ak.num(array, axis=0)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "tuner",
|
|
|
|
"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.10.12"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|