Projektpraktikum/notebooks/trackinglosses_energy.ipynb

1369 lines
412 KiB
Plaintext
Raw Normal View History

2024-01-15 16:46:25 +01:00
{
"cells": [
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 3,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [],
"source": [
2024-04-15 10:12:54 +02:00
"import uproot\n",
2024-01-15 16:46:25 +01:00
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from mpl_toolkits import mplot3d\n",
"import awkward as ak\n",
"from scipy.optimize import curve_fit\n",
2024-02-16 11:27:21 +01:00
"import mplhep\n",
2024-04-15 10:12:54 +02:00
"\n",
2024-02-16 11:27:21 +01:00
"mplhep.style.use([\"LHCbTex2\"])\n",
"plt.rcParams[\"savefig.dpi\"] = 600\n",
2024-01-15 16:46:25 +01:00
"%matplotlib inline"
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 4,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [
{
2024-01-17 15:59:39 +01:00
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-15 10:12:54 +02:00
"31836 6689\n",
"38525\n"
2024-01-17 15:59:39 +01:00
]
2024-01-15 16:46:25 +01:00
}
],
"source": [
2024-01-26 11:34:42 +01:00
"# file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n",
2024-01-18 16:06:16 +01:00
"file = uproot.open(\n",
2024-04-15 10:12:54 +02:00
" \"/work/cetin/LHCb/reco_tuner/data/tracking_losses_ntuple_B_upstream.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\"\n",
2024-01-18 16:06:16 +01:00
")\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-16 21:48:53 +01:00
"# selektiere nur elektronen von B->K*ee\n",
2024-01-15 16:46:25 +01:00
"allcolumns = file.arrays()\n",
2024-04-15 10:12:54 +02:00
"found = allcolumns[\n",
" (allcolumns.isElectron) & (~allcolumns.lost) & (allcolumns.fromB)\n",
"] # B: 9056\n",
"lost = allcolumns[\n",
" (allcolumns.isElectron) & (allcolumns.lost) & (allcolumns.fromB)\n",
"] # B: 1466\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"electrons = allcolumns[(allcolumns.isElectron) & (allcolumns.fromB)]\n",
"\n",
"print(ak.num(found, axis=0), ak.num(lost, axis=0))\n",
2024-01-26 11:34:42 +01:00
"print(ak.num(electrons, axis=0))\n",
2024-01-16 21:48:53 +01:00
"# ak.count(found, axis=None)"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 5,
2024-01-15 16:46:25 +01:00
"metadata": {},
2024-01-18 16:06:16 +01:00
"outputs": [
{
"data": {
"text/html": [
"<pre>{all_endvtx_types_length: 7,\n",
" all_endvtx_types: [101, 101, 101, 101, 101, 101, 0],\n",
" all_endvtx_x_length: 7,\n",
" all_endvtx_x: [-6.97, -52.9, -52.9, ..., -1.71e+03, -2.14e+03, -3.57e+03],\n",
" all_endvtx_y_length: 7,\n",
" all_endvtx_y: [-0.89, -6.75, -6.75, -7.08, -66.1, -72.6, -39.5],\n",
" all_endvtx_z_length: 7,\n",
" all_endvtx_z: [112, 859, 859, 895, 8.7e+03, 9.68e+03, 1.26e+04],\n",
" brem_photons_pe_length: 6,\n",
" brem_photons_pe: [2.62e+03, 812, 2.54e+03, 1.86e+03, 3.12e+03, 241],\n",
" brem_photons_px_length: 6,\n",
" brem_photons_px: [-161, -49.7, -156, -114, -1.18e+03, -101],\n",
" brem_photons_py_length: 6,\n",
" brem_photons_py: [-18.9, -6.92, -21.6, -16.8, -20.9, -0.26],\n",
" brem_photons_pz_length: 6,\n",
" brem_photons_pz: [2.61e+03, 810, 2.54e+03, 1.86e+03, 2.89e+03, 219],\n",
" brem_vtx_x_length: 6,\n",
" brem_vtx_x: [-6.97, -52.9, -52.9, -55.2, -1.71e+03, -2.14e+03],\n",
" brem_vtx_y_length: 6,\n",
" ...}\n",
"---------------------------------------------------------------------------\n",
"type: {\n",
" all_endvtx_types_length: int32,\n",
" all_endvtx_types: var * float32,\n",
" all_endvtx_x_length: int32,\n",
" all_endvtx_x: var * float32,\n",
" all_endvtx_y_length: int32,\n",
" all_endvtx_y: var * float32,\n",
" all_endvtx_z_length: int32,\n",
" all_endvtx_z: var * float32,\n",
" brem_photons_pe_length: int32,\n",
" brem_photons_pe: var * float32,\n",
" brem_photons_px_length: int32,\n",
" brem_photons_px: var * float32,\n",
" brem_photons_py_length: int32,\n",
" brem_photons_py: var * float32,\n",
" brem_photons_pz_length: int32,\n",
" brem_photons_pz: var * float32,\n",
" brem_vtx_x_length: int32,\n",
" brem_vtx_x: var * float32,\n",
" brem_vtx_y_length: int32,\n",
" brem_vtx_y: var * float32,\n",
" brem_vtx_z_length: int32,\n",
" brem_vtx_z: var * float32,\n",
" endvtx_type: int32,\n",
" endvtx_x: float64,\n",
" endvtx_y: float64,\n",
" endvtx_z: float64,\n",
" energy: float64,\n",
" eta: float64,\n",
" event_count: int32,\n",
" fromB: bool,\n",
" fromD: bool,\n",
" fromDecay: bool,\n",
" fromHadInt: bool,\n",
" fromPV: bool,\n",
" fromPairProd: bool,\n",
" fromSignal: bool,\n",
" fromStrange: bool,\n",
2024-04-15 10:12:54 +02:00
" ideal_state_5000_qop: float64,\n",
" ideal_state_5000_tx: float64,\n",
" ideal_state_5000_ty: float64,\n",
" ideal_state_5000_x: float64,\n",
" ideal_state_5000_y: float64,\n",
" ideal_state_5000_z: float64,\n",
2024-01-18 16:06:16 +01:00
" ideal_state_770_qop: float64,\n",
" ideal_state_770_tx: float64,\n",
" ideal_state_770_ty: float64,\n",
" ideal_state_770_x: float64,\n",
" ideal_state_770_y: float64,\n",
" ideal_state_770_z: float64,\n",
" ideal_state_9410_qop: float64,\n",
" ideal_state_9410_tx: float64,\n",
" ideal_state_9410_ty: float64,\n",
" ideal_state_9410_x: float64,\n",
" ideal_state_9410_y: float64,\n",
" ideal_state_9410_z: float64,\n",
" isElectron: bool,\n",
" isKaon: bool,\n",
" isMuon: bool,\n",
" isPion: bool,\n",
" isProton: bool,\n",
" lost: bool,\n",
" lost_in_track_fit: bool,\n",
2024-02-16 11:27:21 +01:00
" match_chi2: float32,\n",
" match_dSlope: float32,\n",
" match_dSlopeY: float32,\n",
" match_distX: float32,\n",
" match_distY: float32,\n",
2024-01-18 16:06:16 +01:00
" match_fraction: float32,\n",
2024-02-16 11:27:21 +01:00
" match_teta2: float32,\n",
2024-04-15 10:12:54 +02:00
" match_yCorr: float32,\n",
" match_yCorr_def: float32,\n",
" match_zMag: float32,\n",
" match_zMag_def: float32,\n",
2024-01-18 16:06:16 +01:00
" mcp_idx: int32,\n",
" mother_id: int32,\n",
" mother_key: int32,\n",
" originvtx_type: int32,\n",
" originvtx_x: float64,\n",
" originvtx_y: float64,\n",
" originvtx_z: float64,\n",
" p: float64,\n",
2024-02-16 11:27:21 +01:00
" p_end_scifi: float64,\n",
2024-01-27 14:02:41 +01:00
" p_end_ut: float64,\n",
" p_end_velo: float64,\n",
2024-04-15 10:12:54 +02:00
" p_upstream: float64,\n",
2024-01-18 16:06:16 +01:00
" phi: float64,\n",
" pid: int32,\n",
" pt: float64,\n",
" px: float64,\n",
" py: float64,\n",
" pz: float64,\n",
" rad_length_frac: float64,\n",
" scifi_hit_pos_x_length: int32,\n",
" scifi_hit_pos_x: var * float32,\n",
" scifi_hit_pos_y_length: int32,\n",
" scifi_hit_pos_y: var * float32,\n",
" scifi_hit_pos_z_length: int32,\n",
" scifi_hit_pos_z: var * float32,\n",
" track_p: float64,\n",
" track_pt: float64,\n",
" tx: float64,\n",
" ty: float64,\n",
" ut_hit_pos_x_length: int32,\n",
" ut_hit_pos_x: var * float32,\n",
" ut_hit_pos_y_length: int32,\n",
" ut_hit_pos_y: var * float32,\n",
" ut_hit_pos_z_length: int32,\n",
" ut_hit_pos_z: var * float32,\n",
" velo_hit_pos_x_length: int32,\n",
" velo_hit_pos_x: var * float32,\n",
" velo_hit_pos_y_length: int32,\n",
" velo_hit_pos_y: var * float32,\n",
" velo_hit_pos_z_length: int32,\n",
" velo_hit_pos_z: var * float32,\n",
" velo_track_idx: int32,\n",
" velo_track_tx: float64,\n",
" velo_track_ty: float64,\n",
" velo_track_x: float64,\n",
" velo_track_y: float64,\n",
" velo_track_z: float64\n",
"}</pre>"
],
"text/plain": [
"<Record {all_endvtx_types_length: 7, ...} type='{all_endvtx_types_length: i...'>"
]
},
2024-04-15 10:12:54 +02:00
"execution_count": 5,
2024-01-18 16:06:16 +01:00
"metadata": {},
"output_type": "execute_result"
}
],
2024-01-15 16:46:25 +01:00
"source": [
2024-01-18 16:06:16 +01:00
"electrons[0]"
2024-01-17 15:59:39 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 6,
2024-01-17 15:59:39 +01:00
"metadata": {},
2024-01-18 16:06:16 +01:00
"outputs": [
{
"data": {
"text/html": [
"<pre>{lost: True,\n",
" rad_length_frac: 0.129,\n",
" energy: 1.17e+04,\n",
" photon_length: 6,\n",
" brem_photons_pe: [2.62e+03, 812, 2.54e+03, 1.86e+03, 3.12e+03, 241],\n",
" brem_vtx_x: [-6.97, -52.9, -52.9, -55.2, -1.71e+03, -2.14e+03],\n",
" brem_vtx_z: [112, 859, 859, 895, 8.7e+03, 9.68e+03]}\n",
"---------------------------------------------------------------------\n",
"type: {\n",
" lost: bool,\n",
" rad_length_frac: float64,\n",
" energy: float64,\n",
" photon_length: int64,\n",
" brem_photons_pe: var * float64,\n",
" brem_vtx_x: var * float64,\n",
" brem_vtx_z: var * float64\n",
"}</pre>"
],
"text/plain": [
"<Record {lost: True, rad_length_frac: ..., ...} type='{lost: bool, rad_leng...'>"
]
},
2024-04-15 10:12:54 +02:00
"execution_count": 6,
2024-01-18 16:06:16 +01:00
"metadata": {},
"output_type": "execute_result"
}
],
2024-01-17 15:59:39 +01:00
"source": [
"lost_e = electrons[\"lost\"]\n",
"e = electrons[\"energy\"]\n",
"brem_pe = electrons[\"brem_photons_pe\"]\n",
"brem_z = electrons[\"brem_vtx_z\"]\n",
"brem_x = electrons[\"brem_vtx_x\"]\n",
"length = electrons[\"brem_vtx_z_length\"]\n",
2024-01-18 16:06:16 +01:00
"rad_length = electrons[\"rad_length_frac\"]\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"brem = ak.ArrayBuilder()\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"for itr in range(ak.num(electrons, axis=0)):\n",
" brem.begin_record()\n",
" brem.field(\"lost\").boolean(lost_e[itr])\n",
2024-01-18 16:06:16 +01:00
" brem.field(\"rad_length_frac\").append(rad_length[itr])\n",
2024-01-16 21:48:53 +01:00
" # [:,\"energy\"] energy\n",
2024-01-17 15:59:39 +01:00
" brem.field(\"energy\").append(e[itr])\n",
2024-01-16 21:48:53 +01:00
" # [:,\"photon_length\"] number of vertices\n",
2024-01-17 15:59:39 +01:00
" brem.field(\"photon_length\").integer(length[itr])\n",
2024-01-16 21:48:53 +01:00
" # [:,\"brem_photons_pe\",:] photon energy\n",
2024-01-17 15:59:39 +01:00
" brem.field(\"brem_photons_pe\").append(brem_pe[itr])\n",
2024-01-16 21:48:53 +01:00
" # [:,\"brem_vtx_z\",:] brem vtx z\n",
2024-01-17 15:59:39 +01:00
" brem.field(\"brem_vtx_x\").append(brem_x[itr])\n",
" brem.field(\"brem_vtx_z\").append(brem_z[itr])\n",
" brem.end_record()\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-18 16:06:16 +01:00
"brem = ak.Array(brem)\n",
"brem[0]"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 7,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [],
"source": [
"photon_cut = 0\n",
2024-02-16 11:27:21 +01:00
"photon_cut_ratio = 0.1\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"cut_brem = ak.ArrayBuilder()\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"for itr in range(ak.num(brem, axis=0)):\n",
" cut_brem.begin_record()\n",
2024-01-18 16:06:16 +01:00
" cut_brem.field(\"event_id\").integer(itr)\n",
2024-01-17 15:59:39 +01:00
" cut_brem.field(\"lost\").boolean(brem[itr, \"lost\"])\n",
2024-01-18 16:06:16 +01:00
" cut_brem.field(\"rad_length_frac\").real(brem[itr, \"rad_length_frac\"])\n",
2024-01-17 15:59:39 +01:00
" cut_brem.field(\"energy\").real(brem[itr, \"energy\"])\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" ph_length = brem[itr, \"photon_length\"]\n",
2024-01-26 11:34:42 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" tmp_energy = brem[itr, \"energy\"]\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" cut_brem.field(\"brem_photons_pe\")\n",
" cut_brem.begin_list()\n",
" for jentry in range(brem[itr, \"photon_length\"]):\n",
2024-02-16 11:27:21 +01:00
" if (brem[itr, \"brem_vtx_z\", jentry] > 9410\n",
" or brem[itr, \"brem_photons_pe\", jentry] < photon_cut\n",
" or brem[itr, \"brem_photons_pe\",\n",
" jentry] < photon_cut_ratio * tmp_energy):\n",
2024-01-17 15:59:39 +01:00
" ph_length -= 1\n",
2024-01-15 16:46:25 +01:00
" continue\n",
" else:\n",
2024-01-17 15:59:39 +01:00
" cut_brem.real(brem[itr, \"brem_photons_pe\", jentry])\n",
" tmp_energy -= brem[itr, \"brem_photons_pe\", jentry]\n",
" cut_brem.end_list()\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" tmp_energy = brem[itr, \"energy\"]\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" cut_brem.field(\"brem_vtx_x\")\n",
" cut_brem.begin_list()\n",
" for jentry in range(brem[itr, \"photon_length\"]):\n",
2024-02-16 11:27:21 +01:00
" if (brem[itr, \"brem_vtx_z\", jentry] > 9410\n",
" or brem[itr, \"brem_photons_pe\", jentry] < photon_cut\n",
" or brem[itr, \"brem_photons_pe\",\n",
" jentry] < photon_cut_ratio * tmp_energy):\n",
2024-01-15 16:46:25 +01:00
" continue\n",
" else:\n",
2024-01-17 15:59:39 +01:00
" cut_brem.real(brem[itr, \"brem_vtx_x\", jentry])\n",
" tmp_energy -= brem[itr, \"brem_photons_pe\", jentry]\n",
" cut_brem.end_list()\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" tmp_energy = brem[itr, \"energy\"]\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" cut_brem.field(\"brem_vtx_z\")\n",
" cut_brem.begin_list()\n",
" for jentry in range(brem[itr, \"photon_length\"]):\n",
2024-02-16 11:27:21 +01:00
" if (brem[itr, \"brem_vtx_z\", jentry] > 9410\n",
" or brem[itr, \"brem_photons_pe\", jentry] < photon_cut\n",
" or brem[itr, \"brem_photons_pe\",\n",
" jentry] < photon_cut_ratio * tmp_energy):\n",
2024-01-15 16:46:25 +01:00
" continue\n",
" else:\n",
2024-01-17 15:59:39 +01:00
" cut_brem.real(brem[itr, \"brem_vtx_z\", jentry])\n",
" tmp_energy -= brem[itr, \"brem_photons_pe\", jentry]\n",
" cut_brem.end_list()\n",
2024-01-26 11:34:42 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" cut_brem.field(\"photon_length\").integer(ph_length)\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" cut_brem.end_record()\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"ntuple = ak.Array(cut_brem)"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 8,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [
{
2024-01-17 15:59:39 +01:00
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-15 10:12:54 +02:00
"48551\n",
"38525\n"
2024-01-17 15:59:39 +01:00
]
},
2024-01-15 16:46:25 +01:00
{
"data": {
"text/html": [
2024-01-18 16:06:16 +01:00
"<pre>{event_id: 0,\n",
" lost: True,\n",
" rad_length_frac: 0.129,\n",
" energy: 1.17e+04,\n",
2024-02-16 11:27:21 +01:00
" brem_photons_pe: [2.62e+03, 2.54e+03, 1.86e+03, 3.12e+03],\n",
" brem_vtx_x: [-6.97, -52.9, -55.2, -1.71e+03],\n",
" brem_vtx_z: [112, 859, 895, 8.7e+03],\n",
" photon_length: 4}\n",
"-----------------------------------------------------------\n",
2024-01-18 16:06:16 +01:00
"type: {\n",
" event_id: int64,\n",
" lost: bool,\n",
" rad_length_frac: float64,\n",
" energy: float64,\n",
" brem_photons_pe: var * float64,\n",
" brem_vtx_x: var * float64,\n",
" brem_vtx_z: var * float64,\n",
" photon_length: int64\n",
"}</pre>"
],
"text/plain": [
"<Record {event_id: 0, lost: True, ...} type='{event_id: int64, lost: bool, ...'>"
]
},
2024-04-15 10:12:54 +02:00
"execution_count": 8,
2024-01-18 16:06:16 +01:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"print(ak.sum(ak.num(ntuple[\"brem_photons_pe\"], axis=1)))\n",
2024-01-26 11:34:42 +01:00
"print(ak.num(ntuple, axis=0))\n",
2024-01-18 16:06:16 +01:00
"ntuple[0]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 9,
2024-01-18 16:06:16 +01:00
"metadata": {},
"outputs": [],
"source": [
"# nulltuple = ntuple[:7000]\n",
"# onetuple = ntuple[7000:14000]\n",
"# twotuple = ntuple[14000:21000]\n",
"# threetuple = ntuple[21000:28000]\n",
"# fourtuple = ntuple[28000:35000]\n",
"# fivetuple = ntuple[35000:42000]\n",
"# sixtuple = ntuple[42000:49000]\n",
"# seventuple = ntuple[49000:]\n",
"\n",
"# ntuple.nbytes"
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 10,
2024-01-18 16:06:16 +01:00
"metadata": {},
"outputs": [],
"source": [
"# cut = \"tenCut\"\n",
"# tree = \"Tree10\"\n",
"# with uproot.update(\"trackinglosses_B_photon_cuts.root\") as outFile:\n",
"# #outFile[\"README\"] = \"The Cuts are placed on the photons. noCut: 0*E, first: 0.05*E, second: 0.1*E, etc.\"\n",
"# outFile.mktree(tree, {cut + \"_event_id\": ntuple[\"event_id\"].type, cut + \"_lost\": ntuple[\"lost\"].type, cut + \"_rad_length_frac\": ntuple[\"rad_length_frac\"].type, cut + \"_energy\": ntuple[\"energy\"].type, cut + \"_brem_photons_pe\": ntuple[\"brem_photons_pe\"].type, cut + \"_brem_vtx_x\": ntuple[\"brem_vtx_x\"].type, cut + \"_brem_vtx_z\": ntuple[\"brem_vtx_z\"].type, cut + \"_photon_length\": ntuple[\"photon_length\"].type} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": nulltuple[\"event_id\"], cut + \"_lost\": nulltuple[\"lost\"], cut + \"_rad_length_frac\": nulltuple[\"rad_length_frac\"], cut + \"_energy\": nulltuple[\"energy\"], cut + \"_brem_photons_pe\": nulltuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": nulltuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": nulltuple[\"brem_vtx_z\"], cut + \"_photon_length\": nulltuple[\"photon_length\"]} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": onetuple[\"event_id\"], cut + \"_lost\": onetuple[\"lost\"], cut + \"_rad_length_frac\": onetuple[\"rad_length_frac\"], cut + \"_energy\": onetuple[\"energy\"], cut + \"_brem_photons_pe\": onetuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": onetuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": onetuple[\"brem_vtx_z\"], cut + \"_photon_length\": onetuple[\"photon_length\"]} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": twotuple[\"event_id\"], cut + \"_lost\": twotuple[\"lost\"], cut + \"_rad_length_frac\": twotuple[\"rad_length_frac\"], cut + \"_energy\": twotuple[\"energy\"], cut + \"_brem_photons_pe\": twotuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": twotuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": twotuple[\"brem_vtx_z\"], cut + \"_photon_length\": twotuple[\"photon_length\"]} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": threetuple[\"event_id\"], cut + \"_lost\": threetuple[\"lost\"], cut + \"_rad_length_frac\": threetuple[\"rad_length_frac\"], cut + \"_energy\": threetuple[\"energy\"], cut + \"_brem_photons_pe\": threetuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": threetuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": threetuple[\"brem_vtx_z\"], cut + \"_photon_length\": threetuple[\"photon_length\"]} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": fourtuple[\"event_id\"], cut + \"_lost\": fourtuple[\"lost\"], cut + \"_rad_length_frac\": fourtuple[\"rad_length_frac\"], cut + \"_energy\": fourtuple[\"energy\"], cut + \"_brem_photons_pe\": fourtuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": fourtuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": fourtuple[\"brem_vtx_z\"], cut + \"_photon_length\": fourtuple[\"photon_length\"]} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": fivetuple[\"event_id\"], cut + \"_lost\": fivetuple[\"lost\"], cut + \"_rad_length_frac\": fivetuple[\"rad_length_frac\"], cut + \"_energy\": fivetuple[\"energy\"], cut + \"_brem_photons_pe\": fivetuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": fivetuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": fivetuple[\"brem_vtx_z\"], cut + \"_photon_length\": fivetuple[\"photon_length\"]} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": sixtuple[\"event_id\"], cut + \"_lost\": sixtuple[\"lost\"], cut + \"_rad_length_frac\": sixtuple[\"rad_length_frac\"], cut + \"_energy\": sixtuple[\"energy\"], cut + \"_brem_photons_pe\": sixtuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": sixtuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": sixtuple[\"brem_vtx_z\"], cut + \"_photon_length\": sixtuple[\"photon_length\"]} )\n",
"# outFile[tree].extend( {cut + \"_event_id\": seventuple[\"event_id\"], cut + \"_lost\": seventuple[\"lost\"], cut + \"_rad_length_frac\": seventuple[\"rad_length_frac\"], cut + \"_energy\": seventuple[\"energy\"], cut + \"_brem_photons_pe\": seventuple[\"brem_photons_pe\"], cut + \"_brem_vtx_x\": seventuple[\"brem_vtx_x\"], cut + \"_brem_vtx_z\": seventuple[\"brem_vtx_z\"], cut + \"_photon_length\": seventuple[\"photon_length\"]} )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 16,
2024-01-18 16:06:16 +01:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-15 10:12:54 +02:00
"31836\n",
"6689\n"
2024-01-18 16:06:16 +01:00
]
},
{
"data": {
"text/html": [
"<pre>{event_id: 1,\n",
" lost: False,\n",
" rad_length_frac: 0.148,\n",
" energy: 1.28e+04,\n",
2024-02-16 11:27:21 +01:00
" brem_photons_pe: [7.42e+03, 1.88e+03],\n",
" brem_vtx_x: [-3.61, -61.5],\n",
" brem_vtx_z: [35.6, 8.49e+03],\n",
" photon_length: 2}\n",
"---------------------------------------\n",
2024-01-15 16:46:25 +01:00
"type: {\n",
2024-01-18 16:06:16 +01:00
" event_id: int64,\n",
2024-01-17 15:59:39 +01:00
" lost: bool,\n",
2024-01-18 16:06:16 +01:00
" rad_length_frac: float64,\n",
2024-01-15 16:46:25 +01:00
" energy: float64,\n",
" brem_photons_pe: var * float64,\n",
" brem_vtx_x: var * float64,\n",
2024-01-17 15:59:39 +01:00
" brem_vtx_z: var * float64,\n",
" photon_length: int64\n",
2024-01-15 16:46:25 +01:00
"}</pre>"
],
"text/plain": [
2024-01-18 16:06:16 +01:00
"<Record {event_id: 1, lost: False, ...} type='{event_id: int64, lost: bool,...'>"
2024-01-15 16:46:25 +01:00
]
},
2024-04-15 10:12:54 +02:00
"execution_count": 16,
2024-01-15 16:46:25 +01:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2024-01-17 15:59:39 +01:00
"# data in cut_brem_found and cut_brem_lost\n",
"\n",
"length_found = ak.num(ntuple[~ntuple.lost][\"brem_photons_pe\"], axis=0)\n",
"length_lost = ak.num(ntuple[ntuple.lost][\"brem_photons_pe\"], axis=0)\n",
2024-04-15 10:12:54 +02:00
"print(length_found)\n",
"print(length_lost)\n",
2024-01-17 15:59:39 +01:00
"ntuple[1]"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 12,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [],
"source": [
2024-01-16 21:48:53 +01:00
"Z_found = ak.to_numpy(\n",
2024-01-28 16:15:00 +01:00
" ak.sum(ntuple[~ntuple.lost][\"brem_photons_pe\"], axis=-1,\n",
" keepdims=False)) / ak.to_numpy(ntuple[~ntuple.lost][\"energy\"])\n",
2024-01-16 21:48:53 +01:00
"Z_lost = ak.to_numpy(\n",
2024-01-28 16:15:00 +01:00
" ak.sum(ntuple[ntuple.lost][\"brem_photons_pe\"], axis=-1,\n",
" keepdims=False)) / ak.to_numpy(ntuple[ntuple.lost][\"energy\"])"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 13,
2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DjtdjtWVlZufOy8abfbsbm5Gc1mM05OTvp3h9zf349KpRKHh4cTD/sHAGbHsHwAACLiV11b2Ww2vv322ygUCv2ZV4eHhyNndzWbzSgWizcOuu/NG/vw4UOcnp5eC9N62yIXYa5WNpuN4+PjqNVqsbm52R+gn81m4/T01JZIAJhzOsIAAIiIiEqlEvv7+7G7uzvT7X3NZrM/oL/XYQUA8BB0hAEAEBG/6ggrl8szPa8uKgBgVnSEAQAQEb+aD3ZxcaEzCwB4lNw1EgCAfjeY7YkAwGMmCAMASLl6vR6VSiUiPs7rqtfr/SH5AACPia2RJO4f/sN/GH/7t38bP/nJT+I3f/M3ky4HAFLnb//2b6/9t88++yw++8w4WQBg+v7mb/4m/u7v/i5+7dd+Lf7n//yfMz23IIzELS8vh8sQAAAA0mVpaSm63e5Mz+mf+UjcYAi2urqaYCWTabVa0e12Y3l5OXK5XNLlTETts7eodUcsbu2LWneE2pOwqHVHqD0Ji1p3hNqTsKh1R6g9CYtad4Tak7CodUdEnJ+fR0Qk0hQjCCNxy8vL/W/es7OzpMsZWz6fj/Pz88jlcgtVd4Tak7CodUcsbu2LWneE2pOwqHVHqD0Ji1p3hNqTsKh1R6g9CYtad4Tak7CodUdE/OQnP+nnALNmWD4AAAAAqfCog7Aff/wxXrx4ET/5yU/i937v96LT6SRdEgAAAAAJedRBWKVSicPDw7i8vIyTk5N4/vx50iUBAAAAkJBHPSOsXq/H0tJSRHwcwHZ8fJxwRQAAAAAk5VF3hD179mzoDgSlUinBagAAAABI0qPuCDs4OIiIiO+++y6KxWK8evUq4YoAAAAASMqjDsIifhWGAQA
2024-01-15 16:46:25 +01:00
"text/plain": [
2024-02-16 11:27:21 +01:00
"<Figure size 1200x900 with 1 Axes>"
2024-01-15 16:46:25 +01:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2024-01-26 11:34:42 +01:00
"xlim = 0\n",
2024-01-17 15:59:39 +01:00
"\n",
2024-01-16 21:48:53 +01:00
"plt.hist(\n",
" Z_lost,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" histtype=\"bar\",\n",
" color=\"darkorange\",\n",
" label=\"lost\",\n",
2024-01-26 11:34:42 +01:00
" range=[xlim, 1],\n",
2024-01-16 21:48:53 +01:00
")\n",
"plt.hist(\n",
" Z_found,\n",
" bins=100,\n",
" density=True,\n",
" alpha=0.5,\n",
" histtype=\"bar\",\n",
" color=\"blue\",\n",
" label=\"found\",\n",
2024-01-26 11:34:42 +01:00
" range=[xlim, 1],\n",
2024-01-16 21:48:53 +01:00
")\n",
2024-01-27 14:02:41 +01:00
"plt.yscale(\"log\")\n",
2024-01-15 16:46:25 +01:00
"plt.xlabel(r\"$E_\\gamma/E_0$\")\n",
"plt.ylabel(\"a.u.\")\n",
2024-01-16 21:48:53 +01:00
"plt.title(r\"$E_{ph}/E_0$\")\n",
2024-01-15 16:46:25 +01:00
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 33,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-15 10:12:54 +02:00
"found: 7000\n",
"lost: 6689\n",
"found: 7910 , lost: 12529\n",
"1.583944374209861\n"
2024-01-15 16:46:25 +01:00
]
2024-01-17 15:59:39 +01:00
},
{
"data": {
"text/html": [
2024-01-18 16:06:16 +01:00
"<pre>[-3.61,\n",
2024-02-16 11:27:21 +01:00
" -61.5,\n",
2024-01-18 16:06:16 +01:00
" 65.2,\n",
2024-02-16 11:27:21 +01:00
" -5.73,\n",
2024-01-18 16:06:16 +01:00
" -26.6,\n",
2024-02-16 11:27:21 +01:00
" -4.26,\n",
" -396,\n",
2024-04-15 10:12:54 +02:00
" 10.7,\n",
" 26.2,\n",
" 19.6,\n",
2024-01-18 16:06:16 +01:00
" ...,\n",
2024-04-15 10:12:54 +02:00
" -38.9,\n",
" 17.6,\n",
" -168,\n",
" -74.7,\n",
" -500,\n",
" -566,\n",
" 4.2,\n",
" -20.3,\n",
" -59.9]\n",
"--------------------\n",
"type: 7910 * float64</pre>"
2024-01-17 15:59:39 +01:00
],
"text/plain": [
2024-04-15 10:12:54 +02:00
"<Array [-3.61, -61.5, 65.2, ..., 4.2, -20.3, -59.9] type='7910 * float64'>"
2024-01-17 15:59:39 +01:00
]
},
2024-04-15 10:12:54 +02:00
"execution_count": 33,
2024-01-17 15:59:39 +01:00
"metadata": {},
"output_type": "execute_result"
2024-01-15 16:46:25 +01:00
}
],
"source": [
2024-01-17 15:59:39 +01:00
"tuple_found = ntuple[~ntuple.lost]\n",
2024-04-15 10:12:54 +02:00
"tuple_found = tuple_found[:7000]\n",
2024-01-17 15:59:39 +01:00
"tuple_lost = ntuple[ntuple.lost]\n",
"\n",
2024-04-15 10:12:54 +02:00
"print(\"found: \", ak.num(tuple_found[\"brem_vtx_x\"], axis=0))\n",
"print(\"lost: \", ak.num(tuple_lost[\"brem_vtx_x\"], axis=0))\n",
"\n",
2024-02-16 11:27:21 +01:00
"brem_x = ak.to_numpy(ak.flatten(ntuple[\"brem_vtx_x\"]))\n",
"brem_z = ak.to_numpy(ak.flatten(ntuple[\"brem_vtx_z\"]))\n",
"\n",
2024-01-15 16:46:25 +01:00
"brem_x_found = ak.to_numpy(ak.flatten(tuple_found[\"brem_vtx_x\"]))\n",
"brem_z_found = ak.to_numpy(ak.flatten(tuple_found[\"brem_vtx_z\"]))\n",
"\n",
"brem_x_lost = ak.to_numpy(ak.flatten(tuple_lost[\"brem_vtx_x\"]))\n",
"brem_z_lost = ak.to_numpy(ak.flatten(tuple_lost[\"brem_vtx_z\"]))\n",
"\n",
"n_found = len(brem_x_found)\n",
"n_lost = len(brem_x_lost)\n",
"print(\"found: \", n_found, \", lost: \", n_lost)\n",
2024-01-16 21:48:53 +01:00
"stretch_factor = n_lost / n_found\n",
2024-01-17 15:59:39 +01:00
"print(stretch_factor)\n",
"ak.flatten(tuple_found[\"brem_vtx_x\"])"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 37,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [
{
"data": {
2024-04-15 10:12:54 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAB9QAAAMyCAYAAAA8EPqZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAD/MUlEQVR4nOz9f3QjZ37f+X4K7B9qdYsNsjU/6OZaI9AaJ3Z+rIBW9iQnuU7SgKRJdrJrD9Gdo52Zs07UpH12nXsvb4ac9s3uSe4m0yZn02fP5t7cIeTEuTNebVqgZ+5GN/ZIhJz4+OzmXjcJjb2JM9aYkDRhm5ofYqPZ3epfJOr+QRGNqnoAFIACUAW8Xzp9hCo+9dSDQgFV33qqnq9l27YtAAAAAAAAAAAAAADgEOt3AwAAAAAAAAAAAAAACCM61AEAAAAAAAAAAAAAMKBDHQAAAAAAAAAAAAAAAzrUAQAAAAAAAAAAAAAwoEMdAAAAAAAAAAAAAAADOtQBAAAAAAAAAAAAADCgQx0AAAAAAAAAAAAAAAM61AEAAAAAAAAAAAAAMKBDHQAAAAAAAAAAAAAAAzrUAQAAAAAAAAAAAAAwoEMdAAAAAAAAAAAAAAADOtQBAAAAAAAAAAAAADCgQx0AAAAAAAAAAAAAAAM61AEAAAAAAAAAAAAAMKBDHQAAAAAAAAAAAAAAAzrUAQAAAAAAAAAAAAAwoEMdAAAAAAAAAAAAAAADOtQBAAAAAAAAAAAAADCgQx0AAAAAAAAAAAAAAAM61AEAAAAAAAAAAAAAMKBDHQAAAAAAAAAAAAAAAzrUAQAAAAAAAAAAAAAwoEMdAAAAAAAAAAAAAAADOtQBAAAAAAAAAAAAADCgQx0AAAAAAAAAAAAAAAM61AEAAAAAAAAAAAAAMKBDHQAAAAAAAAAAAAAAAzrUAQAAAA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pk8lobGxMlmVpampK2WzWkd4yrOhQBwAAA+X8+fOO6Vwu13SZ2qe83U8E+NXLYeKTyWT1daFQYNh3AAAAAOiBoOPNbDbrKZ9MJrW6uqrl5eXqvHK5TE51AEBD5XJZ2WxWU1NTKhQKHV2rLJfLsiyr6b+pqSlfDycVCgWNjY1pYWFB0n66k42NDS0uLqpYLCqTySiTyYT6Gicd6gAAYKBMT087huGrvQhRT+1dkBcvXnT8zT08X70Tu14+Ke6+iHNwMgoAAAAA6J6g481GneQzMzOan5+vTvfyJm4AQHSUy2UtLCxobGwssJuv/NwwdqDZdclCoVDtLJ+ZmdHq6qrS6bQSiYSmp6e1sbGhZDKpQqGgVCoV2k51OtQBAEDkNLuQ8NJLL1Vfl0qlhsMGFYvFaj66xcVFx8URyfk0uGQ+oSyVSp6Tx25e7Jienna0K5fL1T3RLRaLjs5+cq4DAAAAQPuCjDelxp0WtcPouoeBdz8R6L7JO6wdEgCA4CwtLSmVSlWPNUG5dOmSr3IHHeP1HDw1L+0ft+rdiJbP5yXtH8tMo7eEAR3qAAAg9Fq9MDA9Pa3FxcXqdDabNS5TLpd14cIFSd67/2vVXrhYWFjQ7OysCoWCVlZWNDs7q6mpKc/FkXpPrPu9qFG7vGmZgxPNA7Ozs5qdna0uVyqVtLS0pLNnzzratbS0pNnZWZ5qBwAAAIAa7pui68VuQcebCwsLddd10EFi6rBwT8/OzqpcLqtUKml2dralpwsBANFTLBaVTqe1sbHhSRXSiVwup3K5rPn5ea2urjb8574+6VZ7jGx0LfLgaXVp/4n2MB7DLNu27X43AgAAoJGFhQUtLS1Vp9PptFZXV5sut7KyogsXLqhcLisej2txcbHaOV4oFLS4uKhSqaTFxcW6Fzek/QshTz75pPEiRzweVz6fVzqd1tjYWLVMMplUPp/X+Ph4tUP7YIijAzMzM8a
2024-01-15 16:46:25 +01:00
"text/plain": [
"<Figure size 2000x800 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2024-04-15 10:12:54 +02:00
"vmax = 150\n",
"nbins = 150\n",
2024-01-16 21:48:53 +01:00
"\n",
"fig, ((ax0, ax1)) = plt.subplots(nrows=1, ncols=2, figsize=(20, 8))\n",
"\n",
"a0 = ax0.hist2d(\n",
" brem_z_found,\n",
" brem_x_found,\n",
" density=False,\n",
" bins=nbins,\n",
" cmin=1,\n",
" vmax=vmax,\n",
2024-02-16 11:27:21 +01:00
" range=[[-200, 9500], [-3200, 3200]],\n",
2024-01-16 21:48:53 +01:00
")\n",
2024-02-16 11:27:21 +01:00
"ax0.vlines([770, 990, 2700, 7500], -3200, 3200, colors=\"red\", lw=1.5)\n",
"ax0.set_ylim(-3200, 3200)\n",
"ax0.set_xlim(-200, 9500)\n",
2024-01-15 16:46:25 +01:00
"ax0.set_xlabel(\"z [mm]\")\n",
"ax0.set_ylabel(\"x [mm]\")\n",
2024-02-16 11:27:21 +01:00
"ax0.set_title(\"found\")\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-16 21:48:53 +01:00
"a1 = ax1.hist2d(\n",
" brem_z_lost,\n",
" brem_x_lost,\n",
" density=False,\n",
" bins=nbins,\n",
" cmin=1,\n",
2024-04-15 10:12:54 +02:00
" vmax=vmax, # * stretch_factor,\n",
2024-02-16 11:27:21 +01:00
" range=[[-200, 9500], [-3200, 3200]],\n",
2024-01-16 21:48:53 +01:00
")\n",
2024-02-16 11:27:21 +01:00
"ax1.vlines([770, 990, 2700, 7500], -3200, 3200, colors=\"red\", lw=1.5)\n",
"ax1.set_ylim(-3200, 3200)\n",
"ax1.set_xlim(-200, 9500)\n",
2024-01-15 16:46:25 +01:00
"ax1.set_xlabel(\"z [mm]\")\n",
"ax1.set_ylabel(\"x [mm]\")\n",
2024-02-16 11:27:21 +01:00
"ax1.set_title(\"lost\")\n",
2024-01-16 21:48:53 +01:00
"# ax1.set(xlim=(0,4000), ylim=(-1000,1000))\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-02-16 11:27:21 +01:00
"# plt.suptitle(\"brem vtx of photons w/ $E>0.1E_0$\")\n",
2024-01-15 16:46:25 +01:00
"plt.colorbar(a0[3], ax=ax1)\n",
"\n",
2024-04-15 10:12:54 +02:00
"plt.show()\n",
"# plt.savefig(\n",
"# \"/work/cetin/Projektpraktikum/thesis/brem_vtx_found_lost_hist2d.pdf\",\n",
"# format=\"PDF\",\n",
"# )"
2024-02-16 11:27:21 +01:00
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 38,
2024-02-16 11:27:21 +01:00
"metadata": {},
"outputs": [
{
"data": {
2024-04-15 10:12:54 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABJ0AAAOWCAYAAABF0OMKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC/j0lEQVR4nOz9fZAjd37feX5Q/UBSTVajqimNSl0nqlEmZTt2V0eg2ht22KG5K4Ac+yzfSQK6N8bSxCpiumB5z76ICk9BrYt70N7ttACt+x/fnQlQ9jok74SLKI1iPbFaDQHKGntvfaeuAseKW3s0I2RzxlXGaDTsyi6yp9kPhbw/agDiIROVABLITNT7FYFgIfuXv/xlAvWAL3+/T0Ysy7IEAAAAAAAAeGjO7wEAAAAAAABg9lB0AgAAAAAAgOcoOgEAAAAAAMBzFJ0AAAAAAADgOYpOAAAAAAAA8BxFJwAAAAAAAHiOohMAAAAAAAA8R9EJAAAAAAAAnqPoBAAAAAAAAM9RdAIAAAAAAIDnKDoBAAAAAADAcxSdAAAAAAAA4DmKTgAAAAAAAPAcRScAAAAAAAB4jqITAAAAAAAAPEfRCQAAAAAAAJ6j6AQAAAAAAADPUXQCAAAAAACA5yg6AQAAAAAAwHMUnQAAAAAAAOA5ik4AAAAAAADwHEUnAAAAAAAAeI6iEwAAAAAAADxH0QkAAAAAAACeo+gEAAAAAAAAz1F0AgAAAAAAgOcoOgEAAAAAAM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evXr9tuD3IhxUlvgcX
2024-02-16 11:27:21 +01:00
"text/plain": [
"<Figure size 1200x900 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2024-04-15 10:12:54 +02:00
"nbins = 150\n",
"vmax = 150\n",
2024-02-16 11:27:21 +01:00
"\n",
"a1 = plt.hist2d(\n",
" brem_z_found,\n",
" brem_x_found,\n",
" density=False,\n",
" bins=nbins,\n",
" cmin=1,\n",
" vmax=vmax,\n",
" range=[[-200, 9500], [-3200, 3200]],\n",
")\n",
"plt.vlines([770, 990, 2700, 7500], -3200, 3200, colors=\"red\", lw=1.5)\n",
"plt.ylim(-3200, 3200)\n",
"plt.xlim(-200, 9500)\n",
"plt.xlabel(\"z [mm]\")\n",
"plt.ylabel(\"x [mm]\")\n",
"# plt.title(r\"$e^\\pm$ lost brem vertices\")\n",
"# ax1.set(xlim=(0,4000), ylim=(-1000,1000))\n",
"\n",
"# plt.suptitle(\"brem vtx of photons w/ $E>0.1E_0$\")\n",
"plt.colorbar(a1[3])\n",
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
"# plt.show()\n",
"plt.savefig(\n",
" \"/work/cetin/Projektpraktikum/thesis/brem_vtx_hist2d_found.pdf\",\n",
" format=\"PDF\",\n",
")"
]
},
{
"cell_type": "code",
2024-04-15 10:12:54 +02:00
"execution_count": 39,
2024-02-16 11:27:21 +01:00
"metadata": {},
"outputs": [
{
"data": {
2024-04-15 10:12:54 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABJ0AAAOWCAYAAABF0OMKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAADN2ElEQVR4nOz9f5Aj6X3feX6B6p/snmpU9ZBiqes8apRnZNmx0g1Q7Q355BBvC5gZrU3HSgK6HbMkwwxPAyvHyndXZxbYur0f2rXZArTq2DjfnQ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00GvdvZLJamVe9xwjkYjyde2/fif1MwgAAAAYBSudABzI7yudhtF/BzqR0R/H2tqa7OzsWK7uad81z874qnlZ6Q5wz2QylnlW/Xdss1rh1j1/Xdd9+7paXYfd7W4Ehtt9LXK5XOf8mUzGVl+R/dVbqgD77sfxxhtvKF/X/mttc3PT1lwBAAAAL1B0AnAgqzfhjUZjwjNxTlW4+PDDDx2NVy6XpVarmbZxiewXGFZWVlwt5NjdTtj9ug2zBdFPd3p74403JJ/PS7lcPrCwIzK5QmipVOqcy06RKpPJ9LwGwwbYd+s+n59eKwAAAKAfRScAB7JaSaNareF3qgLB2bNnHY8bi8Us87Lq9bopb2gSRr274K1bt9ydiAORSETW1tYsM7SGzeNyS6VS6Xxud2VU9/dREL93AAAAgGFRdAJgi2oVj6Zpvt2KNYxhtrYdJJPJSKPRMBV8NjY2fF1oGLVANWmapkmpVJJqtaoMCZ/kPIbVf51Nw/cOAAAAMAhFJwC2XLp0Sdnu50KKlf4
2024-02-16 11:27:21 +01:00
"text/plain": [
"<Figure size 1200x900 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2024-04-15 10:12:54 +02:00
"# import matplotlib\n",
2024-02-16 11:27:21 +01:00
"\n",
2024-04-15 10:12:54 +02:00
"# nbins = 200\n",
"# vmax = 400\n",
2024-02-16 11:27:21 +01:00
"\n",
"a1 = plt.hist2d(\n",
" brem_z_lost,\n",
" brem_x_lost,\n",
" density=False,\n",
" bins=nbins,\n",
" cmin=1,\n",
2024-04-15 10:12:54 +02:00
" vmax=vmax, # * stretch_factor,\n",
2024-02-16 11:27:21 +01:00
" # norm=matplotlib.colors.Normalize(vmin=1, vmax=vmax * stretch_factor),\n",
" range=[[-200, 9500], [-3200, 3200]],\n",
")\n",
"plt.vlines([770, 990, 2700, 7500], -3200, 3200, colors=\"red\", lw=1.5)\n",
"plt.ylim(-3200, 3200)\n",
"plt.xlim(-200, 9500)\n",
"plt.xlabel(\"z [mm]\")\n",
"plt.ylabel(\"x [mm]\")\n",
"\n",
"plt.colorbar(a1[3])\n",
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
2024-04-15 10:12:54 +02:00
"# plt.show()\n",
"plt.savefig(\n",
" \"/work/cetin/Projektpraktikum/thesis/brem_vtx_hist2d_lost.pdf\",\n",
" format=\"PDF\",\n",
")"
2024-02-16 11:27:21 +01:00
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABJ0AAAOWCAYAAABF0OMKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAD1z0lEQVR4nOz9e3QjWX7Yef4CJPNRmZUJMqu7RSXHVQmqWg+fsaaArBn5MZZmCFR129teq0Vk9rRasuWpJC3NsXfMVQOdmj1nxjvjTgE67tk9nl0XUfJjrJa2WaBaOq7jGauAkixr/VKSqLZ3JLVbDVRVmyn2q5KRrMzKB0nE/sEGEvcGEQ9GBBAgv59zeA6CcXHjxgME8OP9/cKwLMsSAAAAAAAAIESJYQ8AAAAAAAAARw9BJwAAAAAAAISOoBMAAAAAAABCR9AJAAAAAAAAoSPoBAAAAAAAgNARdAIAAAAAAEDoCDoBAAAAAAAgdASdAAAAAAAAEDqCTgAAAAAAAAgdQScAAAAAAACEjqATAAAAAAAAQkfQCQAAAAAAAKEj6AQAAAAAAIDQEXQCAAAAAABA6Ag6AQAAAAAAIHQEnQAAAAAAABA6gk4AAAAAAAAIHUEnAAAAAAAAhI6gEwAAAAAAAEJH0AkAAAAAAAChI+gEAAAAAACA0BF0AgAAAAAAQOgIOgEAAAAAACB0BJ0AAAAAAAAQOoJOAAAAAAAACB1BJwAAAAAAAISOoBMAAAAAAABCR9AJwMgzTXPYQwAAAAAAaAg6ARhJjUZDisWiTE5OyrVr14Y9HAAAAACAZnzYAwB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/plain": [
"<Figure size 1200x900 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"nbins = 200\n",
"vmax = 400\n",
"\n",
"a1 = plt.hist2d(\n",
" brem_z,\n",
" brem_x,\n",
" density=False,\n",
" bins=nbins,\n",
" cmin=1,\n",
" vmax=vmax,\n",
" range=[[-200, 9500], [-3200, 3200]],\n",
")\n",
"plt.vlines([770, 990, 2700, 7500], -3200, 3200, colors=\"red\", lw=1.5)\n",
"plt.ylim(-3200, 3200)\n",
"plt.xlim(-200, 9500)\n",
"plt.xlabel(\"z [mm]\")\n",
"plt.ylabel(\"x [mm]\")\n",
"# plt.title(r\"$e^\\pm$ lost brem vertices\")\n",
"# ax1.set(xlim=(0,4000), ylim=(-1000,1000))\n",
"\n",
"# plt.suptitle(\"brem vtx of photons w/ $E>0.1E_0$\")\n",
"plt.colorbar(a1[3])\n",
"mplhep.lhcb.text(\"Simulation\", loc=0)\n",
"# plt.show()\n",
"plt.savefig(\n",
" \"/work/cetin/Projektpraktikum/thesis/brem_vtx_hist2d.pdf\",\n",
" format=\"PDF\",\n",
")"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": 133,
2024-01-15 16:46:25 +01:00
"metadata": {},
2024-01-17 15:59:39 +01:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-01-18 16:06:16 +01:00
"50501\n"
2024-01-17 15:59:39 +01:00
]
}
],
2024-01-15 16:46:25 +01:00
"source": [
2024-01-17 15:59:39 +01:00
"energy_emissions = ak.ArrayBuilder()\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"for jelec in range(ak.num(ntuple, axis=0)):\n",
" energy_emissions.begin_record()\n",
" energy_emissions.field(\"lost\").boolean(ntuple[jelec, \"lost\"])\n",
" energy_emissions.field(\"energy\").real(ntuple[jelec, \"energy\"])\n",
"\n",
" tmp_velo = 0\n",
" tmp_richut = 0\n",
" tmp_neither = 0\n",
" tmp_velo_length = 0\n",
" tmp_richut_length = 0\n",
" tmp_neither_length = 0\n",
2024-01-26 11:34:42 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" for jphoton in range(ak.num(ntuple[jelec][\"brem_photons_pe\"], axis=0)):\n",
" if ntuple[jelec, \"brem_vtx_z\", jphoton] <= 770:\n",
" tmp_velo += ntuple[jelec, \"brem_photons_pe\", jphoton]\n",
" tmp_velo_length += 1\n",
2024-04-15 10:12:54 +02:00
" elif (ntuple[jelec, \"brem_vtx_z\", jphoton] > 770) and (\n",
" ntuple[jelec, \"brem_vtx_z\", jphoton] <= 2700\n",
" ):\n",
2024-01-17 15:59:39 +01:00
" tmp_richut += ntuple[jelec, \"brem_photons_pe\", jphoton]\n",
" tmp_richut_length += 1\n",
" else:\n",
" tmp_neither += ntuple[jelec, \"brem_photons_pe\", jphoton]\n",
" tmp_neither_length += 1\n",
"\n",
" energy_emissions.field(\"velo_length\").integer(tmp_velo_length)\n",
" energy_emissions.field(\"velo\").real(tmp_velo)\n",
"\n",
" energy_emissions.field(\"rich_length\").integer(tmp_richut_length)\n",
" energy_emissions.field(\"rich\").real(tmp_richut)\n",
2024-01-26 11:34:42 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" energy_emissions.field(\"neither_length\").integer(tmp_neither_length)\n",
" energy_emissions.field(\"downstream\").real(tmp_neither)\n",
2024-01-26 11:34:42 +01:00
"\n",
2024-04-15 10:12:54 +02:00
" energy_emissions.field(\"photon_length\").integer(\n",
" tmp_neither_length + tmp_richut_length + tmp_velo_length\n",
" )\n",
2024-01-26 11:34:42 +01:00
"\n",
2024-01-31 11:58:35 +01:00
" # if (tmp_velo == 0) and (tmp_richut == 0):\n",
2024-04-15 10:12:54 +02:00
" if (\n",
" False # (tmp_velo >= 0.5 * ntuple[jelec, \"energy\"])\n",
" or ((tmp_velo == 0) and (tmp_richut == 0))\n",
" or (ntuple[jelec, \"energy\"] - tmp_velo < 3000)\n",
" ):\n",
2024-01-17 15:59:39 +01:00
" energy_emissions.field(\"quality\").integer(0)\n",
" else:\n",
" energy_emissions.field(\"quality\").integer(1)\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
" energy_emissions.end_record()\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"energy_emissions = ak.Array(energy_emissions)\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"print(ak.num(energy_emissions, axis=0))"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": 134,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [
{
2024-01-17 15:59:39 +01:00
"data": {
"text/html": [
"<pre>{lost: False,\n",
2024-01-18 16:06:16 +01:00
" energy: 5.09e+04,\n",
" velo_length: 0,\n",
" velo: 0,\n",
2024-01-17 15:59:39 +01:00
" rich_length: 0,\n",
" rich: 0,\n",
" neither_length: 0,\n",
" downstream: 0,\n",
2024-01-18 16:06:16 +01:00
" photon_length: 0,\n",
" quality: 0}\n",
2024-01-17 15:59:39 +01:00
"--------------------------\n",
"type: {\n",
" lost: bool,\n",
" energy: float64,\n",
" velo_length: int64,\n",
" velo: float64,\n",
" rich_length: int64,\n",
" rich: float64,\n",
" neither_length: int64,\n",
" downstream: float64,\n",
" photon_length: int64,\n",
" quality: int64\n",
"}</pre>"
],
"text/plain": [
2024-01-18 16:06:16 +01:00
"<Record {lost: False, energy: 5.09e+04, ...} type='{lost: bool, energy: flo...'>"
2024-01-17 15:59:39 +01:00
]
},
2024-01-31 11:58:35 +01:00
"execution_count": 134,
2024-01-17 15:59:39 +01:00
"metadata": {},
"output_type": "execute_result"
2024-01-15 16:46:25 +01:00
}
],
"source": [
2024-01-17 15:59:39 +01:00
"energy_emissions[3]"
2024-01-16 21:48:53 +01:00
]
},
{
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": 135,
2024-01-16 21:48:53 +01:00
"metadata": {},
2024-01-17 15:59:39 +01:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-01-26 11:34:42 +01:00
"found: 41978\n",
"lost: 8523\n",
2024-01-18 16:06:16 +01:00
"50501\n",
2024-01-31 11:58:35 +01:00
"VELO energy emission, eff: 0.18201619769905547\n",
"RICH1+UT energy emission, eff: 0.12653214787825984\n",
"Neither, eff: 0.5226827191540762\n",
2024-01-28 16:15:00 +01:00
"total efficiency: 0.8312310647313914\n",
2024-01-26 11:34:42 +01:00
"efficiency: 0.8312310647313914\n",
2024-01-17 15:59:39 +01:00
"\n",
"found in velo/(found + lost in velo)\n",
2024-01-31 11:58:35 +01:00
"VELO energy emission, eff: 0.848831840428479\n",
"RICH1+UT energy emission, eff: 0.794479671764267\n",
"eff von e die nicht strahlen: 0.8345505706788074\n"
2024-01-17 15:59:39 +01:00
]
}
],
2024-01-16 21:48:53 +01:00
"source": [
2024-01-17 15:59:39 +01:00
"# efficiency berechnen als found in velo oder rich über alle elektronen\n",
"# dann kann man zusammenrechnen mit velo, rich, und allen anderen elektronen\n",
"# expected eff = 81.19%\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"electrons_found = energy_emissions[~energy_emissions.lost]\n",
"electrons_lost = energy_emissions[energy_emissions.lost]\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"anz_found = ak.num(electrons[~electrons.lost], axis=0)\n",
"anz_lost = ak.num(electrons[electrons.lost], axis=0)\n",
"print(\"found: \", anz_found)\n",
2024-01-17 15:59:39 +01:00
"print(\"lost: \", anz_lost)\n",
"\n",
"num_velo_found = 0\n",
"num_rich_found = 0\n",
"num_no_up_rad_found = 0\n",
"for itr in range(ak.num(electrons_found, axis=0)):\n",
2024-01-26 11:34:42 +01:00
" if electrons_found[itr, \"quality\"] == 1:\n",
" if electrons_found[itr, \"velo\"] >= electrons_found[itr, \"rich\"]:\n",
2024-01-17 15:59:39 +01:00
" num_velo_found += 1\n",
" else:\n",
" num_rich_found += 1\n",
" else:\n",
" num_no_up_rad_found += 1\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"num_velo_lost = 0\n",
"num_rich_lost = 0\n",
"num_no_up_rad_lost = 0\n",
"for itr in range(ak.num(electrons_lost, axis=0)):\n",
2024-01-26 11:34:42 +01:00
" if electrons_lost[itr, \"quality\"] == 1:\n",
" if electrons_lost[itr, \"velo\"] >= electrons_lost[itr, \"rich\"]:\n",
2024-01-17 15:59:39 +01:00
" num_velo_lost += 1\n",
" else:\n",
" num_rich_lost += 1\n",
" else:\n",
" num_no_up_rad_lost += 1\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"denom = ak.num(electrons, axis=0)\n",
2024-01-17 15:59:39 +01:00
"print(denom)\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"eff_velo = num_velo_found / denom\n",
2024-01-15 16:46:25 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"eff_rich = num_rich_found / denom\n",
2024-01-17 15:59:39 +01:00
"\n",
2024-04-15 10:12:54 +02:00
"eff_other = ak.num(electrons_found[electrons_found.quality == 0], axis=0) / denom\n",
2024-01-17 15:59:39 +01:00
"\n",
"print(\"VELO energy emission, eff: \", eff_velo)\n",
"\n",
"print(\"RICH1+UT energy emission, eff: \", eff_rich)\n",
"\n",
"print(\"Neither, eff: \", eff_other)\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"print(\"total efficiency: \", eff_velo + eff_rich + eff_other)\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"print(\"efficiency: \", anz_found / (anz_found + anz_lost))\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-17 15:59:39 +01:00
"print(\"\\nfound in velo/(found + lost in velo)\")\n",
2024-01-16 21:48:53 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"eff_velo = num_velo_found / (num_velo_found + num_velo_lost)\n",
"eff_rich = num_rich_found / (num_rich_found + num_rich_lost)\n",
2024-01-17 15:59:39 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"eff_no_rad = num_no_up_rad_found / (num_no_up_rad_found + num_no_up_rad_lost)\n",
2024-01-17 15:59:39 +01:00
"\n",
"print(\"VELO energy emission, eff: \", eff_velo)\n",
"\n",
"print(\"RICH1+UT energy emission, eff: \", eff_rich)\n",
"\n",
2024-01-26 11:34:42 +01:00
"print(\"eff von e die nicht strahlen: \", eff_no_rad)"
2024-01-15 16:46:25 +01:00
]
},
{
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": 136,
2024-01-16 21:48:53 +01:00
"metadata": {},
"outputs": [
{
2024-01-16 22:04:43 +01:00
"name": "stdout",
"output_type": "stream",
"text": [
2024-01-26 11:34:42 +01:00
"41978\n",
"8523\n",
2024-01-18 16:06:16 +01:00
"50501\n"
2024-01-16 22:04:43 +01:00
]
2024-01-16 21:48:53 +01:00
}
],
"source": [
2024-01-26 11:34:42 +01:00
"print(ak.num(electrons[~electrons.lost], axis=0))\n",
"print(ak.num(electrons[electrons.lost], axis=0))\n",
"print(ak.num(electrons, axis=0))"
2024-01-16 21:48:53 +01:00
]
},
2024-01-16 22:04:43 +01:00
{
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": 137,
2024-01-28 16:15:00 +01:00
"metadata": {},
"outputs": [],
"source": [
2024-01-31 11:58:35 +01:00
"# energy_emissions = energy_emissions[energy_emissions.energy >= 5e3]"
2024-01-28 16:15:00 +01:00
]
},
{
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": 138,
2024-01-16 22:04:43 +01:00
"metadata": {},
2024-01-17 15:59:39 +01:00
"outputs": [
{
"data": {
2024-01-31 11:58:35 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAisAAAHLCAYAAAAJAtg3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZl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QAAm22tx6z85je/0a9//Wv97Gc/0+7ubtrFAQAAU7i8vNQ//dM/6ZNPPtFPfvKTa9OvdbDy61//Wr/4xS/SLgYAAJjDF198oT/90z+9Nt1aBys/+9nPJL17sT//+c8XmvebN2/00Ucf6auvvtLt27cXmvfh4aGOj48Xmuc6572sfDmHq8l3WXkv8/xJ1PMq8uYcri7vdfse/Yd/+Af94he/iK/j11lasPLLX/5SBwcH+vTTT5d1iLjr5+c///nCZwJ89913kqR79+7pvffeW2jeu7u7S5u5sI55LytfzuFq8l1W3ss8fxL1vIq8OYery3sdv0clTT2EYymLwr1+/VrNZpPpvQAA4MaW0rJy9+5dNZtNlqQHAAA3trRuoEePHi0rawAAsEWWdm+gTz75RK9evVpW9gAAYEvM3bLy8OHDsfuCIFCv19OLFy907969eQ8BAAAwf7Aybnn7q2n+8i//ct5DbKxKpULeK8h3majn1eW9LNTz6vJeFs7h8vM1xdzL7T948ECu62p/f39k3+npqVqtln71q1/duICTRDca7Pf7S5ly9/777+u3v/3tUqZrYfk4h+uN87f+OIfrb1nncNbr99xjVsrlsu7evav3339/5OE4jrLZrP7iL/5i3uwBAAAk3SBYuX///sT9tm2r2WzOmz0AAICkG4xZmTTTx/d91Wq1ebMGAACIzR2sOI6jnZ2dsfv
2024-01-17 15:59:39 +01:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# energyspektren angucken von velo und rich\n",
2024-01-31 11:58:35 +01:00
"\n",
"velo_found = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[(~energy_emissions.lost) & (energy_emissions.quality == 1)][\"velo\"]\n",
")\n",
2024-01-31 11:58:35 +01:00
"rich_found = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[(~energy_emissions.lost) & (energy_emissions.quality == 1)][\"rich\"]\n",
")\n",
2024-01-31 11:58:35 +01:00
"energy_found = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[(~energy_emissions.lost) & (energy_emissions.quality == 1)][\n",
" \"energy\"\n",
" ]\n",
")\n",
2024-01-31 11:58:35 +01:00
"\n",
"velo_lost = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[(energy_emissions.lost) & (energy_emissions.quality == 1)][\"velo\"]\n",
")\n",
2024-01-31 11:58:35 +01:00
"rich_lost = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[(energy_emissions.lost) & (energy_emissions.quality == 1)][\"rich\"]\n",
")\n",
2024-01-31 11:58:35 +01:00
"energy_lost = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[(energy_emissions.lost) & (energy_emissions.quality == 1)][\n",
" \"energy\"\n",
" ]\n",
")\n",
2024-01-17 15:59:39 +01:00
"\n",
2024-01-31 11:58:35 +01:00
"diff_found = velo_found - rich_found # / energy_found\n",
"diff_lost = velo_lost - rich_lost # / energy_lost\n",
"\n",
"xlim = 20000\n",
2024-01-26 11:34:42 +01:00
"nbins = 80\n",
2024-01-17 15:59:39 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"plt.hist(\n",
" diff_lost,\n",
" bins=nbins,\n",
" density=True,\n",
" alpha=0.5,\n",
" histtype=\"bar\",\n",
" color=\"darkorange\",\n",
" label=\"lost\",\n",
" range=[-xlim, xlim],\n",
")\n",
"plt.hist(\n",
" diff_found,\n",
" bins=nbins,\n",
" density=True,\n",
" alpha=0.5,\n",
" histtype=\"bar\",\n",
" color=\"blue\",\n",
" label=\"found\",\n",
" range=[-xlim, xlim],\n",
")\n",
2024-01-28 16:15:00 +01:00
"# plt.xlim(-20000, 20000)\n",
"# plt.yscale(\"log\")\n",
2024-01-31 11:58:35 +01:00
"plt.title(\"emitted energy difference\")\n",
"plt.xlabel(r\"$(E_{VELO} - E_{RICH1+UT})$ [MeV]\")\n",
2024-01-17 15:59:39 +01:00
"plt.ylabel(\"a.u.\")\n",
"plt.legend()\n",
"plt.show()"
]
2024-01-16 22:04:43 +01:00
},
2024-01-16 21:48:53 +01:00
{
2024-01-17 15:59:39 +01:00
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 139,
2024-01-15 16:46:25 +01:00
"metadata": {},
2024-01-17 15:59:39 +01:00
"outputs": [
{
"data": {
2024-01-31 11:58:35 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkIAAAHJCAYAAABpOFaGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy81sbWrAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAxsklEQVR4nO3dT2wj2WHn8Z/SPS1P0vCU1HPwnDZdDIwglx0U1T4E2LSRJmMEPgTGkJpbZgCjSRi6BAOEhc5lui8hSsghFwEuCgF6c5smjWAPQZCQNna8QA5rsdK5LBaLZXWAPWSB9VA1g7bbattTe+ipGlIiKYrinxLf9wMIHrFYrx6raNWvX70/G3EcxwIAADDQb6y6AgAAAKtCEAIAAMYiCAEAAGMRhAAAgLEIQgAAwFgEIQAAYCyCEAAAMBZBCAAAGIsgBFwhYRiq0WgoiqJVV2VloihSo9FQGIarrgrmLAgCNRqNVVcDhiEIAVfE/v6+crmcqtWq+v3+qqszlSAI5LquyuWycrmc9vf3L1Veo9HQ7du3Va1WjQ6DixCGoba2tlYSRMIwVLlcVj6fl+/7Sz8+zEYQAq6IWq2mUqm06mpMLQgC3bt3T57nqdlsqlQqqdfrXarMSqWiSqUypxp+KQxD44NVFEWKomjkNRp3fuZ13mzbVrPZvHQ5wCwIQsAVsr29veoqTK1erw/V1/O8ufxr/9atW5cu47RyuXxlWtkWxXEcxXEsz/PObBt3fjhvWAcEI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rcVRdHQ6/1+X0E
2024-01-17 15:59:39 +01:00
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# number of brem vtx with E>x*E_0\n",
"\n",
2024-01-26 11:34:42 +01:00
"number_velo = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[energy_emissions.quality == 1][\"velo_length\"]\n",
")\n",
2024-01-26 11:34:42 +01:00
"number_rich = ak.to_numpy(\n",
2024-04-15 10:12:54 +02:00
" energy_emissions[energy_emissions.quality == 1][\"rich_length\"]\n",
")\n",
2024-01-17 15:59:39 +01:00
"\n",
2024-01-26 11:34:42 +01:00
"plt.hist(\n",
" number_velo,\n",
" bins=10,\n",
" density=True,\n",
" alpha=0.5,\n",
" histtype=\"bar\",\n",
" color=\"darkorange\",\n",
" label=\"velo\",\n",
" range=[0, 10],\n",
")\n",
"plt.hist(\n",
" number_rich,\n",
" bins=10,\n",
" density=True,\n",
" alpha=0.5,\n",
" histtype=\"bar\",\n",
" color=\"blue\",\n",
" label=\"rich\",\n",
" range=[0, 10],\n",
")\n",
"plt.xlim(0, 10)\n",
2024-01-17 15:59:39 +01:00
"plt.title(\"number of photons emitted\")\n",
"plt.xlabel(\"number of photons\")\n",
"plt.ylabel(\"a.u.\")\n",
"plt.legend()\n",
"plt.show()"
]
2024-01-15 16:46:25 +01:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2024-01-31 11:58:35 +01:00
"execution_count": 140,
2024-01-15 16:46:25 +01:00
"metadata": {},
2024-01-17 15:59:39 +01:00
"outputs": [
{
"data": {
"text/plain": [
"' \\nphoton cut = x*E_0\\neffs, all photons included: x=0\\nfound in velo/(found + lost in velo)\\nVELO energy emission, eff: 0.8446167611094543\\nRICH1+UT energy emission, eff: 0.7961586121437423\\neff von e die nicht strahlen: 0.7954674220963173\\n'"
]
},
2024-01-31 11:58:35 +01:00
"execution_count": 140,
2024-01-17 15:59:39 +01:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"\"\" \n",
"photon cut = x*E_0\n",
"effs, all photons included: x=0\n",
"found in velo/(found + lost in velo)\n",
"VELO energy emission, eff: 0.8446167611094543\n",
"RICH1+UT energy emission, eff: 0.7961586121437423\n",
"eff von e die nicht strahlen: 0.7954674220963173\n",
"\"\"\""
]
2024-01-15 16:46:25 +01:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
2024-01-17 15:59:39 +01:00
"execution_count": null,
2024-01-15 16:46:25 +01:00
"metadata": {},
"outputs": [],
2024-01-17 15:59:39 +01:00
"source": []
2024-01-15 16:46:25 +01:00
},
{
"cell_type": "code",
2024-01-17 15:59:39 +01:00
"execution_count": null,
2024-01-15 16:46:25 +01:00
"metadata": {},
2024-01-17 15:59:39 +01:00
"outputs": [],
"source": []
2024-01-15 16:46:25 +01:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "tuner",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}