{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/hep/davide/miniconda3/envs/root_env/lib/python2.7/site-packages/root_numpy/_tree.py:5: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility\n", " from . import _librootnumpy\n" ] } ], "source": [ "import root_numpy as rn\n", "import ROOT as r\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "file_name='DplusMuNu_Full'\n", "file_path='/disk/lhcb_data/davide/HCAL_project_full_event/'+file_name+'.root'\n", "tree_name='ntuple/DecayTree'" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "f = r.TFile(file_path)\n", "t = f.Get(tree_name)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "j=t.GetEntries()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "batch_size=25000\n", "#n_batches=3\n", "N = j\n", "n_batches= N//batch_size" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "particle = 'piplus'\n", "variable = 'ET'\n", "\n", "cal_zone = 'inner'\n", "\n", "cellsET_inner_dict={}\n", "\n", "for j in range(n_batches):\n", " cellsET_inner_dict[j]=rn.root2array(\n", " filenames=file_path, \n", " treename=tree_name,\n", " branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", " start=j*batch_size,\n", " stop=(j+1)*batch_size,\n", " )\n", " \n", " cellsET_inner_dict[j]=np.array([cellsET_inner_dict[j][i] for i in range(batch_size)])\n", " np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j), cellsET_inner_dict[j])\n", "\n", "if N % batch_size != 0:\n", " \n", " cellsET_inner_dict[j+1]=rn.root2array(\n", " filenames=file_path,\n", " treename=tree_name,\n", " branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", " start=n_batches*batch_size,\n", " stop=N,\n", " ) \n", " cellsET_inner_dict[j+1]=np.array([cellsET_inner_dict[j+1][i] for i in range((N % batch_size))])\n", " np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j+1), cellsET_inner_dict[j+1])\n", " \n", "particle = 'piplus'\n", "variable = 'ET'\n", "\n", "cal_zone='outer'\n", "\n", "cellsET_outer_dict ={}\n", "\n", "for j in range(n_batches):\n", " cellsET_outer_dict[j]=rn.root2array(\n", " filenames=file_path, \n", " treename=tree_name,\n", " branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", " start=j*batch_size,\n", " stop=(j+1)*batch_size,\n", " )\n", " cellsET_outer_dict[j]=np.array([cellsET_outer_dict[j][i] for i in range(batch_size)])\n", " np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j), cellsET_outer_dict[j])\n", "\n", "if N % batch_size != 0:\n", " \n", " cellsET_outer_dict[j+1]=rn.root2array(\n", " filenames=file_path,\n", " treename=tree_name,\n", " branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", " start=n_batches*batch_size,\n", " stop=N,\n", " ) \n", " cellsET_outer_dict[j+1]=np.array([cellsET_outer_dict[j+1][i] for i in range((N % batch_size))])\n", " np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j+1), cellsET_outer_dict[j+1]) " ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "batch=10\n", "n=4" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.image.AxesImage at 0x7f310df9f350>" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/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AdeLXvdiwxiAlRI2LpW8lb6aFPqlWhdgOvZeaDS3b12id17ei7T3qbNLevK5gfu5p5M/AK8BrwlzNqw68zuqDzE0ZXdf+a6ktPPZz7CUbrG55g9K7nTuAi4F+Bl6qf62fUjseqfjkAPAts6aEdNzK6/rIfeLH6c3PffdLQjl77BLimOvdPgJ8CO6vtnfaH3/CTClX6BT+pWIZfKpThlwpl+KVCGX6pUIZfKpThlwpl+KVC/T+7eUcSMnmA6wAAAABJRU5ErkJggg==\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "plt.imshow(cellsET_inner_dict[batch][n],cmap='gray')" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.image.AxesImage at 0x7f310df929d0>" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAADe1JREFUeJzt3W+IHPd9x/H3t/Yl8V/asySbWqJqa/rAKEJNJdyAU+KWgLHypBhsWgSmuD4ojopTCm1daBTogwYiu7gYgkAmrSWEwQkp1FZt94FxDG6CCIr+WEpjt26kYlkKSm0TXDjb3z7YEZzE7Z+bm5mdvd/7BeJ2Z3Znvve7/Wh257e/30RmIqk8vzDtAiRNh+GXCmX4pUIZfqlQhl8qlOGXCmX4pUIZfqlQhl8q1NWreXJE3A18HbgK+MfM/Lsxj/frhFLLMjMmeVzU/XpvRHwS+BHwOeAc8BqwkJk/GPEcwy+1bNLwr+Zt/x3Aycw8k5mLwDPAzlVsT1KHVhP+jcCZJffPVsskzYBVfeafREQsAAtt70fSyq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VQx50Mzr8cA45W/+7puk1G1NFpmwBbq33/EPgRsKda3mh7+A0/qVCln/CTimX4pUIZfqlQhl8qlOGXCmX4pUIZfqlQhl8q1P8DunFJofehXT0AAAAASUVORK5CYII=\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "plt.imshow(cellsET_outer_dict[batch][n],cmap='gray')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#particle = 'piplus'\n", "#cal_zone = 'inner'\n", "#variable = 'X'\n", "#\n", "#cellsX_inner_dict={}\n", "#\n", "#for j in range(n_batches):\n", "# cellsX_inner_dict[j]=rn.root2array(\n", "# filenames=file_path, \n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=j*batch_size,\n", "# stop=(j+1)*batch_size,\n", "# )\n", "# \n", "# cellsX_inner_dict[j]=np.array([cellsX_inner_dict[j][i] for i in range(batch_size)])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j), cellsX_inner_dict[j])\n", "#\n", "#if N % batch_size != 0:\n", "# \n", "# cellsX_inner_dict[j+1]=rn.root2array(\n", "# filenames=file_path,\n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=n_batches*batch_size,\n", "# stop=N,\n", "# ) \n", "# cellsX_inner_dict[j+1]=np.array([cellsX_inner_dict[j+1][i] for i in range((N % batch_size))])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j+1), cellsX_inner_dict[j+1])\n", "# \n", "#variable = 'Y'\n", "#\n", "#cellsY_inner_dict ={}\n", "#\n", "#for j in range(n_batches):\n", "# cellsY_inner_dict[j]=rn.root2array(\n", "# filenames=file_path, \n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=j*batch_size,\n", "# stop=(j+1)*batch_size,\n", "# )\n", "# cellsY_inner_dict[j]=np.array([cellsY_inner_dict[j][i] for i in range(batch_size)])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j), cellsY_inner_dict[j])\n", "#\n", "#if N % batch_size != 0:\n", "# \n", "# cellsY_inner_dict[j+1]=rn.root2array(\n", "# filenames=file_path,\n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=n_batches*batch_size,\n", "# stop=N,\n", "# ) \n", "# cellsY_inner_dict[j+1]=np.array([cellsY_inner_dict[j+1][i] for i in range((N % batch_size))])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j+1), cellsY_inner_dict[j+1])\n", "\n", "#particle = 'piplus'\n", "#cal_zone = 'outer'\n", "#variable = 'X'\n", "#\n", "#cellsX_outer_dict={}\n", "#\n", "#for j in range(n_batches):\n", "# cellsX_outer_dict[j]=rn.root2array(\n", "# filenames=file_path, \n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=j*batch_size,\n", "# stop=(j+1)*batch_size,\n", "# )\n", "# \n", "# cellsX_outer_dict[j]=np.array([cellsX_outer_dict[j][i] for i in range(batch_size)])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j), cellsX_outer_dict[j])\n", "#\n", "#if N % batch_size != 0:\n", "# \n", "# cellsX_outer_dict[j+1]=rn.root2array(\n", "# filenames=file_path,\n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=n_batches*batch_size,\n", "# stop=N,\n", "# ) \n", "# cellsX_outer_dict[j+1]=np.array([cellsX_outer_dict[j+1][i] for i in range((N % batch_size))])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j+1), cellsX_outer_dict[j+1])\n", "# \n", "#variable = 'Y'\n", "#\n", "#cellsY_outer_dict ={}\n", "#\n", "#for j in range(n_batches):\n", "# cellsY_outer_dict[j]=rn.root2array(\n", "# filenames=file_path, \n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=j*batch_size,\n", "# stop=(j+1)*batch_size,\n", "# )\n", "# cellsY_outer_dict[j]=np.array([cellsY_outer_dict[j][i] for i in range(batch_size)])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j), cellsY_outer_dict[j])\n", "#\n", "#if N % batch_size != 0:\n", "# \n", "# cellsY_outer_dict[j+1]=rn.root2array(\n", "# filenames=file_path,\n", "# treename=tree_name,\n", "# branches=particle+'_L0Calo_HCAL_Cells'+variable+'_'+cal_zone,\n", "# start=n_batches*batch_size,\n", "# stop=N,\n", "# ) \n", "# cellsY_outer_dict[j+1]=np.array([cellsY_outer_dict[j+1][i] for i in range((N % batch_size))])\n", "# np.save('/disk/lhcb_data/davide/HCAL_project_full_event/npy/'+file_name+'/'+variable+'_'+cal_zone+'/batch_'+str(j+1), cellsY_outer_dict[j+1]) " ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.15" } }, "nbformat": 4, "nbformat_minor": 2 }