You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

172 lines
5.7 KiB

{
"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",
"control eff: 0.8629752409817771\n",
"new eff: 0.8629752409817771\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]))\n",
"\n",
"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": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([ 0., 39546., 175333., 205172., 179814., 156192., 131918.,\n",
" 111561., 96269., 82605., 72104., 62481., 54880., 48023.,\n",
" 43043., 37810., 34533., 31242., 27997., 25422., 23137.,\n",
" 20994., 19297., 17662., 16196., 14804., 13679., 12636.,\n",
" 11687., 10738., 10125., 9329., 8681., 8080., 7424.,\n",
" 6950., 6416., 6048., 5771., 5304., 4963., 4611.,\n",
" 4379., 4095., 3844., 3512., 3303., 3104., 3020.,\n",
" 2839., 2717., 2549., 2297., 2287., 2076., 2030.,\n",
" 1875., 1791., 1684., 1557., 1559., 1418., 1389.,\n",
" 1321., 1245., 1164., 1122., 1055., 1008., 961.,\n",
" 920., 899., 833., 839., 746., 744., 725.,\n",
" 656., 657., 673., 601., 547., 552., 504.,\n",
" 524., 452., 440., 427., 438., 395., 412.,\n",
" 408., 392., 349., 328., 328., 289., 308.,\n",
" 271., 297.]),\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": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P_recoed"
]
},
{
"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",
"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.1.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}