2023-10-09 12:10:28 +02:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 1,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"import uproot\t\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",
|
|
|
|
"from mpl_toolkits.axes_grid1 import ImageGrid\n",
|
|
|
|
"%matplotlib inline"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 2,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"44804"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 2,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n",
|
|
|
|
"file = uproot.open(\n",
|
|
|
|
" \"/work/cetin/Projektpraktikum/tracking_losses_ntuple_B_rad_length_beginVelo2endUT.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\"\n",
|
|
|
|
")\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"# selektiere nur elektronen von B->K*ee und nur solche mit einem momentum von ueber 5 GeV\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"allcolumns = file.arrays()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"found = allcolumns[(allcolumns.isElectron)\n",
|
|
|
|
" & (~allcolumns.lost)\n",
|
|
|
|
" & (allcolumns.fromB)\n",
|
|
|
|
" & (allcolumns.p > 5e3)] # B: 9056\n",
|
|
|
|
"lost = allcolumns[(allcolumns.isElectron)\n",
|
|
|
|
" & (allcolumns.lost)\n",
|
|
|
|
" & (allcolumns.fromB)\n",
|
|
|
|
" & (allcolumns.p > 5e3)] # B: 1466\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"ak.num(found, axis=0) + ak.num(lost, axis=0)\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"# ak.count(found, axis=None)"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 3,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"eff all = 0.8343228283189001 +/- 0.0017564670414882176\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"def t_eff(found, lost, axis=0):\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" sel = ak.num(found, axis=axis)\n",
|
|
|
|
" des = ak.num(lost, axis=axis)\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" return sel / (sel + des)\n",
|
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"def eff_err(found, lost):\n",
|
|
|
|
" n_f = ak.num(found, axis=0)\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" 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",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"print(\"eff all = \", t_eff(found, lost), \"+/-\", eff_err(found, lost))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 4,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# try excluding all photons that originate from a vtx @ z>9500mm\n",
|
|
|
|
"# ignore all brem vertices @ z>9500mm\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"# found\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"brem_e_f = found[\"brem_photons_pe\"]\n",
|
|
|
|
"brem_z_f = found[\"brem_vtx_z\"]\n",
|
|
|
|
"e_f = found[\"energy\"]\n",
|
|
|
|
"length_f = found[\"brem_vtx_z_length\"]\n",
|
|
|
|
"\n",
|
|
|
|
"brem_f = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"for itr in range(ak.num(found, axis=0)):\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_f.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"energy\"] energy\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_f.field(\"energy\").append(e_f[itr])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"photon_length\"] number of vertices\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_f.field(\"photon_length\").integer(length_f[itr])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"brem_photons_pe\",:] photon energy\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_f.field(\"brem_photons_pe\").append(brem_e_f[itr])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"brem_vtx_z\",:] brem vtx z\n",
|
2023-10-09 12:10:28 +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",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"# lost\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\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",
|
2024-02-04 16:56:05 +01:00
|
|
|
"for itr in range(ak.num(lost, axis=0)):\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_l.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"energy\"] energy\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_l.field(\"energy\").append(e_l[itr])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"photon_length\"] number of vertices\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_l.field(\"photon_length\").integer(length_l[itr])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"brem_photons_pe\",:] photon energy\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_l.field(\"brem_photons_pe\").append(brem_e_l[itr])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" # [:,\"brem_vtx_z\",:] brem vtx z\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" brem_l.field(\"brem_vtx_z\").append(brem_z_l[itr])\n",
|
|
|
|
" brem_l.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"brem_l = ak.Array(brem_l)"
|
|
|
|
]
|
|
|
|
},
|
2023-10-09 15:25:15 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 5,
|
2023-10-09 15:25:15 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"cut_brem_found = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
|
|
|
"for itr in range(ak.num(brem_f, axis=0)):\n",
|
|
|
|
" cut_brem_found.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" cut_brem_found.field(\"energy\").real(brem_f[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_found.field(\"brem_photons_pe\")\n",
|
|
|
|
" cut_brem_found.begin_list()\n",
|
|
|
|
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if brem_f[itr, \"brem_vtx_z\", jentry] > 9500:\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" cut_brem_found.real(brem_f[itr, \"brem_photons_pe\", jentry])\n",
|
|
|
|
"\n",
|
|
|
|
" # cut_brem_found.field(\"brem_vtx_z\").real(brem_f[itr, \"brem_vtx_z\",jentry])\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_found.end_list()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_found.field(\"brem_vtx_z\")\n",
|
|
|
|
" cut_brem_found.begin_list()\n",
|
|
|
|
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if brem_f[itr, \"brem_vtx_z\", jentry] > 9500:\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" cut_brem_found.real(brem_f[itr, \"brem_vtx_z\", jentry])\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_found.end_list()\n",
|
|
|
|
"\n",
|
|
|
|
" cut_brem_found.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"cut_brem_found = ak.Array(cut_brem_found)\n",
|
|
|
|
"\n",
|
|
|
|
"cut_brem_lost = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
|
|
|
"for itr in range(ak.num(brem_l, axis=0)):\n",
|
|
|
|
" cut_brem_lost.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" cut_brem_lost.field(\"energy\").real(brem_l[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_lost.field(\"brem_photons_pe\")\n",
|
|
|
|
" cut_brem_lost.begin_list()\n",
|
|
|
|
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if brem_l[itr, \"brem_vtx_z\", jentry] > 9500:\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" cut_brem_lost.real(brem_l[itr, \"brem_photons_pe\", jentry])\n",
|
|
|
|
"\n",
|
|
|
|
" # cut_brem_found.field(\"brem_vtx_z\").real(brem_f[itr, \"brem_vtx_z\",jentry])\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_lost.end_list()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_lost.field(\"brem_vtx_z\")\n",
|
|
|
|
" cut_brem_lost.begin_list()\n",
|
|
|
|
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if brem_l[itr, \"brem_vtx_z\", jentry] > 9500:\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" cut_brem_lost.real(brem_l[itr, \"brem_vtx_z\", jentry])\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_lost.end_list()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" cut_brem_lost.end_record()\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"cut_brem_lost = ak.Array(cut_brem_lost)"
|
2023-10-09 15:25:15 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 6,
|
2023-10-09 15:25:15 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"<pre>{energy: 3.26e+04,\n",
|
|
|
|
" brem_photons_pe: [824, 287, 1.26e+04, 4.49e+03, 3.59e+03, 111],\n",
|
|
|
|
" brem_vtx_z: [157, 158, 601, 2.33e+03, 8.65e+03, 8.67e+03]}\n",
|
|
|
|
"----------------------------------------------------------------\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"type: {\n",
|
|
|
|
" energy: float64,\n",
|
|
|
|
" brem_photons_pe: var * float64,\n",
|
|
|
|
" brem_vtx_z: var * float64\n",
|
|
|
|
"}</pre>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"<Record {energy: 3.26e+04, ...} type='{energy: float64, brem_photons_pe: va...'>"
|
2023-10-09 15:25:15 +02:00
|
|
|
]
|
|
|
|
},
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 6,
|
2023-10-09 15:25:15 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# data in cut_brem_found and cut_brem_lost\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"cut_length_found = ak.num(cut_brem_found[\"brem_photons_pe\"], axis=-1)\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"cut_length_lost = ak.num(cut_brem_lost[\"brem_photons_pe\"], axis=-1)\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"cut_brem_found[1]"
|
2023-10-09 15:25:15 +02:00
|
|
|
]
|
|
|
|
},
|
2023-10-29 11:51:36 +01:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"#### in magnet\n"
|
2023-10-29 11:51:36 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 7,
|
2023-10-29 11:51:36 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"inmagnet_found = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
|
|
|
"for itr in range(ak.num(cut_brem_found, axis=0)):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" inmagnet_found.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" inmagnet_found.field(\"energy\").real(cut_brem_found[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" inmagnet_found.field(\"brem_photons_pe\")\n",
|
|
|
|
" inmagnet_found.begin_list()\n",
|
|
|
|
" for jentry in range(cut_length_found[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] > 1500:\n",
|
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" inmagnet_found.real(cut_brem_found[itr, \"brem_photons_pe\",\n",
|
|
|
|
" jentry])\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" inmagnet_found.end_list()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" inmagnet_found.field(\"brem_vtx_z\")\n",
|
|
|
|
" inmagnet_found.begin_list()\n",
|
|
|
|
" for jentry in range(cut_length_found[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] > 1500:\n",
|
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" inmagnet_found.real(cut_brem_found[itr, \"brem_vtx_z\", jentry])\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" inmagnet_found.end_list()\n",
|
|
|
|
" inmagnet_found.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"inmagnet_found = ak.Array(inmagnet_found)\n",
|
|
|
|
"\n",
|
|
|
|
"inmagnet_lost = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
|
|
|
"for itr in range(ak.num(cut_brem_lost, axis=0)):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" inmagnet_lost.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" inmagnet_lost.field(\"energy\").real(cut_brem_lost[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" inmagnet_lost.field(\"brem_photons_pe\")\n",
|
|
|
|
" inmagnet_lost.begin_list()\n",
|
|
|
|
" for jentry in range(cut_length_lost[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] > 1500:\n",
|
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" inmagnet_lost.real(cut_brem_lost[itr, \"brem_photons_pe\",\n",
|
|
|
|
" jentry])\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" inmagnet_lost.end_list()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" inmagnet_lost.field(\"brem_vtx_z\")\n",
|
|
|
|
" inmagnet_lost.begin_list()\n",
|
|
|
|
" for jentry in range(cut_length_lost[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] > 1500:\n",
|
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" inmagnet_lost.real(cut_brem_lost[itr, \"brem_vtx_z\", jentry])\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" inmagnet_lost.end_list()\n",
|
|
|
|
" inmagnet_lost.end_record()\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"inmagnet_lost = ak.Array(inmagnet_lost)"
|
2023-10-29 11:51:36 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 8,
|
2023-10-29 11:51:36 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"cutoff_energy = 350\n",
|
|
|
|
"# possibly: instead of checking if any photons exceed the cutoff, use the sum of all photon energies to separate nobrem and brem\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"inmagnet_brem_found = inmagnet_found[ak.sum(inmagnet_found[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) >= cutoff_energy]\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"magnet_energy_found = ak.to_numpy(inmagnet_brem_found[\"energy\"])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"magnet_eph_found = ak.to_numpy(\n",
|
|
|
|
" ak.sum(inmagnet_brem_found[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"magnet_residual_found = magnet_energy_found - magnet_eph_found\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"magnet_energyloss_found = magnet_eph_found / magnet_energy_found\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"inmagnet_brem_lost = inmagnet_lost[ak.sum(inmagnet_lost[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) >= cutoff_energy]\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"magnet_energy_lost = ak.to_numpy(inmagnet_brem_lost[\"energy\"])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"magnet_eph_lost = ak.to_numpy(\n",
|
|
|
|
" ak.sum(inmagnet_brem_lost[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"magnet_residual_lost = magnet_energy_lost - magnet_eph_lost\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"magnet_energyloss_lost = magnet_eph_lost / magnet_energy_lost"
|
2023-10-29 11:51:36 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 9,
|
2023-10-29 11:51:36 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"20316.361014308728"
|
2023-10-29 11:51:36 +01:00
|
|
|
]
|
|
|
|
},
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 9,
|
2023-10-29 11:51:36 +01:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"ak.mean(magnet_eph_lost)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 10,
|
2023-10-29 11:51:36 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjQAAAHRCAYAAAB96iOvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABLGklEQVR4nO3dTYwbaX7n+V8ag9YUVihFpnyZWynoOfjkqmDqMpeyLXLq7BYpHcbAXDrJLujWcJGdgwFKdemsoHW00B3M8sIL9EVJVhl77Ca104UBjMUqGS2fButuRqoPC+/BlYwSNFtWuV2xh+wniu9JBl+Skfn9AISUZPCJJ54IRvzjiedlK4qiSAAAACn2exedAQAAgEUR0AAAgNQjoAEAAKlHQAMAAFKPgAYAAKQeAQ0AAEg9AhoAAJB6/+aiM7BK5XJZmUxGX3zxhW7fvq1CoX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GMNObplqtKpPJzDVGz/AFul6vxz2WzMXn6Oho5Nxllp/Wu+k8Zv8Pb+/w7znJcbQq5jg0ZeP7/kgQfJ4kQcw47XZbzWYzDpKG9Y/Z0u12F/4NeZ4n13Xl+348HlQQBPF5a1o5DJ9XzDl33DnKvGfb9szLpUlqAhoTKOTz+YH3zQ/O3Okk5Xmeut1uopfneXIcR61Wa6YTgNkWs6y5A1j1aKrmBBsEQRw8dbvdhU9aq0p3HuYiMNy1+dmzZ5IWD3j7LXKc2bYdn6T6Ly7jalTGMd/tr9mYh9k/ruuq2Wxqd3d36d1fTR6TnAyn3RHOGpQuIw3Dtm2dnJzEtWLZbHaghmua4Qu0uWjlcrk4Dc/zRi6GT548US6XW2i
|
2023-10-29 11:51:36 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.hist(\n",
|
|
|
|
" magnet_energyloss_found,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" bins=80,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"blue\",\n",
|
|
|
|
" label=\"found\",\n",
|
|
|
|
")\n",
|
|
|
|
"plt.hist(\n",
|
|
|
|
" magnet_energyloss_lost,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" bins=80,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"darkorange\",\n",
|
|
|
|
" label=\"lost\",\n",
|
|
|
|
")\n",
|
|
|
|
"\n",
|
|
|
|
"# plt.vlines(ak.mean(both_eloss),0,3,colors=\"red\", label=\"mean\")\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"plt.xlabel(r\"Energyloss Ratio $E_\\gamma/E_0$\")\n",
|
|
|
|
"plt.ylabel(\"counts (normed)\")\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.title(\n",
|
|
|
|
" r\"$B^0\\rightarrow K^{\\ast 0} e^+e^-$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm\"\n",
|
|
|
|
")\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 11,
|
2023-10-29 11:51:36 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjQAAAHhCAYAAAB5kCQCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSeElEQVR4nO3dT4zb6J03+G/NDFJjbMFmlXMZ7KVNJYfJZWyqfHizL+AkJtPndEkuYCeLObwpKY26NdJiajCA7cMbNRVfC2mqehazQLCAi3IP9pghPdMe7A5erEts55IBJhHtHN6ZPaRL7EINPJU3ae6h+mHrD6WiKEoiVd8PINglUuTDhxT508Pn+XElCIIARERERDn2B4suABEREdG0GNAQERFR7jGgISIiotxjQENERES5x4CGiIiIco8BDREREeUeAxoiIiLKvT9adAFmqVqtolAo4JNPPsHt27dRKpUWXaSZu4zbTEREtLQBTblchizLqNVqAIBisQhJkqCq6oJLNjuXcZuJiIgAYGUZMwV7nodCoYBOpwNZlgEAjUYDtm3Dtu0Fl242ZrXNjuNgY2MDiqKkVVQiIqLULWUfGtd1ASC8sAOAoihwHAe+7y+oVLM1q232fR/Hx8fTFo+IiGimljKgef78OSRJ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vO8MHjqdDpTn7RmtdxJiIvA4NDm58+fA5g+4O01zXEmy3J4kuq9uES1qEQRn+1t2ZiE2D+GYaDVamFzczP14a+ijElOhuN+EcYNStNYhiDLMl6+fBm2ihWLxb4WrnEGL9DioqWqargM0zSHLoaPHz+GqqpT7ZfedA7jJD2OZkGSJJRKJTiOA8/z8Pj
|
2023-10-29 11:51:36 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"nstart = 0\n",
|
|
|
|
"nend = 5e4\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.hist(\n",
|
|
|
|
" magnet_residual_found,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" bins=70,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"blue\",\n",
|
|
|
|
" label=\"found\",\n",
|
|
|
|
" range=[nstart, nend],\n",
|
|
|
|
")\n",
|
|
|
|
"plt.hist(\n",
|
|
|
|
" magnet_residual_lost,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" bins=70,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"darkorange\",\n",
|
|
|
|
" label=\"lost\",\n",
|
|
|
|
" range=[nstart, nend],\n",
|
|
|
|
")\n",
|
|
|
|
"\n",
|
|
|
|
"# plt.vlines(ak.mean(both_eloss),0,3,colors=\"red\", label=\"mean\")\n",
|
|
|
|
"# plt.xlim(0,50000)\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"plt.xlabel(r\"Residual Energy in magnet $E_\\gamma$\")\n",
|
|
|
|
"plt.ylabel(\"counts (normed)\")\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.title(\n",
|
|
|
|
" r\"$B^0\\rightarrow K^{\\ast 0} e^+e^-$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm\"\n",
|
|
|
|
")\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
2023-10-09 15:25:15 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 12,
|
2023-10-09 15:25:15 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"6"
|
2023-10-09 15:25:15 +02:00
|
|
|
]
|
|
|
|
},
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 12,
|
2023-10-09 15:25:15 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"cut_length_found[1]"
|
|
|
|
]
|
|
|
|
},
|
2023-10-09 12:10:28 +02:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"### Split in Upstream and Downstream Events and analyse separately\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 13,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# try to find a split between energy lost before and after the magnet (z~5000mm)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"upstream_found = ak.ArrayBuilder()\n",
|
|
|
|
"downstream_found = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"for itr in range(ak.num(cut_brem_found, axis=0)):\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_found.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" upstream_found.field(\"energy\").real(cut_brem_found[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" downstream_found.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" downstream_found.field(\"energy\").real(cut_brem_found[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_found.field(\"brem_photons_pe\")\n",
|
|
|
|
" downstream_found.field(\"brem_photons_pe\")\n",
|
|
|
|
" upstream_found.begin_list()\n",
|
|
|
|
" downstream_found.begin_list()\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" for jentry in range(cut_length_found[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] > 5000:\n",
|
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" downstream_found.real(cut_brem_found[itr, \"brem_photons_pe\",\n",
|
|
|
|
" jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" upstream_found.real(cut_brem_found[itr, \"brem_photons_pe\", jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_found.end_list()\n",
|
|
|
|
" downstream_found.end_list()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_found.field(\"brem_vtx_z\")\n",
|
|
|
|
" downstream_found.field(\"brem_vtx_z\")\n",
|
|
|
|
" upstream_found.begin_list()\n",
|
|
|
|
" downstream_found.begin_list()\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" for jentry in range(cut_length_found[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] > 5000:\n",
|
|
|
|
" if cut_brem_found[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" downstream_found.real(cut_brem_found[itr, \"brem_vtx_z\",\n",
|
|
|
|
" jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" upstream_found.real(cut_brem_found[itr, \"brem_vtx_z\", jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_found.end_list()\n",
|
|
|
|
" downstream_found.end_list()\n",
|
|
|
|
" upstream_found.end_record()\n",
|
|
|
|
" downstream_found.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"upstream_found = ak.Array(upstream_found)\n",
|
|
|
|
"downstream_found = ak.Array(downstream_found)\n",
|
|
|
|
"\n",
|
|
|
|
"upstream_lost = ak.ArrayBuilder()\n",
|
|
|
|
"downstream_lost = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"for itr in range(ak.num(cut_brem_lost, axis=0)):\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_lost.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" upstream_lost.field(\"energy\").real(cut_brem_lost[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" downstream_lost.begin_record()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" downstream_lost.field(\"energy\").real(cut_brem_lost[itr, \"energy\"])\n",
|
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_lost.field(\"brem_photons_pe\")\n",
|
|
|
|
" downstream_lost.field(\"brem_photons_pe\")\n",
|
|
|
|
" upstream_lost.begin_list()\n",
|
|
|
|
" downstream_lost.begin_list()\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" for jentry in range(cut_length_lost[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] > 5000:\n",
|
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" downstream_lost.real(cut_brem_lost[itr, \"brem_photons_pe\",\n",
|
|
|
|
" jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" upstream_lost.real(cut_brem_lost[itr, \"brem_photons_pe\", jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_lost.end_list()\n",
|
|
|
|
" downstream_lost.end_list()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_lost.field(\"brem_vtx_z\")\n",
|
|
|
|
" downstream_lost.field(\"brem_vtx_z\")\n",
|
|
|
|
" upstream_lost.begin_list()\n",
|
|
|
|
" downstream_lost.begin_list()\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" for jentry in range(cut_length_lost[itr]):\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] > 5000:\n",
|
|
|
|
" if cut_brem_lost[itr, \"brem_vtx_z\", jentry] <= 9500:\n",
|
|
|
|
" downstream_lost.real(cut_brem_lost[itr, \"brem_vtx_z\", jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
" upstream_lost.real(cut_brem_lost[itr, \"brem_vtx_z\", jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" upstream_lost.end_list()\n",
|
|
|
|
" downstream_lost.end_list()\n",
|
|
|
|
" upstream_lost.end_record()\n",
|
|
|
|
" downstream_lost.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"upstream_lost = ak.Array(upstream_lost)\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"downstream_lost = ak.Array(downstream_lost)"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
2023-10-09 12:22:51 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 14,
|
2023-10-09 12:22:51 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"<pre>{energy: 1.28e+04,\n",
|
|
|
|
" brem_photons_pe: [7.42e+03],\n",
|
|
|
|
" brem_vtx_z: [35.6]}\n",
|
|
|
|
"-----------------------------------\n",
|
2023-10-09 12:22:51 +02:00
|
|
|
"type: {\n",
|
|
|
|
" energy: float64,\n",
|
|
|
|
" brem_photons_pe: var * float64,\n",
|
|
|
|
" brem_vtx_z: var * float64\n",
|
|
|
|
"}</pre>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"<Record {energy: 1.28e+04, ...} type='{energy: float64, brem_photons_pe: va...'>"
|
2023-10-09 12:22:51 +02:00
|
|
|
]
|
|
|
|
},
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 14,
|
2023-10-09 12:22:51 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"upstream_found[0]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
2023-10-09 12:10:28 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 15,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"upstream: cutoff energy = 350MeV, sample size: 6604\n",
|
|
|
|
"eff = 0.8798 +/- 0.004\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# plot efficiency against cutoff energy\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"up_efficiencies = []\n",
|
2023-10-10 16:17:10 +02:00
|
|
|
"up_deff = []\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"for cutoff_energy in range(0, 10050, 200):\n",
|
|
|
|
" up_nobrem_f = upstream_found[ak.sum(upstream_found[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) < cutoff_energy]\n",
|
|
|
|
" up_nobrem_l = upstream_lost[ak.sum(upstream_lost[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) < cutoff_energy]\n",
|
|
|
|
"\n",
|
|
|
|
" if ak.num(up_nobrem_f, axis=0) + ak.num(up_nobrem_l, axis=0) == 0:\n",
|
|
|
|
" up_efficiencies.append(0)\n",
|
|
|
|
" up_deff.append(0)\n",
|
|
|
|
" continue\n",
|
|
|
|
"\n",
|
|
|
|
" eff = t_eff(up_nobrem_f, up_nobrem_l)\n",
|
|
|
|
" deff = eff_err(up_nobrem_f, up_nobrem_l)\n",
|
|
|
|
" up_efficiencies.append(eff)\n",
|
|
|
|
" up_deff.append(deff)\n",
|
|
|
|
"\n",
|
|
|
|
" # print(\"\\ncutoff = \",str(cutoff_energy),\"MeV, sample size: \",ak.num(up_nobrem_f,axis=0)+ak.num(up_nobrem_l,axis=0))\n",
|
|
|
|
" # print(\"eff = \",np.round(eff,4), \"+/-\", np.round(eff_err(up_nobrem_f, up_nobrem_l),4))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
|
|
|
"we see that a cutoff energy of xxxMeV is ideal because the efficiency drops significantly for higher values\n",
|
|
|
|
"\"\"\"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"cutoff_energy = 350.0 # MeV\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
|
|
|
"better statistics: cutoff=xxxMeV - sample size: xxx events and efficiency=xxxx\n",
|
|
|
|
"\"\"\"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"up_nobrem_found = upstream_found[ak.sum(upstream_found[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) < cutoff_energy]\n",
|
|
|
|
"up_nobrem_lost = upstream_lost[ak.sum(\n",
|
|
|
|
" upstream_lost[\"brem_photons_pe\"], axis=-1, keepdims=False) < cutoff_energy]\n",
|
|
|
|
"\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"\\nupstream: cutoff energy = 350MeV, sample size:\",\n",
|
|
|
|
" ak.num(up_nobrem_found, axis=0) + ak.num(up_nobrem_lost, axis=0),\n",
|
|
|
|
")\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"eff = \",\n",
|
|
|
|
" np.round(t_eff(up_nobrem_found, up_nobrem_lost), 4),\n",
|
|
|
|
" \"+/-\",\n",
|
|
|
|
" np.round(eff_err(up_nobrem_found, up_nobrem_lost), 3),\n",
|
|
|
|
")"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 16,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
2023-10-09 16:32:56 +02:00
|
|
|
"nobrem_vertices\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"upstream: cutoff energy = 350MeV, sample size: 6604\n",
|
|
|
|
"eff = 0.8798 +/- 0.004\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"downstream: cutoff energy = 350MeV, sample size: 21986\n",
|
|
|
|
"eff = 0.8739 +/- 0.002\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2023-10-09 15:25:15 +02:00
|
|
|
"down_efficiencies = []\n",
|
2023-10-10 16:17:10 +02:00
|
|
|
"down_deff = []\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"for cutoff_energy in range(0, 10050, 200):\n",
|
|
|
|
" down_nobrem_f = downstream_found[ak.sum(\n",
|
|
|
|
" downstream_found[\"brem_photons_pe\"], axis=-1, keepdims=False) <\n",
|
|
|
|
" cutoff_energy]\n",
|
|
|
|
" down_nobrem_l = downstream_lost[ak.sum(downstream_lost[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) < cutoff_energy]\n",
|
|
|
|
"\n",
|
|
|
|
" if ak.num(down_nobrem_f, axis=0) + ak.num(down_nobrem_l, axis=0) == 0:\n",
|
|
|
|
" down_efficiencies.append(0)\n",
|
|
|
|
" down_deff.append(0)\n",
|
|
|
|
" continue\n",
|
|
|
|
" eff = t_eff(down_nobrem_f, down_nobrem_l)\n",
|
|
|
|
" deff = eff_err(down_nobrem_f, down_nobrem_l)\n",
|
|
|
|
" down_efficiencies.append(eff)\n",
|
|
|
|
" down_deff.append(deff)\n",
|
|
|
|
"\n",
|
|
|
|
" # print(\"\\ncutoff = \",str(cutoff_energy),\"MeV, sample size: \",ak.num(down_nobrem_f,axis=0)+ak.num(down_nobrem_l,axis=0))\n",
|
|
|
|
" # print(\"eff = \",np.round(eff,4), \"+/-\", np.round(eff_err(down_nobrem_f, down_nobrem_l),4))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
|
|
|
"we see that a cutoff energy of xxxMeV is ideal because the efficiency drops significantly for higher values\n",
|
|
|
|
"\"\"\"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"cutoff_energy = 350.0 # MeV\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
|
|
|
"better statistics: cutoff=xxxMeV - sample size: xxx events and efficiency=xxxx\n",
|
|
|
|
"\"\"\"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"down_nobrem_found = downstream_found[ak.sum(\n",
|
|
|
|
" downstream_found[\"brem_photons_pe\"], axis=-1, keepdims=False) <\n",
|
|
|
|
" cutoff_energy]\n",
|
|
|
|
"down_nobrem_lost = downstream_lost[ak.sum(downstream_lost[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) < cutoff_energy]\n",
|
|
|
|
"\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"nobrem_vertices\\nupstream: cutoff energy = 350MeV, sample size:\",\n",
|
|
|
|
" ak.num(up_nobrem_found, axis=0) + ak.num(up_nobrem_lost, axis=0),\n",
|
|
|
|
")\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"eff = \",\n",
|
|
|
|
" np.round(t_eff(up_nobrem_found, up_nobrem_lost), 4),\n",
|
|
|
|
" \"+/-\",\n",
|
|
|
|
" np.round(eff_err(up_nobrem_found, up_nobrem_lost), 3),\n",
|
|
|
|
")\n",
|
|
|
|
"\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"\\ndownstream: cutoff energy = 350MeV, sample size:\",\n",
|
|
|
|
" ak.num(down_nobrem_found, axis=0) + ak.num(down_nobrem_lost, axis=0),\n",
|
|
|
|
")\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"eff = \",\n",
|
|
|
|
" np.round(t_eff(down_nobrem_found, down_nobrem_lost), 4),\n",
|
|
|
|
" \"+/-\",\n",
|
|
|
|
" np.round(eff_err(down_nobrem_found, down_nobrem_lost), 3),\n",
|
|
|
|
")"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 17,
|
2023-10-09 15:25:15 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABc4AAAJLCAYAAADeqgXEAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB5lklEQVR4nO39QYhjWZog6P5WBOnpVGSk3KI7m6ag6ZAxDa/oRbbkRb+CpgI6JHrRtWhwKWIxi5lFhcRgvE0uTDj0kJk0jCHbDsYg86KZRW3Cpdi9WgxSMmRRzXtNuNQ5MExDDyafzdB0vikzVVQMnlGLum/hfRVXbjIzXTPJTJJ9HxjupnvuvUf3yGS/fjv3PztJkiQBAAAAAABERMRv3XcHAAAAAABgnUicAwAAAABAhsQ5AAAAAABkSJwDAAAAAECGxDkAAAAAAGRInAMAAAAAQIbEOQBsqfF4HJPJ5L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/ViMplMaytnv9K6zJPJ5NJzZ8d0MBhcqD09mUyi0Wjk6vdNpWP97jjc5j3t3WNnNRqN6XvdV199NXe/q95n8173u3x/ve3r4rbHS2uFz3u/KJVKcX5+Hp1OZ6Fzv2sVv/uuctnrcm9vLyIiWq3WtG59Krv4LgBwPYlzAFhD9Xo9IiKeP38+TWakC7ilybVNs0hiJU0EXLcQXx43XTgwm6BNk4Hp8TqdznQBw1arNZOEvE6axFnGV6PRiEajEXt7ezdK4I/H4+m4pInK9Hn1er2ljkNW3tf3ffw8pGNaKBTmJmjT67aKxU9LpVJ0u904PT2Ns7Oz2Nvbm16D2ygWi3F
|
2023-10-09 15:25:15 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1800x600 with 2 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# plot efficiencies wrt cutoff energy\n",
|
|
|
|
"fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(18, 6))\n",
|
|
|
|
"x_ = np.arange(0, 10050, step=200)\n",
|
|
|
|
"\n",
|
|
|
|
"ax[0].errorbar(x_, up_efficiencies, yerr=up_deff, ls=\"\", capsize=1, fmt=\".\")\n",
|
|
|
|
"ax[0].set(\n",
|
|
|
|
" xlabel=\"cutoff energy [MeV]\",\n",
|
|
|
|
" ylabel=r\"$\\epsilon$\",\n",
|
|
|
|
" title=\"upstream\",\n",
|
|
|
|
" ylim=[0.8, 1.0],\n",
|
|
|
|
")\n",
|
|
|
|
"# ax[0].set_yticks(np.arange(0.8,1.01,step=0.02),minor=False)\n",
|
|
|
|
"# ax[0].set_xticks(np.arange(0,10100,step=200),minor=True)\n",
|
|
|
|
"# ax[0].grid()\n",
|
|
|
|
"\n",
|
|
|
|
"ax[1].errorbar(x_,\n",
|
|
|
|
" down_efficiencies,\n",
|
|
|
|
" yerr=down_deff,\n",
|
|
|
|
" ls=\"\",\n",
|
|
|
|
" capsize=1,\n",
|
|
|
|
" fmt=\".\")\n",
|
|
|
|
"ax[1].set(\n",
|
|
|
|
" xlabel=\"cutoff energy [MeV]\",\n",
|
|
|
|
" ylabel=r\"$\\epsilon$\",\n",
|
|
|
|
" title=\"downstream\",\n",
|
|
|
|
" ylim=[0.8, 1.0],\n",
|
|
|
|
")\n",
|
|
|
|
"# ax[1].set_yticks(np.arange(0.8,1.01,step=0.02),minor=False)\n",
|
|
|
|
"# ax[1].set_xticks(np.arange(0,10100,step=200),minor=True)\n",
|
|
|
|
"# ax[1].grid(True)\n",
|
|
|
|
"\n",
|
|
|
|
"fig.suptitle(\n",
|
|
|
|
" r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, nobrem electrons\")\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 18,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
2023-10-09 16:32:56 +02:00
|
|
|
"brem vertices\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"upstream eff = 0.826 +/- 0.002\n",
|
|
|
|
"downstream eff = 0.796 +/- 0.003\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"cutoff_energy = 350\n",
|
|
|
|
"# possibly: instead of checking if any photons exceed the cutoff, use the sum of all photon energies to separate nobrem and brem\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"upstream_brem_found = upstream_found[ak.sum(upstream_found[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) >= cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"up_energy_found = ak.to_numpy(upstream_brem_found[\"energy\"])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"up_eph_found = ak.to_numpy(\n",
|
|
|
|
" ak.sum(upstream_brem_found[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"up_residual_found = up_energy_found - up_eph_found\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"up_energyloss_found = up_eph_found / up_energy_found\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"upstream_brem_lost = upstream_lost[ak.sum(upstream_lost[\"brem_photons_pe\"],\n",
|
|
|
|
" axis=-1,\n",
|
|
|
|
" keepdims=False) >= cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"up_energy_lost = ak.to_numpy(upstream_brem_lost[\"energy\"])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"up_eph_lost = ak.to_numpy(\n",
|
|
|
|
" ak.sum(upstream_brem_lost[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"up_residual_lost = up_energy_lost - up_eph_lost\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"up_energyloss_lost = up_eph_lost / up_energy_lost\n",
|
|
|
|
"\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"brem vertices\\nupstream eff = \",\n",
|
|
|
|
" np.round(t_eff(upstream_brem_found, upstream_brem_lost), 3),\n",
|
|
|
|
" \"+/-\",\n",
|
|
|
|
" np.round(eff_err(upstream_brem_found, upstream_brem_lost), 3),\n",
|
|
|
|
")\n",
|
|
|
|
"\n",
|
|
|
|
"downstream_brem_found = downstream_found[ak.sum(\n",
|
|
|
|
" downstream_found[\"brem_photons_pe\"], axis=-1, keepdims=False) >=\n",
|
|
|
|
" cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"down_energy_found = ak.to_numpy(downstream_brem_found[\"energy\"])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"down_eph_found = ak.to_numpy(\n",
|
|
|
|
" ak.sum(downstream_brem_found[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"down_residual_found = down_energy_found - down_eph_found\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"down_energyloss_found = down_eph_found / down_energy_found\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"downstream_brem_lost = downstream_lost[ak.sum(\n",
|
|
|
|
" downstream_lost[\"brem_photons_pe\"], axis=-1, keepdims=False) >=\n",
|
|
|
|
" cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"down_energy_lost = ak.to_numpy(downstream_brem_lost[\"energy\"])\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"down_eph_lost = ak.to_numpy(\n",
|
|
|
|
" ak.sum(downstream_brem_lost[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"down_residual_lost = down_energy_lost - down_eph_lost\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"down_energyloss_lost = down_eph_lost / down_energy_lost\n",
|
|
|
|
"\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"downstream eff = \",\n",
|
|
|
|
" np.round(t_eff(downstream_brem_found, downstream_brem_lost), 3),\n",
|
|
|
|
" \"+/-\",\n",
|
|
|
|
" np.round(eff_err(downstream_brem_found, downstream_brem_lost), 3),\n",
|
|
|
|
")"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 19,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"upstream:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"mean energyloss relative to initial energy (found): 0.3289231319498724\n",
|
|
|
|
"mean energyloss relative to initial energy (lost): 0.530926023218989\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"downstream:\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"mean energyloss relative to initial energy (found): 0.18366915850891907\n",
|
|
|
|
"mean energyloss relative to initial energy (lost): 0.32907909342930114\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"print(\n",
|
|
|
|
" \"upstream:\\nmean energyloss relative to initial energy (found): \",\n",
|
|
|
|
" ak.mean(up_energyloss_found),\n",
|
|
|
|
")\n",
|
|
|
|
"print(\"mean energyloss relative to initial energy (lost): \",\n",
|
|
|
|
" ak.mean(up_energyloss_lost))\n",
|
|
|
|
"\n",
|
|
|
|
"print(\n",
|
|
|
|
" \"downstream:\\nmean energyloss relative to initial energy (found): \",\n",
|
|
|
|
" ak.mean(down_energyloss_found),\n",
|
|
|
|
")\n",
|
|
|
|
"print(\"mean energyloss relative to initial energy (lost): \",\n",
|
|
|
|
" ak.mean(down_energyloss_lost))"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 20,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-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/m+0wShsPe46jB6vr9b973m4nGcZKJk2z3cKypVOrIZ3048fnmuZ58D978TJrN5thJ5n7/6Pds1Lxh37MkgTzMWa8Jhz/bZCDAw/s5fH6ctF6yv0qlMvgBbpLvwUk/PCVJvlQqdexzPpxYPc93+PCPvMMUCoVjAxiOO8hnci1Kjl1yjp1nUMuNjY2h183k3D1LwvPwD0CjtntWhxO2py0z6rsz7rX88I9EwwaZTBxOFp9nvcRFnbOz/i4AwFlJdgMw9w7fVL5Z5TcswXWZkiTMeWM4fPN6WiXnNCXxv5l8S25u33xfZ13+vJLPolAoHNv2m9Vt03C4km1aSZY3t3/4HH7zPR0+t0/bd1L9XiwWj72ShF/yw8kwScJm1Pwk3iSeUQnaaVXEn/TjxeGkyZvJqlFJmH7/m3PkzSRMkogdleg/nHQ6vN3TkomTbrff7x9J7r3pcHXrsP0N+8xO+hHjTUliddi5cLjK+k3DEq6Jk5L+wxz+bIcdy5N+4Eq+U6MSmZN8Dw5X4r/p8PfipATveX4IPfx5DEtqD3s/4ya7D3+fkmr4s5wvwwzb3+G/a+P8bXjzR8dpSv6WnHROjpMQT5x0LT/paYnDku9vch5Nul7ios7ZWX8XAOCs9NkNwFw73E9vrVaL/f396Pf7sb+/H8VicTB446wG5crlclGpVOKDDz4412CVhwfgPDwo4eE+WKct6XczlUod2Wer1YpWqxW5XO5Iv6FnXf68er3e4DPN5/PHtp30WzrNAUlzuVw0m81ot9vR7Xbj1q1bUx2INJfLRbvdHvz78Pl91n5NM5lMVCqVQV/K29v
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1800x600 with 2 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# in abhängigkeit von der energie der elektronen\n",
|
|
|
|
"fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(18, 6))\n",
|
|
|
|
"\n",
|
|
|
|
"ax[0].hist(\n",
|
|
|
|
" up_energyloss_lost,\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"darkorange\",\n",
|
|
|
|
" label=\"lost\",\n",
|
|
|
|
")\n",
|
|
|
|
"ax[0].hist(\n",
|
|
|
|
" up_energyloss_found,\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"blue\",\n",
|
|
|
|
" label=\"found\",\n",
|
|
|
|
")\n",
|
|
|
|
"# ax[0].set_xticks(np.arange(0,1.1,0.1), minor=True,)\n",
|
|
|
|
"# ax[0].set_yticks(np.arange(0,11,1), minor=True)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax[0].set_xlabel(r\"$E_\\gamma/E_0$\")\n",
|
|
|
|
"ax[0].set_ylabel(\"counts (normed)\")\n",
|
|
|
|
"ax[0].set_title(\"Upstream\")\n",
|
|
|
|
"ax[0].legend()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"# ax[0].grid()\n",
|
|
|
|
"\n",
|
|
|
|
"ax[1].hist(\n",
|
|
|
|
" down_energyloss_lost,\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"darkorange\",\n",
|
|
|
|
" label=\"lost\",\n",
|
|
|
|
")\n",
|
|
|
|
"ax[1].hist(\n",
|
|
|
|
" down_energyloss_found,\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"blue\",\n",
|
|
|
|
" label=\"found\",\n",
|
|
|
|
")\n",
|
|
|
|
"# ax[1].set_xticks(np.arange(0,1.1,0.1), minor=True,)\n",
|
|
|
|
"# ax[1].set_yticks(np.arange(0,11,1), minor=True)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax[1].set_xlabel(r\"$E_\\gamma/E_0$\")\n",
|
|
|
|
"ax[1].set_ylabel(\"counts (normed)\")\n",
|
|
|
|
"ax[1].set_title(\"Downstream\")\n",
|
|
|
|
"ax[1].legend()\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"# ax[1].grid()\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"most electrons lose little energy relative to their initial energy downstream\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"fig.suptitle(\n",
|
|
|
|
" r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm\")\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-26 16:21:44 +02:00
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 21,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjgAAAHOCAYAAACVVnNvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABNhElEQVR4nO3dTZDb5pkv+n9P3RuNq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+LU2iGVZaDabqR6WZUFRFDiOM/Ki1NsQWvxCmcZos+KiHgRBFDA1m82uMiVZZlziptDbuPLp06cARgeX45hkwDpZlqOLVufNJi7jEkes25n5GIc43qZpwrZtbG9vT7XRe2cZ01wch/1iTBKkTrp+L1mWcXp6GmXNCoVC4ob1vTdscRNTVTXahmVZfTfHw8PDsRt99xLrjvoM0p5HsyAaw7uuiyAIcHh4mLiRtSA6TgRBMFFnAbHfuIb9s1KpVNBsNtFut+F5Hra3txEEAYrF4shzofO6Ij7zuMEfxXOKoiReLosY4IwpDMPo11Dvjbrz4jHtmwlw+UvHMAw8efIkUZAgMk2dgZj45TPuBaWTCJzK5TIqlQpM0+y7eCdZJo247Blw+atZVdWJg6dCoQDLstBoNOA4TurPsbfXgjju4/7yFBenuCoQAAOzeOVyOboB7O3tTfR5DyIujuOMvCyOSVy5RdCSz+dntv4g4obpOE50sxvnmIkbdmcwKUaordVqsb/Mx62eiiPec2+VVK+059GsiOpSy7IGVjkOs7e3B8/zIMty6hHXxXqVSmVggCgyXY7jJOpZl0bnj5F
|
2023-10-26 16:21:44 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.hist(\n",
|
|
|
|
" up_energyloss_lost,\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"darkorange\",\n",
|
|
|
|
" label=\"lost\",\n",
|
|
|
|
")\n",
|
|
|
|
"plt.hist(\n",
|
|
|
|
" up_energyloss_found,\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" alpha=0.5,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"blue\",\n",
|
|
|
|
" label=\"found\",\n",
|
|
|
|
")\n",
|
2023-10-26 16:21:44 +02:00
|
|
|
"plt.xlabel(r\"$E_\\gamma/E_0$\")\n",
|
|
|
|
"plt.ylabel(\"counts (normed)\")\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.title(\n",
|
|
|
|
" r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm\")\n",
|
2023-10-26 16:21:44 +02:00
|
|
|
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.text(0.35, 2.0, \"Upstream\", size=15)\n",
|
2023-10-26 16:21:44 +02:00
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
2023-10-29 11:51:36 +01:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 22,
|
2023-10-29 11:51:36 +01:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkIAAAHRCAYAAACGvdZwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSgElEQVR4nO3dTYzcZn4/+G8NslGMFSR2O5c5xWJNDjlFZrXORkZkfAuQUVF9yAC5uIt2dDPi4nQusrHAtFmjqzImWwFymIualHPaBSakEnivatIaYPEPkKAozWKx8z+Mq2hBC6cnL9xDz0OzqlhvrJeuan4/QEHqKr48fMgif/W81tI0TUFERERUQd+56AQQERERXRQGQkRERFRZDISIiIioshgIERERUWUxECIiIqLKYiBERERElcVAiIiIiCrrdy46AZvIMAzU63V89dVXuHXrFprN5kUnaeWqeMxEREQMhIboug5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YiiKBvPK47j7L41KR+G7yvinlt0jxLvybI883Lb5NIHQiLA0DRt4H3xRRW/rMqybRvdbrfUy7ZtKIoC3/dnunGIYxHLil8cqx59V9yY4zjOgq5ut7vwzW5V252HeHgMdzF/9uwZgMUD5bxFrjNZlrObW/6hVFSCU0Ssmy9JmYc4P5ZlwfM87O3tLb0bskhjmZvopF+gswazy9iGIMsyXrx4kZXCNRqNgRK1SYYf7OJhp6pqtg3btkceoo8fP4aqqgudl/ywGpOUvY5WQZIkNJtNBEGAOI7x+PHjuYeMiOM4K2nMl+LNS+x3eNiQVWq32+h
|
2023-10-29 11:51:36 +01:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"both_eloss = np.append(up_energyloss_found, up_energyloss_lost)\n",
|
|
|
|
"plt.hist(\n",
|
|
|
|
" both_eloss,\n",
|
|
|
|
" bins=100,\n",
|
|
|
|
" density=True,\n",
|
|
|
|
" histtype=\"bar\",\n",
|
|
|
|
" color=\"cornflowerblue\",\n",
|
|
|
|
" label=\"Upstream\",\n",
|
|
|
|
")\n",
|
|
|
|
"plt.vlines(ak.mean(both_eloss), 0, 3, colors=\"red\", label=\"mean\")\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"plt.xlabel(r\"Energyloss Ratio $E_\\gamma/E_0$\")\n",
|
|
|
|
"plt.ylabel(\"counts (normed)\")\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"plt.title(\n",
|
|
|
|
" r\"$B^0\\rightarrow K^{\\ast 0} e^+e^-$, $p>5$GeV, photons w/ brem_vtx_z$<9500$mm\"\n",
|
|
|
|
")\n",
|
2023-10-29 11:51:36 +01:00
|
|
|
"plt.legend(title=\"LHCb Simulation\", title_fontsize=15)\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
2023-10-26 16:21:44 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 23,
|
2023-10-26 16:21:44 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABjIAAAJPCAYAAADWqU3EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAADV3klEQVR4nOz9f3Bc55nYez6H4IBWoiEboJ27o6qbSA05U5Od1Wi6aXuXN4qhsCGDG92rKALIIbDZzGZHwNwC7/jK1qCHVmiaw8iY5pWvd2qJzTSUm3JtlkBEQKVSormEDWgER7PcdYndtlVJZnJHaGlm9zq3xia6yWhDE0Pw7B/UaXUD3f08b/fpX+D3U4WyxfP0e97znvf8fM/7vp7v+74AAAAAAAAAAAB0oD3tzgAAAAAAAAAAAEA1NGQAAAAAAAAAAICORUMGAAAAAAAAAADoWDRkAAAAAAAAAACAjkVDBgAAAAAAAAAA6Fg0ZAAAAAAAAAAAgI5FQwYAAAAAAAAAAOhYNGQAAAAAAAAAAICORUMGAAAAAAAAAADoWDRkAACAlisUCpLL5dqdDQAAAAAA0AVoyAAAAC136dIlSaVS7c4GFEtLS+3OAtARVldXZXJyUvr6+jguulihUJClpSUZHR2Vvr4+yWaz7c4S4ITzDwDgXkZDBgAADchms8WXW57nlf319fVJX1+fxONxSSaTUigU2p3duiWTSYnH4zu2cXR0VFZXV0Xk7guiZDK5oywmJydF5G5ZBb0w+vv7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qC7dheN4J9Vq1BrvSFYmm62v6rN13f98te3G5X+lX69nVZ6l0twQvzSnWqtGfEdpVepAdqNeZ
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# energyloss in abh von der energie der elektronen\n",
|
|
|
|
"# upstream\n",
|
|
|
|
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20, 6))\n",
|
|
|
|
"\n",
|
|
|
|
"a0 = ax0.hist2d(\n",
|
|
|
|
" up_energyloss_found,\n",
|
|
|
|
" up_energy_found,\n",
|
|
|
|
" bins=(np.linspace(0, 1, 80), np.linspace(0, 5e4, 80)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=15,\n",
|
|
|
|
")\n",
|
|
|
|
"ax0.set_ylim(0, 5e4)\n",
|
|
|
|
"ax0.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax0.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax0.set_ylabel(r\"$E_0$\")\n",
|
|
|
|
"ax0.set_title(\"found energyloss wrt electron energy\")\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"a1 = ax1.hist2d(\n",
|
|
|
|
" up_energyloss_lost,\n",
|
|
|
|
" up_energy_lost,\n",
|
|
|
|
" bins=(np.linspace(0, 1, 50), np.linspace(0, 5e4, 50)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=15,\n",
|
|
|
|
")\n",
|
|
|
|
"ax1.set_ylim(0, 5e4)\n",
|
|
|
|
"ax1.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax1.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax1.set_ylabel(r\"$E_0$\")\n",
|
|
|
|
"ax1.set_title(\"lost energyloss wrt electron energy\")\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"fig.colorbar(a1[3], ax=ax1)\n",
|
|
|
|
"fig.suptitle(\n",
|
|
|
|
" r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, Upstream photons w/ brem_vtx_z$<9500$mm\"\n",
|
|
|
|
")\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 24,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABjIAAAJPCAYAAADWqU3EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAADAlklEQVR4nOz9cZRc133Yef4eGu4mEwiobiiZWDszEaup5Gh2hqarICvDjUwwqJbADTMMg27AAOY43sTodrYxdiTRXYYcGYI5UrsQajzesDeuZmaPJhmiTXTj8HAjD2FVUYRWWZzVEFWieTKJs1YXae+OsicWuwowEwgtNN7+0XyFqu6qur9bdd+rV93fzzl9SPT71X333Xtf9Xvvvnuv5/u+LwAAAAAAAAAAADG0p98ZAAAAAAAAAAAAaIeODAAAAAAAAAAAEFt0ZAAAAAAAAAAAgNiiIwMAAAAAAAAAAMQWHRkAAAAAAAAAACC26MgAAAAAAAAAAACxRUcGAAAAAAAAAACILToyA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lG8Y54/v9OQcaNXb6tjI5ObltMWjtgunB37ag/oI21ssC4XNzcy3/Dgdt1+ZhdmPnXrt0bTU+jDfFtDt3tNcGjZ2ArRbsDjR2BPTyuUBYbbbf5wIAIFx0ZAAAdr3GG7ytb1O2etgUpeCBSK95aLyRNL0x61KQ/60PwoIbza3HZRvfq6AsJicnt6W99S1CFxrfGHT1wGNr+o1teOsxNbZt076DUSvT09PbfoKHb0GnWCvBw5N224P8Bvlp97DU1UiWbjoyGj/TeBzBg892nTSND3i2vkXcrkwa3+reqtVDQN/3mx6ebdX4ZnCjViM
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# downstream\n",
|
|
|
|
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20, 6))\n",
|
|
|
|
"\n",
|
|
|
|
"a0 = ax0.hist2d(\n",
|
|
|
|
" down_energyloss_found,\n",
|
|
|
|
" down_energy_found,\n",
|
|
|
|
" bins=(np.linspace(0, 1, 80), np.linspace(0, 5e4, 80)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=15,\n",
|
|
|
|
")\n",
|
|
|
|
"ax0.set_ylim(0, 5e4)\n",
|
|
|
|
"ax0.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax0.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax0.set_ylabel(r\"$E_0$\")\n",
|
|
|
|
"ax0.set_title(\"found energyloss wrt electron energy\")\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"a1 = ax1.hist2d(\n",
|
|
|
|
" down_energyloss_lost,\n",
|
|
|
|
" down_energy_lost,\n",
|
|
|
|
" bins=(np.linspace(0, 1, 50), np.linspace(0, 5e4, 50)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=15,\n",
|
|
|
|
")\n",
|
|
|
|
"ax1.set_ylim(0, 5e4)\n",
|
|
|
|
"ax1.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax1.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax1.set_ylabel(r\"$E_0$\")\n",
|
|
|
|
"ax1.set_title(\"lost energyloss wrt electron energy\")\n",
|
|
|
|
"\n",
|
2024-02-04 16:56:05 +01:00
|
|
|
"fig.colorbar(a1[3], ax=ax1)\n",
|
|
|
|
"fig.suptitle(\n",
|
|
|
|
" r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, Downstream photons w/ brem_vtx_z$<9500$mm\"\n",
|
|
|
|
")\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 25,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2024-02-04 16:56:05 +01:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABkMAAAJPCAYAAADPIqNiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAADH6ElEQVR4nOz9f5Qc533fe34KoAAhZjQNUPEBlcQxelY6Mi3JVDcUE8INERLd1slmY1tCD6CspYS5S/Y4d6gQl1zPGFauIfiuMu45JkNGnBt1w+dEeyJtDHRDjpPj7LG6SYr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wYVUJBLZdsOkU747aby51JhmcMMsuEnTTdq9ikajody0brzJEAyC9HIzY3193XkQxaV+9xLfq+AifH5+3p+fn/czmYxfLpc33QgKYxAjGGQJBkXCevH8+vr6pgGcdjdeGr8Poz4Hx97WutDYVrQamPH9zcd8s30b3CQJS1iDIYEgra2DisFN5mZlHdSrreVfLBZNgyFbv2/VJlv3UXDDe2sbHqTTrG0fdNvdTbk3LheNRreVR3BDuVl97eac5nKzudtzZZDXSCSy6bhpvDG+tc2y1Lt2GtvLVt81ay+DAYZmrO371nrfuE2NAzZby7Yfx4vvD6/vEmj8QUczqVRq2wu2XV9CH5xXgn0X1LFeXro+Pz/f9PwX1F3LDfHGAcJW6Vo13tDvFNPq2HE9LzcOIjZ7CXqgcTChl+UC/aqzwz4WAACdMRgCABi64MJ96w2P4IKilwtOK5eLkeBitdVFYnBTo9UN0MYLuK0XSo2/ht2q8QZHu4vobgYOGi9Ut/6ytNlNs0E
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# plot residual energy against energyloss and try to find a good split (eg energyloss before and after the magnet)\n",
|
|
|
|
"# upstream\n",
|
|
|
|
"nbins = 60\n",
|
|
|
|
"\n",
|
|
|
|
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20, 6))\n",
|
|
|
|
"\n",
|
|
|
|
"a0 = ax0.hist2d(\n",
|
|
|
|
" up_energyloss_found,\n",
|
|
|
|
" up_residual_found,\n",
|
|
|
|
" bins=(np.linspace(0, 1, nbins), np.linspace(0, 5e4, nbins)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=20,\n",
|
|
|
|
")\n",
|
|
|
|
"ax0.set_ylim(0, 5e4)\n",
|
|
|
|
"ax0.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"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",
|
2024-02-04 16:56:05 +01:00
|
|
|
"a1 = ax1.hist2d(\n",
|
|
|
|
" up_energyloss_lost,\n",
|
|
|
|
" up_residual_lost,\n",
|
|
|
|
" bins=(np.linspace(0, 1, nbins), np.linspace(0, 5e4, nbins)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=20,\n",
|
|
|
|
")\n",
|
|
|
|
"ax1.set_ylim(0, 5e4)\n",
|
|
|
|
"ax1.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"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",
|
2024-02-04 16:56:05 +01:00
|
|
|
"fig.colorbar(a1[3], ax=ax1)\n",
|
|
|
|
"fig.suptitle(\n",
|
|
|
|
" r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, Upstream photons w/ brem_vtx_z$<9500$mm\"\n",
|
|
|
|
")\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-02-04 16:56:05 +01:00
|
|
|
"execution_count": 26,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
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uPs7DOG6VSyU+lUo1jY319vbGeTsdk8/mmXT0PYsI67prX2Xx+6qT5/LC9DvZyrmtX/pVKpeN5Jnhnf3C8BuUeLJPL5fxsNtuY26a5brSaD2B73d7Y2NixLc3rbV53c9m4Xhes9ST4rjnvreb4GfT1o1KpbFlfUAapVGrL/tiez0BzXlKplJ/JZLbko93+sta14Pt2+67XdAdV79oJ8xhqtaxrPprLNjhHBOf55jrQnI8ojpdht5+Csgi2od3cRMG2tyvDdvWzeQ6n5v0dpNfrHF65XK7ldbJ5/iTr9br53NDP/GLN16l2edhe/5r/bm0btEtru+CcEOzHXpeLqs7G4VgAgFFBhwYAIBTBA4XmBwfBg5vgZnZmZqbxwKT5E0wa2Oo7681Ypw4N399685JMJht5y+VyWx70tZvI0PfffEjV6qa308PW4EYkkUjseODQLd/dND+caU4zeOAUPOToJe1+JZPJUB48N9+kBx0Z/TwM2NjYcO4Icanf/cT3K7iJnZ+f9+fn5/1cLudXKpUtD1LC6IgIOkqCjo2wJlPf2NjY0gnT6cFF8/dh1Ofg2NteF5rPFe06V3x/6zHfat8GDxnC0kuHRvMD1O0POno51zXXt+2C71rVt+AB53bBg8REIrGlDJsfMm5PL6jb2+tAqVQydWhs/77ddcFaT4Iy3162QTqtynzQ149gme2dwsED+nZpNpfV9vII9lerutFLXXN5YNzr9TrqetdJ2MeQ79uvMdvrffM2NZ8ztpdtFMeL7w+v/RRo7vhtJZvN7pg02nVi9eDaFuy7oI71M5H4/Px8y2twUHctD7WbO/napWvV/FC+W0y7Y8e1bdDcEdhqYu9Ac4dAP8sFoqqzwz4WAGAU0KE
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2024-02-04 16:56:05 +01:00
|
|
|
"# downstream\n",
|
|
|
|
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20, 6))\n",
|
|
|
|
"\n",
|
|
|
|
"a0 = ax0.hist2d(\n",
|
|
|
|
" down_energyloss_found,\n",
|
|
|
|
" down_residual_found,\n",
|
|
|
|
" bins=(np.linspace(0, 1, 60), np.linspace(0, 5e4, 60)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=25,\n",
|
|
|
|
")\n",
|
|
|
|
"ax0.set_ylim(0, 5e4)\n",
|
|
|
|
"ax0.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"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",
|
2024-02-04 16:56:05 +01:00
|
|
|
"a1 = ax1.hist2d(\n",
|
|
|
|
" down_energyloss_lost,\n",
|
|
|
|
" down_residual_lost,\n",
|
|
|
|
" bins=(np.linspace(0, 1, 60), np.linspace(0, 5e4, 60)),\n",
|
|
|
|
" cmap=plt.cm.jet,\n",
|
|
|
|
" cmin=1,\n",
|
|
|
|
" vmax=20,\n",
|
|
|
|
")\n",
|
|
|
|
"ax1.set_ylim(0, 5e4)\n",
|
|
|
|
"ax1.set_xlim(0, 1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"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",
|
2024-02-04 16:56:05 +01:00
|
|
|
"fig.colorbar(a0[3], ax=ax1)\n",
|
|
|
|
"fig.suptitle(\n",
|
|
|
|
" r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, Downstream photons w/ brem_vtx_z$<9500$mm\"\n",
|
|
|
|
")\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\"\"\"\n",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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-10-09 12:10:28 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|