Projektpraktikum/B_updown.ipynb

718 lines
357 KiB
Plaintext
Raw Normal View History

2023-10-09 12:10:28 +02:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"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",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"10522"
]
},
"execution_count": 2,
"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",
"execution_count": 3,
"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",
"execution_count": 4,
"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)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Split in Upstream and Downstream Events and analyse separately"
]
},
{
"cell_type": "code",
"execution_count": 5,
"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",
"for itr in range(ak.num(brem_f, axis=0)):\n",
" upstream_found.begin_record()\n",
" upstream_found.field(\"energy\").real(brem_f[itr,\"energy\"])\n",
" \n",
" downstream_found.begin_record()\n",
" downstream_found.field(\"energy\").real(brem_f[itr,\"energy\"])\n",
" \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",
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
" if (brem_f[itr, \"brem_vtx_z\", jentry]>5000):\n",
" if brem_f[itr, \"brem_vtx_z\", jentry]<9500:\n",
" downstream_found.real(brem_f[itr,\"brem_photons_pe\",jentry])\n",
" else:\n",
" continue\n",
" else:\n",
" upstream_found.real(brem_f[itr,\"brem_photons_pe\", jentry]) \n",
" 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",
" for jentry in range(brem_f[itr, \"photon_length\"]):\n",
" if brem_f[itr, \"brem_vtx_z\", jentry]>5000:\n",
" if brem_f[itr,\"brem_vtx_z\",jentry]<9500:\n",
" downstream_found.real(brem_f[itr,\"brem_vtx_z\",jentry])\n",
" else:\n",
" continue\n",
" else:\n",
" upstream_found.real(brem_f[itr, \"brem_vtx_z\",jentry])\n",
" 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",
"for itr in range(ak.num(brem_l, axis=0)):\n",
" upstream_lost.begin_record()\n",
" upstream_lost.field(\"energy\").real(brem_l[itr,\"energy\"])\n",
" \n",
" downstream_lost.begin_record()\n",
" downstream_lost.field(\"energy\").real(brem_l[itr,\"energy\"])\n",
" \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",
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
" if (brem_l[itr, \"brem_vtx_z\", jentry]>5000):\n",
" if brem_l[itr, \"brem_vtx_z\", jentry]<9500:\n",
" downstream_lost.real(brem_l[itr,\"brem_photons_pe\",jentry])\n",
" else:\n",
" continue\n",
" else:\n",
" upstream_lost.real(brem_l[itr,\"brem_photons_pe\", jentry]) \n",
" 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",
" for jentry in range(brem_l[itr, \"photon_length\"]):\n",
" if brem_l[itr, \"brem_vtx_z\", jentry]>5000:\n",
" if brem_l[itr,\"brem_vtx_z\",jentry]<9500:\n",
" downstream_lost.real(brem_l[itr,\"brem_vtx_z\",jentry])\n",
" else:\n",
" continue\n",
" else:\n",
" upstream_lost.real(brem_l[itr, \"brem_vtx_z\",jentry])\n",
" 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"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"cutoff = 0 MeV, sample size: 880\n",
"eff = 0.9125 +/- 0.0095\n",
"\n",
"cutoff = 100 MeV, sample size: 880\n",
"eff = 0.9125 +/- 0.0095\n",
"\n",
"cutoff = 200 MeV, sample size: 1279\n",
"eff = 0.921 +/- 0.0075\n",
"\n",
"cutoff = 300 MeV, sample size: 1587\n",
"eff = 0.9175 +/- 0.0069\n",
"\n",
"cutoff = 400 MeV, sample size: 1827\n",
"eff = 0.9152 +/- 0.0065\n",
"\n",
"cutoff = 500 MeV, sample size: 2072\n",
"eff = 0.9146 +/- 0.0061\n",
"\n",
"cutoff = 600 MeV, sample size: 2266\n",
"eff = 0.9144 +/- 0.0059\n",
"\n",
"cutoff = 700 MeV, sample size: 2445\n",
"eff = 0.9121 +/- 0.0057\n",
"\n",
"cutoff = 800 MeV, sample size: 2615\n",
"eff = 0.9117 +/- 0.0055\n",
"\n",
"cutoff = 900 MeV, sample size: 2765\n",
"eff = 0.9114 +/- 0.0054\n",
"\n",
"cutoff = 1000 MeV, sample size: 2910\n",
"eff = 0.9096 +/- 0.0053\n",
"\n",
"upstream: cutoff energy = 200MeV, sample size: 1279\n",
"eff = 0.921 +/- 0.008\n"
]
}
],
"source": [
"up_efficiencies = ak.ArrayBuilder()\n",
"\n",
"\n",
"\n",
"for cutoff_energy in range(0,1050,100):\n",
"\tup_nobrem_f = upstream_found[ak.all(upstream_found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\tup_nobrem_l = upstream_lost[ak.all(upstream_lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\n",
"\n",
"\n",
"\tprint(\"\\ncutoff = \",str(cutoff_energy),\"MeV, sample size: \",ak.num(up_nobrem_f,axis=0)+ak.num(up_nobrem_l,axis=0))\n",
"\tprint(\"eff = \",np.round(t_eff(up_nobrem_f,up_nobrem_l),4), \"+/-\", np.round(eff_err(up_nobrem_f, up_nobrem_l),4))\n",
"\n",
"\"\"\"\n",
"we see that a cutoff energy of xxxMeV is ideal because the efficiency drops significantly for higher values\n",
"\"\"\"\n",
"cutoff_energy = 200.0 #MeV\n",
"\n",
"\"\"\"\n",
"better statistics: cutoff=xxxMeV - sample size: xxx events and efficiency=xxxx\n",
"\"\"\"\n",
"up_nobrem_found = upstream_found[ak.all(upstream_found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"up_nobrem_lost = upstream_lost[ak.all(upstream_lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\n",
"print(\"\\nupstream: cutoff energy = 200MeV, 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"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"cutoff = 0 MeV, sample size: 3971\n",
"eff = 0.893 +/- 0.0049\n",
"\n",
"cutoff = 100 MeV, sample size: 3971\n",
"eff = 0.893 +/- 0.0049\n",
"\n",
"cutoff = 200 MeV, sample size: 4634\n",
"eff = 0.8869 +/- 0.0047\n",
"\n",
"cutoff = 300 MeV, sample size: 5096\n",
"eff = 0.8872 +/- 0.0044\n",
"\n",
"cutoff = 400 MeV, sample size: 5414\n",
"eff = 0.886 +/- 0.0043\n",
"\n",
"cutoff = 500 MeV, sample size: 5654\n",
"eff = 0.885 +/- 0.0042\n",
"\n",
"cutoff = 600 MeV, sample size: 5881\n",
"eff = 0.8845 +/- 0.0042\n",
"\n",
"cutoff = 700 MeV, sample size: 6079\n",
"eff = 0.8842 +/- 0.0041\n",
"\n",
"cutoff = 800 MeV, sample size: 6251\n",
"eff = 0.8831 +/- 0.0041\n",
"\n",
"cutoff = 900 MeV, sample size: 6426\n",
"eff = 0.8828 +/- 0.004\n",
"\n",
"cutoff = 1000 MeV, sample size: 6561\n",
"eff = 0.882 +/- 0.004\n",
"\n",
"downstream: cutoff energy = 200MeV, sample size: 4634\n",
"eff = 0.8869 +/- 0.005\n"
]
}
],
"source": [
"down_efficiencies = ak.ArrayBuilder()\n",
"for cutoff_energy in range(0,1050,100):\n",
"\tdown_nobrem_f = downstream_found[ak.all(downstream_found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\tdown_nobrem_l = downstream_lost[ak.all(downstream_lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\n",
"\n",
"\n",
"\tprint(\"\\ncutoff = \",str(cutoff_energy),\"MeV, sample size: \",ak.num(down_nobrem_f,axis=0)+ak.num(down_nobrem_l,axis=0))\n",
"\tprint(\"eff = \",np.round(t_eff(down_nobrem_f,down_nobrem_l),4), \"+/-\", np.round(eff_err(down_nobrem_f, down_nobrem_l),4))\n",
"\n",
"\"\"\"\n",
"we see that a cutoff energy of xxxMeV is ideal because the efficiency drops significantly for higher values\n",
"\"\"\"\n",
"cutoff_energy = 200.0 #MeV\n",
"\n",
"\"\"\"\n",
"better statistics: cutoff=xxxMeV - sample size: xxx events and efficiency=xxxx\n",
"\"\"\"\n",
"down_nobrem_found = downstream_found[ak.all(downstream_found[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"down_nobrem_lost = downstream_lost[ak.all(downstream_lost[\"brem_photons_pe\"]<cutoff_energy,axis=1)]\n",
"\n",
"print(\"\\ndownstream: cutoff energy = 200MeV, sample size:\",ak.num(down_nobrem_found,axis=0)+ak.num(down_nobrem_lost,axis=0))\n",
"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",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"upstream eff = 0.852 +/- 0.004\n",
"downstream eff = 0.84 +/- 0.005\n"
]
}
],
"source": [
"cutoff_energy=200\n",
"\n",
"upstream_brem_found = upstream_found[ak.any(upstream_found[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\n",
"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",
"upstream_brem_lost = upstream_lost[ak.any(upstream_lost[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\n",
"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",
"print(\"upstream eff = \", np.round(t_eff(upstream_brem_found,upstream_brem_lost),3), \"+/-\", np.round(eff_err(upstream_brem_found, upstream_brem_lost),3))\n",
"\n",
"\n",
"downstream_brem_found = downstream_found[ak.any(downstream_found[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\n",
"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",
"downstream_brem_lost = downstream_lost[ak.any(downstream_lost[\"brem_photons_pe\"]>=cutoff_energy,axis=1)]\n",
"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",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"upstream:\n",
"mean energyloss relative to initial energy (found): 0.3207102540525612\n",
"mean energyloss relative to initial energy (lost): 0.5602258293743071\n",
"downstream:\n",
"mean energyloss relative to initial energy (found): 0.17552539358035377\n",
"mean energyloss relative to initial energy (lost): 0.2870828762276071\n"
]
}
],
"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",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABa0AAAJNCAYAAAAyI1mqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACJRUlEQVR4nOzdeVxUZf//8fcAwwAKKCYqivuSu5lWLpUrZqmtVlpmaquaGWVGdxqWhcuvssysrLTy1qzbpc0MTNHMLNes9E4rS8p9BUVwgPP7oy9zOzKjjMzO6/l48KhzzTnX9TnzGYdrPpy5jskwDEMAAAAAAAAAAPiBEF8HAAAAAAAAAABAMYrWAAAAAAAAAAC/QdEaAAAAAAAAAOA3KFoDAAAAAAAAAPwGRWsAAAAAAAAAgN+gaA0AAAAAAAAA8BsUrQEAAAAAAAAAfoOiNQAAAAAAAADAb1C0BgAAAAAAAAD4DYrWAADAoa1bt2r37t2+DgMAAAAAUM5QtAYAAA69+eabWrFiha/DAAAAAACUMxStAQCAzerVq3XvvffqwIEDtrZt27bppptu0v79+30YGQAAAACgvKBoDQCAhyxdulQmk8nuJyYmRpdeeqk+/PBDr4z93nvv2bUfPXpUvXv3Vnh4uF599dUSx1166aWqVq2aWrVqpa+++kqvvvqqevbsqWuuuUZVq1b1aMyBJDMzs0Rui3/WrVvn8JitW7dq2LBhatCggSIjIxUZGalGjRrp/vvv14YNG1yO4cYbb1RkZKSOHTvmdJ877rhDZrPZL/7gMGfOHJlMJv3xxx9eHTc1NVUmk0mHDh1yW59r165VamrqOZ/7QFdYWKj4+Hi99NJLTvfxxHMbCII5/99//7169eql6OhoVaxYUV27dtU333xTYj9X3gNPnDih0aNHKyEhQREREWrTpo0++OADh+O7si8AAAhuYb4OAACAYLVp0yZJ0scff6z4+HgZhqHdu3fr6aef1oABA3TxxRerVatWHh370ksvtbVt3bpVN954o06ePKkVK1aoc+fOJY6rUKGCnnnmGRUVFSktLU0hISH697//rdtvv90jcQa6559/Xl27drVra9GiRYn93njjDY0cOVJNmjTRww8/rObNm8tkMmn79u2aP3++2rdvr19//VUNGjQo9djDhg3TkiVLNG/ePA0fPrzE48ePH9fixYvVp08fVatWzfWTg1Nr167VhAkTdPfdd6tSpUq+DscjVq9erYMHD+qmm27ydSh+J1jzv379el111VW67LLL9P7778swDE2ZMkXdu3fXypUr1aFDhxLHlOY98KabbtL69es1adIkNW7cWPPmzdOAAQNUVFSkgQMHXvC+AAAguFG0BgDAQzZt2qTY2Fj169fP1tahQwcVFBTozjvv1ObNmz1atI6MjNTFF18sSfrggw80bNgwtWrVSgsXLlRCQoLD43788UcNGjRI1atX17XXXquEhAQ999xzev/99/Xuu+/qoosu8ki83nTkyBEVFRW55VwaNWqkK6644pz7fPPNNxo+fLiuu+46/ec//1F4eLjtsW7dumnEiBH66KOPFBkZ6dLYvXv3VkJCgt555x2HRev58+fr1KlTGjZsmEv9ApL0n//8R+3atVOdOnU80n9ubq6ioqI80jec27t3rypUqKCYmJgSj40bN06VKlXSsmXLbLnp0aOH6tevr8cee8zhFdfnew9cunSpMjIybMVnSeratav+/PNPjRkzRrfddptCQ0Nd3hcAAAQ/lgcBAMBDNm7cqDZt2pRo/+uvvyRJTZs2dbnPl156SUuWLHFp7Mcee0wDBgzQHXfcoVWrVjktWEtS5cqVNXHiRC1btkz16tVTp06dtGXLFt16662KjY11etyaNWuUlJSk2NhYVa5cWdddd5127tx5wfuVVt++fdWuXTvNmjVLrVu3VmRkpBITE/X000+rqKjI4TFbt25VjRo11Lt3b7333nvKycm54PFL4/nnn1doaKjeeOMNu4L1mfr3718iLzt37tTAgQMVHx8vi8Wipk2basaMGbbHQ0NDNXjwYG3cuFE//vhjiT5nz55tO88LsWbNGnXv3l3R0dGKiopSx44d9fnnn9vtU7w8xM8//6wBAwYoNjZW1apV09ChQ3X8+PFz9v/111/LZDJp/vz5JR577733ZDKZtH79eqfHF4+9efNm3XTTTYqJiVFsbKzuvPNOHTx4sMT++/fvL1WM5zvv1NRUjRkzRpJUr14925IImZmZHnnuDh48qPvuu0+JiYmyWCyqWrWqOnXqpOXLlzt9bn7++WeZTCZ99NFHtraNGzfKZDKpefPmdvv269fP7hsZkmQYhhYvXqybb77Z6RhnysrKOmcOis9106ZNuuWWW1S5cmW7bxWc77V+dj9bt25V//79FRsbq7i4OCUnJ6ugoEC//PKLrrnmGkVHR6tu3bqaMmVKqeKXpCVLlshkMumrr74q8djMmTNt454r/3l5ebrkkkvUsGFDuxzu27dP1atXV5cuXVRYWFiqeJwtvXEhS+wcPXpUb7/9tnr06KFatWrp999/d7jfN998oy5dutj9MSE6OlpXXXWV1q5dq71797o0riQtXrxYFStWVP/+/e3ahwwZoj179ui7775zeV93vA48+VoCAABuYgAAALc7dOiQIckYNWqUYbVaDavVauzfv9947733jOjoaOOee+65oH4HDhxomM1mY/Hixecd+7bbbjO6detmWCwWY9asWS6PNWLECGP27Nnn3e/pp582QkJCjKFDhxqff/658Z///Mdo2bKlkZiYaOTk5Li8nytq1KhhVKh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q1aJYpTI0eONCIiIowjR47Y2q6++mrjoosushUIDcMwHn300VIVHZ254oorjPj4eLs/JhQUFBgtWrQwatWqZYu1uPBzdl6HDx9uRERE2J2To6J1cdvmzZttbd9//70hyXj33XfPGWPx2I888oh
"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",
"ax[0].set_yticks(np.arange(0,10,1), minor=True)\n",
"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",
"ax[1].set_yticks(np.arange(0,15,1), minor=True)\n",
"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",
"\n",
"\"\"\"\n",
"fig.suptitle(r\"$B\\rightarrow K^\\ast ee$, $p>5$GeV, only photons w/ brem_vtx_z$<9500$mm\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [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z53hcZGamXXnpJOTk5GjdunEqVKqX58+frnnvu8Ug5S7qxY8eqVatWLtvq1q2bJ+6NN97QY489plq1aumJJ55QnTp15HA49O2332rhwoW69dZb9f333+u6666znPeDDz6o5cuXa8GCBRo8eHCe1zMyMrRs2TJ16dJF8fHx7lfOizZt2qTRo0erf//+Klu2rLeL4zcCoV03bNig48ePq0ePHt4uis/x1/2/detW/fGPf9Rtt92muXPnyhijCRMmqE2bNlq3bp2aNm2a5z1Wzt09evTQ1q1bNX78eN1www1asGCB+vTpo5ycHPXt2/eKYwEAgP9j8gMAAPi9HTt2KCYmRt26dXNua9q0qbKysnTffffpq6++8ujkR0REhG688UZJ0qJFi/Tggw8qKSlJS5YsUWJiYr7v+89//qPk5GQlJCTojjvuUGJiosaMGaO5c+dqzpw5Kl++vEfKezWdOHFCOTk5ttSlZs2aatKkSaExn3/+uQYPHqzOnTvrn//8p0JDQ52vtW7dWo8++qjef/99RUREuJV3p06dlJiYqLfffjvfyY+FCxfq3LlzevDBB91Kt6T57bffVLp0aW8XAz7in//8pxo1aqSqVat6LA/63NV35MgRRUZGKjo6Os9rL7zwgsqWLavU1FTnfmnbtq1q1KihESNG5LsCpKhz90cffaTVq1c7JzEkqVWrVvrpp5/01FNP6e6771ZQUJDbsQAAIDBw2ysAAOD3tm/frgYNGuTZfujQIUlS7dq13U7z1Vdf1fLly93Ke8SIEerTp4/uvfderV+/vsCJD0mKjY3Vyy+/rNTUVFWvXl3NmjXTzp071bt3b8XExBT4vo0bN6p9+/aKiYlRbGysOnfurO++++6K46zq2rWrGjVqpFmzZql+/fqKiIhQ5cqVlZKSopycnHzfs2vXLlWsWFGdOnXSu+++q9OnT19x/laMHTtWQUFBeuONN1wmPi7Vq1evPPvlu+++U9++fVWhQgWFhYWpdu3aeu2115yvBwUFqV+/ftq+fbv+85//5EnznXfecdbT03JvI/TVV1+pR48eio6OVkxMjO677z4dP37cJfb48eN6+OGHVblyZYWFhemaa65Rs2bNtGbNGmdaTz31lCSpevXqzlvSfPrpp858duzYoZ49eyo2NtZltUxRbSZJ33//vQYMGKCaNWuqdOnSqlSpkrp27ZqnDXPz2rVrl3r16qWYmBjFxcVp2LBhysrK0t69e9WxY0dFRUWpWrVqmjBhgu1tlevo0aPq06ePYmJiFB8frwceeEAZGRkuMRs3blSbNm0UFRWl0qVL6/bbb9fKlStd8i2oXa2mcWn5v/nmmyLLVNS+zs8333wjh8Oh999/37lt+/btcjgcqlOnjktst27dXFa3GWO0bNky/elPfyow/UsdPHiwyH1gR5/zVF+SpOXLl8vhcOiTTz7J89rrr7/uzLew/X/+/HndfPPNuv766132YVpamhISEtSyZUtlZ2dbKk9Bt5RyOBz68ccfLddL+v02jW+99Zbatm2ra6+9Vj/88EO+cZ9//rlatmzpMiEVFRWlP/7xj9q0aZOOHDniVr6StGzZMpUpU0a9evVy2T5gwAAdPnxYX3zxxRXFFrcveLIvAQAA+zD5AQAA/Nqvv/6qAwcOqH79+srKylJWVpaOHTumuXPnasyYMXrooYd02223uZ3utm3b1Lt370InQHLzrlKlitq3b6/p06dr1qxZ+sc//lHgl++5rr32WnXp0sVlW+6X7CEhIfm+Z9SoUWrRooUqV66shQsX6s0339TBgwfVpk0bnTlzxu04d2zfvl3/93//p1dffVVPPfWUPvjgAzVv3lwvvfSS3n777Xzf06RJE82ZM0chISEaOHCgKlSooF69emnp0qW6cOGCW/k/+uijCg4OVnR0tDp06KCNGze6vJ6dna1169apUaNGqlixouV09+zZo1tvvVW7d+/W5MmTtWLFCnXu3FlDhgzR6NGjnXEPPPCAHA5Hnrru2bNHX375pfr163dVf3HcvXt3XX/99frnP/+pUaNGafny5erQoYMuXrzojElOTtby5cv14osvatWqVXrzzTfVtm1b/frrr5Kkhx56SI8//rgkaenSpdq8ebM2b96sW265xZlGjx49dP311+v999/XzJkznXW20maHDx9WuXLlNH78eKWmpuq1115TcHCwGjdurL179+apU+/evVW/fn0tWbJEAwcO1Kuvvqonn3xSd911lzp37qxly5apdevWevrpp7V06VJb2yrXn/70J91www1asmSJnnnmGS1YsEBPPvmk8/X169erdevWysjI0FtvvaWFCxcqKipKXbt21eLFiy21q5U03CmTVPS+zk+dOnVUsWJFlwmSNWvWKCIiQnv27NHhw4clSVlZWVq/fr3atm3rjMv9otvq5Ic7+6A4fS6XJ/pSly5dVKFCBb3zzjt5Xps9e7ZuueUWJSUlFbr/w8PD9d577+nYsWN64IEHJEk5OTm69957ZYzRwoULLZ9HctPN/Vu7dq0qVaqkhIQExcXFFfn+3377TYsXL9add96phIQEPf744ypbtqwWL16sm266Kd/3ZGZmKiwsLM/23G35TQ4Xde7evXu3ateureBg15tW5K7W3L179xXF5ipuX/DUeQkAANjEAAAA+LFVq1YZSXn+goODzcsvv3zF6WZlZZm+ffuakJAQs2zZsiLzDg8PN1u2bLni/Iry4YcfGklmwoQJLtv37dtnJJl58+a5FeeOQ4cOGUmmRo0a5uTJk87tmZmZJiEhwXTp0qXINNLT083bb79t2rdvb4KDg01MTIzp37+/+fjjj01WVlaB79uxY4d54oknzLJly8yGDRvM22+/bWrXrm2CgoJMamqqMy4tLc1IMvfcc0+eNLKysszFixedfzk5Oc7XOnToYK699lqTkZHh8p7HHnvMhIeHmxMnTji3tWjRwpQvX95kZmY6tw0fPtxIMvv27SuyDfKTkpJiJJnjx4/n+3q
"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",
"a0=ax0.hist2d(up_energyloss_found, up_energy_found, bins=(np.linspace(0,1,70), np.linspace(0,1.5e5,70)), cmap=plt.cm.jet, cmin=1, vmax=15)\n",
"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",
"a1=ax1.hist2d(up_energyloss_lost, up_energy_lost, bins=(np.linspace(0,1,70), np.linspace(0,1.5e5,70)), cmap=plt.cm.jet, cmin=1, vmax=15)\n",
"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",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "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3r171b17d4WFhTlHAGV3TNL88MMP6t+/v6pWraoiRYqoTJky6tKlS7rjlJbX/v371aNHDzkcDhUvXlzDhg1TcnKyDh06pA4dOigkJEQVK1bUhAkTsj0+aWl+/fXX6tatm0JDQ+VwOPTII4/ozJkzGW5z6tSpLPdpmuyOb3b7Nrvtr6/DjR7rjNzIOShJxhgtX75cDzzwQKZ5XOv48eNZHoeszjfJ2jmXG+fRtVasWCGbzab169enW/fOO+84887s+K9Zs0Z33HGHbr31VpfjFxcXp4iICLVo0UIpKSmWypLZo69sNpt++uknt+oVHx+v999/X23atFHZsmX1448/Zhq7detWtWjRwqUzKyQkRHfffbe2bdumkydPupW3JC1fvlxFixZVjx49XJb3799fJ06c0M6dO92Kk278XMjtcwkAAHgWnSYAACBf+f3333Xs2DHVrVtXycnJSk5O1unTpzVv3jyNHTtWjz/+uBo2bOh2urt371bPnj2z7DhJy7t8+fJq166dZsyYoffee0//+Mc/Mv2jfZqyZcuqc+fOLsvS/jjv7++f4TajR49WVFSUypUrp0WLFumf//ynjh8/rtatW+v8+fNux7ljz549+s9//qOpU6fqueee08qVK9W8eXO99tpr+uCDDzLcpnHjxpo7d678/f01YMAAlSpVSj169NCyZct0+fJlt/J/6qmn5Ofnp9DQULVv315btmxxWZ+SkqKNGzeqQYMGKl26tOV0Dx48qLvuuksHDhzQ5MmT9dlnn6lTp04aMmSIxowZ44x79NFHZbPZ0tX14MGD+uqrr9S3b99c+QXyPffcI19fX23evNm5bNOmTWrVqpUSEhL0/vvva9GiRQoJCVGXLl20ZMkSSdLtt9+u0qVLu/xROzY2VkFBQTp48KBOnDghSUpOTtamTZsyfPzXAw88oNtuu01Lly7Viy++qIULF+rZZ591ro+OjtaKFSv06quvau3atfrnP/+pNm3a6Pfff5ckPf7443r66aclScuWLdP27du1fft23XnnnS75dOvWTbfeeqs+/vhjzZo1y/IxkaQTJ06oRIkSeuONN7RmzRq9/fbb8vPzU6NGjXTo0KF0derZs6fq1q2rpUuXasCAAZo6daqeffZZ3XffferUqZOWL1+uVq1a6YUXXtCyZcssHaP7779ft956q/71r39p9OjRWrFihdq3b68rV664vU8la8c3q31rZXt3y5Xdsc7IjZ6DaX8gt9ppYvU4XH++SdavA2ly4zySpM6dO6tUqVKaPXt2unVz5szRnXfeqTp16mR6/Js2baqPPvpIp0+f1qOPPipJSk1N1cMPPyxjjBYtWmT5OpWWZtprw4YNKlOmjCIiIlS8ePFst//zzz+1ZMkS3XvvvYqIiNDTTz+tYsWKacmSJapZs2am2yUlJclut6dbnrbs+g7R7L4bJOnAgQOqUaOG/PxcH6yRNgL1wIEDbsVd60bPhdw6lwAAgIcZAACAfGTt2rVGUrqXn5+fef3113OcbnJysundu7fx9/c3y5cvzzbvwMBAs2PHjhznl51PP/3USDITJkxwWX748GEjycyfP9+tOHf88ssvRpKpXLmyOXv2rHN5UlKSiYiIMJ07d842jfj4ePPBBx+Ydu3aGT8/P+NwOEy/fv3M559/bpKTkzPdbu/
"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",
"a0=ax0.hist2d(down_energyloss_found, down_energy_found, bins=(np.linspace(0,1,70), np.linspace(0,1.5e5,70)), cmap=plt.cm.jet, cmin=1, vmax=20)\n",
"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",
"a1=ax1.hist2d(down_energyloss_lost, down_energy_lost, bins=(np.linspace(0,1,70), np.linspace(0,1.5e5,70)), cmap=plt.cm.jet, cmin=1, vmax=20)\n",
"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",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABk4AAAJOCAYAAADxgPt3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADfLElEQVR4nOzdd3gU1f7H8c+mbUJIltASQgfpXTqoAenSLBRBQxW5AiICFlSqCioIKNiuVw3SVXoRIVTpXQ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I4dO5LEu3LflqSHH35Ys2bN0tixY/X111+rfv366tGjR7L33LTEAgCArOWV1RkAAABYuXKl/f99+vRRs2bN1KdPnzSnc/ToUcXGxurxxx9XWFhYinF//fWX8uXLdydZdbv9+/fLZrOpU6dO9mWNGzdWXFycHn/8cR04cEA1a9bM0P37+fmpcuXKkqQFCxaof//+qlmzphYtWqTQ0NAk2/j7+2vChAlKSEjQpEmT5OHhoblz5+rRRx/NsHxmhT///FMJCQkqXLhwutOqUKGCGjVqlOL6bdu2adCgQWrfvr2++uor+fj42Nfdf//9Gjx4sL788kv5+fmled/t2rVTaGioPv30Uw0aNCjJ+vnz5+v69evq379/mtPOSbLT5x5Z76uvvlK9evVUunTpDEmf6y1rnD17Vv7+/goMDEyybvTo0SpQoIDWrFljPzctW7ZUuXLlNHLkyCQ9T5zdt6W/e22uW7dO8+bNU48ePSRJzZs31y+//KLnnntO3bt3l6enZ5pjAQBA1qPHCQAAyBBbt25V69atZbPZFBQUpPbt2+vYsWMZtr8+ffronnvukSR1795dFotFzZo1sw+1sn//fnXp0kVBQUEqX768Qz5btGihgIAA5cuXT02aNNGqVasc0k5M49ChQ+ratatsNpsKFiyo4cOHKy4uTj/99JPatm2rgIAAlSlTRm+99ZbL+d63b59q166dZPmvv/4qSapSpcodlIY0bdo0LV26NE37HzlypHr06KHHHntMmzdvTrbRRJK+//573X333dq/f78eeOAB9evXT6+//rrat2/vdEgbV68Ld18/HTt2VL169fTxxx+rVq1a8vPzU8mSJTV27FglJCQku82hQ4dUrFgxtWvXTp9//rmuXLlyx/t3ZuLEifL09NRHH33k0GjyT127dk1yTo4dO6aePXuqaNGislqtqlKlit577z2HGE9PT/Xu3Vv79u3T999/nyTdzz77zH6cGS3xs3TgwAE9/PDDCgwMlM1m0+OPP64LFy7Y4y5cuKAnn3xSJUuWlNVqVZEiRdS0aVNFRkba03nuueckSWXLlrUPo7Np0yaH/aT0uXel3I4fP66+ffuqQoUKypcvn4oXL66OHTsmKcOMuj+4WlaJzp07px49eshmsyk4OFj9+vVTdHR0kjhn9zxnZevKPfOf+T9y5Eiq+XJ2rpNz5MgRWSwWffnll/Zl+/btk8ViUbVq1RxiO3Xq5NCjTpKMMVqyZIkeeeSRFPfxT6dPn071HLjjesvIvzOStHTpUlksFq1fvz7Jug8++MC+75TO/5o1a1SnTh3dddddDucvKipKISEhatasmeLj413OT0pDYVksFp08eTJNx3bx4kV98sknatmypUqUKKGff/452bht27apWbNmDg1aAQEBuu+++7R9+3adPXs2TfuVpCVLlih//vzq2rWrw/K+ffvqzJkz2rVrV5pj03stZPS1BABAnmEAAADcbOzYscbDw8P069fPrFq1ynz11VemRo0apmTJkubKlSsZss/jx4+b9957z0gyEydONDt27DBHjhwxY8eONZJM6dKlzQsvvGDWrVtnli5daowxZtOmTcbb29vUrVvXLFy40CxdutS0bt3aWCwWs2DBAofjkWQqVapkXn31VbNu3Trz/PPPG0lmyJAhpnLlyubdd98169atM3379jWSzKJFi5zm+ffffzeSzNChQ01sbKyJjY01586dM59//rkJCAgwTzzxxB2XR8+ePY23t7dZsmSJ0/13797d3H///cZqtZqPP/7YadqnT582K1asMMYYM3jwYPPZZ5+ZuLg4ExERYW7evJnidq5eFxlx/RQrVsz4+/ubKlWqmNmzZ5u1a9eaRx991EhK8ZivX79u5s6dazp27Gh8fHyMr6+v6dKli1m0aJGJiYlxab8bN240kkzRokWNp6enCQgIMK1btzbffvutPSYuLs74+fmZxo0bp+mYjhw5Ymw2m6lRo4b5/PPPzdq1a82IESOMh4eHGTdunEPssWPHjMViMcOGDUuShiTz4osvpmnfiRI/GxcuXEh2fbVq1UxYWFiS+NKlS5vnnnvOfPPNN2bq1KnG39/f1KlTx379tGnTxhQpUsT8+9//Nps2bTJLly41Y8aMsX8uT58+bZ5++mkjySxevNjs2LHD7Nixw0RHRyfZz+2fe1fLbfPmzWbEiBHmq6++Mps3bzZLliwxDz74oPHz8zP//e9/kxyTu+8PrpbVP/c/ZswYs27dOjN16lRjtVpN3759HdJ05Z6XWtm6es9MS76cneuUFCtWzDz55JP292+88Ybx8/Mzksxvv/1mjDEmNjbWBAYGmueff95h261btxpJ5ujRo249B+m53jLqOkoUGxtrihYtah577LEk6xo0aGDuvvtuY0zq5//o0aMmICDAPPzww8YYY+Lj4839999vihYtas6cOeNyXowx9nQTXxs2bDDFixc3ISEh9s9xaq5du2YWLFhgOnXqZHx8fIyfn5955JFHzJdffmlu3LiR7DY+Pj6mV69eSZb36NHDSDLffPONMca1+3aiRo0amfr16ydZfvjwYSPJfPTRR2mOTe+1kNHXEgAAeQUNJwAAwK1WrFhhJJm33nrLYfnRo0eNJDNnzpwk27Rt29b4+/sn+3r99ddd3nfilx1ffvmlfVniFwhjxoxJEt+oUSNTtGhRhy/j4+LiTPXq1U2JEiVMQkK
"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",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20,6))\n",
"\n",
"a0=ax0.hist2d(up_energyloss_found, up_residual_found, bins=(np.linspace(0,1,80), np.linspace(0,1.5e5,80)), cmap=plt.cm.jet, cmin=1, vmax=20)\n",
"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",
"a1=ax1.hist2d(up_energyloss_lost, up_residual_lost, bins=(np.linspace(0,1,80), np.linspace(0,1.5e5,80)), cmap=plt.cm.jet, cmin=1, vmax=20) \n",
"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",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABk4AAAJOCAYAAADxgPt3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADYBklEQVR4nOzdd3hUxf7H8c+mh5AsoSWGDtK7dFAD0iWAhSJoqCJXQETAgkpVQQQFBdvPewVFEFR6lSpIlSqCBbiCgBBAhASQQBLm9wdkL0uS3U2y6e/X8+wDe873zJlTcnZmZ2fGYowxAgAAAAAAAAAAgDyyOgMAAAAAAAAAAADZBQ0nAAAAAAAAAAAAt9BwAgAAAAAAAAAAcAsNJwAAAAAAAAAAALfQcAIAAAAAAAAAAHALDScAAAAAAAAAAAC30HACAAAAAAAAAABwCw0nAAAAAAAAAAAAt9BwAgAAAAAAAAAAcAsNJwAAAAAAAAAAALfQcAIAADJUr169NHPmzKzOBly0f/9+HT9+PKuzAQAAAABAlqHhBAAAADb/93//p/Xr12d1NgAAAAAAyDI0nAAAgGxt3rx5qlq1qvz9/WWxWLRv376szpJDK1askMVisXsFBQWpTp06+uqrrzJt/59//rnd8gsXLqht27by8fHR9OnT7dZt2rRJ/fr109mzZ23Lfv75Zz3yyCM6c+ZMhuc5J/nuu++SXN/E1/bt25PE79+/X3379lW5cuXk7+8vf39/lS9fXv3799euXbvSlIeHH35Y/v7+unjxYooxjz/+uLy9vVN9/WbOnGl3TH5+fgoNDVWzZs00YcIEu3skJ9q6davGjBnj8NzlBWPGjJHFYtFff/3llvTywnlNSEhQ0aJFNWXKlBRj3H1ec4rcfP1/+OEHtW7dWoGBgcqfP7+aNWumLVu2JIlLzWfD5cuXNWTIEIWFhcnPz0+1atXS3Llzk91/amIBAIB70XACAADcLiIiQgUKFFCBAgU0Z84cDRgwwPb+zTffdDmdc+fOKTIyUuXKldOqVau0bds2VahQIQNznn579uyRJC1evFjbtm3T1q1b9cknn+jKlSvq1q2b9u/fnyn7r1Onjm3Z/v37VbduXe3du1fr16/XoEGD7LapU6eOQkJCVKNGDa1bt07Tp09Xy5Yt1aZNGxUpUiRD85tTjR8/Xtu2bbN7VatWzS7m448/Vp06dbRjxw49++yzWrZsmZYvX64hQ4bo4MGDqlevnv773/+met99+/ZVbGys5syZk+z66OhoLVy4UBEREQoJCUnT8c2YMUPbtm3TmjVr9P7776tWrVqaOHGiKleurLVr16Ypzexg69atGjt2bK78gjcr5YXzumnTJp07d06PPPJIVmcl28mt13/nzp26//77dfXqVc2aNUuzZs1SbGysmjdvrm3btiW7jSufDY888og+++wzjR49WitXrlS9evXUrVu3ZJ/pqYkFAADu5ZXVGQAAALnPsmXLbP/v1auXmjZtql69eqU6nUOHDikuLk5PPPGEwsPDU4z7559/lC9fvrRk1e327Nkjq9WqDh062JY1atRI8fHxeuKJJ7R3717VqFEjQ/fv7++vSpUqSZLmzp2rvn37qkaNGpo/f77CwsKSbBMQEKBx48bpxo0bmjBhgjw8PDR79mw99thjGZbPrPD333/rxo0bKly4cLrTKl++vBo2bJji+i1btmjAgAFq166dvvnmG/n4+NjWPfDAAxo4cKC+/vpr+fv7p3rfbdu2VVhYmD799FMNGDAgyfovv/xSV69eVd++fVOddqJq1aqpbt26tvePPvqonnvuOd1777165JFHdPjw4TQ3yuQU2em5gqz3zTffqG7duipVqlSG7YN7LvOdPn1aAQEBCgoKSrJu5MiRKlCggFatWmW7Li1atFDZsmU1fPjwZHueOPtsWLFihdasWaM5c+aoW7dukqRmzZrpjz/+0PPPP6+uXbvK09Mz1bEAAMD96HECAABcsnnzZrVq1UpW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NK+99ppZs2aNeeGFF4wkM2jQIFOpUiXz3nvvmTVr1pjevXsbSWb+/PlO8/zXX38ZSWbw4MEmLi7OxMXFmTNnzpjPP//cBAYGmieffDLN56N79+7G29vbLFy40On+u3btah544AHj6+trPvnkE6dpnzhxwixdutQYY8zAgQPNjBkzTHx8vJk5c6a5fv16itu5el9kxP1z1113mYCAAFO5cmUza9Yss3r1avPYY48ZSSke89WrV83s2bNN+/btjY+Pj/Hz8zOdOnUy8+fPN7GxsS7td8OGDUaSKVq0qPH09DSBgYGmVatW5vvvv7fFxMfHG39/f9OoUaNUHdPBgweN1Wo11atXN59//rlZvXq1GTZsmPHw8DBjxoyxiz18+LCxWCxmyJAhSdKQZF566aVU7TvRjBkzjCSzc+fOZNdfvnzZeHp6mubNmxtjXP+bM+bmNXvqqads7998803j7+9vJJk///zTGGNMXFycCQoKMi+88IIxxv5vddSoUWbNmjXmnXfeMb6+vqZ379526bdu3doUKVLE/N///Z/57rvvzKJFi8yoUaNs+Thx4oR55plnjCSzYMECs23bNrNt2zYTHR3t8Lni6nXZuHGjGTZsmPnmm2/Mxo0bzcKFC81DDz1k/P39za+//mqLy6jnz+3H8Pzzz5tvv/3WvPPOOyYgIMDUrl3b7m/Z1fPqyvV1dF5Tc4+481qnJC33oDHGbN682Ugyhw4dcvs1SM89l1H3UuJ5KFq0qHn88ceTrKtfv7655557jDHOr/+hQ4dMYGCgeeSRR4wxxiQkJJgHHnjAFC1a1Jw6dcqlvBhjbOkmvtavX2+KFStmQkNDbfty5MqVK2bu3LmmQ4cOxsfHx/j7+5tHH33UfP311+batWvJbuPj42N69OiRZHm3bt2MJPPtt9/alrny2WCMMQ0bNjT16tVLkuaBAwe
"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",
"a0=ax0.hist2d(down_energyloss_found, down_residual_found, bins=(np.linspace(0,1,80), np.linspace(0,1.5e5,80)), cmap=plt.cm.jet, cmin=1, vmax=20)\n",
"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",
"a1=ax1.hist2d(down_energyloss_lost, down_residual_lost, bins=(np.linspace(0,1,80), np.linspace(0,1.5e5,80)), cmap=plt.cm.jet, cmin=1, vmax=20) \n",
"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, 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
}