<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[a4paper, 11pt]{book}

\usepackage{graphicx}
\usepackage{color}
\usepackage[hidelinks]{hyperref}
\hypersetup{
  colorlinks   = true,    % Colours links instead of ugly boxes
  urlcolor     = blue,    % Colour for external hyperlinks
  linkcolor    = blue,    % Colour of internal links
  citecolor    = red      % Colour of citations
}
\usepackage{alertmessage}
\usepackage{listings}
% \usepackage{forest}
\usepackage{dirtree}
\usepackage{bytefield}
\usepackage[separate-uncertainty=true,multi-part-units=single]{siunitx}
\usepackage{xcolor}

\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{ascii}{
    backgroundcolor=\color{backcolour},
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,
    breaklines=true,
    captionpos=b,
    keepspaces=true,
    numbers=left,
    numbersep=5pt,
    showspaces=false,
    showstringspaces=false,
    showtabs=false,
    tabsize=2
}

\lstset{style=ascii}

\newcommand{\datafield}[3][]{%
  \noindent\parbox{\linewidth}{
    \noindent\textbf{\texttt{\detokenize{#2}}}%
    \ifx&amp;#1&amp;% Check if the optional argument is empty
    \else\ \textit{(#1)}\fi\ % Display datatype in italics if given
    \vspace{0.2em}
    \\
    \vspace{0.5em}\hspace{2.0em}\parbox[t]{\linewidth - 2.0em}{%
        #3%
    }\par\vspace{0.5em} % Adds spacing between each field

   }
}

\newenvironment{fieldspecs}
{
}
{
}
%

\begin{document}

\title{KM3NeT Dataformat Specifications}
\author{Tam\'as G\'al}
\date{\today}
\maketitle

\tableofcontents

\part{Introduction}


\part{Detector Description}


The KM3NeT detector description is stored in two different file formats: ASCII
(.detx) and binary (.datx). The ASCII version uses UTF-16 encoding. The file
contains information about the position of the active elements (depending on the
version: anchors, optical and base modules and PMTs) of the detector and the
timing information.


\section{DETX}
\subsection{Version 1 (August 2014)}
\begin{lstlisting}
global_det_id ndoms\n
dom_id line_id floor_id npmts\n
pmt_id_global x y z dx dy dz t0 opt\n
pmt_id_global x y z dx dy dz t0 opt\n
...
pmt_id_global x y z dx dy dz t0 opt\n
#repeat for each dom
\end{lstlisting}

\begin{fieldspecs}
  \datafield[int]{global_det_id}{The global detector identifier. Negative values between -100 and 0 are indicating simulation detectors. It is 1 for the PPM-DU and follows the KM3NeT serial number for all detectors in testing and the sea.}
  \datafield[unsigned int]{ndoms}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
  \datafield[int]{dom_id}{The unique optical module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
  \datafield[int]{line_id}{The string number.}
  \datafield[int]{floor_id}{The floor number starting at 1. In some older DETX files, this might be -1. In this case, the floors are assumed to be numbered strictly monotonically increasing as they appear in the file.}
  \datafield[unsigned int]{npmts}{The number of PMTs. Can be 0.}
  \datafield[int]{pmt_id_global}{The unique global PMT ID. When applicable, the ID corresponds to the ID in the MC files or the KM3NeT product number.}
  \datafield[int or float]{x, y, z}{The position of the PMT.}
  \datafield[int or float]{dx, dy, dz}{The direction where the PMT is pointing at.}
  \datafield[int or float]{t0}{The calibration time offset which has to be added to the detected hit times.}
  \datafield[int or float]{opt}{Optional (undocumented) calibration values (space separated) might appear here.}
\end{fieldspecs}

\alertinfo{Within each DOM section, the PMTs are listed according to an ascending order of their DAQ channel ID, starting at 0.}


\subsubsection*{Example}

Example for DU-2 (ARCA-DU1) at its test in the dark room (detector-ID 5) this is:

\begin{lstlisting}
5 18
808992603 1 1 31
1838 -0.166 0 72.111 -0.830 0 0.556 0
4944 0 -0.191 72.059 0 -0.954 0.296 0
4945 -0.165 -0.096 72.059 -0.826 -0.478 0.297 0
...
808974928 1 2 31
1746 -0.166 0 108.111 -0.830 0 0.556 0
...
\end{lstlisting}

\subsection{Version 2 (April 2016)}

The first version of the detector format does include global position variables
that are not well defined. In addition, no validity time span is defined that is
e.g. necessary for the detector deforming due to the sea current. Therefore, a
new data format is proposed – with main changes in the header section.

\begin{lstlisting}
global_det_id format_version\n
UTC_validity_from UTC_validity_to \n
UTM_ref_grid UTM_ref_easting UTM_ref_northing UTM_ref_z \n
ndoms \n
dom_id line_id floor_id npmts\n
 pmt_id_global x y z dx dy dz t0 opt\n
 pmt_id_global x y z dx dy dz t0 opt\n
 ...
 pmt_id_global x y z dx dy dz t0 opt\n
#repeat for each dom
\end{lstlisting}

\begin{fieldspecs}
  \datafield[int]{global_det_id}{The global detector identifier. Negative values between -100 and 0 are indicating simulation detectors. It is 1 for the PPM-DU and follows the KM3NeT serial number for all detectors in testing and the sea.}
  \datafield[string]{format_version}{The version of the data format with the following format: (v|V)[1-9][0-9]+}
  \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
  \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
  \datafield[string]{UTM_ref_grid}{The reference grid, composed of the string UTM, the reference ellipsoid and the UTM grid of the detector, e.g. "UTM WGS84 33N" for the ARCA site in Italy.}
  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
  \datafield[unsigned int]{ndoms}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
  \datafield[int]{dom_id}{The unique optical module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
  \datafield[int]{line_id}{The string number.}
  \datafield[int]{floor_id}{The floor number starting at 1. In some older DETX files, this might be -1. In this case, the floors are assumed to be numbered strictly monotonically increasing as they appear in the file.}
  \datafield[unsigned int]{npmts}{The number of PMTs. Can be 0.}
  \datafield[int]{pmt_id_global}{The unique global PMT ID. When applicable, the ID corresponds to the ID in the MC files or the KM3NeT product number.}
  \datafield[int or float]{x, y, z}{The position of the PMT with reference to the UTM coordinate with x (y) defining the relative distance in Easting (Northing) in metres.}
  \datafield[int or float]{dx, dy, dz}{The direction where the PMT is pointing at.}
  \datafield[int or float]{t0}{The calibration time offset which has to be added to the detected hit times.}
  \datafield[int or float]{opt}{Optional (undocumented) calibration values (space separated) might appear here.}
\end{fieldspecs}

\alertinfo{Within each DOM section, the PMTs are listed according to an ascending order of their DAQ channel ID, starting at 0.}

\subsubsection*{Example}

Example for ARCA28 (D0ARCA028, detector-ID 160):

\begin{lstlisting}
160 v2
1695281794.0 9999999999.0
UTM WGS84 33N 587600 4016800 -3450
504
817606477 1 1 31
 28677 -23.09 49.51363 67.363 0 -0.83185 0.555 0
 29160 -23.2811 49.68 67.311 -0.9555 0 0.295 0
 28685 -23.18555 49.5145 67.311 -0.47775 -0.82748 0.295 0
 29152 -22.99445 49.5145 67.311 0.47775 -0.82748 0.295 0
 28692 -22.94592 49.59681 67.363 0.7204 -0.41593 0.555 0
...
817595519 1 2 31
 25019 -23.09 49.51363 103.363 0 -0.83185 0.555 0
 25039 -23.2811 49.68 103.311 -0.9555 0 0.295 0
...
\end{lstlisting}

\subsection{Version 3 (November 2018)}

\begin{lstlisting}
# comment line(s) - meta data\n
global_det_id format_version\n
UTC_validity_from UTC_validity_to \n
UTM_ref_grid UTM_ref_easting UTM_ref_northing UTM_ref_z \n
ndoms \n
dom_id line_id floor_id npmts\n
 pmt_id_global x y z dx dy dz t0 PMT_STATUS\n
 pmt_id_global x y z dx dy dz t0 PMT_STATUS\n
 ...
 pmt_id_global x y z dx dy dz t0 PMT_STATUS\n
#repeat for each dom
\end{lstlisting}

The main additions in the third version of the DETX format are PMT status flags
for every PMT and comment lines at the beginning of the file to store meta data.

\begin{fieldspecs}
  \datafield[hashtag-prefixed string]{comment line}{Only allowed at beginning of the file. New lines may appear inside double quotes (") and are treated as multi-line comments.}
  \datafield[string]{format_version}{The version of the data format with the following format: (v|V)[1-9][0-9]+}
  \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
  \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
  \datafield[string]{UTM_ref_grid}{The reference grid, composed of the string UTM, the reference ellipsoid and the UTM grid of the detector, e.g. "UTM WGS84 33N" for the ARCA site in Italy.}
  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
  \datafield[unsigned int]{ndoms}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
  \datafield[int]{dom_id}{The unique optical module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
  \datafield[int]{line_id}{The string number.}
  \datafield[int]{floor_id}{The floor number starting at 1. In some older DETX files, this might be -1. In this case, the floors are assumed to be numbered strictly monotonically increasing as they appear in the file.}
  \datafield[unsigned int]{npmts}{The number of PMTs. Can be 0.}
  \datafield[int]{pmt_id_global}{The unique global PMT ID. When applicable, the ID corresponds to the ID in the MC files or the KM3NeT product number.}
  \datafield[int or float]{x, y, z}{The position of the PMT with reference to the UTM coordinate with x (y) defining the relative distance in Easting (Northing) in metres.}
  \datafield[int or float]{dx, dy, dz}{The direction where the PMT is pointing at.}
  \datafield[int or float]{t0}{The calibration time offset which has to be added to the detected hit times.}
  \datafield[int]{PMT_STATUS}{MSB: default = 0 means PMT OK for analysis; 1 = PMT NOT OK for analysis; other status flags to be updated. The status bit definitions can be found here (updated regularly): \url{https://git.km3net.de/common/km3net-dataformat/-/blob/master/definitions/module_status.csv}}
\end{fieldspecs}

\alertinfo{Within each DOM section, the PMTs are listed according to an ascending order of their DAQ channel ID, starting at 0.}

\subsubsection*{Example}

Example for ARCA28 (D0ARCA028, detector-ID 160):

\begin{lstlisting}
160 v3
1695281794.0 9999999999.0
UTM WGS84 33N 587600 4016800 -3450
504
817606477 1 1 31
 28677 -23.09 49.51363 67.363 0 -0.83185 0.555 0 0
 29160 -23.2811 49.68 67.311 -0.9555 0 0.295 0 0
 28685 -23.18555 49.5145 67.311 -0.47775 -0.82748 0.295 0 0
 29152 -22.99445 49.5145 67.311 0.47775 -0.82748 0.295 0 0
 28692 -22.94592 49.59681 67.363 0.7204 -0.41593 0.555 0 0
...
817595519 1 2 31
 25019 -23.09 49.51363 103.363 0 -0.83185 0.555 0 0
 25039 -23.2811 49.68 103.311 -0.9555 0 0.295 0 0
...
\end{lstlisting}

\subsection{Version 4 (November 2020)}
\begin{lstlisting}
# comment line(s) - meta data\n
global_det_id format_version\n
UTC_validity_from UTC_validity_to \n
UTM_ref_grid UTM_ref_easting UTM_ref_northing UTM_ref_z \n
nmodules \n
module_id line_id floor_id m_x m_y m_z q0 qx qy qz m_t0 npmts\n
 pmt_id_global p_x p_y p_z dx dy dz p_t0 PMT_STATUS\n
 pmt_id_global p_x p_y p_z dx dy dz p_t0 PMT_STATUS\n
 ...
 pmt_id_global p_x p_y p_z dx dy dz p_t0 PMT_STATUS\n
#repeat for each dom
\end{lstlisting}

The main additions in the fourth version of the DETX format are extended module
parameters: position, orientation (represented by a quaternion) and t0 to allow
for defining non-optical modules (like base modules).

\begin{fieldspecs}
  \datafield[hashtag-prefixed string]{comment line}{Only allowed at beginning of the file. New lines may appear inside double quotes (") and are treated as multi-line comments.}
  \datafield[string]{format_version}{The version of the data format with the following format: (v|V)[1-9][0-9]+}
  \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
  \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
  \datafield[string]{UTM_ref_grid}{The reference grid, composed of the string UTM, the reference ellipsoid and the UTM grid of the detector, e.g. "UTM WGS84 33N" for the ARCA site in Italy.}
  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
  \datafield[unsigned int]{nmodules}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
  \datafield[int]{module_id}{The unique optical module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
  \datafield[int]{line_id}{The string number.}
  \datafield[int]{floor_id}{The floor number starting at 1. In some older DETX files, this might be -1. In this case, the floors are assumed to be numbered strictly monotonically increasing as they appear in the file.}
  \datafield[int or float]{m_x, m_y, m_z}{The position of the module with reference to the UTM coordinate with x (y) defining the relative distance in Easting (Northing) in metres.}
  \datafield[int or float]{q0, qx, qy, qz}{The orientation of the module represented by a quaternion.}
  \datafield[int or float]{m_t0}{The calibration time offset which has to be added to the detected hit times.}
  \datafield[unsigned int]{npmts}{The number of PMTs. Can be 0.}
  \datafield[int]{pmt_id_global}{The unique global PMT ID. When applicable, the ID corresponds to the ID in the MC files or the KM3NeT product number.}
  \datafield[int or float]{p_x, p_y, p_z}{The position of the PMT with reference to the UTM coordinate with x (y) defining the relative distance in Easting (Northing) in metres.}
  \datafield[int or float]{dx, dy, dz}{The direction where the PMT is pointing at.}
  \datafield[int or float]{p_t0}{The calibration time offset which has to be added to the detected hit times.}
  \datafield[int]{PMT_STATUS}{MSB: default = 0 means PMT OK for analysis; 1 = PMT NOT OK for analysis; other status flags to be updated. The status bit definitions can be found here (updated regularly): \url{https://git.km3net.de/common/km3net-dataformat/-/blob/master/definitions/module_status.csv}}
\end{fieldspecs}

\alertinfo{Within each module section, the PMTs are listed according to an ascending order of their DAQ channel ID, starting at 0.}

\subsubsection*{Example}

Example for ARCA28 (D0ARCA028, detector-ID 160):

\begin{lstlisting}
160 v4
1695281794.0 9999999999.0
UTM WGS84 33N 587600 4016800 -3450
532
809503302 1 0 -23.09 49.68 0 1 0 0 0 0 0
817606477 1 1 -23.09 49.68 67.252 1 0 0 0 0 31
 28677 -23.09 49.51363 67.363 0 -0.83185 0.555 0 0
 29160 -23.2811 49.68 67.311 -0.9555 0 0.295 0 0
 28685 -23.18555 49.5145 67.311 -0.47775 -0.82748 0.295 0 0
 29152 -22.99445 49.5145 67.311 0.47775 -0.82748 0.295 0 0
 28692 -22.94592 49.59681 67.363 0.7204 -0.41593 0.555 0 0
...
817595519 1 2 -23.09 49.68 103.252 1 0 0 0 0 31
 25019 -23.09 49.51363 103.363 0 -0.83185 0.555 0 0
 25039 -23.2811 49.68 103.311 -0.9555 0 0.295 0 0
...
\end{lstlisting}


\subsection{Version 5 (October 2021)}

\begin{lstlisting}
# comment line(s) - meta data\n
global_det_id format_version\n
UTC_validity_from UTC_validity_to\n
UTM_ref_grid UTM_ref_easting UTM_ref_northing UTM_ref_z\n
nmodules\n
module_id line_id floor_id m_x m_y m_z q0 qx qy qz m_t0 COMPONENT_STATUS npmts\n
 pmt_id_global p_x p_y p_z dx dy dz p_t0 PMT_STATUS\n
 pmt_id_global p_x p_y p_z dx dy dz p_t0 PMT_STATUS\n
 ...
 pmt_id_global p_x p_y p_z dx dy dz p_t0 PMT_STATUS\n
#repeat for each module
\end{lstlisting}

The main additions in the fifth version of the DETX format is the COMPONENTESTATUS

\begin{fieldspecs}
  \datafield[hashtag-prefixed string]{comment line}{Only allowed at beginning of the file. New lines may appear inside double quotes (") and are treated as multi-line comments.}
  \datafield[string]{format_version}{The version of the data format with the following format: (v|V)[1-9][0-9]+}
  \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
  \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
  \datafield[string]{UTM_ref_grid}{The reference grid, composed of the string UTM, the reference ellipsoid and the UTM grid of the detector, e.g. "UTM WGS84 33N" for the ARCA site in Italy.}
  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
  \datafield[unsigned int]{nmodules}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
  \datafield[int]{module_id}{The unique module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
  \datafield[int]{line_id}{The string number.}
  \datafield[int]{floor_id}{The floor number starting at 1. In some older DETX files, this might be -1. In this case, the floors are assumed to be numbered strictly monotonically increasing as they appear in the file.}
  \datafield[int or float]{m_x, m_y, m_z}{The position of the module with reference to the UTM coordinate with x (y) defining the relative distance in Easting (Northing) in metres.}
  \datafield[int or float]{q0, qx, qy, qz}{The orientation of the module represented by a quaternion.}
  \datafield[int or float]{m_t0}{The calibration time offset which has to be added to the detected hit times.}
  \datafield[unsigned int]{npmts}{The number of PMTs. Can be 0.}
  \datafield[int]{pmt_id_global}{The unique global PMT ID. When applicable, the ID corresponds to the ID in the MC files or the KM3NeT product number.}
  \datafield[int or float]{p_x, p_y, p_z}{The position of the PMT with reference to the UTM coordinate with x (y) defining the relative distance in Easting (Northing) in metres.}
  \datafield[int or float]{dx, dy, dz}{The direction where the PMT is pointing at.}
  \datafield[int or float]{p_t0}{The calibration time offset which has to be added to the detected hit times.}
  \datafield[int]{PMT_STATUS}{MSB: default = 0 means PMT OK for analysis; 1 = PMT NOT OK for analysis; other status flags to be updated. The status bit definitions can be found here (updated regularly): \url{https://git.km3net.de/common/km3net-dataformat/-/blob/master/definitions/module_status.csv}}
\end{fieldspecs}

\alertinfo{Within each module section, the PMTs are listed according to an ascending order of their DAQ channel ID, starting at 0.}

\subsubsection*{Example}

Example for ARCA28 (D0ARCA028, detector-ID 160):

\begin{lstlisting}
160 v5
1695281794.0 9999999999.0
UTM WGS84 33N 587600 4016800 -3450
532
809503302 1 0 -23.09 49.68 0 1 0 0 0 0 0 0
817606477 1 1 -23.09 49.68 67.252 1 0 0 0 0 31
 28677 -23.09 49.51363 67.363 0 -0.83185 0.555 0 0
 29160 -23.2811 49.68 67.311 -0.9555 0 0.295 0 0
 28685 -23.18555 49.5145 67.311 -0.47775 -0.82748 0.295 0 0
 29152 -22.99445 49.5145 67.311 0.47775 -0.82748 0.295 0 0
 28692 -22.94592 49.59681 67.363 0.7204 -0.41593 0.555 0 0
...
817595519 1 2 -23.09 49.68 103.252 1 0 0 0 0 31
 25019 -23.09 49.51363 103.363 0 -0.83185 0.555 0 0
 25039 -23.2811 49.68 103.311 -0.9555 0 0.295 0 0
...
\end{lstlisting}


\section{DATX}

The corresponding Google drive document: \url{https://drive.google.com/open?id=0B6l8SNtndcwaUTZPOWZOXzd6R3M}

\section{UTM Grid}
\label{section:utm_grid}

The KM3NeT coordinate system is proposed in \verb|KM3NeT_SOFT_WD_2016_002|, the reference
point for the ARCA site is defined within the building block one with:

\begin{itemize}
  \item UTM reference ellipsoid: WGS84
  \item UTM grid zone: 33N (where N is for North\footnote{A note of caution: The method used here simply adds N or S following the zone number to indicate Northern or Southern hemisphere. See \url{https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system\#Notation} for a general discussion on the grid zone notation})
  \item The elevation (\verb|UTM_ref_z|) above is the orthometric height calculated relative to the mean sea surface (MSS) as defined by \verb|DTU132|. The see \verb|WGS84| geoid height can be deduced by adding the \verb|EGM96| Geoid height which is \SI{30.9(0.1)}{\meter} at the reference point, as provided by the \verb|NGA EGM96 Geoid Calculator|; the orthometric height of the seafloor at that point is \SI{-3454(1)}{\meter} and the mean for the ARCA building block is \SI{-3452}{\meter}.
\end{itemize}

\section{PMT Status}

\section{Module Status}


\part{DAQ}
\section{DAQ Common Header}

\begin{bytefield}{32}
  \bitheader{0-31} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{0}
    \wordbox{1}{Frame Length}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{32}
    \wordbox{1}{Data Type}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{64}
    \wordbox{1}{Detector ID}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{96}
    \wordbox{1}{Run Number}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{128}
    \wordbox{1}{Sequence Number}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{160}
    \wordbox{2}{Time Stamp}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{224}
    \wordbox{1}{DOM Identifier}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{256}
    \wordbox{1}{DataQueue Status}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{288}
    \wordbox{1}{DOM Status I}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{320}
    \wordbox{1}{DOM Status II}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{352}
    \wordbox{1}{DOM Status III}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{384}
    \wordbox{1}{DOM Status IV}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{416}
    \wordbox{1}{Number of Items}
  \end{rightwordgroup} \\
\end{bytefield}

\section{Summaryslice}

\begin{bytefield}{32}
  \bitheader{0-31} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{0}
    \wordbox{1}{Frame Length}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{32}
    \wordbox{1}{Data Type}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{64}
    \wordbox{1}{Detector ID}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{96}
    \wordbox{1}{Run Number}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{128}
    \wordbox{1}{TimeSlice Number}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{160}
    \wordbox{2}{Time Stamp}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{224}
    \wordbox{1}{Nsummaryframes}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{256}
    \wordbox{1}{DOM Identifier}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{288}
    \wordbox{1}{status}
  \end{rightwordgroup} \\
  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{320}
    \bitbox{8}{Rates PMT 0}
    \bitbox{8}{Rates PMT 1}
    \bitbox{8}{Rates PMT 2}
    \bitbox{8}{Rates PMT 3}
  \end{rightwordgroup} \\

  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{352}
    \bitbox{8}{Rates PMT 4}
    \bitbox{8}{Rates PMT 5}
    \bitbox{8}{Rates PMT 6}
    \bitbox{8}{Rates PMT 7}
  \end{rightwordgroup} \\

  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{384}
    \bitbox{8}{Rates PMT 8}
    \bitbox{8}{Rates PMT 9}
    \bitbox{8}{Rates PMT 10}
    \bitbox{8}{Rates PMT 11}
  \end{rightwordgroup} \\

  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{416}
    \bitbox{8}{Rates PMT 12}
    \bitbox{8}{Rates PMT 13}
    \bitbox{8}{Rates PMT 14}
    \bitbox{8}{Rates PMT 15}
  \end{rightwordgroup} \\

  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{448}
    \bitbox{8}{Rates PMT 16}
    \bitbox{8}{Rates PMT 17}
    \bitbox{8}{Rates PMT 18}
    \bitbox{8}{Rates PMT 19}
  \end{rightwordgroup} \\

  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{480}
    \bitbox{8}{Rates PMT 20}
    \bitbox{8}{Rates PMT 21}
    \bitbox{8}{Rates PMT 22}
    \bitbox{8}{Rates PMT 23}
  \end{rightwordgroup} \\

  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{512}
    \bitbox{8}{Rates PMT 24}
    \bitbox{8}{Rates PMT 25}
    \bitbox{8}{Rates PMT 26}
    \bitbox{8}{Rates PMT 27}
  \end{rightwordgroup} \\

  \begin{rightwordgroup}[rightcurly=., rightcurlyspace=0pt]{544}
    \bitbox{8}{Rates PMT 28}
    \bitbox{8}{Rates PMT 29}
    \bitbox{8}{Rates PMT 30}
    \bitbox{8}{unused}
  \end{rightwordgroup} \\
\end{bytefield}

\part{Acoustics Data}
\part{Online Dataformat}
\part{Offline Dataformat}

\part{Analysis Data Formats}
\section{PMT Rates Summary File}

% file extension: pmtrates.h5

\dirtree{%
 .1 HDF5 root (group).
 .2 806451584 (group).
 .3 max\_rate.
 .3 min\_rate.
 .3 mean\_rate.
 .3 median\_rate.
 .3 std\_rate.
 .2 806455816 (group).
 .3 max\_rate.
 .3 min\_rate.
 .3 mean\_rate.
 .3 median\_rate.
 .3 std\_rate.
 .2 806459597 (group).
 .3 max\_rate.
 .3 min\_rate.
 .3 mean\_rate.
 .3 median\_rate.
 .3 std\_rate.
 .2 ....
}


% \begin{forest}
%   for tree={
%     font=\ttfamily,
%     grow'=0,
%     child anchor=west,
%     parent anchor=south,
%     anchor=west,
%     calign=first,
%     edge path={
%       \noexpand\path [draw, \forestoption{edge} ]
%       (!u.south west) +(7.5pt,0) |- node[fill,inner sep=1.25pt] {} (.child anchor)\forestoption{edge label};
%     },
%     before typesetting nodes={
%       if n=1
%         {insert before={[,phantom]}}
%         {}
%     },
%     fit=band,
%     before computing xy={l=15pt},
%   }
% [HDF5 root
%   [806451584
%     [max\_rate]
%     [min\_rate]
%     [mean\_rate]
%     [std\_rate]
%   ]
%   [806455816
%     [max\_rate]
%     [min\_rate]
%     [mean\_rate]
%     [std\_rate]
%   ]
%   [806459597
%     [max\_rate]
%     [min\_rate]
%     [mean\_rate]
%     [std\_rate]
%   ]
% ]
% \end{forest}

%\begin{lstlisting}
%\end{lstlisting}

\end{document}
</pre></body></html>