{ "cells": [ { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [], "source": [ "import uproot\t\n", "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", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "41978 8523\n", "50501\n" ] } ], "source": [ "# file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n", "file = uproot.open(\n", " \"tracking_losses_ntuple_B_EndVeloP.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\"\n", ")\n", "\n", "# selektiere nur elektronen von B->K*ee\n", "allcolumns = file.arrays()\n", "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", "\n", "electrons = allcolumns[(allcolumns.isElectron) & (allcolumns.fromB)]\n", "\n", "print(ak.num(found, axis=0), ak.num(lost, axis=0))\n", "print(ak.num(electrons, axis=0))\n", "# ak.count(found, axis=None)" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
{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", " ideal_state_770_qop: float64,\n", " ideal_state_770_tx: float64,\n", " ideal_state_770_ty: float64,\n", " ideal_state_770_x: float64,\n", " ideal_state_770_y: float64,\n", " ideal_state_770_z: float64,\n", " ideal_state_9410_qop: float64,\n", " ideal_state_9410_tx: float64,\n", " ideal_state_9410_ty: float64,\n", " ideal_state_9410_x: float64,\n", " ideal_state_9410_y: float64,\n", " ideal_state_9410_z: float64,\n", " isElectron: bool,\n", " isKaon: bool,\n", " isMuon: bool,\n", " isPion: bool,\n", " isProton: bool,\n", " lost: bool,\n", " lost_in_track_fit: bool,\n", " match_fraction: float32,\n", " mc_chi2: float32,\n", " mc_dSlope: float32,\n", " mc_dSlopeY: float32,\n", " mc_distX: float32,\n", " mc_distY: float32,\n", " mc_teta2: float32,\n", " mc_zMag: float32,\n", " mcp_idx: int32,\n", " mother_id: int32,\n", " mother_key: int32,\n", " originvtx_type: int32,\n", " originvtx_x: float64,\n", " originvtx_y: float64,\n", " originvtx_z: float64,\n", " p: float64,\n", " p_end_ut: float64,\n", " p_end_velo: float64,\n", " phi: float64,\n", " pid: int32,\n", " pt: float64,\n", " px: float64,\n", " py: float64,\n", " pz: float64,\n", " quality: int32,\n", " rad_length_frac: float64,\n", " scifi_hit_pos_x_length: int32,\n", " scifi_hit_pos_x: var * float32,\n", " scifi_hit_pos_y_length: int32,\n", " scifi_hit_pos_y: var * float32,\n", " scifi_hit_pos_z_length: int32,\n", " scifi_hit_pos_z: var * float32,\n", " track_p: float64,\n", " track_pt: float64,\n", " tx: float64,\n", " ty: float64,\n", " ut_hit_pos_x_length: int32,\n", " ut_hit_pos_x: var * float32,\n", " ut_hit_pos_y_length: int32,\n", " ut_hit_pos_y: var * float32,\n", " ut_hit_pos_z_length: int32,\n", " ut_hit_pos_z: var * float32,\n", " velo_hit_pos_x_length: int32,\n", " velo_hit_pos_x: var * float32,\n", " velo_hit_pos_y_length: int32,\n", " velo_hit_pos_y: var * float32,\n", " velo_hit_pos_z_length: int32,\n", " velo_hit_pos_z: var * float32,\n", " velo_track_idx: int32,\n", " velo_track_tx: float64,\n", " velo_track_ty: float64,\n", " velo_track_x: float64,\n", " velo_track_y: float64,\n", " velo_track_z: float64\n", "}" ], "text/plain": [ "
{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", "}" ], "text/plain": [ "
{event_id: 0,\n", " lost: True,\n", " rad_length_frac: 0.129,\n", " energy: 1.17e+04,\n", " brem_photons_pe: [2.62e+03, 2.54e+03, 1.86e+03],\n", " brem_vtx_x: [-6.97, -52.9, -55.2],\n", " brem_vtx_z: [112, 859, 895],\n", " photon_length: 3}\n", "-------------------------------------------------\n", "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", "}" ], "text/plain": [ "
{event_id: 1,\n", " lost: False,\n", " rad_length_frac: 0.148,\n", " energy: 1.28e+04,\n", " brem_photons_pe: [7.42e+03],\n", " brem_vtx_x: [-3.61],\n", " brem_vtx_z: [35.6],\n", " photon_length: 1}\n", "-----------------------------------\n", "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", "}" ], "text/plain": [ "