{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['/home/zineb/km3net/km3net/km3io/notebooks', '/home/zineb/miniconda3/envs/km3pipe/lib/python37.zip', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7/lib-dynload', '', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7/site-packages', '/home/zineb/miniconda3/envs/km3pipe/lib/python3.7/site-packages/IPython/extensions', '/home/zineb/.ipython', '/home/zineb/km3net/km3net/km3io']\n"
     ]
    }
   ],
   "source": [
    "# Add file to current python path\n",
    "from pathlib import Path\n",
    "import sys\n",
    "sys.path.append(str(Path.cwd().parent))\n",
    "Path.cwd()\n",
    "print(sys.path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from km3io.DataReader import DataReader\n",
    "import uproot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "file = 'datav6.0test.jchain.aanet.00005972.root'\n",
    "data = uproot.open(file)['E']['Evt']['hits']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "reader = DataReader(file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Table [<Row 0> <Row 1> <Row 2> ... <Row 145629> <Row 145630> <Row 145631>] at 0x7f91f0271e90>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# big lazyarray with ALL file data!\n",
    "lazy_data = reader.lazy_data\n",
    "lazy_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<ChunkedArray [5972 5972 5972 ... 5972 5972 5972] at 0x7f91f004f410>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# reading all data from a specific branch from events data (data is \n",
    "# ordered in the same order as in Aanet event file)\n",
    "reader.event_reader('run_id')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5972"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# getting the run_id for a specific event (event 5 for example)\n",
    "reader.event_reader('run_id')[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "The event key must be one of the following: 'id', 'det_id', 'mc_id', 'run_id', 'mc_run_id', 'frame_index', 'trigger_mask', 'trigger_counter', 'overlays', 'hits', 'trks', 'w', 'w2list', 'w3list', 'mc_t', 'mc_hits', 'mc_trks', 'comment', 'index', 'flags', 't.fSec', 't.fNanoSec' ",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-8-b734e6d9be61>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;31m# the user is reminded to always specify the \"correct\" event key in the\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0;31m# Aanet event file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mevent_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'whatever'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m~/km3net/km3net/km3io/km3io/DataReader.py\u001b[0m in \u001b[0;36mevent_reader\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m     36\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mevt_key_lazy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     37\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 38\u001b[0;31m             \u001b[0;32mraise\u001b[0m \u001b[0mNameError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The event key must be one of the following: 'id', 'det_id', 'mc_id', 'run_id', 'mc_run_id', 'frame_index', 'trigger_mask', 'trigger_counter', 'overlays', 'hits', 'trks', 'w', 'w2list', 'w3list', 'mc_t', 'mc_hits', 'mc_trks', 'comment', 'index', 'flags', 't.fSec', 't.fNanoSec' \"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     39\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     40\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_event_keys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mevt_tree\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: The event key must be one of the following: 'id', 'det_id', 'mc_id', 'run_id', 'mc_run_id', 'frame_index', 'trigger_mask', 'trigger_counter', 'overlays', 'hits', 'trks', 'w', 'w2list', 'w3list', 'mc_t', 'mc_hits', 'mc_trks', 'comment', 'index', 'flags', 't.fSec', 't.fNanoSec' "
     ]
    }
   ],
   "source": [
    "# the user is reminded to always specify the \"correct\" event key in the\n",
    "# Aanet event file\n",
    "reader.event_reader('whatever')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "218"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# one can check how many hits are in event 5\n",
    "reader.event_reader('hits')[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "56"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# one can also check how many tracks are in event 5\n",
    "reader.event_reader('trks')[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "#########################################################################\n",
    "#\n",
    "# Now let's explore in more details the hits:\n",
    "#\n",
    "#########################################################################"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<ChunkedArray [[806455814 806487219 806487231 ... 809524432 809526097 809544058] [806451572 806451572 806455814 ... 809544058 809544058 809544058] [806451572 806487219 806487219 ... 809526097 809526097 809544058] ... [806451572 806451572 806451572 ... 809526097 809526097 809544058] [806451572 806483369 806483369 ... 809544058 809544058 809544058] [806451572 806451572 806455814 ... 809524432 809544061 809544061]] at 0x7f91f0015850>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# reading all data from a specific branch in hits data:\n",
    "reader.hits_reader('hits.dom_id')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([806451572, 806451572, 806451572, 806455814, 806455814, 806455814,\n",
       "       806455814, 806455814, 806465101, 806465101, 806465101, 806465101,\n",
       "       806483369, 806483369, 806483369, 806483369, 806483369, 806487219,\n",
       "       806487219, 806487219, 806487226, 806487226, 806487226, 806487226,\n",
       "       806487226, 806487226, 806487226, 806487226, 806487226, 806487226,\n",
       "       806487226, 806487226, 806487231, 808435278, 808435278, 808435278,\n",
       "       808447180, 808447180, 808447180, 808447180, 808447180, 808447180,\n",
       "       808447180, 808447180, 808447180, 808451904, 808451904, 808451904,\n",
       "       808472260, 808472260, 808472260, 808472260, 808472260, 808472260,\n",
       "       808472265, 808472265, 808472265, 808472265, 808488895, 808488895,\n",
       "       808488895, 808489014, 808489014, 808489014, 808489014, 808489014,\n",
       "       808489014, 808489117, 808489117, 808946818, 808946818, 808946818,\n",
       "       808946818, 808949744, 808951460, 808951460, 808956908, 808956908,\n",
       "       808959411, 808959411, 808959411, 808959411, 808961448, 808961480,\n",
       "       808961504, 808961504, 808961504, 808961504, 808961504, 808961655,\n",
       "       808961655, 808961655, 808964815, 808964815, 808964815, 808964815,\n",
       "       808964815, 808964852, 808964852, 808964852, 808964883, 808964883,\n",
       "       808969857, 808969857, 808969857, 808969857, 808969857, 808969857,\n",
       "       808969857, 808972593, 808972593, 808972593, 808972593, 808972593,\n",
       "       808972593, 808972593, 808972593, 808972593, 808972598, 808972598,\n",
       "       808974758, 808974758, 808974758, 808974758, 808974811, 808974811,\n",
       "       808974811, 808974811, 808974811, 808974811, 808974811, 808974811,\n",
       "       808974811, 808974811, 808974972, 808974972, 808976377, 808976377,\n",
       "       808979729, 808979729, 808979729, 808979729, 808979729, 808979729,\n",
       "       808979729, 808979729, 808979729, 808981510, 808981523, 808981523,\n",
       "       808981812, 808981812, 808981812, 808981864, 808982005, 808982041,\n",
       "       808982041, 808982041, 808982041, 808982041, 808982041, 808982547,\n",
       "       808982547, 808982547, 808982547, 808982547, 808982547, 808982547,\n",
       "       808982547, 808984711, 808984711, 808984711, 808984711, 808984711,\n",
       "       808984711, 808984711, 808984711, 808984711, 808984711, 808984711,\n",
       "       808984711, 808984711, 808984711, 808984711, 808984711, 808984711,\n",
       "       808984711, 808984711, 808984711, 808984711, 808984711, 809007627,\n",
       "       809007627, 809007627, 809007627, 809007627, 809007627, 809007627,\n",
       "       809007627, 809007627, 809521500, 809521500, 809521500, 809524432,\n",
       "       809524432, 809524432, 809524432, 809524432, 809524432, 809524432,\n",
       "       809524432, 809524432, 809524432, 809524432, 809524432, 809526097,\n",
       "       809526097, 809544058], dtype=int32)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# the user can access hits.dom_id data for a specific event (for example \n",
    "# event 5)\n",
    "reader.hits_reader('hits.dom_id')[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "218"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We previsouly checked (using reader.event_reader('hits')[5]) that event\n",
    "# 5 has 218 hits, now we can see that reader.hits_reader('hits.dom_id')[5]\n",
    "# has exaclty 218 dom ids as well! \n",
    "len(reader.hits_reader('hits.dom_id')[5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "806451572"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# one can access a dom id of the first hit \n",
    "reader.hits_reader('hits.dom_id')[5][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "The hits key must be one of the following: 'hits.fUniqueID', 'hits.fBits', 'hits.usr', 'hits.usr_names', 'hits.id', 'hits.dom_id', 'hits.channel_id', 'hits.tdc', 'hits.tot', 'hits.trig', 'hits.pmt_id', 'hits.t', 'hits.a', 'hits.pos.x', 'hits.pos.y', 'hits.pos.z', 'hits.dir.x', 'hits.dir.y', 'hits.dir.z', 'hits.pure_t', 'hits.pure_a', 'hits.type', 'hits.origin', 'hits.pattern_flags'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-16-53a843e61284>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;31m# once again, the user is reminded to always use the hits keys stored i Aanet event\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0;31m# file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhits_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'whatever'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m~/km3net/km3net/km3io/km3io/DataReader.py\u001b[0m in \u001b[0;36mhits_reader\u001b[0;34m(self, hits_key)\u001b[0m\n\u001b[1;32m     87\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mhits_key_lazy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     88\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 89\u001b[0;31m             \u001b[0;32mraise\u001b[0m \u001b[0mNameError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The hits key must be one of the following: 'hits.fUniqueID', 'hits.fBits', 'hits.usr', 'hits.usr_names', 'hits.id', 'hits.dom_id', 'hits.channel_id', 'hits.tdc', 'hits.tot', 'hits.trig', 'hits.pmt_id', 'hits.t', 'hits.a', 'hits.pos.x', 'hits.pos.y', 'hits.pos.z', 'hits.dir.x', 'hits.dir.y', 'hits.dir.z', 'hits.pure_t', 'hits.pure_a', 'hits.type', 'hits.origin', 'hits.pattern_flags'\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     91\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0mtracks_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtracks_key\u001b[0m \u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: The hits key must be one of the following: 'hits.fUniqueID', 'hits.fBits', 'hits.usr', 'hits.usr_names', 'hits.id', 'hits.dom_id', 'hits.channel_id', 'hits.tdc', 'hits.tot', 'hits.trig', 'hits.pmt_id', 'hits.t', 'hits.a', 'hits.pos.x', 'hits.pos.y', 'hits.pos.z', 'hits.dir.x', 'hits.dir.y', 'hits.dir.z', 'hits.pure_t', 'hits.pure_a', 'hits.type', 'hits.origin', 'hits.pattern_flags'"
     ]
    }
   ],
   "source": [
    "# once again, the user is reminded to always use the hits keys stored i Aanet event\n",
    "# file\n",
    "reader.hits_reader('whatever')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "#########################################################################\n",
    "#\n",
    "# Now let's explore in more details the tracks:\n",
    "#\n",
    "#########################################################################"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<ChunkedArray [[-0.9048163793905828 -0.9048163793905828 -0.9048163793905828 ... -0.88545604390297 -0.9350162572437829 -0.7485107718446855] [-0.9254262257092779 -0.9254262257092779 -0.9254262257092779 ... -0.6631226836266504 -0.88545604390297 -0.8229838871876581] [-0.5887857820134094 -0.5887857820134094 -0.5887857820134094 ... -0.4647231989130516 -0.88545604390297 -0.88545604390297] ... [-0.6827714023340542 -0.6827714023340542 -0.6827714023340542 ... -0.9350162572437829 -0.4647231989130516 -0.8229838871876581] [-0.9414587076782783 -0.9414587076782783 -0.9414587076782783 ... -0.9709418276783801 -0.8229838871876581 -0.8229838871876581] [-0.8738359256162922 -0.8738359256162922 -0.8738359256162922 ... -0.8229838871876581 -0.7485107718446855 -0.6631226836266504]] at 0x7f9192b52d50>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# reading all data from a specific branch in tracks data:\n",
    "reader.tracks_reader('trks.dir.z')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.95646862, -0.95646862, -0.95646862, -0.95676578, -0.95695685,\n",
       "       -0.95637026, -0.95768896, -0.95888618, -0.95691334, -0.95327743,\n",
       "       -0.95563316, -0.95785959, -0.95019627, -0.9588535 , -0.95330259,\n",
       "       -0.95474777, -0.95125599, -0.9489768 , -0.87580863, -0.92460301,\n",
       "       -0.93501626, -0.97094183, -0.93501626, -0.93501626, -0.93501626,\n",
       "       -0.88545604, -0.97094183, -0.88545604, -0.93501626, -0.88545604,\n",
       "       -0.93501626, -0.97094183, -0.88545604, -0.88545604, -0.88545604,\n",
       "       -0.88545604, -0.82298389, -0.88545604, -0.82298389, -0.88545604,\n",
       "       -0.82298389, -0.93501626, -0.74851077, -0.93501626, -0.82298389,\n",
       "       -0.82298389, -0.82298389, -0.56806477, -0.66312268, -0.93501626,\n",
       "       -0.93501626, -0.74851077, -0.56806477, -0.56806477, -0.88545604,\n",
       "       -0.97094183])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# the user can access trks.dir.z data for a specific event (for example \n",
    "# event 5)\n",
    "reader.tracks_reader('trks.dir.z')[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "56"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# We previsouly checked (using reader.event_reader('trks')[5]) that event\n",
    "# 5 has 56 tracks, now we can see that reader.hits_reader('hits.dom_id')[5]\n",
    "# has exaclty 56 values of trks.dir.z as well! \n",
    "len(reader.tracks_reader('trks.dir.z')[5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.9564686180086494"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# one can access the first trks.dir.z from event 5 using \n",
    "reader.tracks_reader('trks.dir.z')[5][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "The tracks key must be one the following: 'trks.fUniqueID', 'trks.fBits', 'trks.usr', 'trks.usr_names', 'trks.id', 'trks.pos.x', 'trks.pos.y', 'trks.pos.z', 'trks.dir.x', 'trks.dir.y', 'trks.dir.z', 'trks.t', 'trks.E', 'trks.len', 'trks.lik', 'trks.type', 'trks.rec_type', 'trks.rec_stages', 'trks.fitinf', 'trks.hit_ids', 'trks.error_matrix', 'trks.comment'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-24-ba9dff8e27cb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;31m# once again, the user is reminded to always use the tracks keys stored in Aanet\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0;31m# event file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mreader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtracks_reader\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'whatever'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m~/km3net/km3net/km3io/km3io/DataReader.py\u001b[0m in \u001b[0;36mtracks_reader\u001b[0;34m(self, tracks_key)\u001b[0m\n\u001b[1;32m    118\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mtracks_key_lazy\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    119\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 120\u001b[0;31m             \u001b[0;32mraise\u001b[0m \u001b[0mNameError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"The tracks key must be one the following: 'trks.fUniqueID', 'trks.fBits', 'trks.usr', 'trks.usr_names', 'trks.id', 'trks.pos.x', 'trks.pos.y', 'trks.pos.z', 'trks.dir.x', 'trks.dir.y', 'trks.dir.z', 'trks.t', 'trks.E', 'trks.len', 'trks.lik', 'trks.type', 'trks.rec_type', 'trks.rec_stages', 'trks.fitinf', 'trks.hit_ids', 'trks.error_matrix', 'trks.comment'\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    121\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    122\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: The tracks key must be one the following: 'trks.fUniqueID', 'trks.fBits', 'trks.usr', 'trks.usr_names', 'trks.id', 'trks.pos.x', 'trks.pos.y', 'trks.pos.z', 'trks.dir.x', 'trks.dir.y', 'trks.dir.z', 'trks.t', 'trks.E', 'trks.len', 'trks.lik', 'trks.type', 'trks.rec_type', 'trks.rec_stages', 'trks.fitinf', 'trks.hit_ids', 'trks.error_matrix', 'trks.comment'"
     ]
    }
   ],
   "source": [
    "# once again, the user is reminded to always use the tracks keys stored in Aanet\n",
    "# event file\n",
    "reader.tracks_reader('whatever')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}