Skip to content
Snippets Groups Projects
Commit 0bb9553e authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Update

parent aaf25213
No related branches found
No related tags found
1 merge request!14Add premiere talk
Pipeline #8507 passed
...@@ -51,21 +51,31 @@ pip install -e ~/Dev/km3io ...@@ -51,21 +51,31 @@ pip install -e ~/Dev/km3io
- *Goal*: provide a **standalone**, **independent** access to KM3NeT data - *Goal*: provide a **standalone**, **independent** access to KM3NeT data
- Uses the [[https://github.com/scikit-hep/uproot][uproot]] library to access ROOT data - Uses the [[https://github.com/scikit-hep/uproot][uproot]] library to access ROOT data
- Provides convenient wrapper classes - Provides convenient wrapper classes
- Maximum performance due to numpy and numba - Maximum performance due to [[https://www.numpy.org][numpy]] and [[http://numba.pydata.org][numba]]
- Data are read lazily: - Data are read lazily:
- only loaded into memory when directly accessed - only loaded into memory when directly accessed
- apply several cut masks on huge datasets without reading them into the memory - apply several cut masks on huge datasets without reading them into the memory
** uproot
- Describe the projec
- describe Scikit-HEP
- thanks to Jim
- etc.
** Installation ** Installation
- Dependencies: - Dependencies:
- Python 3.5+ - Python 3.5+
- uproot (a small Python package, installed automatically via ~pip~) - uproot (a small Python package, installed automatically via ~pip~)
- no binaries!
- *No ROOT, Jpp or aanet* required to read ROOT files - *No ROOT, Jpp or aanet* required to read ROOT files
- Releases are published on the official Python package repository: - Releases are published on the official Python package repository:
- ~pip install km3io~ - ~pip install km3io~
** Why is it so cool? ** Why is it so cool?
- Runs on Linux, macOS, Windows, as long as Python 3.5+ is installed - Runs on Linux, macOS, Windows, as long as Python 3.5+ is installed
- Every data is a ~numpy~ array or ~awkward~ array (~numpy~ compatible array of complex data structures) - Every data is a ~numpy~ array or ~awkward~ array (~numpy~ compatible array of complex data structures)
** awkward arrays?
- some details on it
- maybe the link to the talk which Jim gave on a HEP conference about awkward arrays
* Accessing Online (DAQ) Data * Accessing Online (DAQ) Data
** km3io supports the following DAQ datatypes ** km3io supports the following DAQ datatypes
...@@ -85,7 +95,8 @@ pip install -e ~/Dev/km3io ...@@ -85,7 +95,8 @@ pip install -e ~/Dev/km3io
*** Opening a run file *** Opening a run file
#+BEGIN_SRC python :results output replace :session km3io :exports both #+BEGIN_SRC python :results output replace :session km3io :exports both
import km3io import km3io
f = km3io.DAQReader("KM3NeT_00000044_00006880.root") # Random run from iRODS # A run from iRODS
f = km3io.DAQReader("KM3NeT_00000044_00006880.root")
print(f.events) print(f.events)
print(f.summaryslices) print(f.summaryslices)
print(f.timeslices) print(f.timeslices)
...@@ -94,7 +105,7 @@ print(f.timeslices) ...@@ -94,7 +105,7 @@ print(f.timeslices)
#+RESULTS: #+RESULTS:
: Number of events: 115038 : Number of events: 115038
: Number of summaryslices: 182668 : Number of summaryslices: 182668
: Available timeslice streams: SN, L1 : Available timeslice streams: L1, SN
*** Investigating timeslice frames *** Investigating timeslice frames
...@@ -121,6 +132,8 @@ print(a_timeslice.frames[806451572].pmt[:42]) ...@@ -121,6 +132,8 @@ print(a_timeslice.frames[806451572].pmt[:42])
*** Checking the number of UDP packets in summary slices *** Checking the number of UDP packets in summary slices
- functions to parse binary masks and bit positions from the KM3NeT format definitions
#+BEGIN_SRC python :results output replace :session km3io :exports both #+BEGIN_SRC python :results output replace :session km3io :exports both
f = km3io.DAQReader("KM3NeT_00000044_00006880.root") f = km3io.DAQReader("KM3NeT_00000044_00006880.root")
sumslice = f.summaryslices.slices[23] sumslice = f.summaryslices.slices[23]
...@@ -144,14 +157,15 @@ print(km3io.daq.get_number_udp_packets(sumslice.dq_status)) ...@@ -144,14 +157,15 @@ print(km3io.daq.get_number_udp_packets(sumslice.dq_status))
* Offline (MC/reco) Data * Offline (MC/reco) Data
** Reading offline files (aka aanet-ROOT files) ** Reading offline files (aka aanet-ROOT files)
#+ATTR_REVEAL: :frag (appear)
- Events - Events
- header information - header information
- hits - hits
- tracks (from reconstruction)
- MC tracks
- MC information - MC information
- MC tracks
- MC hits
- Reco information - Reco information
- tracks
- reconstruction info and parameters
** Opening a reconstructed MUPAGE file ** Opening a reconstructed MUPAGE file
#+BEGIN_SRC python :results output replace :session km3io :exports both #+BEGIN_SRC python :results output replace :session km3io :exports both
...@@ -160,7 +174,7 @@ print(f) ...@@ -160,7 +174,7 @@ print(f)
#+END_SRC #+END_SRC
#+RESULTS: #+RESULTS:
: <km3io.offline.OfflineReader object at 0x7f8eeb436e20> : <km3io.offline.OfflineReader object at 0x1155bde50>
** Investigating events and tracks ** Investigating events and tracks
#+BEGIN_SRC python :results output replace :session km3io :exports both #+BEGIN_SRC python :results output replace :session km3io :exports both
...@@ -210,7 +224,7 @@ offline hit: ...@@ -210,7 +224,7 @@ offline hit:
pattern_flags : 0 pattern_flags : 0
#+end_example #+end_example
*** Tracks *** Tracks :noexportpresentation:
#+BEGIN_SRC python :results output replace :session km3io :exports both #+BEGIN_SRC python :results output replace :session km3io :exports both
print(f[0].tracks[0]) print(f[0].tracks[0])
...@@ -262,18 +276,15 @@ offline track: ...@@ -262,18 +276,15 @@ offline track:
** Extracting the energy of every first reco track in each event ** Extracting the energy of every first reco track in each event
#+BEGIN_SRC python :results output replace :session km3io :exports both #+BEGIN_SRC python :results output replace :session km3io :exports both
# from irods:mc/v5.2/mcv5.2.mupage_10T.sirene.jte.1186.root
f = km3io.OfflineReader("mupage.root") f = km3io.OfflineReader("mupage.root")
print(f.mc_tracks) print(f.events)
print(f.mc_tracks.id.counts) # number of tracks per event
mask = f.mc_tracks.id.counts > 0 print(f.mc_tracks.E.counts)
mask = f.mc_tracks.E.counts > 0
print(f.mc_tracks.E[mask, 0]) print(f.mc_tracks.E[mask, 0])
#+END_SRC #+END_SRC
#+RESULTS:
: Number of tracks: 12236
: [11 2 3 ... 10 1 4]
: [17.72 73.213 10884.78 1694.332 1221.061 22945.123 11019.418 ...]
* ORCA DU4 RBR Analysis Example * ORCA DU4 RBR Analysis Example
** A tiny function to extract track attributes from a list of files ** A tiny function to extract track attributes from a list of files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment