{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import uproot\n", "import numpy as np\n", "import sys\n", "import os\n", "import matplotlib\n", "import matplotlib.pyplot as plt\n", "import mplhep\n", "from mpl_toolkits import mplot3d\n", "import itertools\n", "import awkward as ak\n", "from scipy.optimize import curve_fit\n", "from utils.components import unique_name_ext_re\n", "mplhep.style.use([\"LHCbTex2\"])\n", "plt.rcParams[\"savefig.dpi\"] = 600\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "file = uproot.open(\n", " \"/work/cetin/LHCb/reco_tuner/data/resolutions_and_effs_B_thesis.root:Track/MatchTrackChecker_8319528f/Match;1\",\n", ")\n", "\n", "P_recoed = file[\"01_long_P_reconstructed;1\"].to_numpy()\n", "P_recoable = file[\"01_long_P_reconstructible;1\"].to_numpy()\n", "\n", "Pt_recoed = file[\"01_long_Pt_reconstructed;1\"].to_numpy()\n", "Pt_recoable = file[\"01_long_Pt_reconstructible;1\"].to_numpy()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "control eff: 0.8626619913200968\n", "new eff: 0.8626619913200968\n" ] } ], "source": [ "P_Velo_recoed = file[\"01_long_EndVelo_P_reconstructed;1\"].to_numpy()\n", "P_Velo_recoable = file[\"01_long_EndVelo_P_reconstructible;1\"].to_numpy()\n", "\n", "print(\"control eff: \", np.sum(P_recoed[0]) / np.sum(P_recoable[0]))\n", "print(\"new eff: \", np.sum(P_Velo_recoed[0]) / np.sum(P_Velo_recoable[0]))" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "control eff: 0.8629752409817771\n", "new eff: 0.8629752409817771\n" ] } ], "source": [ "Pt_Velo_recoed = file[\"01_long_EndVelo_Pt_reconstructed;1\"].to_numpy()\n", "Pt_Velo_recoable = file[\"01_long_EndVelo_Pt_reconstructible;1\"].to_numpy()\n", "\n", "print(\"control eff: \", np.sum(Pt_recoed[0]) / np.sum(Pt_recoable[0]))\n", "print(\"new eff: \", np.sum(Pt_Velo_recoed[0]) / np.sum(Pt_Velo_recoable[0]))" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(array([1.00000e+00, 8.01040e+04, 2.49215e+05, 2.50095e+05, 2.10569e+05,\n", " 1.75027e+05, 1.46219e+05, 1.23088e+05, 1.05255e+05, 9.01970e+04,\n", " 7.85600e+04, 6.79570e+04, 5.95880e+04, 5.19260e+04, 4.65560e+04,\n", " 4.07310e+04, 3.72930e+04, 3.35370e+04, 3.01050e+04, 2.72980e+04,\n", " 2.47460e+04, 2.24910e+04, 2.05840e+04, 1.88150e+04, 1.72910e+04,\n", " 1.57940e+04, 1.46220e+04, 1.34730e+04, 1.24900e+04, 1.14550e+04,\n", " 1.07880e+04, 9.95800e+03, 9.23400e+03, 8.56100e+03, 7.91100e+03,\n", " 7.36700e+03, 6.80700e+03, 6.42800e+03, 6.11500e+03, 5.63900e+03,\n", " 5.26200e+03, 4.91100e+03, 4.66800e+03, 4.39400e+03, 4.05300e+03,\n", " 3.75000e+03, 3.49800e+03, 3.30800e+03, 3.20800e+03, 3.03300e+03,\n", " 2.88100e+03, 2.72300e+03, 2.41900e+03, 2.42900e+03, 2.21800e+03,\n", " 2.17500e+03, 1.99500e+03, 1.91400e+03, 1.77100e+03, 1.66700e+03,\n", " 1.64800e+03, 1.49800e+03, 1.46400e+03, 1.40000e+03, 1.33000e+03,\n", " 1.23000e+03, 1.19300e+03, 1.11400e+03, 1.08300e+03, 1.02700e+03,\n", " 9.94000e+02, 9.44000e+02, 8.81000e+02, 8.85000e+02, 7.90000e+02,\n", " 7.94000e+02, 7.77000e+02, 7.05000e+02, 7.03000e+02, 7.09000e+02,\n", " 6.45000e+02, 5.87000e+02, 5.93000e+02, 5.35000e+02, 5.48000e+02,\n", " 4.68000e+02, 4.67000e+02, 4.58000e+02, 4.70000e+02, 4.26000e+02,\n", " 4.30000e+02, 4.23000e+02, 4.11000e+02, 3.76000e+02, 3.56000e+02,\n", " 3.49000e+02, 3.05000e+02, 3.24000e+02, 2.83000e+02, 3.18000e+02]),\n", " array([ 0., 1000., 2000., 3000., 4000., 5000., 6000.,\n", " 7000., 8000., 9000., 10000., 11000., 12000., 13000.,\n", " 14000., 15000., 16000., 17000., 18000., 19000., 20000.,\n", " 21000., 22000., 23000., 24000., 25000., 26000., 27000.,\n", " 28000., 29000., 30000., 31000., 32000., 33000., 34000.,\n", " 35000., 36000., 37000., 38000., 39000., 40000., 41000.,\n", " 42000., 43000., 44000., 45000., 46000., 47000., 48000.,\n", " 49000., 50000., 51000., 52000., 53000., 54000., 55000.,\n", " 56000., 57000., 58000., 59000., 60000., 61000., 62000.,\n", " 63000., 64000., 65000., 66000., 67000., 68000., 69000.,\n", " 70000., 71000., 72000., 73000., 74000., 75000., 76000.,\n", " 77000., 78000., 79000., 80000., 81000., 82000., 83000.,\n", " 84000., 85000., 86000., 87000., 88000., 89000., 90000.,\n", " 91000., 92000., 93000., 94000., 95000., 96000., 97000.,\n", " 98000., 99000., 100000.]))" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "P_recoable" ] }, { "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": [] } ], "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 }