2023-10-09 12:10:28 +02:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 125,
|
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",
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 126,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"10522"
|
|
|
|
]
|
|
|
|
},
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 126,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n",
|
|
|
|
"\n",
|
|
|
|
"#selektiere nur elektronen von B->K*ee und nur solche mit einem momentum von ueber 5 GeV \n",
|
|
|
|
"allcolumns = file.arrays()\n",
|
|
|
|
"found = allcolumns[(allcolumns.isElectron) & (~allcolumns.lost) & (allcolumns.fromSignal) & (allcolumns.p > 5e3)] #B: 9056\n",
|
|
|
|
"lost = allcolumns[(allcolumns.isElectron) & (allcolumns.lost) & (allcolumns.fromSignal) & (allcolumns.p > 5e3)] #B: 1466\n",
|
|
|
|
"\n",
|
|
|
|
"ak.num(found, axis=0) + ak.num(lost, axis=0)\n",
|
|
|
|
"#ak.count(found, axis=None)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 127,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"eff all = 0.8606728758791105 +/- 0.003375885792719708\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"def t_eff(found, lost, axis = 0):\n",
|
|
|
|
" sel = ak.num(found, axis=axis)\n",
|
|
|
|
" des = ak.num(lost, axis=axis)\n",
|
|
|
|
" return sel/(sel + des)\n",
|
|
|
|
"\n",
|
|
|
|
"def eff_err(found, lost):\n",
|
|
|
|
" n_f = ak.num(found, axis=0)\n",
|
|
|
|
" n_all = ak.num(found, axis=0) + ak.num(lost,axis=0)\n",
|
|
|
|
" return 1/n_all * np.sqrt(np.abs(n_f*(1-n_f/n_all)))\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"print(\"eff all = \", t_eff(found, lost), \"+/-\", eff_err(found, lost))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 128,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"#try excluding all photons that originate from a vtx @ z>9500mm\n",
|
|
|
|
"#ignore all brem vertices @ z>9500mm \n",
|
|
|
|
"\n",
|
|
|
|
"#found\n",
|
|
|
|
"\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",
|
|
|
|
"for itr in range(ak.num(found,axis=0)):\n",
|
|
|
|
" brem_f.begin_record()\n",
|
|
|
|
" #[:,\"energy\"] energy\n",
|
|
|
|
" brem_f.field(\"energy\").append(e_f[itr])\n",
|
|
|
|
" #[:,\"photon_length\"] number of vertices\n",
|
|
|
|
" brem_f.field(\"photon_length\").integer(length_f[itr])\n",
|
|
|
|
" #[:,\"brem_photons_pe\",:] photon energy \n",
|
|
|
|
" brem_f.field(\"brem_photons_pe\").append(brem_e_f[itr])\n",
|
|
|
|
" #[:,\"brem_vtx_z\",:] brem vtx z\n",
|
|
|
|
" 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",
|
|
|
|
"#lost\n",
|
|
|
|
"\n",
|
|
|
|
"brem_e_l = lost[\"brem_photons_pe\"]\n",
|
|
|
|
"brem_z_l = lost[\"brem_vtx_z\"]\n",
|
|
|
|
"e_l = lost[\"energy\"]\n",
|
|
|
|
"length_l = lost[\"brem_vtx_z_length\"]\n",
|
|
|
|
"\n",
|
|
|
|
"brem_l = ak.ArrayBuilder()\n",
|
|
|
|
"\n",
|
|
|
|
"for itr in range(ak.num(lost,axis=0)):\n",
|
|
|
|
" brem_l.begin_record()\n",
|
|
|
|
" #[:,\"energy\"] energy\n",
|
|
|
|
" brem_l.field(\"energy\").append(e_l[itr])\n",
|
|
|
|
" #[:,\"photon_length\"] number of vertices\n",
|
|
|
|
" brem_l.field(\"photon_length\").integer(length_l[itr])\n",
|
|
|
|
" #[:,\"brem_photons_pe\",:] photon energy \n",
|
|
|
|
" brem_l.field(\"brem_photons_pe\").append(brem_e_l[itr])\n",
|
|
|
|
" #[:,\"brem_vtx_z\",:] brem vtx z\n",
|
|
|
|
" brem_l.field(\"brem_vtx_z\").append(brem_z_l[itr])\n",
|
|
|
|
" brem_l.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"brem_l = ak.Array(brem_l)"
|
|
|
|
]
|
|
|
|
},
|
2023-10-09 15:25:15 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 129,
|
|
|
|
"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",
|
|
|
|
" cut_brem_found.field(\"energy\").real(brem_f[itr,\"energy\"])\n",
|
|
|
|
" \n",
|
|
|
|
" cut_brem_found.field(\"brem_photons_pe\")\n",
|
|
|
|
" cut_brem_found.begin_list()\n",
|
|
|
|
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
|
|
|
|
" if brem_f[itr, \"brem_vtx_z\", jentry]>9500:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
|
|
|
" 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",
|
|
|
|
" cut_brem_found.end_list()\n",
|
|
|
|
" \n",
|
|
|
|
" cut_brem_found.field(\"brem_vtx_z\")\n",
|
|
|
|
" cut_brem_found.begin_list()\n",
|
|
|
|
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
|
|
|
|
" if brem_f[itr, \"brem_vtx_z\", jentry]>9500:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
|
|
|
" cut_brem_found.real(brem_f[itr, \"brem_vtx_z\",jentry])\n",
|
|
|
|
" cut_brem_found.end_list()\n",
|
|
|
|
" \n",
|
|
|
|
"\n",
|
|
|
|
" \n",
|
|
|
|
" cut_brem_found.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"cut_brem_found = ak.Array(cut_brem_found)\n",
|
|
|
|
"\n",
|
|
|
|
"\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",
|
|
|
|
" cut_brem_lost.field(\"energy\").real(brem_l[itr,\"energy\"])\n",
|
|
|
|
" \n",
|
|
|
|
" \n",
|
|
|
|
" cut_brem_lost.field(\"brem_photons_pe\")\n",
|
|
|
|
" cut_brem_lost.begin_list()\n",
|
|
|
|
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
|
|
|
|
" if brem_l[itr, \"brem_vtx_z\", jentry]>9500:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
|
|
|
" 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",
|
|
|
|
" cut_brem_lost.end_list()\n",
|
|
|
|
" \n",
|
|
|
|
" cut_brem_lost.field(\"brem_vtx_z\")\n",
|
|
|
|
" cut_brem_lost.begin_list()\n",
|
|
|
|
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
|
|
|
|
" if brem_l[itr, \"brem_vtx_z\", jentry]>9500:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
|
|
|
" cut_brem_lost.real(brem_l[itr, \"brem_vtx_z\",jentry])\n",
|
|
|
|
" cut_brem_lost.end_list()\n",
|
|
|
|
" \n",
|
|
|
|
" cut_brem_lost.end_record()\n",
|
|
|
|
"\n",
|
|
|
|
"cut_brem_lost = ak.Array(cut_brem_lost)\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 130,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"<pre>{energy: 9.36e+03,\n",
|
|
|
|
" brem_photons_pe: [2.47e+03, 170, 224, 388, 3.23e+03, 809, 172, 224],\n",
|
|
|
|
" brem_vtx_z: [400, 501, 638, 667, 677, 709, 8.58e+03, 9.28e+03]}\n",
|
|
|
|
"---------------------------------------------------------------------\n",
|
|
|
|
"type: {\n",
|
|
|
|
" energy: float64,\n",
|
|
|
|
" brem_photons_pe: var * float64,\n",
|
|
|
|
" brem_vtx_z: var * float64\n",
|
|
|
|
"}</pre>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
"<Record {energy: 9.36e+03, ...} type='{energy: float64, brem_photons_pe: va...'>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 130,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#data in cut_brem_found and cut_brem_lost\n",
|
|
|
|
"\n",
|
|
|
|
"cut_length_found = ak.num(cut_brem_found[\"brem_photons_pe\"],axis=-1)\n",
|
|
|
|
"cut_length_lost = ak.num(cut_brem_lost[\"brem_photons_pe\"], axis=-1)\n",
|
|
|
|
"\n",
|
|
|
|
"cut_brem_found[1]\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 131,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"8"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 131,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"cut_length_found[1]"
|
|
|
|
]
|
|
|
|
},
|
2023-10-09 12:10:28 +02:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Split in Upstream and Downstream Events and analyse separately"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 132,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"#try to find a split between energy lost before and after the magnet (z~5000mm)\n",
|
|
|
|
"\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",
|
2023-10-09 15:25:15 +02:00
|
|
|
" upstream_found.field(\"energy\").real(cut_brem_found[itr,\"energy\"])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" \n",
|
|
|
|
" downstream_found.begin_record()\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" downstream_found.field(\"energy\").real(cut_brem_found[itr,\"energy\"])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" \n",
|
|
|
|
" 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",
|
|
|
|
" 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\",jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2023-10-09 15:25:15 +02: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",
|
|
|
|
" \n",
|
|
|
|
" 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",
|
|
|
|
" 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\",jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2023-10-09 15:25:15 +02: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",
|
|
|
|
"\n",
|
|
|
|
"upstream_found = ak.Array(upstream_found)\n",
|
|
|
|
"downstream_found = ak.Array(downstream_found)\n",
|
|
|
|
"\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",
|
2023-10-09 15:25:15 +02:00
|
|
|
" upstream_lost.field(\"energy\").real(cut_brem_lost[itr,\"energy\"])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" \n",
|
|
|
|
" downstream_lost.begin_record()\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
" downstream_lost.field(\"energy\").real(cut_brem_lost[itr,\"energy\"])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" \n",
|
|
|
|
" 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",
|
|
|
|
" 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\",jentry])\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
" else:\n",
|
|
|
|
" continue\n",
|
|
|
|
" else:\n",
|
2023-10-09 15:25:15 +02: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",
|
|
|
|
" \n",
|
|
|
|
" 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",
|
|
|
|
" 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",
|
2023-10-09 15:25:15 +02: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",
|
|
|
|
"\n",
|
|
|
|
"upstream_lost = ak.Array(upstream_lost)\n",
|
|
|
|
"downstream_lost = ak.Array(downstream_lost)\n"
|
|
|
|
]
|
|
|
|
},
|
2023-10-09 12:22:51 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 133,
|
2023-10-09 12:22:51 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/html": [
|
|
|
|
"<pre>{energy: 4.62e+04,\n",
|
|
|
|
" brem_photons_pe: [3.26e+03, 4.45e+03, 178, 1.45e+04, 1.1e+03, 3.79e+03],\n",
|
|
|
|
" brem_vtx_z: [162, 187, 387, 487, 1.34e+03, 2.32e+03]}\n",
|
|
|
|
"-------------------------------------------------------------------------\n",
|
|
|
|
"type: {\n",
|
|
|
|
" energy: float64,\n",
|
|
|
|
" brem_photons_pe: var * float64,\n",
|
|
|
|
" brem_vtx_z: var * float64\n",
|
|
|
|
"}</pre>"
|
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
"<Record {energy: 4.62e+04, ...} type='{energy: float64, brem_photons_pe: va...'>"
|
|
|
|
]
|
|
|
|
},
|
2023-10-09 15:25:15 +02:00
|
|
|
"execution_count": 133,
|
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",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 148,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"upstream: cutoff energy = 350MeV, sample size: 1562\n",
|
|
|
|
"eff = 0.9181 +/- 0.007\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2023-10-09 15:25:15 +02:00
|
|
|
"#plot efficiency against cutoff energy \n",
|
|
|
|
"up_efficiencies = []\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"for cutoff_energy in range(50,1050,50):\n",
|
|
|
|
"\tup_nobrem_f = upstream_found[ak.sum(upstream_found[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
|
|
|
"\tup_nobrem_l = upstream_lost[ak.sum(upstream_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
|
|
|
"\t\n",
|
|
|
|
"\tif ak.num(up_nobrem_f,axis=0)+ak.num(up_nobrem_l,axis=0)==0:\n",
|
|
|
|
"\t\tcontinue\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"\teff = t_eff(up_nobrem_f,up_nobrem_l)\n",
|
|
|
|
"\tup_efficiencies.append(eff)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"\t#print(\"\\ncutoff = \",str(cutoff_energy),\"MeV, sample size: \",ak.num(up_nobrem_f,axis=0)+ak.num(up_nobrem_l,axis=0))\n",
|
|
|
|
"\t#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",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"we see that a cutoff energy of xxxMeV is ideal because the efficiency drops significantly for higher values\n",
|
|
|
|
"\"\"\"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"cutoff_energy = 350.0 #MeV\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"better statistics: cutoff=xxxMeV - sample size: xxx events and efficiency=xxxx\n",
|
|
|
|
"\"\"\"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"up_nobrem_found = upstream_found[ak.sum(upstream_found[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
|
|
|
"up_nobrem_lost = upstream_lost[ak.sum(upstream_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"print(\"\\nupstream: cutoff energy = 350MeV, sample size:\",ak.num(up_nobrem_found,axis=0)+ak.num(up_nobrem_lost,axis=0))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"print(\"eff = \",np.round(t_eff(up_nobrem_found, up_nobrem_lost),4), \"+/-\", np.round(eff_err(up_nobrem_found, up_nobrem_lost),3))\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 161,
|
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",
|
|
|
|
"upstream: cutoff energy = 350MeV, sample size: 1562\n",
|
|
|
|
"eff = 0.9181 +/- 0.007\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"downstream: cutoff energy = 350MeV, sample size: 5131\n",
|
|
|
|
"eff = 0.8864 +/- 0.004\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2023-10-09 15:25:15 +02:00
|
|
|
"down_efficiencies = []\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"for cutoff_energy in range(50,1050,50):\n",
|
|
|
|
"\tdown_nobrem_f = downstream_found[ak.sum(downstream_found[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
|
|
|
"\tdown_nobrem_l = downstream_lost[ak.sum(downstream_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
|
|
|
"\n",
|
|
|
|
"\tif ak.num(down_nobrem_f,axis=0)+ak.num(down_nobrem_l,axis=0)==0:\n",
|
|
|
|
"\t\tcontinue\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"\teff = t_eff(down_nobrem_f,down_nobrem_l)\n",
|
|
|
|
"\tdown_efficiencies.append(eff)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"\t#print(\"\\ncutoff = \",str(cutoff_energy),\"MeV, sample size: \",ak.num(down_nobrem_f,axis=0)+ak.num(down_nobrem_l,axis=0))\n",
|
|
|
|
"\t#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",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"we see that a cutoff energy of xxxMeV is ideal because the efficiency drops significantly for higher values\n",
|
|
|
|
"\"\"\"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"cutoff_energy = 350.0 #MeV\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"better statistics: cutoff=xxxMeV - sample size: xxx events and efficiency=xxxx\n",
|
|
|
|
"\"\"\"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"down_nobrem_found = downstream_found[ak.sum(downstream_found[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
|
|
|
"down_nobrem_lost = downstream_lost[ak.sum(downstream_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)<cutoff_energy]\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"print(\"nobrem_vertices\\nupstream: cutoff energy = 350MeV, sample size:\",ak.num(up_nobrem_found,axis=0)+ak.num(up_nobrem_lost,axis=0))\n",
|
|
|
|
"print(\"eff = \",np.round(t_eff(up_nobrem_found, up_nobrem_lost),4), \"+/-\", np.round(eff_err(up_nobrem_found, up_nobrem_lost),3))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"print(\"\\ndownstream: cutoff energy = 350MeV, sample size:\",ak.num(down_nobrem_found,axis=0)+ak.num(down_nobrem_lost,axis=0))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"print(\"eff = \",np.round(t_eff(down_nobrem_found, down_nobrem_lost),4), \"+/-\", np.round(eff_err(down_nobrem_found, down_nobrem_lost),3))\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 162,
|
2023-10-09 15:25:15 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2023-10-09 16:32:56 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABcMAAAJJCAYAAABmnC9/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACJ10lEQVR4nOzdeVyVZf7/8fcRkUURFxJwBbUUh1ET92VKyy2XbMWaLAudDEczy2+amWKWaZPZJqlprqVTmWVDFpmVhoZrjdpoTTaUgYxo4hLIcv/+8McZj+ACcc59uHg9Hw8edW6u+77u+3zOgcs317luh2VZlgAAAAAAAAAAMFgVu08AAAAAAAAAAAB3IwwHAAAAAAAAABiPMBwAAAAAAAAAYDzCcAAAAAAAAACA8QjDAQAAAAAAAADGIwwHAAAAAAAAABiPMBwAAAAAAAAAYDzCcAAAAAAAAACA8QjDAQAAAAAAAADGIwwHAAAAAAAAABiPMBwAAAAAAAAAYDzCcAAAUKENHz5cS5Yssfs0cJm++eYbpaWl2X0aAAAAACohwnAAAAB4zIIFC/Tpp5/afRoAAAAAKiHCcAAAUKmtXr1af/jDHxQQECCHw6Hdu3fbfUoXlZSUJIfD4fJVs2ZNxcTE6O9//7vH+l+2bJnL9mPHjql///6qVq2aXn75ZZfvffHFFxo5cqQyMzOd2/bt26ebb75Zhw8fdvs5VySfffZZsfoWfW3durVY+2+++UZxcXFq1qyZAgICFBAQoCuvvFL333+/tm/fXqZzuOmmmxQQEKBff/31gm3+/Oc/y9fX1/b6TZs2TQ6HQ0eOHLH1PDxlyZIlcjgc+vHHH91y/JSUFE2bNu2itQcAAKjICMMBAECFM3DgQNWqVUu1atXSG2+8ofj4eOfjZ5555rKP89///lfDhg1Ts2bNtH79em3ZskVXXXWVG8/899u5c6ck6b333tOWLVuUkpKihQsX6tSpU7rjjjv0zTffeKT/mJgY57ZvvvlG7du3165du/Tpp5/qr3/9q8s+MTExCg0NVevWrbVhwwa9/PLL6t27t/r166crrrjCredbUT399NPasmWLy1d0dLRLm/nz5ysmJkZfffWVHnzwQX3wwQf6xz/+oXHjxmnv3r3q0KGD/v3vf5e677i4OOXk5OiNN94o8fvHjx/Xu+++q4EDByo0NLRM1wfvlJKSooSEBMJwAABgrKp2nwAAAEBpffDBB87/Hz58uK699loNHz681Mc5cOCA8vLydNddd+maa665YLvTp08rMDCwLKda7nbu3Kng4GANHjzYua1Lly7Kz8/XXXfdpV27dql169Zu7T8gIEAtW7aUJK1atUpxcXFq3bq13nnnHdWvX7/YPtWrV9f06dNVWFiomTNnqkqVKlq5cqWGDh3qtvO0w9GjR1VYWKiQkJDffawrr7xSnTt3vuD3v/zyS8XHx2vAgAF6++23Va1aNef3evXqpdGjR+utt95SQEBAqfvu37+/6tevr8WLFys+Pr7Y999880399ttviouLK/WxvY03vbcrGp47AABQETEzHAAAeIXNmzerT58+Cg4OVu3atTVgwAB99913butv+PDh6t69uyQpNjZWDodD1157rXPZhZ07d+rWW29V7dq11axZM5fzvO666xQUFKTAwEB17dpV//jHP1yOXXSMb775RrfddpuCg4NVp04djR8/Xvn5+dq/f7/69eunoKAgRUREaPbs2Zd93jt27FDbtm2Lbf/5558lSVFRUWV4NqTnn39ea9euLVX/jzzyiO644w79+c9/1ueff15iEC5J//znP9WuXTvt3LlTN9xwg+677z499dRTGjBgwCWXt7jc10V5v34GDRqk9u3ba+HChWrTpo0CAgLUqFEjTZ06VYWFhSXu88033yg8PFz9+/fXsmXLdOLEiTL3fylPP/20fHx8NH/+fJcg/Fy33XZbsZp89913uvPOO1WvXj35+fkpKipKr7zyiksbHx8f3XPPPdqxY4f++c9/Fjvu66+/7rzO0ip6b+zdu1d33HGHgoODFRoaqvvuu0/Hjx93aXs577UiP/30k26++WbVrFlTwcHBuuuuu/Tf//63xL4v9N6+nOfGne/ty+n/9+77r3/9S3fccYdCQ0Pl5+enxo0b6+6771Zubq6mTZumCRMmSJIiIyOdy/N89tln5fJz8dzn71L1/+9//6u//OUvatSokfz8/HTFFVeoW7du+uSTTy77+QQAACgJYTgAALDdtGnTdM0116hRo0Z688039dprr+mnn37Sddddp5MnT1503yVLlpRpVviUKVOcYVHRkhTz5s1zfv/mm29W8+bN9dZbb+nVV1+VJH3++efq1auXjh8/rkWLFunNN99UUFCQBg0apNWrVxfr4/bbb1ebNm30zjvvaOTIkXr++ef10EMPaciQIRowYIDeffdd9erVS48++qjWrFlzyXPOyspSWlqa2rRpo/z8fOXn5yszM1PLly/XU089pREjRqhjx46lfi4kafv27br99tsvGogX9d+4cWP16dNHL7/8shYuXKgFCxZcMJCVpNq1a2vGjBlav369IiMj1a1bN+3evVu33367goODL7jf5b4ufs/r50J27Nihf/3rX3r++ec1YcIEvf/+++revbumT5+uxYsXl7hP586dtXTpUvn6+mrkyJGqV6+ebrvtNq1Zs0a5ubml6n/06NGqWrWqatasqb59+2rz5s3O7xUUFGjjxo1q3769wsPDL/uY+/btU4cOHbRnzx4999xz+uCDDzRgwACNHTtWCQkJLm3vu+8+ORyOYte6b98+paam6p577pGPj0+prulct9xyi6666iq98847mjhxot544w099NBDzu+X9r120003qXnz5nr77bc1bdo0rV27Vn379lVeXl6xtiW9t0vz3Ejl/94ubf9l2ffrr79Whw4dtHXrVk2fPl0ffvihZs6cqdzcXJ05c0YjRozQmDFjJElr1qxxLs/Trl27iz53pa2VdOn6Dxs2TGvXrtUTTzyhjz/+WK+99pquv/56ZWVlXfK5BAAAuCgLAADARuvWrbMkWbNnz3bZfuDAAUuStWLFimL79OvXz6pevXqJX0899dRl971x40ZLkvXWW285t02dOtWSZD3xxBPF2nfu3NmqV6+edeLECee2/Px8Kzo62mrYsKFVWFjocoznnnvOZf+2bdtakqw1a9Y4t+Xl5VlXXHGFdfPNN1/yfD/++GNLUrGvqlWrWjNmzLjs6y5Jfn6+deedd1q+vr7Wu+++e8n+/f39ra1bt5a6n9GjR1uvv/76Jdtd7uuiLK+fS/n5558tSVbTpk2tX3/91bn9zJkzVlhYmDVw4MBLHuPYsWPW4sWLrT59+lhVq1a1goODreHDh1sfffSRlZ+ff8H9du7caT344IPWu+++a33xxRfW4sWLraioKMvHx8dav369ZVmWlZGRYUmyhg4dWmz//Px8Ky8vz/lV9Jq0LMvq27ev1bBhQ+v48eMu+/z1r3+1/P39raNHj7psv+aaa6yQkBDrzJkzzm0PP/ywJck6cODAJZ+DkhS9N86vV3x8vOXv7+8839K+1x566CGX461cubJY/S/23r7c58Zd7+3L7f/111+3JFkHDx4s9b69evWyatWqZWVmZl7wPJ599tlixz/3un/Pz8Vzj3Op+teoUcMaN27cBc8TAACgrJgZDgAAbPXEE0+oWbNmevDBB52znfPz8xUZGamAgAD98MMPxfb58MMPdfLkyRK/HnvssXI5r1tuucXl8alTp/TVV1/p1ltvVY0aNZzbfXx8NGzYMP3888/av3+/yz4DBw50eRwVFSWHw+GyvETVqlXVvHlz/ec//7nkOe3YsUPS2Vmb27Zt07Zt27R+/XoNGDBATzzxxAVnoB45csS55MGFvqpWrao33nhDeXl5uv3223X48OEL9j9s2DDl5OToiy++uOQ5n+/ll1++rJn8l/u6KMvr51K2bdsm6eyM83Nnrvv6+qp58+aXXNpFkmrVqqV7771XH330kdLT0/XMM8/o4MGD6tevn+rXr3/B87r66qs1d+5cDRkyRD1
|
2023-10-09 15:25:15 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1800x600 with 2 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#plot efficiencies wrt cutoff energy\n",
|
|
|
|
"fig, ax = plt.subplots(nrows=1,ncols=2,figsize=(18,6))\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"x_ = np.arange(50,1050,step=50)\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"ax[0].scatter(x_,up_efficiencies)\n",
|
|
|
|
"ax[0].set(xlabel=\"cutoff energy [MeV]\",ylabel=r\"$\\epsilon$\",title=\"upstream\", ylim=[0.85,0.95])\n",
|
|
|
|
"ax[0].set_yticks(np.arange(0.85,0.96,step=0.01),minor=False)\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"ax[0].set_xticks(np.arange(0,1100,step=50),minor=True)\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"ax[0].grid()\n",
|
|
|
|
"\n",
|
|
|
|
"ax[1].scatter(x_,down_efficiencies)\n",
|
|
|
|
"ax[1].set(xlabel=\"cutoff energy [MeV]\",ylabel=r\"$\\epsilon$\",title=\"downstream\", ylim=[0.85,0.95])\n",
|
|
|
|
"ax[1].set_yticks(np.arange(0.85,0.96,step=0.01),minor=False)\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"ax[1].set_xticks(np.arange(0,1100,step=50),minor=True)\n",
|
|
|
|
"ax[1].grid(True)\n",
|
|
|
|
"\n",
|
|
|
|
"fig.suptitle(r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, nobrem electrons\")\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 164,
|
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",
|
|
|
|
"upstream eff = 0.851 +/- 0.004\n",
|
|
|
|
"downstream eff = 0.836 +/- 0.005\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2023-10-09 16:32:56 +02:00
|
|
|
"cutoff_energy=350\n",
|
2023-10-09 12:22:51 +02:00
|
|
|
"#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",
|
2023-10-09 16:32:56 +02:00
|
|
|
"upstream_brem_found = upstream_found[ak.sum(upstream_found[\"brem_photons_pe\"],axis=-1,keepdims=False)>=cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"up_energy_found = ak.to_numpy(upstream_brem_found[\"energy\"])\n",
|
|
|
|
"up_eph_found = ak.to_numpy(ak.sum(upstream_brem_found[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
|
|
|
"up_residual_found = up_energy_found - up_eph_found\n",
|
|
|
|
"up_energyloss_found = up_eph_found/up_energy_found\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"upstream_brem_lost = upstream_lost[ak.sum(upstream_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)>=cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"up_energy_lost = ak.to_numpy(upstream_brem_lost[\"energy\"])\n",
|
|
|
|
"up_eph_lost = ak.to_numpy(ak.sum(upstream_brem_lost[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
|
|
|
"up_residual_lost = up_energy_lost - up_eph_lost\n",
|
|
|
|
"up_energyloss_lost = up_eph_lost/up_energy_lost\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"print(\"brem vertices\\nupstream eff = \", np.round(t_eff(upstream_brem_found,upstream_brem_lost),3), \"+/-\", np.round(eff_err(upstream_brem_found, upstream_brem_lost),3))\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"\n",
|
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"downstream_brem_found = downstream_found[ak.sum(downstream_found[\"brem_photons_pe\"],axis=-1,keepdims=False)>=cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"down_energy_found = ak.to_numpy(downstream_brem_found[\"energy\"])\n",
|
|
|
|
"down_eph_found = ak.to_numpy(ak.sum(downstream_brem_found[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
|
|
|
"down_residual_found = down_energy_found - down_eph_found\n",
|
|
|
|
"down_energyloss_found = down_eph_found/down_energy_found\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"downstream_brem_lost = downstream_lost[ak.sum(downstream_lost[\"brem_photons_pe\"],axis=-1,keepdims=False)>=cutoff_energy]\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"down_energy_lost = ak.to_numpy(downstream_brem_lost[\"energy\"])\n",
|
|
|
|
"down_eph_lost = ak.to_numpy(ak.sum(downstream_brem_lost[\"brem_photons_pe\"], axis=-1, keepdims=False))\n",
|
|
|
|
"down_residual_lost = down_energy_lost - down_eph_lost\n",
|
|
|
|
"down_energyloss_lost = down_eph_lost/down_energy_lost\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"print(\"downstream eff = \", np.round(t_eff(downstream_brem_found,downstream_brem_lost),3), \"+/-\", np.round(eff_err(downstream_brem_found, downstream_brem_lost),3))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 165,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"upstream:\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"mean energyloss relative to initial energy (found): 0.33078325542598164\n",
|
|
|
|
"mean energyloss relative to initial energy (lost): 0.5708618852236069\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"downstream:\n",
|
2023-10-09 16:32:56 +02:00
|
|
|
"mean energyloss relative to initial energy (found): 0.19104090843883118\n",
|
|
|
|
"mean energyloss relative to initial energy (lost): 0.3051594568487781\n"
|
2023-10-09 12:10:28 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"print(\"upstream:\\nmean energyloss relative to initial energy (found): \",ak.mean(up_energyloss_found))\n",
|
|
|
|
"print(\"mean energyloss relative to initial energy (lost): \", ak.mean(up_energyloss_lost))\n",
|
|
|
|
"\n",
|
|
|
|
"print(\"downstream:\\nmean energyloss relative to initial energy (found): \",ak.mean(down_energyloss_found))\n",
|
|
|
|
"print(\"mean energyloss relative to initial energy (lost): \", ak.mean(down_energyloss_lost))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 166,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2023-10-09 16:32:56 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABbYAAAJNCAYAAADtbSO1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAB1tklEQVR4nO3deZyN9f//8eeZfcYy1jH2nezKlqWyK6GVSklI9UHSIrQw+ijbT2khJdEnkcqSykdUhpCspeITRZmyb2MQZnn//ug7J8fMMNc423XN4367za3O+1znfb3OeR0zr3nN+7wvlzHGCAAAAAAAAAAAmwgJdAAAAAAAAAAAAFhBYxsAAAAAAAAAYCs0tgEAAAAAAAAAtkJjGwAAAAA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bs2aMGDRooLS1NaWlpOnjwoN599109//zzuv/++9W0aVPL827cuFE9evS4aHM789wVKlRQx44d9dprr2n69Ol68803c2ysZipXrpy6dOniMZbZQA0PD8/2MQkJCbruuutUvnx5zZ07V2+99ZaSkpLUrl07nTx50vJxVmzatEn/+9//9NJLL2no0KFavHixWrVqpeeee05vv/12to+5+uqr9c477yg8PFz9+/dXXFycunfvrgULFujs2bOWzj9w4ECFhYWpcOHC6tSpk1avXu1xf3p6ulasWKHGjRurdOnSuZ5327ZtatKkiX788UdNmjRJn376qW688UYNHjxYo0ePdh/Xt29fuVyuLM9127ZtWr9+vXr37n1ZqzBvueUWVatWTR999JESEhK0aNEiderUSampqVmOve2221SjRg3Nnz9fw4cP15w5c/Too4+671+5cqXatm2r5ORkzZgxQ3PnzlWhQoXUtWtXzZs3T5J0//336+GHH5YkLViwQN98842++eYbXXXVVbmew0pMktSrVy8tWrRII0eO1LJly/TWW2+pffv2OnLkSI6vS506dVS6dGmP5vcXX3yh6Ohobdu2TXv37pUkpaWlaeXKlWrfvr37uMwmZm4b21ZycOutt6patWr68MMPNW3aNEm5fy9l6tGjhxo0aKD58+erf//+eumll/Too4/q5ptv1o033qiFCxeqbdu2GjZsmBYsWJCr5yBJXbp0UVxcnGbOnJnlvlmzZumqq67SK6+8kmP+o6Ki9MEHH+jgwYPq27evJCkjI0N33323jDGaO3durt/rmfNmfn311VcqW7as4uPjVaxYsUs+/vTp05o3b55uuukmxcfH6+GHH1aRIkU0b9481a5dO9vHnDt3TpGRkVnGM8ey++PUpb6/SNKPP/6oWrVqKSzM88O/mZ8G+vHHHy0dd77LfS/46r0EAACClAEAAI6wbNkyIynLV1hYmBkzZkye501LSzM9e/Y04eHhZuHChZc8d1RUlFm3bl2ez3cpn3zyiZFkJkyY4DG+Y8cOI8nMnj3b0nFW/PHHH0aSqVKlijl+/Lh7/Ny5cyY+Pt506dLlknMcO3bMvP3226Zjx44mLCzMxMbGmvvuu898/vnnJi0tLcfHbd682TzyyCNm4cKFZtWqVebtt982tWrVMqGhoWbp0qXu4/bv328kmTvvvDPLHGlpaSY1NdX9lZGR4b6vU6dOply5ciY5OdnjMYMGDTJRUVHm6NGj7rHrrrvOlChRwpw7d8499vjjjxtJZseOHZd8DbIzatQoI8k8+uijHuPvvfdelnxlHnthbgcMGGCioqLcz+vqq682cXFxJiUlxeM1qFu3rilXrpz7uIkTJxpJZvfu3Vniyu0cuY3JGGMKFixohgwZYuXlMcYYc88995gqVaq4b7dv397079/fFC1a1LzzzjvGGGPWrFljJJlly5a5jxs
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1800x600 with 2 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#in abhängigkeit von der energie der elektronen\n",
|
|
|
|
"fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(18,6))\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"ax[0].hist(up_energyloss_lost, bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=\"lost\")\n",
|
|
|
|
"ax[0].hist(up_energyloss_found, bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=\"found\")\n",
|
|
|
|
"ax[0].set_xticks(np.arange(0,1.1,0.1), minor=True,)\n",
|
2023-10-09 12:22:51 +02:00
|
|
|
"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",
|
|
|
|
"ax[0].grid()\n",
|
|
|
|
"\n",
|
|
|
|
"ax[1].hist(down_energyloss_lost, bins=100, density=True, alpha=0.5, histtype='bar', color=\"darkorange\", label=\"lost\")\n",
|
|
|
|
"ax[1].hist(down_energyloss_found, bins=100, density=True, alpha=0.5, histtype='bar', color=\"blue\", label=\"found\")\n",
|
|
|
|
"ax[1].set_xticks(np.arange(0,1.1,0.1), minor=True,)\n",
|
2023-10-09 12:22:51 +02:00
|
|
|
"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",
|
|
|
|
"ax[1].grid()\n",
|
|
|
|
"\n",
|
|
|
|
"\"\"\"\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",
|
2023-10-09 16:32:56 +02:00
|
|
|
"fig.suptitle(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-09 16:32:56 +02:00
|
|
|
"execution_count": 168,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2023-10-09 16:32:56 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABj8AAAJOCAYAAADoCxXRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADUBklEQVR4nOzde5zN1eL/8fc2d2NmmyEzxr1CwlCU68n9lksRippQyUnlCJ3SDZ1cInIOSemi3OuEE3UmREkuuSRH+lInhRiUMYMwZmb9/ug3+9jmsj/bfGbbM/v1fDz2o3z22uv++ezPZ9ZeazmMMUYAAAAAAAAAAAAlRKkrnQEAAAAAAAAAAAA7MfgBAAAAAAAAAABKFAY/AAAAAAAAAABAicLgBwAAAAAAAAAAKFEY/AAAAAAAAAAAACUKgx8AAAAAAAAAAKBEYfADAAAAAAAAAACUKAx+AAAAAAAAAACAEoXBDwAAAAAAAAAAUKIw+AEAAODndu3apQMHDlzpbAAAAAAAUGww+AEAAODnXn/9da1du/ZKZwMAAAAAgGKDwQ8AAAA/tH79eg0ePFjHjh1zHduzZ4969eqlo0ePXsGcAQAAAADg/xj8AAAAJd7HH38sh8Ph9oqOjlajRo303nvv+STtd9991+14amqqunTpotDQUM2cOTPX5xo1aqS4uDglJibq008/1cyZM9WhQwd17txZV111VZHmuTj57LPPcrVtzmvz5s15fmbXrl26//77dc011ygiIkIRERGqWbOmhgwZom3btnmdh549eyoiIkInT57MN8zdd9+tkJAQrweuxo4dK4fDoV9//TXP9+vVq6fWrVt7Fac3Nm7cqLFjxxZYtkDgqR28FQj1mpWVpQoVKujll1/ON4zd9VpclOT2/+qrr9SpUydFRUWpTJkyatOmjb788stc4by5dp8+fVrDhw9XQkKCwsPD1bBhQy1evDjP9L0JCwAASr7gK50BAACAorZjxw5J0r/+9S9VqFBBxhgdOHBAY8aMUb9+/XTdddcpMTGxSNNu1KiR69iuXbvUs2dPnTlzRmvXrlXLli1zfS4yMlLPP/+8srOzNXHiRJUqVUoLFizQXXfdVST5LO4mTJigNm3auB2rV69ernCvvfaaHnnkEdWuXVt/+ctfVLduXTkcDn333XdatGiRbrrpJv3www+65pprLKd9//33a/ny5Vq4cKGGDh2a6/20tDQtW7ZM3bp1U1xcnPeFu4I2btyocePGaeDAgSpbtuyVzk6JEQj1un79eh0/fly9evW60lnxOyW1/bdu3apbbrlFN998s+bNmydjjCZPnqx27dpp3bp1atasWa7PWLl29+rVS1u3btWkSZNUq1YtLVy4UP369VN2drb69+9/2WEBAEDJx+AHAAAo8Xbs2CGn06kePXq4jjVr1kyZmZm655579PXXXxfp4EdERISuu+46SdLixYt1//33KzExUR988IESEhLy/Nx//vMfJSUlKT4+XrfeeqsSEhI0fvx4zZs3T++8847Kly9fJPn1pRMnTig7O9uWstSsWVNNmzYtMMyXX36poUOHqmvXrvrnP/+p0NBQ13tt27bVww8/rPfff18RERFepd2lSxclJCTorbfeynPwY9GiRTp79qzuv/9+r+Itbn7//XeVLl36SmcDfuKf//ynGjdurGrVqhVZGvQ53zty5IgiIyMVHR2d671nn31WZcuWVXJysqtd2rdvr6uvvlqjRo3KcwaIp2v3xx9/rNWrV7sGMSSpTZs2+vnnn/X444/rzjvvVFBQkNdhAQBAYGDZKwAAUOJt375dDRs2zHX80KFDkqQ6dep4HefLL7+s5cuXe5X2qFGj1K9fP9199936/PPP8x34kKSYmBi98MILSk5OVo0aNdSiRQvt3LlTffv2ldPpzPdzGzZsUMeOHeV0OhUTE6OuXbvq+++/v+xwVnXv3l2NGzfWnDlz1KBBA0VERKhKlSoaM2aMsrOz8/zMrl27VLFiRXXp0kXvvvuuTp06ddnpWzFhwgQFBQXptddecxv4uFifPn1ytcv333+v/v37q0KFCgoLC1OdOnX0yiuvuN4PCgrSgAEDtH37dv3nP//JFefbb7/tKmdRy1lG6Ouvv1avXr0UHR0tp9Ope+65R8ePH3cLe/z4cT344IOqUqWKwsLCdNVVV6lFixZas2aNK67HH39cklSjRg3XkjSfffaZK50dO3aod+/eiomJcZst46nOJOmHH37QoEGDVLNmTZUuXVqVKlVS9+7dc9VhTlq7du1Snz595HQ6FRsbqxEjRigzM1N79+5V586dFRUVperVq2vy5Mm211WOo0ePql+/fnI6nYqLi9N9992ntLQ0tzAbNmxQu3btFBUVpdKlS6t58+b66KOP3NLNr16txnFx/r/99luPefLU1nn59ttv5XA49P7777uObd++XQ6HQ3Xr1nUL26NHD7fZbcYYLVu2THfccUe+8V/s4MGDHtvAjj5XVH1JkpYvXy6Hw6FPP/0013uvvvqqK92C2v/cuXO64YYbdO2117q1YUpKiuLj49W6dWtlZWVZyk9+S0o5HA799NNPlssl/bFM45tvvqn27durcuXK+vHHH/MM9+WXX6p169ZuA1JRUVG65ZZbtHHjRh05csSrdCVp2bJlKlOmjPr06eN2fNCgQTp8+LC2bNlyWWEL2xeKsi8BAAD7MPgBAABKtN9++00HDhxQgwYNlJmZqczMTB07dkzz5s3T+PHj9cADD+jmm2/2Ot5t27apb9++BQ6A5KRdtWpVdezYUTNnztScOXP0+uuv5/vH9xyVK1dWt27d3I7l/JE9JCQkz8+MHTtWrVq1UpUqVbRo0SK98cYbOnjwoNq1a6fTp097Hc4b27dv1//93//p5Zdf1uOPP64PP/xQLVu21PPPP6+33norz880bdpU77zzjkJCQjR48GBVqFBBffr00dKlS3X+/Hmv0n/44YcVHBys6OhoderUSRs2bHB7PysrS+vWrVPjxo1VsWJFy/Hu2bNHN910k3bv3q2pU6dq5cqV6tq1q4YNG6Zx48a5wt13331yOBy5yrpnzx599dVXGjBggE9/cdyzZ09de+21+uc//6mxY8dq+fLl6tSpky5cuOAKk5SUpOXLl+u5557TqlWr9MYbb6h9+/b67bffJEkPPPCAHn30UUnS0qVLtWnTJm3atEk33nijK45evXrp2muv1fvvv6/Zs2e7ymylzg4fPqxy5cpp0qRJSk5O1iuvvKLg4GA1adJEe/fuzVWmvn37qkGDBvrggw80ePBgvfzyy3rsscd0++23q2vXrlq2bJnatm2rJ554QkuXLrW1rnLccccdqlWrlj744AM9+eSTWrhwoR577DHX+59//rnatm2rtLQ0vfnmm1q0aJGioqLUvXt3LVmyxFK9WonDmzxJnts6L3Xr1lXFihXdBkjWrFmjiIgI7dmzR4cPH5YkZWZm6vPPP1f79u1d4XL+0G118MObNihMn8tRFH2pW7duqlChgt5+++1c782dO1c33nijEhMTC2z/8PBwvffeezp27Jjuu+8+SVJ2drbuvvtuGWO0aNEiy9eRnHhzXmvXrlWlSpUUHx+v2NhYj5///ffftWTJEt12222Kj4/Xo48+qrJly2rJkiW6/vrr8/xMRkaGwsLCch3POZbX4LCna/fu3btVp04dBQe7L1qRM1tz9+7dlxU2R2H7QlFdlwAAgE0MAABACbZq1SojKdcrODjYvPDCC5cdb2Zmpunfv78JCQkxy5Yt85h2eHi42bx582Wn58mKFSuMJDN58mS34/v27TOSzPz5870K541Dhw4ZSebqq682J0+edB3PyMgw8fHxplu3bh7jSE1NNW+99Zbp2LGjCQ4ONk6n0wwcONB88sknJjMzM9/P7dixw/zlL38xy5YtM+vXrzdvvfWWqVOnjgkKCjLJycmucCkpKUaSueuuu3LFkZmZaS5cuOB6ZWdnu97r1KmTqVy5sklLS3P7zCOPPGLCw8PNiRMnXMdatWplypcvbzIyMlzHRo4caSSZffv2eayDvIwZM8ZIMsePH8/z/bp
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#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",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a0=ax0.hist2d(up_energyloss_found, up_energy_found, bins=(np.linspace(0,1,80), np.linspace(0,1.5e5,80)), cmap=plt.cm.jet, cmin=1, vmax=15)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax0.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax0.set_xlim(0,1)\n",
|
|
|
|
"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",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a1=ax1.hist2d(up_energyloss_lost, up_energy_lost, bins=(np.linspace(0,1,50), np.linspace(0,1.5e5,50)), cmap=plt.cm.jet, cmin=1, vmax=15)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax1.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax1.set_xlim(0,1)\n",
|
|
|
|
"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",
|
|
|
|
"fig.colorbar(a1[3],ax=ax1)\n",
|
|
|
|
"fig.suptitle(r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, Upstream photons w/ brem_vtx_z$<9500$mm\")\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 169,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2023-10-09 16:32:56 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABj8AAAJOCAYAAADoCxXRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADGZ0lEQVR4nOzdeXwURf7/8feQm5AMCUdCkFO5BAIKyrlyX3IoCChoBFRkRUUEPPACXDnk3gURZRWU2wNYATcCgiByyCGyiF/QFQWEAEoIh0BIUr8//GWWIcf0QCdMMq/n4zEPSPenq6qreibdqakqhzHGCAAAAAAAAAAAoJAocr0LAAAAAAAAAAAAYCc6PwAAAAAAAAAAQKFC5wcAAAAAAAAAAChU6PwAAAAAAAAAAACFCp0fAAAAAAAAAACgUKHzA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Z9r355puuvHNq/8TERN1yyy266aab3NovKSlJsbGxat68udLT0y2VJacppRwOh37++Wevzis5OVnvvPOOWrdurRtuuEE//fRTjrFfffWVmjdv7tYpFRERoTvuuEObNm3S0aNHvcpbkpYuXapixYqpR48ebtv79eunI0eOaOvWrV7FSdd+LeT1tQQAALJH5wcAAChQfv/9dx08eFB16tRRWlqa0tLSdPz4cc2dO1ejR4/WI488ottvv93rdLdv366ePXvm2gGSmXf58uXVtm1bTZ8+XbNmzdLbb7+d4x/fM91www3q1KmT27bMP7IHBQVle8zIkSPVrFkzlStXTgsXLtQ///lPHTp0SK1atdLZs2e9jvPGjh079H//93+aMmWKnnnmGX3yySdq2rSpXn31Vb377rvZHtOwYUO99957CgoKUv/+/VW6dGn16NFDS5Ys0cWLF73K//HHH1dgYKAiIyPVrl07bdy40W1/enq61q1bp/r166tMmTKW0927d69uu+027dmzR5MmTdKKFSvUsWNHDRo0SKNGjXLFPfTQQ3I4HFnOde/evfr666/Vp0+fPPlG8J133qmAgABt2LDBtW39+vVq2bKlUlJS9M4772jhwoWKiIhQ586dtXjxYklSzZo1VaZMGbc/Tq9Zs0ZhYWHau3evjhw5IklKS0vT+vXrs51W65577lHVqlX18ccf6/nnn9eCBQv09NNPu/YnJCRo2bJleuWVV7Rq1Sr985//VOvWrfX7779Lkh555BE9+eSTkqQlS5Zo8+bN2rx5s2699Va3fLp166abbrpJH374oWbOnGm5TSTpyJEjKlGihMaNG6fExES98cYbCgwMVIMGDbRv374s59SzZ0/VqVNHH3/8sfr3768pU6bo6aef1t13362OHTtq6dKlatmypZ577jktWbLEUht17dpVN910kz766CONHDlSy5YtU7t27XTp0iWv61Sy1r651a2V470tl6e2zs61XoOZf+i22vlhtR2uvN4k658DmfLiOpKkTp06qXTp0po9e3aWfXPmzNGtt96q+Pj4HNu/cePG+uCDD3T8+HE99NBDkqSMjAzdf//9MsZo4cKFlj+nMtPMfK1du1Zly5ZVbGysoqOjPR7/xx9/aPHixbrrrrsUGxurJ598UsWLF9fixYt1880353hcamqqQkJCsmzP3HZlx6an3w2StGfPHtWoUUOBge4TXWSOCN2zZ49XcZe71mshr64lAACQAwMAAFCArFq1ykjK8goMDDSvvfbaVaeblpZmevfubYKCgszSpUs95h0aGmq2bNly1fl5snz5ciPJjB8/3m37/v37jSQzb948r+K8cfjwYSPJVK5c2Zw6dcq1PTU11cTGxppOnTp5TCM5Odm8++67pm3btiYwMNA4nU7Tt29f89lnn5m0tLQ
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#downstream\n",
|
|
|
|
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a0=ax0.hist2d(down_energyloss_found, down_energy_found, bins=(np.linspace(0,1,80), np.linspace(0,1.5e5,80)), cmap=plt.cm.jet, cmin=1, vmax=15)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax0.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax0.set_xlim(0,1)\n",
|
|
|
|
"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",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a1=ax1.hist2d(down_energyloss_lost, down_energy_lost, bins=(np.linspace(0,1,50), np.linspace(0,1.5e5,50)), cmap=plt.cm.jet, cmin=1, vmax=15)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax1.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax1.set_xlim(0,1)\n",
|
|
|
|
"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",
|
|
|
|
"fig.colorbar(a1[3],ax=ax1)\n",
|
|
|
|
"fig.suptitle(r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, Downstream photons w/ brem_vtx_z$<9500$mm\")\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 170,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2023-10-09 16:32:56 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABk4AAAJOCAYAAADxgPt3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADT4UlEQVR4nOzdd3gU1f7H8c+mh5AsoSWEDiK9KB3UgHRpFoqgkSZyBUQE7NIsoIKAgu3nVUG6Si8iBBCkdxH0ClxBUAigQgJIIOX8/oDsdUnbCbumvV/Psw/szHfOnDkzmZ2zZ885NmOMEQAAAAAAAAAAAOSV3RkAAAAAAAAAAADIKWg4AQAAAAAAAAAAuI6GEwAAAAAAAAAAgOtoOAEAAAAAAAAAALiOhhMAAAAAAAAAAIDraDgBAAAAAAAAAAC4joYTAAAAAAAAAACA62g4AQAAAAAAAAAAuI6GEwAAAAAAAAAAgOtoOAEAAAAAAAAAALiOhhMAAJCj9O7dW9OnT8/ubMBF+/fv1/Hjx7M7GwAAAAAAuA0NJwAAAMiy//u//9O6deuyOxsAAAAAALgNDScAACBPmT9/vqpXr67AwEDZbDbt27cvu7OUoZUrV8pmszm9QkJCVLduXX3++ef/2P4/++wzp+Xnzp1Tu3bt5Ofnp2nTpjmt27hxo/r3768zZ844lv3www+6//77dfr0aY/nOTf55ptvUp3flNe2bdtSxe/fv1/9+vVTxYoVFRgYqMDAQFWqVEkDBgzQrl27spSH++67T4GBgTp//ny6MQ899JB8fX0tn78xY8bIZrPp999/T3N9jRo11KxZM0tpumrLli0aM2ZMhseVH2R2DrIiP5RtUlKSihcvrsmTJ6cb44myzQ3y8vnfsWOH2rRpo+DgYBUsWFDNmzfX5s2bnWKs3rcvXryooUOHKiIiQgEBAapTp47mzZuX5v6txAIAgOxFwwkAAMh2HTp0UKFChVSoUCHNmTNHAwcOdLx//fXXXU7n7NmzioqKUsWKFbVq1Spt3bpVt956qwdzfvP27NkjSVqyZIm2bt2qLVu26KOPPtKlS5fUo0cP7d+//x/Zf926dR3L9u/fr3r16mnv3r1at26dBg8e7LRN3bp1FRYWplq1amnt2rWaNm2aWrVqpbZt26pYsWIezW9uNW7cOG3dutXpVaNGDaeYDz/8UHXr1tX27dv15JNPavny5VqxYoWGDh2qgwcPqn79+vrvf/9red/9+vVTfHy85syZk+b62NhYLVq0SB06dFBYWFiWji87bNmyRWPHjs2TX+5mt/xQths3btTZs2d1//33Z3dWcpy8ev537typu+66S5cvX9bMmTM1c+ZMxcfHq0WLFtq6dWuqeFfu25J0//33a8aMGRo9erS++uor1a9fXz169EjznmslFgAAZC+f7M4AAADA8uXLHf/v3bu3mjVrpt69e1tO59ChQ0pISNDDDz+syMjIdOP++usvFShQICtZdbs9e/bIbrerU6dOjmWNGzdWYmKiHn74Ye3du1e1atXy6P4DAwNVpUoVSdK8efPUr18/1apVSwsWLFBERESqbYKCgvTyyy8rOTlZ48ePl5eXl2bPnq0HH3zQY/nMDn/++aeSk5NVtGjRm06rUqVKatSoUbrrN2/erIEDB6p9+/b68ssv5efn51h39913a9CgQfriiy8UGBhoed/t2rVTRESEPvnkEw0cODDV+rlz5+ry5cvq16+f5bRzk5z0d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ktTs2ZNU7p0aXPhwgWP7PPIkSPm3XffNZLMuHHjzNatW83BgwfN6NGjjSRTtmxZ8+yzz5o1a9aYxYsXG2OM+eabb4yvr6+pW7eumT9/vlm8eLFp3bq1sdlsZt68eU7HI8lUrlzZvPLKK2bNmjXmmWeeMZLM4MGDTZUqVcw777xj1qxZY/r06WMkmQULFmSa599//91IMkOGDDEJCQkmISHBnD592nz22WcmODjYPProo1kuj549expfX1+zaNGiTPffvXt3c/fddxt/f3/z0UcfZZr2iRMnzLJly4wxxgwaNMh8+umnJjEx0UyfPt1cvXo13e1cvS48cf2UKFHCBAUFmapVq5qZM2ea1atXmwcffNBISveYL1++bGbPnm06duxo/Pz8TEBAgOnSpYtZsGCBiY+Pd2m/69evN5JM8eLFjbe3twkODjatW7c23377rSMmMTHRBAYGmsaNG1s6poMHDxq73W5q1qxpPvvsM7N69WozfPhw4+XlZcaMGeMUe/jwYWOz2czQoUNTpSHJPPfcc5b2nSLlb+Ps2bNprq9evbqJjIxMFV+2bFnz9NNPm6+//tpMmjTJBAUFmdtuu81x/bRp08YUK1bM/N///Z/55ptvzOLFi82oUaMcf5cnTpwwTzzxhJFkFi5caLZu3Wq2bt1qYmNjU+3nxr97V8ttw4YNZvjw4ebLL780GzZsMIsWLTL33nuvCQwMNP/5z39SHZO77w+ultXf9z9q1CizZs0aM2nSJOPv72/69OnjlKYr97yMytbVe6aVfGV2rtNTokQJ89hjjznev/766yYwMNBIMr/99psxxpiEhAQTEhJinnnmGadtN23aZCSZQ4cOufUc3Mz15qnrKEVCQoIpXry4eeihh1Kta9Cggbn99tuNMRmf/0OHDpng4GBz//33G2OMSUpKMnfffbcpXry4OXnypMt5McY40k15rVu3zpQsWdKEh4c7/o4zcunSJTNv3jzTqVMn4+fnZwIDA80DDzxgvvjiC3PlypU0t/Hz8zOPPPJIquU9evQwkszXX39tjHHtvp2iUaNGpn79+qmWHzhwwEgyH374oeXYm70WPH0tAQCQX9BwAgAA3GrZsmVGknnzzTedlh86dMhIMrNmzUq1Tdu2bU1QUFCar9dee83lfad82fHFF184lqV8gTBq1KhU8Y0aNTLFixd3+jI+MTHR1KhRw5QqVco
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#plot residual energy against energyloss and try to find a good split (eg energyloss before and after the magnet)\n",
|
|
|
|
"#upstream\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"nbins=60\n",
|
|
|
|
"\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a0=ax0.hist2d(up_energyloss_found, up_residual_found, bins=(np.linspace(0,1,nbins), np.linspace(0,1.5e5,nbins)), cmap=plt.cm.jet, cmin=1, vmax=20)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax0.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax0.set_xlim(0,1)\n",
|
|
|
|
"ax0.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax0.set_ylabel(r\"$E_0-E_\\gamma$\")\n",
|
|
|
|
"ax0.set_title(\"found energyloss wrt residual electron energy\")\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a1=ax1.hist2d(up_energyloss_lost, up_residual_lost, bins=(np.linspace(0,1,nbins), np.linspace(0,1.5e5,nbins)), cmap=plt.cm.jet, cmin=1, vmax=20) \n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax1.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax1.set_xlim(0,1)\n",
|
|
|
|
"ax1.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax1.set_ylabel(r\"$E_0-E_\\gamma$\")\n",
|
|
|
|
"ax1.set_title(\"lost energyloss wrt residual electron energy\")\n",
|
|
|
|
"\n",
|
|
|
|
"fig.colorbar(a1[3],ax=ax1)\n",
|
|
|
|
"fig.suptitle(r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, Upstream photons w/ brem_vtx_z$<9500$mm\")\n",
|
|
|
|
"\n",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"\"\"\"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-10-09 16:32:56 +02:00
|
|
|
"execution_count": 171,
|
2023-10-09 12:10:28 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2023-10-09 16:32:56 +02:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABkEAAAJOCAYAAAAAi6D6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADEXklEQVR4nOzdd3hUxf7H8c+mh5AsoYQQOkivCggIGpAuTRFU0EgTuQIiAnYlgAoqRb1gu14FpAgqTYp0BJHeRNAreAVBIYAYQpFAyvz+8Je9LGl7kl3YJO/X8+wDe/Z75syZc7I7s7MzYzPGGAEAAAAAAAAAAOQzPjc6AwAAAAAAAAAAAJ5AJwgAAAAAAAAAAMiX6AQBAAAAAAAAAAD5Ep0gAAAAAAAAAAAgX6ITBAAAAAAAAAAA5Et0ggAAAAAAAAAAgHyJThAAAAAAAAAAAJAv0QkCAAAAAAAAAADyJTpBAAAAAAAAAABAvkQnCAAAAAAAAAAAyJfoBAEAAB7Vp08fTZ8+/UZnAy7at2+fjh49eqOzAQAAAACAW9AJAgAAAId//etfWrdu3Y3OBgAAAAAAbkEnCAAA8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7TqlKlipo0aZLp699++60GDRqkjh076osvvlBAQIDjtTvvvFODBw/W559/ruDgYMvH7tChg6KiovTxxx9r0KBB6V7/9NNPdenSJfXv399y2mlq166thg0bOp7fe++9evLJJ9W8eXN169ZNhw4dynEHS17hTe8ruPG++OILNWzYUOXLl/fYMbjnrr8TJ04oJCREYWFh6V576aWXVKRIEa1YscJxXVq3bq1KlSpp5MiRGY4Iye6zYfny5Vq9erXmzJmjnj17SpJatmypX3/9VU899ZTuv/9++fr6Wo4FAABZYyQIAABwyaZNm9S2bVvZ7XaFh4erY8eOOnTokMeO16dPHzVv3lySdP/998tms6lFixaO6UZ2796t7t27Kzw8XJUrV3bKZ6tWrRQaGqpChQrptttu07Jly5zSTktj37596tGjh+x2u4oWLarhw4crOTlZP/30k9q3b6/Q0FBVqFBBb7zxhsv53rVrl+rXr59u+2+//SZJqlGjRg5KQ3rzzTe1aNEiS8cfOXKkevbsqQcffFAbNmzIsANEkr7//nvdcsst2r17t+666y7169dPr776qjp27JjttC6u3hfuvn86d+6shg0b6sMPP1S9evUUHByssmXLKjY2VqmpqRnus2/fPpUqVUodOnTQJ598ovPnz+f4+NkZN26cfH199cEHHzh1gFytR48e6a7JoUOH1KtXL0VERCgwMFA1atTQO++84xTj6+ur3r17a9euXfr+++/TpTtt2jTHebpTuXLlNGnSJJ0/f14ffPCBY7srf3MHDhyQzWbT559/7ti2a9cu2Ww21apVyym2S5cujpFMaX+rBw4cUM+ePWW321WyZEn169dPCQkJTvudPn1ajz76qMqWLavAwECVKFFCzZo1c4xcGT16tJ566ilJUsWKFR1T1Xz99dfZvq+4cl1+/vln9e3bV1WqVFGhQoVUunRpde7cOd018tT7T1q6e/bsUbdu3RQWFia73a6HHnpIp0+fznCfkydPZluu2V3frMrV1TSuzr87rnVGcnoPSpIxRgsXLtS9996bafpXO3bsWLbXwB33nCc/yxYtWiSbzaa1a9eme+29995zHDer65+YmKibb75ZN910k9M1jIuLU2RkpFq0aKGUlBSX8pPZVFM2m01Hjhxx+bykv6eH/Oijj9S6dWuVKVNGv/zyS4Zx3377rVq0aOHUMRUaGqo77rhDmzdv1okTJywdV5IWLlyowoULq0ePHk7b+/btq+PHj2vbtm05is3tveDJewkAAK9gAAAAshEbG2t8fHxMv379zLJly8wXX3xh6tSpY8qWLWvOnz/vkWP+/PPP5p133jGSzLhx48yWLVvMgQMHTGxsrJFkypcvb5555hmzevVqs2jRImOMMV9//bXx9/c3DRo0MPPmzTOLFi0ybdu2NTabzcydO9fpfCSZatWqmZdfftmsXr3aPP3000aSGTJkiKlevbr55z//aVavXm369u1rJJn58+dnm+c//vjDSDJDhw41SUlJJikpyZw8edJ88sknJjQ01DzyyCM5Lo9evXoZf39/s3DhwmyPf//995s777zTBAYGmg8//DDbtI8dO2aWLFlijDFm8ODBZtq0aSY5OdlMnz7dXLlyJdP9XL0vPHH/lCpVyoSEhJgaNWqYmTNnmlWrVpkHHnjASMr0nC9dumRmz55tOnfubAICAkxQUJDp3r27mT9/vklMTHTpuOvXrzeSTEREhPH19TWhoaGmbdu25ptvvnHEJCcnm+DgYNO0aVNL53TgwAFjt9tNnTp1zCeffGJWrVplRowYYXx8fMzo0aOdYg8dOmRsNpsZNmxYujQkmWeffdbSsdNMmzbNSDI7duzI8PULFy4YX19f06pVK2OM639zxvx9zR599FHH89dee80EBwcbSeb33383xhiTlJRkwsLCzNNPP22Mcf5bHTVqlFm9erWZPHmyCQwMNH379nVKv127dqZEiRLmX//6l/n666/NokWLzKhRoxz5OHbsmHn88ceNJLNgwQKzZcsWs2XLFpOQkJDl+4qr12XDhg1mxIgR5osvvjAbNmwwCxcuNHfffbcJDg42//nPfxxxnnr/ufocnnrqKbNy5UozefJkExISYm6++Wanv2VXy9WV65tVuVq5R9x5rTOTk3vQGGM2bdpkJJmDBw+6/Rrk5p7z1L2UVg4RERHmwQcfTPfarbfeam655RZjTPbX/+DBgyY0NNR069bNGGNMSkqKufPOO01ERIQ5fvy4S3kxxjjSTXusW7fOlC5d2kRGRjqOlZWLFy+auXPnmi5dupiAgAATHBxs7r33XvP555+by5cvZ7hPQECAefjhh9Nt79mzp5FkVq5c6djmymeDMcY0adLENGrUKF2a+/f
|
2023-10-09 12:10:28 +02:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 2000x600 with 3 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"#downstream\n",
|
|
|
|
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a0=ax0.hist2d(down_energyloss_found, down_residual_found, bins=(np.linspace(0,1,60), np.linspace(0,1.5e5,60)), cmap=plt.cm.jet, cmin=1, vmax=25)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax0.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax0.set_xlim(0,1)\n",
|
|
|
|
"ax0.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax0.set_ylabel(r\"$E_0-E_\\gamma$\")\n",
|
|
|
|
"ax0.set_title(\"found energyloss wrt residual electron energy\")\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"a1=ax1.hist2d(down_energyloss_lost, down_residual_lost, bins=(np.linspace(0,1,60), np.linspace(0,1.5e5,60)), cmap=plt.cm.jet, cmin=1, vmax=20) \n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"ax1.set_ylim(0,1.5e5)\n",
|
|
|
|
"ax1.set_xlim(0,1)\n",
|
|
|
|
"ax1.set_xlabel(r\"energyloss $E_\\gamma/E_0$\")\n",
|
|
|
|
"ax1.set_ylabel(r\"$E_0-E_\\gamma$\")\n",
|
|
|
|
"ax1.set_title(\"lost energyloss wrt residual electron energy\")\n",
|
|
|
|
"\n",
|
2023-10-09 15:25:15 +02:00
|
|
|
"fig.colorbar(a0[3],ax=ax1)\n",
|
2023-10-09 12:10:28 +02:00
|
|
|
"fig.suptitle(r\"$e^\\pm$ from $B\\rightarrow K^\\ast ee$, $p>5$GeV, Downstream photons w/ brem_vtx_z$<9500$mm\")\n",
|
|
|
|
"\n",
|
|
|
|
"\"\"\"\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",
|
|
|
|
"version": "3.11.5"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|