diff --git a/dev/api/index.html b/dev/api/index.html
index 07a7d9911c290f2f89a14ba1f6e2d52999a0d924..fb59ae59073571af6f32bc5951d3bc375c7d80f1 100644
--- a/dev/api/index.html
+++ b/dev/api/index.html
@@ -1,17 +1,17 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>API · KM3io.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><script src="../assets/extra_styles.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">KM3io.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>API</a><ul class="internal"><li><a class="tocitem" href="#Basic-Data-Structures"><span>Basic Data Structures</span></a></li><li><a class="tocitem" href="#Offline-Format"><span>Offline Format</span></a></li><li><a class="tocitem" href="#Online-Format"><span>Online Format</span></a></li><li><a class="tocitem" href="#Hardware-Components"><span>Hardware Components</span></a></li><li><a class="tocitem" href="#Optical-Data"><span>Optical Data</span></a></li><li><a class="tocitem" href="#Acoustics"><span>Acoustics</span></a></li><li><a class="tocitem" href="#Calibration"><span>Calibration</span></a></li><li><a class="tocitem" href="#Trigger"><span>Trigger</span></a></li><li><a class="tocitem" href="#Tools"><span>Tools</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>API</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>API</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/api.md#L" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="API"><a class="docs-heading-anchor" href="#API">API</a><a id="API-1"></a><a class="docs-heading-anchor-permalink" href="#API" title="Permalink"></a></h1><ul><li><a href="#KM3io.AcousticSignal"><code>KM3io.AcousticSignal</code></a></li><li><a href="#KM3io.AcousticsTriggerParameter"><code>KM3io.AcousticsTriggerParameter</code></a></li><li><a href="#KM3io.Detector"><code>KM3io.Detector</code></a></li><li><a href="#KM3io.DetectorModule"><code>KM3io.DetectorModule</code></a></li><li><a href="#KM3io.Direction"><code>KM3io.Direction</code></a></li><li><a href="#KM3io.Hydrophone"><code>KM3io.Hydrophone</code></a></li><li><a href="#KM3io.Location"><code>KM3io.Location</code></a></li><li><a href="#KM3io.PMT"><code>KM3io.PMT</code></a></li><li><a href="#KM3io.Position"><code>KM3io.Position</code></a></li><li><a href="#KM3io.RecStageRange"><code>KM3io.RecStageRange</code></a></li><li><a href="#KM3io.Tripod"><code>KM3io.Tripod</code></a></li><li><a href="#KM3io.Trk"><code>KM3io.Trk</code></a></li><li><a href="#KM3io.Waveform"><code>KM3io.Waveform</code></a></li><li><a href="#KM3io.calibrate"><code>KM3io.calibrate</code></a></li><li><a href="#KM3io.categorize"><code>KM3io.categorize</code></a></li><li><a href="#KM3io.floordist"><code>KM3io.floordist</code></a></li><li><a href="#KM3io.hydrophoneenabled"><code>KM3io.hydrophoneenabled</code></a></li><li><a href="#KM3io.is3dmuon"><code>KM3io.is3dmuon</code></a></li><li><a href="#KM3io.is3dshower"><code>KM3io.is3dshower</code></a></li><li><a href="#KM3io.ismxshower"><code>KM3io.ismxshower</code></a></li><li><a href="#KM3io.isnb"><code>KM3io.isnb</code></a></li><li><a href="#KM3io.most_frequent"><code>KM3io.most_frequent</code></a></li><li><a href="#KM3io.nthbitset"><code>KM3io.nthbitset</code></a></li><li><a href="#KM3io.piezoenabled"><code>KM3io.piezoenabled</code></a></li><li><a href="#KM3io.slew"><code>KM3io.slew</code></a></li></ul><h2 id="Basic-Data-Structures"><a class="docs-heading-anchor" href="#Basic-Data-Structures">Basic Data Structures</a><a id="Basic-Data-Structures-1"></a><a class="docs-heading-anchor-permalink" href="#Basic-Data-Structures" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.Position" href="#KM3io.Position"><code>KM3io.Position</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Position{T} &lt;: StaticArraysCore.FieldVector{3, T}</code></pre><p>A vector to represent a position in 3D.</p><p><strong>Fields</strong></p><ul><li><p><code>x::Any</code></p></li><li><p><code>y::Any</code></p></li><li><p><code>z::Any</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/types.jl#LL7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Direction" href="#KM3io.Direction"><code>KM3io.Direction</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Direction{T} &lt;: StaticArraysCore.FieldVector{3, T}</code></pre><p>A vector to represent a direction in 3D.</p><p><strong>Fields</strong></p><ul><li><p><code>x::Any</code></p></li><li><p><code>y::Any</code></p></li><li><p><code>z::Any</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/types.jl#LL16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Location" href="#KM3io.Location"><code>KM3io.Location</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Location</code></pre><p>A module&#39;s location in the detector where string represents the detection unit identifier and floor counts from 0 from the bottom to top. Base modules are sitting on floor 0 and optical modules on floor 1 and higher.</p><p><strong>Fields</strong></p><ul><li><p><code>string::Int32</code></p></li><li><p><code>floor::Int8</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL19">source</a></section></article><h2 id="Offline-Format"><a class="docs-heading-anchor" href="#Offline-Format">Offline Format</a><a id="Offline-Format-1"></a><a class="docs-heading-anchor-permalink" href="#Offline-Format" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.Trk" href="#KM3io.Trk"><code>KM3io.Trk</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Trk</code></pre><p>Represents a reconstructed &quot;track&quot;, which can be e.g. a muon track but also a shower.</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int64</code></p></li><li><p><code>pos::Position{Float64}</code></p></li><li><p><code>dir::Direction{Float64}</code></p></li><li><p><code>t::Float64</code></p></li><li><p><code>E::Float64</code></p></li><li><p><code>len::Float64</code></p></li><li><p><code>lik::Float64</code></p></li><li><p><code>rec_type::Int32</code></p></li><li><p><code>rec_stages::Vector{Int32}</code></p></li><li><p><code>fitinf::Vector{Float64}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/root/offline.jl#LL26">source</a></section></article><div class="admonition is-warning"><header class="admonition-header">Missing docstring.</header><div class="admonition-body"><p>Missing docstring for <code>McTrk</code>. Check Documenter&#39;s build log for details.</p></div></div><div class="admonition is-warning"><header class="admonition-header">Missing docstring.</header><div class="admonition-body"><p>Missing docstring for <code>Evt</code>. Check Documenter&#39;s build log for details.</p></div></div><h2 id="Online-Format"><a class="docs-heading-anchor" href="#Online-Format">Online Format</a><a id="Online-Format-1"></a><a class="docs-heading-anchor-permalink" href="#Online-Format" title="Permalink"></a></h2><h2 id="Hardware-Components"><a class="docs-heading-anchor" href="#Hardware-Components">Hardware Components</a><a id="Hardware-Components-1"></a><a class="docs-heading-anchor-permalink" href="#Hardware-Components" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.PMT" href="#KM3io.PMT"><code>KM3io.PMT</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct PMT</code></pre><p>The photomultiplier tube of an optical module. The <code>id</code> stands for the DAQ channel ID.</p><p>A non-zero status means the PMT is &quot;not OK&quot;. Individual bits can be read out to identify the problem (see definitions/pmt_status.jl for the bit positions and check them using the <code>nthbitset()</code> function).</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int32</code></p></li><li><p><code>pos::Position</code></p></li><li><p><code>dir::Direction</code></p></li><li><p><code>t₀::Float64</code></p></li><li><p><code>status::Union{Missing, Int32}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL1">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.DetectorModule" href="#KM3io.DetectorModule"><code>KM3io.DetectorModule</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct DetectorModule</code></pre><p>Either a base module or an optical module. A non-zero status means the module is &quot;not OK&quot;. Individual bits can be read out to identify the problem (see definitions/module_status.jl for the bit positions and check them using the <code>nthbitset()</code> function).</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int32</code></p></li><li><p><code>pos::Position</code></p></li><li><p><code>location::Location</code></p></li><li><p><code>n_pmts::Int8</code></p></li><li><p><code>pmts::Vector{PMT}</code></p></li><li><p><code>q::Union{Missing, Quaternion}</code></p></li><li><p><code>status::Int32</code></p></li><li><p><code>t₀::Float64</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Detector" href="#KM3io.Detector"><code>KM3io.Detector</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Detector</code></pre><p>A KM3NeT detector.</p><p><strong>Fields</strong></p><ul><li><p><code>version::Int8</code></p></li><li><p><code>id::Int32</code></p></li><li><p><code>validity::Union{Missing, KM3io.DateRange}</code></p></li><li><p><code>pos::Union{Missing, UTMPosition}</code></p></li><li><p><code>utm_ref_grid::Union{Missing, String}</code></p></li><li><p><code>n_modules::Int32</code></p></li><li><p><code>modules::Dict{Int32, DetectorModule}</code></p></li><li><p><code>locations::Dict{Tuple{Int64, Int64}, DetectorModule}</code></p></li><li><p><code>strings::Vector{Int64}</code></p></li><li><p><code>comments::Vector{String}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL189">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Hydrophone" href="#KM3io.Hydrophone"><code>KM3io.Hydrophone</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Hydrophone</code></pre><p>A hydrophone, typically installed in the base module of a KM3NeT detector&#39;s string.</p><p><strong>Fields</strong></p><ul><li><p><code>location::Location</code></p></li><li><p><code>pos::Position</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL63">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Tripod" href="#KM3io.Tripod"><code>KM3io.Tripod</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Tripod</code></pre><p>A tripod installed on the seabed which sends acoustic signals to modules.</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int8</code></p></li><li><p><code>pos::Position</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL90">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.piezoenabled" href="#KM3io.piezoenabled"><code>KM3io.piezoenabled</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">piezoenabled(m::DetectorModule) -&gt; Bool
-</code></pre><pre><code class="nohighlight hljs">function piezoenabled(m::DetectorModule)</code></pre><p>Return <code>true</code> if the piezo is enabled, <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/acoustics.jl#LL47">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.hydrophoneenabled" href="#KM3io.hydrophoneenabled"><code>KM3io.hydrophoneenabled</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">hydrophoneenabled(m::DetectorModule) -&gt; Bool
-</code></pre><pre><code class="nohighlight hljs">function hydrophonenabled(m::DetectorModule)</code></pre><p>Return <code>true</code> if the hydrophone is enabled, <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/acoustics.jl#LL54">source</a></section></article><h2 id="Optical-Data"><a class="docs-heading-anchor" href="#Optical-Data">Optical Data</a><a id="Optical-Data-1"></a><a class="docs-heading-anchor-permalink" href="#Optical-Data" title="Permalink"></a></h2><h2 id="Acoustics"><a class="docs-heading-anchor" href="#Acoustics">Acoustics</a><a id="Acoustics-1"></a><a class="docs-heading-anchor-permalink" href="#Acoustics" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.Waveform" href="#KM3io.Waveform"><code>KM3io.Waveform</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Waveform</code></pre><p>Waveform translates Emitter ID to Tripod ID.</p><p><strong>Fields</strong></p><ul><li><code>ids::Dict{Int8, Int8}</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL134">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.AcousticSignal" href="#KM3io.AcousticSignal"><code>KM3io.AcousticSignal</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct AcousticSignal</code></pre><p>AcousticSignal is a custom type with four fields to store all the information inside the raw acoustic binary files.</p><ul><li>dom_id::Int32 ID of the module</li><li>utc_seconds:: UInt32 storing the first 4 Bytes and is a UNIX time stamp</li><li>ns_cycles:: UInt32 storing the second 4 Bytes</li><li>samples:: UInt32 storing the third 4 Bytes, corresponding to the number of data points accuired during the measring window</li><li>pcm:: Vector of Float32 of length frame_length, storing all other 4 Byte blocks. Each entry is a data point of the acoustic signal.</li></ul><p><strong>Fields</strong></p><ul><li><p><code>dom_id::Int32</code></p></li><li><p><code>utc_seconds::UInt32</code></p></li><li><p><code>ns_cycles::UInt32</code></p></li><li><p><code>samples::UInt32</code></p></li><li><p><code>pcm::Vector{Float32}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/acoustics.jl#LL8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.AcousticsTriggerParameter" href="#KM3io.AcousticsTriggerParameter"><code>KM3io.AcousticsTriggerParameter</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct AcousticsTriggerParameter</code></pre><p>Certain parameters which define an acoustic event.</p><p><strong>Fields</strong></p><ul><li><p><code>q::Float64</code></p></li><li><p><code>tmax::Float64</code></p></li><li><p><code>nmin::Int32</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/hardware.jl#LL161">source</a></section></article><h2 id="Calibration"><a class="docs-heading-anchor" href="#Calibration">Calibration</a><a id="Calibration-1"></a><a class="docs-heading-anchor-permalink" href="#Calibration" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.calibrate" href="#KM3io.calibrate"><code>KM3io.calibrate</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">calibrate(
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>API · KM3io.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><script src="../assets/extra_styles.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">KM3io.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>API</a><ul class="internal"><li><a class="tocitem" href="#Basic-Data-Structures"><span>Basic Data Structures</span></a></li><li><a class="tocitem" href="#Offline-Format"><span>Offline Format</span></a></li><li><a class="tocitem" href="#Online-Format"><span>Online Format</span></a></li><li><a class="tocitem" href="#Hardware-Components"><span>Hardware Components</span></a></li><li><a class="tocitem" href="#Optical-Data"><span>Optical Data</span></a></li><li><a class="tocitem" href="#Acoustics"><span>Acoustics</span></a></li><li><a class="tocitem" href="#Calibration"><span>Calibration</span></a></li><li><a class="tocitem" href="#Trigger"><span>Trigger</span></a></li><li><a class="tocitem" href="#Tools"><span>Tools</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>API</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>API</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/api.md#L" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="API"><a class="docs-heading-anchor" href="#API">API</a><a id="API-1"></a><a class="docs-heading-anchor-permalink" href="#API" title="Permalink"></a></h1><ul><li><a href="#KM3io.AcousticSignal"><code>KM3io.AcousticSignal</code></a></li><li><a href="#KM3io.AcousticsTriggerParameter"><code>KM3io.AcousticsTriggerParameter</code></a></li><li><a href="#KM3io.Detector"><code>KM3io.Detector</code></a></li><li><a href="#KM3io.DetectorModule"><code>KM3io.DetectorModule</code></a></li><li><a href="#KM3io.Direction"><code>KM3io.Direction</code></a></li><li><a href="#KM3io.Hydrophone"><code>KM3io.Hydrophone</code></a></li><li><a href="#KM3io.Location"><code>KM3io.Location</code></a></li><li><a href="#KM3io.PMT"><code>KM3io.PMT</code></a></li><li><a href="#KM3io.Position"><code>KM3io.Position</code></a></li><li><a href="#KM3io.RecStageRange"><code>KM3io.RecStageRange</code></a></li><li><a href="#KM3io.Tripod"><code>KM3io.Tripod</code></a></li><li><a href="#KM3io.Trk"><code>KM3io.Trk</code></a></li><li><a href="#KM3io.Waveform"><code>KM3io.Waveform</code></a></li><li><a href="#KM3io.besttrack"><code>KM3io.besttrack</code></a></li><li><a href="#KM3io.calibrate"><code>KM3io.calibrate</code></a></li><li><a href="#KM3io.categorize"><code>KM3io.categorize</code></a></li><li><a href="#KM3io.floordist"><code>KM3io.floordist</code></a></li><li><a href="#KM3io.hashistory"><code>KM3io.hashistory</code></a></li><li><a href="#KM3io.hydrophoneenabled"><code>KM3io.hydrophoneenabled</code></a></li><li><a href="#KM3io.is3dmuon"><code>KM3io.is3dmuon</code></a></li><li><a href="#KM3io.is3dshower"><code>KM3io.is3dshower</code></a></li><li><a href="#KM3io.ismxshower"><code>KM3io.ismxshower</code></a></li><li><a href="#KM3io.isnb"><code>KM3io.isnb</code></a></li><li><a href="#KM3io.most_frequent"><code>KM3io.most_frequent</code></a></li><li><a href="#KM3io.nthbitset"><code>KM3io.nthbitset</code></a></li><li><a href="#KM3io.piezoenabled"><code>KM3io.piezoenabled</code></a></li><li><a href="#KM3io.slew"><code>KM3io.slew</code></a></li></ul><h2 id="Basic-Data-Structures"><a class="docs-heading-anchor" href="#Basic-Data-Structures">Basic Data Structures</a><a id="Basic-Data-Structures-1"></a><a class="docs-heading-anchor-permalink" href="#Basic-Data-Structures" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.Position" href="#KM3io.Position"><code>KM3io.Position</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Position{T} &lt;: StaticArraysCore.FieldVector{3, T}</code></pre><p>A vector to represent a position in 3D.</p><p><strong>Fields</strong></p><ul><li><p><code>x::Any</code></p></li><li><p><code>y::Any</code></p></li><li><p><code>z::Any</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/types.jl#LL7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Direction" href="#KM3io.Direction"><code>KM3io.Direction</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Direction{T} &lt;: StaticArraysCore.FieldVector{3, T}</code></pre><p>A vector to represent a direction in 3D.</p><p><strong>Fields</strong></p><ul><li><p><code>x::Any</code></p></li><li><p><code>y::Any</code></p></li><li><p><code>z::Any</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/types.jl#LL16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Location" href="#KM3io.Location"><code>KM3io.Location</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Location</code></pre><p>A module&#39;s location in the detector where string represents the detection unit identifier and floor counts from 0 from the bottom to top. Base modules are sitting on floor 0 and optical modules on floor 1 and higher.</p><p><strong>Fields</strong></p><ul><li><p><code>string::Int32</code></p></li><li><p><code>floor::Int8</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL19">source</a></section></article><h2 id="Offline-Format"><a class="docs-heading-anchor" href="#Offline-Format">Offline Format</a><a id="Offline-Format-1"></a><a class="docs-heading-anchor-permalink" href="#Offline-Format" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.Trk" href="#KM3io.Trk"><code>KM3io.Trk</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Trk</code></pre><p>Represents a reconstructed &quot;track&quot;, which can be e.g. a muon track but also a shower.</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int64</code></p></li><li><p><code>pos::Position{Float64}</code></p></li><li><p><code>dir::Direction{Float64}</code></p></li><li><p><code>t::Float64</code></p></li><li><p><code>E::Float64</code></p></li><li><p><code>len::Float64</code></p></li><li><p><code>lik::Float64</code></p></li><li><p><code>rec_type::Int32</code></p></li><li><p><code>rec_stages::Vector{Int32}</code></p></li><li><p><code>fitinf::Vector{Float64}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/root/offline.jl#LL26">source</a></section></article><div class="admonition is-warning"><header class="admonition-header">Missing docstring.</header><div class="admonition-body"><p>Missing docstring for <code>McTrk</code>. Check Documenter&#39;s build log for details.</p></div></div><div class="admonition is-warning"><header class="admonition-header">Missing docstring.</header><div class="admonition-body"><p>Missing docstring for <code>Evt</code>. Check Documenter&#39;s build log for details.</p></div></div><h2 id="Online-Format"><a class="docs-heading-anchor" href="#Online-Format">Online Format</a><a id="Online-Format-1"></a><a class="docs-heading-anchor-permalink" href="#Online-Format" title="Permalink"></a></h2><h2 id="Hardware-Components"><a class="docs-heading-anchor" href="#Hardware-Components">Hardware Components</a><a id="Hardware-Components-1"></a><a class="docs-heading-anchor-permalink" href="#Hardware-Components" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.PMT" href="#KM3io.PMT"><code>KM3io.PMT</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct PMT</code></pre><p>The photomultiplier tube of an optical module. The <code>id</code> stands for the DAQ channel ID.</p><p>A non-zero status means the PMT is &quot;not OK&quot;. Individual bits can be read out to identify the problem (see definitions/pmt_status.jl for the bit positions and check them using the <code>nthbitset()</code> function).</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int32</code></p></li><li><p><code>pos::Position</code></p></li><li><p><code>dir::Direction</code></p></li><li><p><code>t₀::Float64</code></p></li><li><p><code>status::Union{Missing, Int32}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL1">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.DetectorModule" href="#KM3io.DetectorModule"><code>KM3io.DetectorModule</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct DetectorModule</code></pre><p>Either a base module or an optical module. A non-zero status means the module is &quot;not OK&quot;. Individual bits can be read out to identify the problem (see definitions/module_status.jl for the bit positions and check them using the <code>nthbitset()</code> function).</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int32</code></p></li><li><p><code>pos::Position</code></p></li><li><p><code>location::Location</code></p></li><li><p><code>n_pmts::Int8</code></p></li><li><p><code>pmts::Vector{PMT}</code></p></li><li><p><code>q::Union{Missing, Quaternion}</code></p></li><li><p><code>status::Int32</code></p></li><li><p><code>t₀::Float64</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Detector" href="#KM3io.Detector"><code>KM3io.Detector</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Detector</code></pre><p>A KM3NeT detector.</p><p><strong>Fields</strong></p><ul><li><p><code>version::Int8</code></p></li><li><p><code>id::Int32</code></p></li><li><p><code>validity::Union{Missing, KM3io.DateRange}</code></p></li><li><p><code>pos::Union{Missing, UTMPosition}</code></p></li><li><p><code>utm_ref_grid::Union{Missing, String}</code></p></li><li><p><code>n_modules::Int32</code></p></li><li><p><code>modules::Dict{Int32, DetectorModule}</code></p></li><li><p><code>locations::Dict{Tuple{Int64, Int64}, DetectorModule}</code></p></li><li><p><code>strings::Vector{Int64}</code></p></li><li><p><code>comments::Vector{String}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL189">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Hydrophone" href="#KM3io.Hydrophone"><code>KM3io.Hydrophone</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Hydrophone</code></pre><p>A hydrophone, typically installed in the base module of a KM3NeT detector&#39;s string.</p><p><strong>Fields</strong></p><ul><li><p><code>location::Location</code></p></li><li><p><code>pos::Position</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL63">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.Tripod" href="#KM3io.Tripod"><code>KM3io.Tripod</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Tripod</code></pre><p>A tripod installed on the seabed which sends acoustic signals to modules.</p><p><strong>Fields</strong></p><ul><li><p><code>id::Int8</code></p></li><li><p><code>pos::Position</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL90">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.piezoenabled" href="#KM3io.piezoenabled"><code>KM3io.piezoenabled</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">piezoenabled(m::DetectorModule) -&gt; Bool
+</code></pre><pre><code class="nohighlight hljs">function piezoenabled(m::DetectorModule)</code></pre><p>Return <code>true</code> if the piezo is enabled, <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/acoustics.jl#LL47">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.hydrophoneenabled" href="#KM3io.hydrophoneenabled"><code>KM3io.hydrophoneenabled</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">hydrophoneenabled(m::DetectorModule) -&gt; Bool
+</code></pre><pre><code class="nohighlight hljs">function hydrophonenabled(m::DetectorModule)</code></pre><p>Return <code>true</code> if the hydrophone is enabled, <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/acoustics.jl#LL54">source</a></section></article><h2 id="Optical-Data"><a class="docs-heading-anchor" href="#Optical-Data">Optical Data</a><a id="Optical-Data-1"></a><a class="docs-heading-anchor-permalink" href="#Optical-Data" title="Permalink"></a></h2><h2 id="Acoustics"><a class="docs-heading-anchor" href="#Acoustics">Acoustics</a><a id="Acoustics-1"></a><a class="docs-heading-anchor-permalink" href="#Acoustics" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.Waveform" href="#KM3io.Waveform"><code>KM3io.Waveform</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Waveform</code></pre><p>Waveform translates Emitter ID to Tripod ID.</p><p><strong>Fields</strong></p><ul><li><code>ids::Dict{Int8, Int8}</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL134">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.AcousticSignal" href="#KM3io.AcousticSignal"><code>KM3io.AcousticSignal</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct AcousticSignal</code></pre><p>AcousticSignal is a custom type with four fields to store all the information inside the raw acoustic binary files.</p><ul><li>dom_id::Int32 ID of the module</li><li>utc_seconds:: UInt32 storing the first 4 Bytes and is a UNIX time stamp</li><li>ns_cycles:: UInt32 storing the second 4 Bytes</li><li>samples:: UInt32 storing the third 4 Bytes, corresponding to the number of data points accuired during the measring window</li><li>pcm:: Vector of Float32 of length frame_length, storing all other 4 Byte blocks. Each entry is a data point of the acoustic signal.</li></ul><p><strong>Fields</strong></p><ul><li><p><code>dom_id::Int32</code></p></li><li><p><code>utc_seconds::UInt32</code></p></li><li><p><code>ns_cycles::UInt32</code></p></li><li><p><code>samples::UInt32</code></p></li><li><p><code>pcm::Vector{Float32}</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/acoustics.jl#LL8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.AcousticsTriggerParameter" href="#KM3io.AcousticsTriggerParameter"><code>KM3io.AcousticsTriggerParameter</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct AcousticsTriggerParameter</code></pre><p>Certain parameters which define an acoustic event.</p><p><strong>Fields</strong></p><ul><li><p><code>q::Float64</code></p></li><li><p><code>tmax::Float64</code></p></li><li><p><code>nmin::Int32</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/hardware.jl#LL161">source</a></section></article><h2 id="Calibration"><a class="docs-heading-anchor" href="#Calibration">Calibration</a><a id="Calibration-1"></a><a class="docs-heading-anchor-permalink" href="#Calibration" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.calibrate" href="#KM3io.calibrate"><code>KM3io.calibrate</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">calibrate(
     det::Detector,
     hits
 ) -&gt; Vector{KM3io.CalibratedDAQHit}
-</code></pre><p>Apply geometry and time calibration to given hits.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/calibration.jl#LL1">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.floordist" href="#KM3io.floordist"><code>KM3io.floordist</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">floordist(det::Detector) -&gt; Float64
-</code></pre><p>Calculates the average floor distance between neighboured modules.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/calibration.jl#LL30">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.slew" href="#KM3io.slew"><code>KM3io.slew</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">slew(tot::Integer) -&gt; Any
-</code></pre><p>Return the time slewing for a ToT.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/calibration.jl#LL44">source</a></section></article><h2 id="Trigger"><a class="docs-heading-anchor" href="#Trigger">Trigger</a><a id="Trigger-1"></a><a class="docs-heading-anchor-permalink" href="#Trigger" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.is3dmuon" href="#KM3io.is3dmuon"><code>KM3io.is3dmuon</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">is3dmuon(e::KM3io.DAQEvent) -&gt; Bool
-</code></pre><pre><code class="language-julia hljs">is3dmuon(e)</code></pre><p>defined at <a href="https://github.com//tree/a046ce4273f5a3ce2483a77388f19f67f920aa50//src/tools/trigger.jl#L11"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:11</code></a>.</p><p>Return <code>true</code> the 3D Muon trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/trigger.jl#LL6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.is3dshower" href="#KM3io.is3dshower"><code>KM3io.is3dshower</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">is3dshower(e::KM3io.DAQEvent) -&gt; Bool
-</code></pre><pre><code class="language-julia hljs">is3dshower(e)</code></pre><p>defined at <a href="https://github.com//tree/a046ce4273f5a3ce2483a77388f19f67f920aa50//src/tools/trigger.jl#L19"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:19</code></a>.</p><p>Return <code>true</code> if the 3D Shower trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/trigger.jl#LL14-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.ismxshower" href="#KM3io.ismxshower"><code>KM3io.ismxshower</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">ismxshower(x) -&gt; Bool
-</code></pre><pre><code class="language-julia hljs">ismxshower(x)</code></pre><p>defined at <a href="https://github.com//tree/a046ce4273f5a3ce2483a77388f19f67f920aa50//src/tools/trigger.jl#L27"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:27</code></a>.</p><pre><code class="language-julia hljs">ismxshower(e)</code></pre><p>defined at <a href="https://github.com//tree/a046ce4273f5a3ce2483a77388f19f67f920aa50//src/tools/trigger.jl#L28"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:28</code></a>.</p><p>Return <code>true</code> if the MX Shower trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/trigger.jl#LL22-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.isnb" href="#KM3io.isnb"><code>KM3io.isnb</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">isnb(x) -&gt; Bool
-</code></pre><pre><code class="language-julia hljs">isnb(x)</code></pre><p>defined at <a href="https://github.com//tree/a046ce4273f5a3ce2483a77388f19f67f920aa50//src/tools/trigger.jl#L35"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:35</code></a>.</p><pre><code class="language-julia hljs">isnb(e)</code></pre><p>defined at <a href="https://github.com//tree/a046ce4273f5a3ce2483a77388f19f67f920aa50//src/tools/trigger.jl#L36"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:36</code></a>.</p><p>Return <code>true</code> if the NanoBeacon trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/trigger.jl#LL30-L34">source</a></section></article><h2 id="Tools"><a class="docs-heading-anchor" href="#Tools">Tools</a><a id="Tools-1"></a><a class="docs-heading-anchor-permalink" href="#Tools" title="Permalink"></a></h2><h3 id="General-tools"><a class="docs-heading-anchor" href="#General-tools">General tools</a><a id="General-tools-1"></a><a class="docs-heading-anchor-permalink" href="#General-tools" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="KM3io.categorize" href="#KM3io.categorize"><code>KM3io.categorize</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">categorize(field::Symbol, elements::Vector) -&gt; Dict
+</code></pre><p>Apply geometry and time calibration to given hits.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/calibration.jl#LL1">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.floordist" href="#KM3io.floordist"><code>KM3io.floordist</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">floordist(det::Detector) -&gt; Float64
+</code></pre><p>Calculates the average floor distance between neighboured modules.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/calibration.jl#LL30">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.slew" href="#KM3io.slew"><code>KM3io.slew</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">slew(tot::Integer) -&gt; Any
+</code></pre><p>Return the time slewing for a ToT.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/calibration.jl#LL44">source</a></section></article><h2 id="Trigger"><a class="docs-heading-anchor" href="#Trigger">Trigger</a><a id="Trigger-1"></a><a class="docs-heading-anchor-permalink" href="#Trigger" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="KM3io.is3dmuon" href="#KM3io.is3dmuon"><code>KM3io.is3dmuon</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">is3dmuon(e::KM3io.DAQEvent) -&gt; Bool
+</code></pre><pre><code class="language-julia hljs">is3dmuon(e)</code></pre><p>defined at <a href="https://github.com//tree/fc27e7a42bfc98fcbec34db0455050de1b37ffbc//src/tools/trigger.jl#L11"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:11</code></a>.</p><p>Return <code>true</code> the 3D Muon trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/trigger.jl#LL6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.is3dshower" href="#KM3io.is3dshower"><code>KM3io.is3dshower</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">is3dshower(e::KM3io.DAQEvent) -&gt; Bool
+</code></pre><pre><code class="language-julia hljs">is3dshower(e)</code></pre><p>defined at <a href="https://github.com//tree/fc27e7a42bfc98fcbec34db0455050de1b37ffbc//src/tools/trigger.jl#L19"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:19</code></a>.</p><p>Return <code>true</code> if the 3D Shower trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/trigger.jl#LL14-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.ismxshower" href="#KM3io.ismxshower"><code>KM3io.ismxshower</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">ismxshower(x) -&gt; Bool
+</code></pre><pre><code class="language-julia hljs">ismxshower(x)</code></pre><p>defined at <a href="https://github.com//tree/fc27e7a42bfc98fcbec34db0455050de1b37ffbc//src/tools/trigger.jl#L27"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:27</code></a>.</p><pre><code class="language-julia hljs">ismxshower(e)</code></pre><p>defined at <a href="https://github.com//tree/fc27e7a42bfc98fcbec34db0455050de1b37ffbc//src/tools/trigger.jl#L28"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:28</code></a>.</p><p>Return <code>true</code> if the MX Shower trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/trigger.jl#LL22-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.isnb" href="#KM3io.isnb"><code>KM3io.isnb</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">isnb(x) -&gt; Bool
+</code></pre><pre><code class="language-julia hljs">isnb(x)</code></pre><p>defined at <a href="https://github.com//tree/fc27e7a42bfc98fcbec34db0455050de1b37ffbc//src/tools/trigger.jl#L35"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:35</code></a>.</p><pre><code class="language-julia hljs">isnb(e)</code></pre><p>defined at <a href="https://github.com//tree/fc27e7a42bfc98fcbec34db0455050de1b37ffbc//src/tools/trigger.jl#L36"><code>/builds/common/KM3io.jl/src/tools/trigger.jl:36</code></a>.</p><p>Return <code>true</code> if the NanoBeacon trigger bit is set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/trigger.jl#LL30-L34">source</a></section></article><h2 id="Tools"><a class="docs-heading-anchor" href="#Tools">Tools</a><a id="Tools-1"></a><a class="docs-heading-anchor-permalink" href="#Tools" title="Permalink"></a></h2><h3 id="General-tools"><a class="docs-heading-anchor" href="#General-tools">General tools</a><a id="General-tools-1"></a><a class="docs-heading-anchor-permalink" href="#General-tools" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="KM3io.categorize" href="#KM3io.categorize"><code>KM3io.categorize</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">categorize(field::Symbol, elements::Vector) -&gt; Dict
 </code></pre><p>Categorise the struct elements of a vector by a given field into a dictionary of <code>T.field =&gt; Vector{T}</code>.</p><p><strong>Examples</strong></p><pre><code class="nohighlight hljs">julia&gt; using KM3io
 
 julia&gt; struct PMT  # just an ad-hoc PMT struct for demonstration purposes
@@ -24,10 +24,15 @@ julia&gt; pmts = [PMT(2, 10.4), PMT(4, 23.5), PMT(2, 42.0)];
 julia&gt; categorize(:dom_id, pmts)
 Dict{Any, Vector{PMT}} with 2 entries:
   4 =&gt; [PMT(4, 23.5)]
-  2 =&gt; [PMT(2, 10.4), PMT(2, 42.0)]</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/general.jl#LL56">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.nthbitset" href="#KM3io.nthbitset"><code>KM3io.nthbitset</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">nthbitset(n, a) -&gt; Any
-</code></pre><p>Return <code>true</code> if the n-th bit of <code>a</code> is set, <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/general.jl#LL1">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.most_frequent" href="#KM3io.most_frequent"><code>KM3io.most_frequent</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">most_frequent(iterable) -&gt; Any
-</code></pre><p>Return the most frequent value of a given iterable.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/general.jl#LL7">source</a></section><section><div><pre><code class="language-julia hljs">most_frequent(f::Function, iterable; rettype) -&gt; Int64
-</code></pre><p>Return the most frequent value of a given iterable based on the return value of a function <code>f</code> which returns (hashable) values of <code>rettype</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/general.jl#LL30">source</a></section></article><h3 id="Reconstruction"><a class="docs-heading-anchor" href="#Reconstruction">Reconstruction</a><a id="Reconstruction-1"></a><a class="docs-heading-anchor-permalink" href="#Reconstruction" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="KM3io.RecStageRange" href="#KM3io.RecStageRange"><code>KM3io.RecStageRange</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct RecStageRange{T&lt;:Integer}</code></pre><p>This struct is used to represent a range of reconstruction stages. These are well-defined integers (see <a href="https://git.km3net.de/common/km3net-dataformat/-/blob/master/definitions/reconstruction.csv">KM3NeT Dataformat</a>) for each reconstruction algorithm and are stored in a vector named <code>rec_stages</code> of each <a href="#KM3io.Trk"><code>Trk</code></a>.</p><pre><code class="language-julia-repl hljs">julia&gt; using KM3io
+  2 =&gt; [PMT(2, 10.4), PMT(2, 42.0)]</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/general.jl#LL56">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.nthbitset" href="#KM3io.nthbitset"><code>KM3io.nthbitset</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">nthbitset(n, a) -&gt; Any
+</code></pre><p>Return <code>true</code> if the n-th bit of <code>a</code> is set, <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/general.jl#LL1">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.most_frequent" href="#KM3io.most_frequent"><code>KM3io.most_frequent</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">most_frequent(iterable) -&gt; Any
+</code></pre><p>Return the most frequent value of a given iterable.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/general.jl#LL7">source</a></section><section><div><pre><code class="language-julia hljs">most_frequent(f::Function, iterable; rettype) -&gt; Int64
+</code></pre><p>Return the most frequent value of a given iterable based on the return value of a function <code>f</code> which returns (hashable) values of <code>rettype</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/general.jl#LL30">source</a></section></article><h3 id="Reconstruction"><a class="docs-heading-anchor" href="#Reconstruction">Reconstruction</a><a id="Reconstruction-1"></a><a class="docs-heading-anchor-permalink" href="#Reconstruction" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-binding" id="KM3io.besttrack" href="#KM3io.besttrack"><code>KM3io.besttrack</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">besttrack(
+    e::KM3io.Evt,
+    rec_type::Integer,
+    rsr::RecStageRange
+) -&gt; Union{Nothing, Trk}
+</code></pre><p>Return the best reconstructed track for a given reconstruction type and reconstruction stage range. If no track could be found, <code>nothing</code> is returned.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/reconstruction.jl#LL69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.RecStageRange" href="#KM3io.RecStageRange"><code>KM3io.RecStageRange</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct RecStageRange{T&lt;:Integer}</code></pre><p>This struct is used to represent a range of reconstruction stages. These are well-defined integers (see <a href="https://git.km3net.de/common/km3net-dataformat/-/blob/master/definitions/reconstruction.csv">KM3NeT Dataformat</a>) for each reconstruction algorithm and are stored in a vector named <code>rec_stages</code> of each <a href="#KM3io.Trk"><code>Trk</code></a>.</p><pre><code class="language-julia-repl hljs">julia&gt; using KM3io
 
 julia&gt; rsr = RecStageRange(KM3io.RECONSTRUCTION.JMUONBEGIN, KM3io.RECONSTRUCTION.JMUONEND)
 RecStageRange{Int64}(0, 99)
@@ -42,4 +47,14 @@ julia&gt; 23 ∈ rsr
 true
 
 julia&gt; 523 ∈ rsr
-false</code></pre><p><strong>Fields</strong></p><ul><li><p><code>lower::Integer</code></p></li><li><p><code>upper::Integer</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/a046ce4273f5a3ce2483a77388f19f67f920aa50/src/tools/reconstruction.jl#LL1">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 09:08">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+false</code></pre><p><strong>Fields</strong></p><ul><li><p><code>lower::Integer</code></p></li><li><p><code>upper::Integer</code></p></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/reconstruction.jl#LL1">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="KM3io.hashistory" href="#KM3io.hashistory"><code>KM3io.hashistory</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">hashistory(
+    t::Trk,
+    rec_type::Integer,
+    rsr::RecStageRange
+) -&gt; Bool
+</code></pre><p>Returns <code>true</code> if a track with a given <code>rec_type</code> contains all the reconstruction stages in <code>rsr::RecStageRange</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/reconstruction.jl#LL34">source</a></section><section><div><pre><code class="language-julia hljs">hashistory(
+    t::Trk,
+    rec_type::Integer,
+    rec_stage::Integer
+) -&gt; Union{Missing, Bool}
+</code></pre><p>Returns <code>true</code> if a track with a given <code>rec_type</code> contains the <code>rec_stage</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.km3net.de/common/KM3io.jl/blob/fc27e7a42bfc98fcbec34db0455050de1b37ffbc/src/tools/reconstruction.jl#LL45">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 22:01">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/examples/index.html b/dev/examples/index.html
index 2f3bb406c9bbe2f6ffd345e7a4c498fa15b1973e..994eceddb1a1f61529b674b5e0bb7a4df8a49e34 100644
--- a/dev/examples/index.html
+++ b/dev/examples/index.html
@@ -1,4 +1,4 @@
 <!DOCTYPE html>
 <html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Examples · KM3io.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><script src="../assets/extra_styles.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">KM3io.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Examples</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Examples</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/examples.md#L" title="Edit source"><span class="docs-icon fa"></span><span class="docs-label is-hidden-touch">Edit source</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Examples"><a class="docs-heading-anchor" href="#Examples">Examples</a><a id="Examples-1"></a><a class="docs-heading-anchor-permalink" href="#Examples" title="Permalink"></a></h1><h2 id="Whatever"><a class="docs-heading-anchor" href="#Whatever">Whatever</a><a id="Whatever-1"></a><a class="docs-heading-anchor-permalink" href="#Whatever" title="Permalink"></a></h2><pre><code class="language- hljs">using KM3io, KM3NeTTestData
 
-f = ROOTFile(datapath(&quot;offline&quot;, &quot;numucc.root&quot;))</code></pre></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 09:08">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+f = ROOTFile(datapath(&quot;offline&quot;, &quot;numucc.root&quot;))</code></pre></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 22:01">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/index.html b/dev/index.html
index 8ddf409050737483375997bae229da579d091434..eba54df2d4a31a19e3bc2474485c1fe535c86510 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -127,4 +127,4 @@ julia&gt; for s ∈ f.online.summaryslices
        end
 s.header = KM3io.SummarysliceHeader(44, 6633, 126, KM3io.UTCExtended(0x5dc6018c, 0x23c34600, false))
 s.header = KM3io.SummarysliceHeader(44, 6633, 127, KM3io.UTCExtended(0x5dc6018c, 0x29b92700, false))
-s.header = KM3io.SummarysliceHeader(44, 6633, 128, KM3io.UTCExtended(0x5dc6018c, 0x2faf0800, false))</code></pre><p>To access the actual PMT rates and flags (e.g. for high-rate veto or FIFO status), the <code>s.frames</code> can be used (TODO).</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="api/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 09:08">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+s.header = KM3io.SummarysliceHeader(44, 6633, 128, KM3io.UTCExtended(0x5dc6018c, 0x2faf0800, false))</code></pre><p>To access the actual PMT rates and flags (e.g. for high-rate veto or FIFO status), the <code>s.frames</code> can be used (TODO).</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="api/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 22:01">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/search/index.html b/dev/search/index.html
index 89298a5779ab6d775e63da792f5e6a0ef7832ef2..2df0e5375c3183afea06375856ac8b4c8e063538 100644
--- a/dev/search/index.html
+++ b/dev/search/index.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · KM3io.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><script src="../assets/extra_styles.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">KM3io.jl</a></span></div><form class="docs-search" action><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Search</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Search</a></li></ul></nav><div class="docs-right"><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article><p id="documenter-search-info">Loading search...</p><ul id="documenter-search-results"></ul></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 09:08">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><script src="../search_index.js"></script><script src="../assets/search.js"></script></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · KM3io.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><script src="../assets/extra_styles.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">KM3io.jl</a></span></div><form class="docs-search" action><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Search</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Search</a></li></ul></nav><div class="docs-right"><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article><p id="documenter-search-info">Loading search...</p><ul id="documenter-search-results"></ul></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Monday 17 April 2023 22:01">Monday 17 April 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><script src="../search_index.js"></script><script src="../assets/search.js"></script></html>
diff --git a/dev/search_index.js b/dev/search_index.js
index 3bfaca30aa703d46dba6e3b3d107d7e24e3877a1..e81fc9f5aee4b8cef45f44380b00cbd694a9f54d 100644
--- a/dev/search_index.js
+++ b/dev/search_index.js
@@ -1,3 +1,3 @@
 var documenterSearchIndex = {"docs":
-[{"location":"api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"","category":"page"},{"location":"api/#Basic-Data-Structures","page":"API","title":"Basic Data Structures","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"Position\nDirection\nLocation","category":"page"},{"location":"api/#KM3io.Position","page":"API","title":"KM3io.Position","text":"struct Position{T} <: StaticArraysCore.FieldVector{3, T}\n\nA vector to represent a position in 3D.\n\nFields\n\nx::Any\ny::Any\nz::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Direction","page":"API","title":"KM3io.Direction","text":"struct Direction{T} <: StaticArraysCore.FieldVector{3, T}\n\nA vector to represent a direction in 3D.\n\nFields\n\nx::Any\ny::Any\nz::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Location","page":"API","title":"KM3io.Location","text":"struct Location\n\nA module's location in the detector where string represents the detection unit identifier and floor counts from 0 from the bottom to top. Base modules are sitting on floor 0 and optical modules on floor 1 and higher.\n\nFields\n\nstring::Int32\nfloor::Int8\n\n\n\n\n\n","category":"type"},{"location":"api/#Offline-Format","page":"API","title":"Offline Format","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"Trk\nMcTrk\nEvt","category":"page"},{"location":"api/#KM3io.Trk","page":"API","title":"KM3io.Trk","text":"struct Trk\n\nRepresents a reconstructed \"track\", which can be e.g. a muon track but also a shower.\n\nFields\n\nid::Int64\npos::Position{Float64}\ndir::Direction{Float64}\nt::Float64\nE::Float64\nlen::Float64\nlik::Float64\nrec_type::Int32\nrec_stages::Vector{Int32}\nfitinf::Vector{Float64}\n\n\n\n\n\n","category":"type"},{"location":"api/#Online-Format","page":"API","title":"Online Format","text":"","category":"section"},{"location":"api/#Hardware-Components","page":"API","title":"Hardware Components","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"PMT\nDetectorModule\nDetector\nHydrophone\nTripod\npiezoenabled\nhydrophoneenabled","category":"page"},{"location":"api/#KM3io.PMT","page":"API","title":"KM3io.PMT","text":"struct PMT\n\nThe photomultiplier tube of an optical module. The id stands for the DAQ channel ID.\n\nA non-zero status means the PMT is \"not OK\". Individual bits can be read out to identify the problem (see definitions/pmt_status.jl for the bit positions and check them using the nthbitset() function).\n\nFields\n\nid::Int32\npos::Position\ndir::Direction\nt₀::Float64\nstatus::Union{Missing, Int32}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.DetectorModule","page":"API","title":"KM3io.DetectorModule","text":"struct DetectorModule\n\nEither a base module or an optical module. A non-zero status means the module is \"not OK\". Individual bits can be read out to identify the problem (see definitions/module_status.jl for the bit positions and check them using the nthbitset() function).\n\nFields\n\nid::Int32\npos::Position\nlocation::Location\nn_pmts::Int8\npmts::Vector{PMT}\nq::Union{Missing, Quaternion}\nstatus::Int32\nt₀::Float64\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Detector","page":"API","title":"KM3io.Detector","text":"struct Detector\n\nA KM3NeT detector.\n\nFields\n\nversion::Int8\nid::Int32\nvalidity::Union{Missing, KM3io.DateRange}\npos::Union{Missing, UTMPosition}\nutm_ref_grid::Union{Missing, String}\nn_modules::Int32\nmodules::Dict{Int32, DetectorModule}\nlocations::Dict{Tuple{Int64, Int64}, DetectorModule}\nstrings::Vector{Int64}\ncomments::Vector{String}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Hydrophone","page":"API","title":"KM3io.Hydrophone","text":"struct Hydrophone\n\nA hydrophone, typically installed in the base module of a KM3NeT detector's string.\n\nFields\n\nlocation::Location\npos::Position\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Tripod","page":"API","title":"KM3io.Tripod","text":"struct Tripod\n\nA tripod installed on the seabed which sends acoustic signals to modules.\n\nFields\n\nid::Int8\npos::Position\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.piezoenabled","page":"API","title":"KM3io.piezoenabled","text":"piezoenabled(m::DetectorModule) -> Bool\n\n\nfunction piezoenabled(m::DetectorModule)\n\nReturn true if the piezo is enabled, false otherwise.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.hydrophoneenabled","page":"API","title":"KM3io.hydrophoneenabled","text":"hydrophoneenabled(m::DetectorModule) -> Bool\n\n\nfunction hydrophonenabled(m::DetectorModule)\n\nReturn true if the hydrophone is enabled, false otherwise.\n\n\n\n\n\n","category":"function"},{"location":"api/#Optical-Data","page":"API","title":"Optical Data","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"","category":"page"},{"location":"api/#Acoustics","page":"API","title":"Acoustics","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"Waveform\nAcousticSignal\nAcousticsTriggerParameter","category":"page"},{"location":"api/#KM3io.Waveform","page":"API","title":"KM3io.Waveform","text":"struct Waveform\n\nWaveform translates Emitter ID to Tripod ID.\n\nFields\n\nids::Dict{Int8, Int8}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.AcousticSignal","page":"API","title":"KM3io.AcousticSignal","text":"struct AcousticSignal\n\nAcousticSignal is a custom type with four fields to store all the information inside the raw acoustic binary files.\n\ndom_id::Int32 ID of the module\nutc_seconds:: UInt32 storing the first 4 Bytes and is a UNIX time stamp\nns_cycles:: UInt32 storing the second 4 Bytes\nsamples:: UInt32 storing the third 4 Bytes, corresponding to the number of data points accuired during the measring window\npcm:: Vector of Float32 of length frame_length, storing all other 4 Byte blocks. Each entry is a data point of the acoustic signal.\n\nFields\n\ndom_id::Int32\nutc_seconds::UInt32\nns_cycles::UInt32\nsamples::UInt32\npcm::Vector{Float32}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.AcousticsTriggerParameter","page":"API","title":"KM3io.AcousticsTriggerParameter","text":"struct AcousticsTriggerParameter\n\nCertain parameters which define an acoustic event.\n\nFields\n\nq::Float64\ntmax::Float64\nnmin::Int32\n\n\n\n\n\n","category":"type"},{"location":"api/#Calibration","page":"API","title":"Calibration","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"calibrate\nfloordist\nslew","category":"page"},{"location":"api/#KM3io.calibrate","page":"API","title":"KM3io.calibrate","text":"calibrate(\n    det::Detector,\n    hits\n) -> Vector{KM3io.CalibratedDAQHit}\n\n\nApply geometry and time calibration to given hits.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.floordist","page":"API","title":"KM3io.floordist","text":"floordist(det::Detector) -> Float64\n\n\nCalculates the average floor distance between neighboured modules.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.slew","page":"API","title":"KM3io.slew","text":"slew(tot::Integer) -> Any\n\n\nReturn the time slewing for a ToT.\n\n\n\n\n\n","category":"function"},{"location":"api/#Trigger","page":"API","title":"Trigger","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"is3dmuon\nis3dshower\nismxshower\nisnb","category":"page"},{"location":"api/#KM3io.is3dmuon","page":"API","title":"KM3io.is3dmuon","text":"is3dmuon(e::KM3io.DAQEvent) -> Bool\n\n\nis3dmuon(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:11.\n\nReturn true the 3D Muon trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.is3dshower","page":"API","title":"KM3io.is3dshower","text":"is3dshower(e::KM3io.DAQEvent) -> Bool\n\n\nis3dshower(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:19.\n\nReturn true if the 3D Shower trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.ismxshower","page":"API","title":"KM3io.ismxshower","text":"ismxshower(x) -> Bool\n\n\nismxshower(x)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:27.\n\nismxshower(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:28.\n\nReturn true if the MX Shower trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.isnb","page":"API","title":"KM3io.isnb","text":"isnb(x) -> Bool\n\n\nisnb(x)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:35.\n\nisnb(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:36.\n\nReturn true if the NanoBeacon trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#Tools","page":"API","title":"Tools","text":"","category":"section"},{"location":"api/#General-tools","page":"API","title":"General tools","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"categorize\nnthbitset\nmost_frequent","category":"page"},{"location":"api/#KM3io.categorize","page":"API","title":"KM3io.categorize","text":"categorize(field::Symbol, elements::Vector) -> Dict\n\n\nCategorise the struct elements of a vector by a given field into a dictionary of T.field => Vector{T}.\n\nExamples\n\njulia> using KM3io\n\njulia> struct PMT  # just an ad-hoc PMT struct for demonstration purposes\n         dom_id\n         time\n       end\n\njulia> pmts = [PMT(2, 10.4), PMT(4, 23.5), PMT(2, 42.0)];\n\njulia> categorize(:dom_id, pmts)\nDict{Any, Vector{PMT}} with 2 entries:\n  4 => [PMT(4, 23.5)]\n  2 => [PMT(2, 10.4), PMT(2, 42.0)]\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.nthbitset","page":"API","title":"KM3io.nthbitset","text":"nthbitset(n, a) -> Any\n\n\nReturn true if the n-th bit of a is set, false otherwise.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.most_frequent","page":"API","title":"KM3io.most_frequent","text":"most_frequent(iterable) -> Any\n\n\nReturn the most frequent value of a given iterable.\n\n\n\n\n\nmost_frequent(f::Function, iterable; rettype) -> Int64\n\n\nReturn the most frequent value of a given iterable based on the return value of a function f which returns (hashable) values of rettype.\n\n\n\n\n\n","category":"function"},{"location":"api/#Reconstruction","page":"API","title":"Reconstruction","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"RecStageRange","category":"page"},{"location":"api/#KM3io.RecStageRange","page":"API","title":"KM3io.RecStageRange","text":"struct RecStageRange{T<:Integer}\n\nThis struct is used to represent a range of reconstruction stages. These are well-defined integers (see KM3NeT Dataformat) for each reconstruction algorithm and are stored in a vector named rec_stages of each Trk.\n\njulia> using KM3io\n\njulia> rsr = RecStageRange(KM3io.RECONSTRUCTION.JMUONBEGIN, KM3io.RECONSTRUCTION.JMUONEND)\nRecStageRange{Int64}(0, 99)\n\njulia> KM3io.RECONSTRUCTION.JMUONSIMPLEX ∈ rsr\ntrue\n\njulia> KM3io.RECONSTRUCTION.AASHOWERFITPREFIT ∈ rsr\nfalse\n\njulia> 23 ∈ rsr\ntrue\n\njulia> 523 ∈ rsr\nfalse\n\nFields\n\nlower::Integer\nupper::Integer\n\n\n\n\n\n","category":"type"},{"location":"examples/#Examples","page":"Examples","title":"Examples","text":"","category":"section"},{"location":"examples/#Whatever","page":"Examples","title":"Whatever","text":"","category":"section"},{"location":"examples/","page":"Examples","title":"Examples","text":"using KM3io, KM3NeTTestData\n\nf = ROOTFile(datapath(\"offline\", \"numucc.root\"))","category":"page"},{"location":"#KM3io.jl","page":"Home","title":"KM3io.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Stable) (Image: Dev) (Image: Build Status) (Image: Coverage)","category":"page"},{"location":"","page":"Home","title":"Home","text":"KM3io.jl is a Julia library which implements high-performance I/O functions and additional utilities to deal with dataformats used in KM3NeT, e.g. ROOT (online/offline files), DETX (detector geometry and calibrations) and acoustics (waveforms and hardware). In contrast to Python, you are free to utilise as many (nested) for-loops as you like while still being as fast as in e.g. in C++.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Apropos ROOT and C++, the KM3NeT Dataformat is defined in C++ and uses the I/O functionality of the ROOT framework to create the online and offline ROOT files. Luckily, there is a pure Julia library named UnROOT.jl that provides access the the ROOT files without the need to install ROOT or the corresponding C++ library. This allows KM3io.jl to be completely free from these external dependencies.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The library is still under development so that the API might slightly change. Feedback and contributions are highly welcome!","category":"page"},{"location":"#TODOs","page":"Home","title":"TODOs","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"These are mostly low-hanging fruits, so feel free to contribute! ;)","category":"page"},{"location":"","page":"Home","title":"Home","text":"[ ] Best track selection (cf. the implementation in km3io or KM3NeT Dataformat, latter being much more closer to the Julia implementation since we don't need all the fancy masking/slicing magic as in Python)\n[ ] Hit calibration for the offline format: fairly straight forward\n[ ] Event+Summaryslice matching: for a given event, return the correct summaryslice to be able to query the most recent PMT rates\n[ ] Optimise type hierarchy\n[ ] Examples!","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"KM3io.jl is not an officially registered Julia package but it's available via the KM3NeT Julia registry. To add the KM3NeT Julia registry to your local Julia registry list, follow the instructions in its README.","category":"page"},{"location":"#ROOT-Files","page":"Home","title":"ROOT Files","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The two main types of ROOT files in KM3NeT are the online and offline files, however, both types can be mixed together as the data is stored in distinct ROOT trees. UnROOT has a single ROOTFile type to represent a KM3NeT ROOT file which can be used to access both the online and offline information. This section describes what kind of data is stored in each tree and how to access them.","category":"page"},{"location":"#Offline-Dataformat","page":"Home","title":"Offline Dataformat","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The offline dataformat is used to store Monte Carlo (MC) simulations and reconstruction results. The OfflineTree type represents an actual offline file and it is essentially a vector of events (Vector{Evt}) with some fancy caching, lazy access and slicing magic. The offline tree is accessible via the .offline field of the ROOTFile type.","category":"page"},{"location":"#MC-Header","page":"Home","title":"MC Header","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The MC header stores metadata related to the simulation chain. The individual entries can be accessed as properties, as shown below.","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io, KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"offline\", \"numucc.root\"))\nROOTFile{OnlineTree (0 events, 0 summaryslices), OfflineTree (10 events)}\n\njulia> f.offline\nOfflineTree (10 events)\n\njulia> f.offline.header\nMCHeader\n  DAQ => (livetime = 394,)\n  PDF => (i1 = 4, i2 = 58)\n  XSecFile => Any[]\n  can => (zmin = 0, zmax = 1027, r = 888.4)\n  can_user => [0.0, 1027.0, 888.4]\n  coord_origin => (x = 0, y = 0, z = 0)\n  cut_in => (Emin = 0, Emax = 0, cosTmin = 0, cosTmax = 0)\n  cut_nu => (Emin = 100, Emax = 1.0e8, cosTmin = -1, cosTmax = 1)\n  cut_primary => (Emin = 0, Emax = 0, cosTmin = 0, cosTmax = 0)\n  cut_seamuon => (Emin = 0, Emax = 0, cosTmin = 0, cosTmax = 0)\n  decay => [\"doesnt\", \"happen\"]\n  detector => NOT\n  drawing => Volume\n  end_event => Any[]\n  genhencut => (gDir = 2000, Emin = 0)\n  genvol => (zmin = 0, zmax = 1027, r = 888.4, volume = 2.649e9, numberOfEvents = 100000)\n  kcut => 2\n  livetime => (numberOfSeconds = 0, errorOfSeconds = 0)\n  model => (interaction = 1, muon = 2, scattering = 0, numberOfEnergyBins = 1, field_4 = 12)\n  muon_desc_file => Any[]\n  ngen => 100000.0\n  norma => (primaryFlux = 0, numberOfPrimaries = 0)\n  nuflux => Real[0, 3, 0, 0.5, 0.0, 1.0, 3.0]\n  physics => (program = \"GENHEN\", version = \"7.2-220514\", date = 181116, time = 1138)\n  seed => (program = \"GENHEN\", level = 3, iseed = 305765867, field_3 = 0, field_4 = 0)\n  simul => (program = \"JSirene\", version = 11012, date = \"11/17/18\", time = 7)\n  sourcemode => diffuse\n  spectrum => (alpha = -1.4,)\n  start_run => 1\n  target => isoscalar\n  usedetfile => false\n  xlat_user => 0.63297\n  xparam => OFF\n  zed_user => [0.0, 3450.0]\n\n\njulia> f.offline.header.genvol\n(zmin = 0, zmax = 1027, r = 888.4, volume = 2.649e9, numberOfEvents = 100000)\n\njulia> f.offline.header.genvol.volume\n2.649e9","category":"page"},{"location":"#Event-data","page":"Home","title":"Event data","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The following REPL session shows how to open a file, access individual events or slices of events, loop through events and access e.g. the tracks which are stored in the events.","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io, KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"offline\", \"km3net_offline.root\"))\nROOTFile{OfflineTree (10 events)}\n\njulia> f.offline[5]\nKM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n\njulia> f.offline[3:5]\n3-element Vector{KM3io.Evt}:\n KM3io.Evt (318 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n KM3io.Evt (157 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n KM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n\njulia> event = f.offline[1]\nKM3io.Evt (176 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n\njulia> event.trks[:4]\nKM3io.Trk(4, [448.25834890057024, ... , 291.64653112688273, 4000)\n\njulia> event.trks[1:4]\n4-element Vector{KM3io.Trk}:\n KM3io.Trk(1, [445.835395997812, ... , 294.6407542676734, 4000)\n KM3io.Trk(2, [445.835395997812, ... , 294.6407542676734, 4000)\n KM3io.Trk(3, [448.136188112227, ... , 294.6407542676734, 4000)\n KM3io.Trk(4, [448.258348900570, ... , 291.64653112688273, 4000)\n\njulia> for event in f.offline\n           @show event\n       end\nevent = KM3io.Evt (176 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (125 hits, 0 MC hits, 55 tracks, 0 MC tracks)\nevent = KM3io.Evt (318 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (157 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (60 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (71 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (84 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (255 hits, 0 MC hits, 54 tracks, 0 MC tracks)\nevent = KM3io.Evt (105 hits, 0 MC hits, 56 tracks, 0 MC tracks)","category":"page"},{"location":"#Online-Dataformat","page":"Home","title":"Online Dataformat","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The online dataformat refers to the dataformat which is written by the data acquisition system (DAQ) of the KM3NeT detectors, more precisely, the ROOT files produced by the JDataFilter which is part of the Jpp framework. The very same format is used in run-by-run (RBR) Monte Carlo (MC) productions, which mimic the detector response and therefore produce similarly structured data. The online data can be accessed via the .online field of the ROOTFile type.","category":"page"},{"location":"#Event-data-2","page":"Home","title":"Event data","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The events are accessible via ROOTFile(filename).online.events which supports indexing, slicing and iteration, just like the we have seen above, in case of the offline events. Notice however that the online format also contains other types of trees, that's why the explicit .events field is needed. Everything is lazily loaded so that the data is only occupying memory when it's actually accessed, similar to the offline access. In the examples below, we use KM3NeTTestdata to get access to small sample files.","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io\n\njulia> using KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"online\", \"km3net_online.root\"))\nROOTFile{OnlineTree (3 events, 3 summaryslices), OfflineTree (0 events)}\n\njulia> event = f.online.events[1]\nKM3io.DAQEvent with 96 snapshot and 18 triggered hits\n\njulia> event.triggered_hits[4:8]\n5-element Vector{KM3io.TriggeredHit}:\n KM3io.TriggeredHit(808447186, 0x00, 30733214, 0x19, 0x0000000000000016)\n KM3io.TriggeredHit(808447186, 0x01, 30733214, 0x15, 0x0000000000000016)\n KM3io.TriggeredHit(808447186, 0x02, 30733215, 0x15, 0x0000000000000016)\n KM3io.TriggeredHit(808447186, 0x03, 30733214, 0x1c, 0x0000000000000016)\n KM3io.TriggeredHit(808451907, 0x07, 30733441, 0x1e, 0x0000000000000004)\n\njulia> for event ∈ f.online.events\n           @show event.header.frame_index length(event.snapshot_hits)\n       end\nevent.header.frame_index = 127\nlength(event.snapshot_hits) = 96\nevent.header.frame_index = 127\nlength(event.snapshot_hits) = 124\nevent.header.frame_index = 129\nlength(event.snapshot_hits) = 78","category":"page"},{"location":"#Summaryslices-and-Summary-Frames","page":"Home","title":"Summaryslices and Summary Frames","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Summaryslices are generated from timeslices (raw hit data) and are produced by the DataFilter. A slice contains the data of 100ms and is divided into so-called frames, each corresponding to the data of a single optical module. Due to the high amount of data, the storage of timeslices is usually reduced by a factor of 10-100 after the event triggering stage. However, summaryslices are covering the full data taking period. They however do not contain hit data but only the rates of the PMTs encoded into a single byte, which therefore is only capable to store 256 different values. The actual rate is calcuated by a helper function (TODO).","category":"page"},{"location":"","page":"Home","title":"Home","text":"The summaryslices are accessible using the .summaryslices attribute of the OnlineTree instance, which again is hidden behind the .online field of a ROOTFile:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io, UnROOT, KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"online\", \"km3net_online.root\"))\nROOTFile{OnlineTree (3 events, 3 summaryslices), OfflineTree (0 events)}\n\njulia> f.online.summaryslices\nKM3io.SummarysliceContainer with 3 summaryslices\n\njulia> for s ∈ f.online.summaryslices\n           @show s.header\n       end\ns.header = KM3io.SummarysliceHeader(44, 6633, 126, KM3io.UTCExtended(0x5dc6018c, 0x23c34600, false))\ns.header = KM3io.SummarysliceHeader(44, 6633, 127, KM3io.UTCExtended(0x5dc6018c, 0x29b92700, false))\ns.header = KM3io.SummarysliceHeader(44, 6633, 128, KM3io.UTCExtended(0x5dc6018c, 0x2faf0800, false))","category":"page"},{"location":"","page":"Home","title":"Home","text":"To access the actual PMT rates and flags (e.g. for high-rate veto or FIFO status), the s.frames can be used (TODO).","category":"page"}]
+[{"location":"api/#API","page":"API","title":"API","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"","category":"page"},{"location":"api/#Basic-Data-Structures","page":"API","title":"Basic Data Structures","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"Position\nDirection\nLocation","category":"page"},{"location":"api/#KM3io.Position","page":"API","title":"KM3io.Position","text":"struct Position{T} <: StaticArraysCore.FieldVector{3, T}\n\nA vector to represent a position in 3D.\n\nFields\n\nx::Any\ny::Any\nz::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Direction","page":"API","title":"KM3io.Direction","text":"struct Direction{T} <: StaticArraysCore.FieldVector{3, T}\n\nA vector to represent a direction in 3D.\n\nFields\n\nx::Any\ny::Any\nz::Any\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Location","page":"API","title":"KM3io.Location","text":"struct Location\n\nA module's location in the detector where string represents the detection unit identifier and floor counts from 0 from the bottom to top. Base modules are sitting on floor 0 and optical modules on floor 1 and higher.\n\nFields\n\nstring::Int32\nfloor::Int8\n\n\n\n\n\n","category":"type"},{"location":"api/#Offline-Format","page":"API","title":"Offline Format","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"Trk\nMcTrk\nEvt","category":"page"},{"location":"api/#KM3io.Trk","page":"API","title":"KM3io.Trk","text":"struct Trk\n\nRepresents a reconstructed \"track\", which can be e.g. a muon track but also a shower.\n\nFields\n\nid::Int64\npos::Position{Float64}\ndir::Direction{Float64}\nt::Float64\nE::Float64\nlen::Float64\nlik::Float64\nrec_type::Int32\nrec_stages::Vector{Int32}\nfitinf::Vector{Float64}\n\n\n\n\n\n","category":"type"},{"location":"api/#Online-Format","page":"API","title":"Online Format","text":"","category":"section"},{"location":"api/#Hardware-Components","page":"API","title":"Hardware Components","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"PMT\nDetectorModule\nDetector\nHydrophone\nTripod\npiezoenabled\nhydrophoneenabled","category":"page"},{"location":"api/#KM3io.PMT","page":"API","title":"KM3io.PMT","text":"struct PMT\n\nThe photomultiplier tube of an optical module. The id stands for the DAQ channel ID.\n\nA non-zero status means the PMT is \"not OK\". Individual bits can be read out to identify the problem (see definitions/pmt_status.jl for the bit positions and check them using the nthbitset() function).\n\nFields\n\nid::Int32\npos::Position\ndir::Direction\nt₀::Float64\nstatus::Union{Missing, Int32}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.DetectorModule","page":"API","title":"KM3io.DetectorModule","text":"struct DetectorModule\n\nEither a base module or an optical module. A non-zero status means the module is \"not OK\". Individual bits can be read out to identify the problem (see definitions/module_status.jl for the bit positions and check them using the nthbitset() function).\n\nFields\n\nid::Int32\npos::Position\nlocation::Location\nn_pmts::Int8\npmts::Vector{PMT}\nq::Union{Missing, Quaternion}\nstatus::Int32\nt₀::Float64\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Detector","page":"API","title":"KM3io.Detector","text":"struct Detector\n\nA KM3NeT detector.\n\nFields\n\nversion::Int8\nid::Int32\nvalidity::Union{Missing, KM3io.DateRange}\npos::Union{Missing, UTMPosition}\nutm_ref_grid::Union{Missing, String}\nn_modules::Int32\nmodules::Dict{Int32, DetectorModule}\nlocations::Dict{Tuple{Int64, Int64}, DetectorModule}\nstrings::Vector{Int64}\ncomments::Vector{String}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Hydrophone","page":"API","title":"KM3io.Hydrophone","text":"struct Hydrophone\n\nA hydrophone, typically installed in the base module of a KM3NeT detector's string.\n\nFields\n\nlocation::Location\npos::Position\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.Tripod","page":"API","title":"KM3io.Tripod","text":"struct Tripod\n\nA tripod installed on the seabed which sends acoustic signals to modules.\n\nFields\n\nid::Int8\npos::Position\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.piezoenabled","page":"API","title":"KM3io.piezoenabled","text":"piezoenabled(m::DetectorModule) -> Bool\n\n\nfunction piezoenabled(m::DetectorModule)\n\nReturn true if the piezo is enabled, false otherwise.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.hydrophoneenabled","page":"API","title":"KM3io.hydrophoneenabled","text":"hydrophoneenabled(m::DetectorModule) -> Bool\n\n\nfunction hydrophonenabled(m::DetectorModule)\n\nReturn true if the hydrophone is enabled, false otherwise.\n\n\n\n\n\n","category":"function"},{"location":"api/#Optical-Data","page":"API","title":"Optical Data","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"","category":"page"},{"location":"api/#Acoustics","page":"API","title":"Acoustics","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"Waveform\nAcousticSignal\nAcousticsTriggerParameter","category":"page"},{"location":"api/#KM3io.Waveform","page":"API","title":"KM3io.Waveform","text":"struct Waveform\n\nWaveform translates Emitter ID to Tripod ID.\n\nFields\n\nids::Dict{Int8, Int8}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.AcousticSignal","page":"API","title":"KM3io.AcousticSignal","text":"struct AcousticSignal\n\nAcousticSignal is a custom type with four fields to store all the information inside the raw acoustic binary files.\n\ndom_id::Int32 ID of the module\nutc_seconds:: UInt32 storing the first 4 Bytes and is a UNIX time stamp\nns_cycles:: UInt32 storing the second 4 Bytes\nsamples:: UInt32 storing the third 4 Bytes, corresponding to the number of data points accuired during the measring window\npcm:: Vector of Float32 of length frame_length, storing all other 4 Byte blocks. Each entry is a data point of the acoustic signal.\n\nFields\n\ndom_id::Int32\nutc_seconds::UInt32\nns_cycles::UInt32\nsamples::UInt32\npcm::Vector{Float32}\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.AcousticsTriggerParameter","page":"API","title":"KM3io.AcousticsTriggerParameter","text":"struct AcousticsTriggerParameter\n\nCertain parameters which define an acoustic event.\n\nFields\n\nq::Float64\ntmax::Float64\nnmin::Int32\n\n\n\n\n\n","category":"type"},{"location":"api/#Calibration","page":"API","title":"Calibration","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"calibrate\nfloordist\nslew","category":"page"},{"location":"api/#KM3io.calibrate","page":"API","title":"KM3io.calibrate","text":"calibrate(\n    det::Detector,\n    hits\n) -> Vector{KM3io.CalibratedDAQHit}\n\n\nApply geometry and time calibration to given hits.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.floordist","page":"API","title":"KM3io.floordist","text":"floordist(det::Detector) -> Float64\n\n\nCalculates the average floor distance between neighboured modules.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.slew","page":"API","title":"KM3io.slew","text":"slew(tot::Integer) -> Any\n\n\nReturn the time slewing for a ToT.\n\n\n\n\n\n","category":"function"},{"location":"api/#Trigger","page":"API","title":"Trigger","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"is3dmuon\nis3dshower\nismxshower\nisnb","category":"page"},{"location":"api/#KM3io.is3dmuon","page":"API","title":"KM3io.is3dmuon","text":"is3dmuon(e::KM3io.DAQEvent) -> Bool\n\n\nis3dmuon(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:11.\n\nReturn true the 3D Muon trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.is3dshower","page":"API","title":"KM3io.is3dshower","text":"is3dshower(e::KM3io.DAQEvent) -> Bool\n\n\nis3dshower(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:19.\n\nReturn true if the 3D Shower trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.ismxshower","page":"API","title":"KM3io.ismxshower","text":"ismxshower(x) -> Bool\n\n\nismxshower(x)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:27.\n\nismxshower(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:28.\n\nReturn true if the MX Shower trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.isnb","page":"API","title":"KM3io.isnb","text":"isnb(x) -> Bool\n\n\nisnb(x)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:35.\n\nisnb(e)\n\ndefined at /builds/common/KM3io.jl/src/tools/trigger.jl:36.\n\nReturn true if the NanoBeacon trigger bit is set.\n\n\n\n\n\n","category":"function"},{"location":"api/#Tools","page":"API","title":"Tools","text":"","category":"section"},{"location":"api/#General-tools","page":"API","title":"General tools","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"categorize\nnthbitset\nmost_frequent","category":"page"},{"location":"api/#KM3io.categorize","page":"API","title":"KM3io.categorize","text":"categorize(field::Symbol, elements::Vector) -> Dict\n\n\nCategorise the struct elements of a vector by a given field into a dictionary of T.field => Vector{T}.\n\nExamples\n\njulia> using KM3io\n\njulia> struct PMT  # just an ad-hoc PMT struct for demonstration purposes\n         dom_id\n         time\n       end\n\njulia> pmts = [PMT(2, 10.4), PMT(4, 23.5), PMT(2, 42.0)];\n\njulia> categorize(:dom_id, pmts)\nDict{Any, Vector{PMT}} with 2 entries:\n  4 => [PMT(4, 23.5)]\n  2 => [PMT(2, 10.4), PMT(2, 42.0)]\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.nthbitset","page":"API","title":"KM3io.nthbitset","text":"nthbitset(n, a) -> Any\n\n\nReturn true if the n-th bit of a is set, false otherwise.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.most_frequent","page":"API","title":"KM3io.most_frequent","text":"most_frequent(iterable) -> Any\n\n\nReturn the most frequent value of a given iterable.\n\n\n\n\n\nmost_frequent(f::Function, iterable; rettype) -> Int64\n\n\nReturn the most frequent value of a given iterable based on the return value of a function f which returns (hashable) values of rettype.\n\n\n\n\n\n","category":"function"},{"location":"api/#Reconstruction","page":"API","title":"Reconstruction","text":"","category":"section"},{"location":"api/","page":"API","title":"API","text":"besttrack\nRecStageRange\nhashistory","category":"page"},{"location":"api/#KM3io.besttrack","page":"API","title":"KM3io.besttrack","text":"besttrack(\n    e::KM3io.Evt,\n    rec_type::Integer,\n    rsr::RecStageRange\n) -> Union{Nothing, Trk}\n\n\nReturn the best reconstructed track for a given reconstruction type and reconstruction stage range. If no track could be found, nothing is returned.\n\n\n\n\n\n","category":"function"},{"location":"api/#KM3io.RecStageRange","page":"API","title":"KM3io.RecStageRange","text":"struct RecStageRange{T<:Integer}\n\nThis struct is used to represent a range of reconstruction stages. These are well-defined integers (see KM3NeT Dataformat) for each reconstruction algorithm and are stored in a vector named rec_stages of each Trk.\n\njulia> using KM3io\n\njulia> rsr = RecStageRange(KM3io.RECONSTRUCTION.JMUONBEGIN, KM3io.RECONSTRUCTION.JMUONEND)\nRecStageRange{Int64}(0, 99)\n\njulia> KM3io.RECONSTRUCTION.JMUONSIMPLEX ∈ rsr\ntrue\n\njulia> KM3io.RECONSTRUCTION.AASHOWERFITPREFIT ∈ rsr\nfalse\n\njulia> 23 ∈ rsr\ntrue\n\njulia> 523 ∈ rsr\nfalse\n\nFields\n\nlower::Integer\nupper::Integer\n\n\n\n\n\n","category":"type"},{"location":"api/#KM3io.hashistory","page":"API","title":"KM3io.hashistory","text":"hashistory(\n    t::Trk,\n    rec_type::Integer,\n    rsr::RecStageRange\n) -> Bool\n\n\nReturns true if a track with a given rec_type contains all the reconstruction stages in rsr::RecStageRange.\n\n\n\n\n\nhashistory(\n    t::Trk,\n    rec_type::Integer,\n    rec_stage::Integer\n) -> Union{Missing, Bool}\n\n\nReturns true if a track with a given rec_type contains the rec_stage.\n\n\n\n\n\n","category":"function"},{"location":"examples/#Examples","page":"Examples","title":"Examples","text":"","category":"section"},{"location":"examples/#Whatever","page":"Examples","title":"Whatever","text":"","category":"section"},{"location":"examples/","page":"Examples","title":"Examples","text":"using KM3io, KM3NeTTestData\n\nf = ROOTFile(datapath(\"offline\", \"numucc.root\"))","category":"page"},{"location":"#KM3io.jl","page":"Home","title":"KM3io.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Stable) (Image: Dev) (Image: Build Status) (Image: Coverage)","category":"page"},{"location":"","page":"Home","title":"Home","text":"KM3io.jl is a Julia library which implements high-performance I/O functions and additional utilities to deal with dataformats used in KM3NeT, e.g. ROOT (online/offline files), DETX (detector geometry and calibrations) and acoustics (waveforms and hardware). In contrast to Python, you are free to utilise as many (nested) for-loops as you like while still being as fast as in e.g. in C++.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Apropos ROOT and C++, the KM3NeT Dataformat is defined in C++ and uses the I/O functionality of the ROOT framework to create the online and offline ROOT files. Luckily, there is a pure Julia library named UnROOT.jl that provides access the the ROOT files without the need to install ROOT or the corresponding C++ library. This allows KM3io.jl to be completely free from these external dependencies.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The library is still under development so that the API might slightly change. Feedback and contributions are highly welcome!","category":"page"},{"location":"#TODOs","page":"Home","title":"TODOs","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"These are mostly low-hanging fruits, so feel free to contribute! ;)","category":"page"},{"location":"","page":"Home","title":"Home","text":"[ ] Best track selection (cf. the implementation in km3io or KM3NeT Dataformat, latter being much more closer to the Julia implementation since we don't need all the fancy masking/slicing magic as in Python)\n[ ] Hit calibration for the offline format: fairly straight forward\n[ ] Event+Summaryslice matching: for a given event, return the correct summaryslice to be able to query the most recent PMT rates\n[ ] Optimise type hierarchy\n[ ] Examples!","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"KM3io.jl is not an officially registered Julia package but it's available via the KM3NeT Julia registry. To add the KM3NeT Julia registry to your local Julia registry list, follow the instructions in its README.","category":"page"},{"location":"#ROOT-Files","page":"Home","title":"ROOT Files","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The two main types of ROOT files in KM3NeT are the online and offline files, however, both types can be mixed together as the data is stored in distinct ROOT trees. UnROOT has a single ROOTFile type to represent a KM3NeT ROOT file which can be used to access both the online and offline information. This section describes what kind of data is stored in each tree and how to access them.","category":"page"},{"location":"#Offline-Dataformat","page":"Home","title":"Offline Dataformat","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The offline dataformat is used to store Monte Carlo (MC) simulations and reconstruction results. The OfflineTree type represents an actual offline file and it is essentially a vector of events (Vector{Evt}) with some fancy caching, lazy access and slicing magic. The offline tree is accessible via the .offline field of the ROOTFile type.","category":"page"},{"location":"#MC-Header","page":"Home","title":"MC Header","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The MC header stores metadata related to the simulation chain. The individual entries can be accessed as properties, as shown below.","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io, KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"offline\", \"numucc.root\"))\nROOTFile{OnlineTree (0 events, 0 summaryslices), OfflineTree (10 events)}\n\njulia> f.offline\nOfflineTree (10 events)\n\njulia> f.offline.header\nMCHeader\n  DAQ => (livetime = 394,)\n  PDF => (i1 = 4, i2 = 58)\n  XSecFile => Any[]\n  can => (zmin = 0, zmax = 1027, r = 888.4)\n  can_user => [0.0, 1027.0, 888.4]\n  coord_origin => (x = 0, y = 0, z = 0)\n  cut_in => (Emin = 0, Emax = 0, cosTmin = 0, cosTmax = 0)\n  cut_nu => (Emin = 100, Emax = 1.0e8, cosTmin = -1, cosTmax = 1)\n  cut_primary => (Emin = 0, Emax = 0, cosTmin = 0, cosTmax = 0)\n  cut_seamuon => (Emin = 0, Emax = 0, cosTmin = 0, cosTmax = 0)\n  decay => [\"doesnt\", \"happen\"]\n  detector => NOT\n  drawing => Volume\n  end_event => Any[]\n  genhencut => (gDir = 2000, Emin = 0)\n  genvol => (zmin = 0, zmax = 1027, r = 888.4, volume = 2.649e9, numberOfEvents = 100000)\n  kcut => 2\n  livetime => (numberOfSeconds = 0, errorOfSeconds = 0)\n  model => (interaction = 1, muon = 2, scattering = 0, numberOfEnergyBins = 1, field_4 = 12)\n  muon_desc_file => Any[]\n  ngen => 100000.0\n  norma => (primaryFlux = 0, numberOfPrimaries = 0)\n  nuflux => Real[0, 3, 0, 0.5, 0.0, 1.0, 3.0]\n  physics => (program = \"GENHEN\", version = \"7.2-220514\", date = 181116, time = 1138)\n  seed => (program = \"GENHEN\", level = 3, iseed = 305765867, field_3 = 0, field_4 = 0)\n  simul => (program = \"JSirene\", version = 11012, date = \"11/17/18\", time = 7)\n  sourcemode => diffuse\n  spectrum => (alpha = -1.4,)\n  start_run => 1\n  target => isoscalar\n  usedetfile => false\n  xlat_user => 0.63297\n  xparam => OFF\n  zed_user => [0.0, 3450.0]\n\n\njulia> f.offline.header.genvol\n(zmin = 0, zmax = 1027, r = 888.4, volume = 2.649e9, numberOfEvents = 100000)\n\njulia> f.offline.header.genvol.volume\n2.649e9","category":"page"},{"location":"#Event-data","page":"Home","title":"Event data","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The following REPL session shows how to open a file, access individual events or slices of events, loop through events and access e.g. the tracks which are stored in the events.","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io, KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"offline\", \"km3net_offline.root\"))\nROOTFile{OfflineTree (10 events)}\n\njulia> f.offline[5]\nKM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n\njulia> f.offline[3:5]\n3-element Vector{KM3io.Evt}:\n KM3io.Evt (318 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n KM3io.Evt (157 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n KM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n\njulia> event = f.offline[1]\nKM3io.Evt (176 hits, 0 MC hits, 56 tracks, 0 MC tracks)\n\njulia> event.trks[:4]\nKM3io.Trk(4, [448.25834890057024, ... , 291.64653112688273, 4000)\n\njulia> event.trks[1:4]\n4-element Vector{KM3io.Trk}:\n KM3io.Trk(1, [445.835395997812, ... , 294.6407542676734, 4000)\n KM3io.Trk(2, [445.835395997812, ... , 294.6407542676734, 4000)\n KM3io.Trk(3, [448.136188112227, ... , 294.6407542676734, 4000)\n KM3io.Trk(4, [448.258348900570, ... , 291.64653112688273, 4000)\n\njulia> for event in f.offline\n           @show event\n       end\nevent = KM3io.Evt (176 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (125 hits, 0 MC hits, 55 tracks, 0 MC tracks)\nevent = KM3io.Evt (318 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (157 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (83 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (60 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (71 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (84 hits, 0 MC hits, 56 tracks, 0 MC tracks)\nevent = KM3io.Evt (255 hits, 0 MC hits, 54 tracks, 0 MC tracks)\nevent = KM3io.Evt (105 hits, 0 MC hits, 56 tracks, 0 MC tracks)","category":"page"},{"location":"#Online-Dataformat","page":"Home","title":"Online Dataformat","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The online dataformat refers to the dataformat which is written by the data acquisition system (DAQ) of the KM3NeT detectors, more precisely, the ROOT files produced by the JDataFilter which is part of the Jpp framework. The very same format is used in run-by-run (RBR) Monte Carlo (MC) productions, which mimic the detector response and therefore produce similarly structured data. The online data can be accessed via the .online field of the ROOTFile type.","category":"page"},{"location":"#Event-data-2","page":"Home","title":"Event data","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The events are accessible via ROOTFile(filename).online.events which supports indexing, slicing and iteration, just like the we have seen above, in case of the offline events. Notice however that the online format also contains other types of trees, that's why the explicit .events field is needed. Everything is lazily loaded so that the data is only occupying memory when it's actually accessed, similar to the offline access. In the examples below, we use KM3NeTTestdata to get access to small sample files.","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io\n\njulia> using KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"online\", \"km3net_online.root\"))\nROOTFile{OnlineTree (3 events, 3 summaryslices), OfflineTree (0 events)}\n\njulia> event = f.online.events[1]\nKM3io.DAQEvent with 96 snapshot and 18 triggered hits\n\njulia> event.triggered_hits[4:8]\n5-element Vector{KM3io.TriggeredHit}:\n KM3io.TriggeredHit(808447186, 0x00, 30733214, 0x19, 0x0000000000000016)\n KM3io.TriggeredHit(808447186, 0x01, 30733214, 0x15, 0x0000000000000016)\n KM3io.TriggeredHit(808447186, 0x02, 30733215, 0x15, 0x0000000000000016)\n KM3io.TriggeredHit(808447186, 0x03, 30733214, 0x1c, 0x0000000000000016)\n KM3io.TriggeredHit(808451907, 0x07, 30733441, 0x1e, 0x0000000000000004)\n\njulia> for event ∈ f.online.events\n           @show event.header.frame_index length(event.snapshot_hits)\n       end\nevent.header.frame_index = 127\nlength(event.snapshot_hits) = 96\nevent.header.frame_index = 127\nlength(event.snapshot_hits) = 124\nevent.header.frame_index = 129\nlength(event.snapshot_hits) = 78","category":"page"},{"location":"#Summaryslices-and-Summary-Frames","page":"Home","title":"Summaryslices and Summary Frames","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Summaryslices are generated from timeslices (raw hit data) and are produced by the DataFilter. A slice contains the data of 100ms and is divided into so-called frames, each corresponding to the data of a single optical module. Due to the high amount of data, the storage of timeslices is usually reduced by a factor of 10-100 after the event triggering stage. However, summaryslices are covering the full data taking period. They however do not contain hit data but only the rates of the PMTs encoded into a single byte, which therefore is only capable to store 256 different values. The actual rate is calcuated by a helper function (TODO).","category":"page"},{"location":"","page":"Home","title":"Home","text":"The summaryslices are accessible using the .summaryslices attribute of the OnlineTree instance, which again is hidden behind the .online field of a ROOTFile:","category":"page"},{"location":"","page":"Home","title":"Home","text":"julia> using KM3io, UnROOT, KM3NeTTestData\n\njulia> f = ROOTFile(datapath(\"online\", \"km3net_online.root\"))\nROOTFile{OnlineTree (3 events, 3 summaryslices), OfflineTree (0 events)}\n\njulia> f.online.summaryslices\nKM3io.SummarysliceContainer with 3 summaryslices\n\njulia> for s ∈ f.online.summaryslices\n           @show s.header\n       end\ns.header = KM3io.SummarysliceHeader(44, 6633, 126, KM3io.UTCExtended(0x5dc6018c, 0x23c34600, false))\ns.header = KM3io.SummarysliceHeader(44, 6633, 127, KM3io.UTCExtended(0x5dc6018c, 0x29b92700, false))\ns.header = KM3io.SummarysliceHeader(44, 6633, 128, KM3io.UTCExtended(0x5dc6018c, 0x2faf0800, false))","category":"page"},{"location":"","page":"Home","title":"Home","text":"To access the actual PMT rates and flags (e.g. for high-rate veto or FIFO status), the s.frames can be used (TODO).","category":"page"}]
 }