--- /dev/null
+\section{Data File Structure}
+The overall file structure is the Hades hld format, described in \cite{jmichel12}.
+Each sub-sub-event in the data structure contains the data from one read-out controller.
+Currently, there can be up to four sensors connected to each read-out controller.
+The data stream starts with a header, marking the data version number and an arbitrary
+number of additional words, such as information about external trigger signals.
+This section is followed by the individual sensor data.
+
+
+\subsection{Header Structure}
+
+
+
+\begin{table}[htbp]
+\begin{center}
+\begin{tabularx}{\textwidth}{|c|C|}
+\hline
+\textbf{Bits} & \textbf{Description} \\
+\hline\hline
+31 -- 24 & Version Number. Defines how the following data is to be unpacked. \\
+7 -- 0 & Header Size. Number of additional 32 Bit words inside the header before the first frame header is sent\\
+\hline
+\end{tabularx}
+\caption{The ROC header.}
+\label{rocheader}
+\end{center}
+\end{table}
+
+
+
+\begin{table}[htbp]
+\begin{center}
+\begin{tabularx}{\textwidth}{|c|c|C|}
+\hline
+\textbf{Word} & \textbf{Bits} & \textbf{Description} \\
+\hline\hline
+1 & 31 & Frame Marked. If this bit is set, the ROC got an external trigger /
+marker signal during reception of this frame on the first spare input (J6, 1) on the first converter board.\\
+1 & 23 -- 0 & Timestamp. Clock Cycles (100 MHz) since the last rising edge on the trigger / marker signal input.\\
+\hline
+\end{tabularx}
+\caption{The ROC header words}
+\label{rocheaderwords}
+\end{center}
+\end{table}
+
+
+
+\subsection{Frame Structure}
+The content of the frame header may change with different roc data format versions as indicated in the ROC header.
+
+\begin{table}[htbp]
+\begin{center}
+\begin{tabularx}{\textwidth}{|c|c|C|}
+\hline
+\textbf{Word} & \textbf{Bits} & \textbf{Description} \\
+\hline\hline
+1 & 31 -- 0 & Frame Header. Should always read 0xFFFFFFFF\\
+2 & 31 -- 0 & Sensor ID. The 16 Bit sensor ID, repeated twice. The sensor id is an integer marking the position of the sensor
+on the respective ROC. The first sensor ont he first converter board as ID 0\\
+3 & 31 -- 0 & Status \\
+4 & 31 -- 0 & Debug 1 \\
+5 & 31 -- 0 & Debug 2 \\
+6 & 31 -- 0 & Timestamp, LSB \\
+7 & 31 -- 0 & Timestamp, MSB \\
+
+\hline
+\end{tabularx}
+\caption{The frame header words, data format version 1.}
+\label{frameheaderwords}
+\end{center}
+\end{table}
\ No newline at end of file
--- /dev/null
+\documentclass[11pt,a4paper,twoside]{scrartcl}
+\usepackage[left=3.5cm,right=3cm,top=2.5cm,bottom=2.5cm,includeheadfoot]{geometry}
+
+
+\usepackage[utf8]{inputenc}
+\usepackage{amsfonts}
+\usepackage[american]{babel}
+\usepackage[T1]{fontenc}
+\usepackage[pdftex]{graphicx}
+\usepackage{pslatex}
+\usepackage{xcolor}
+\usepackage{array}
+\usepackage{rotating}
+\usepackage{multirow}
+\usepackage{tabularx}
+\usepackage{url}
+\usepackage{booktabs}
+\usepackage{longtable}
+\usepackage{ltxtable}
+\usepackage{upgreek}
+\usepackage{listings}
+\usepackage{scrtime}
+\usepackage{lscape}
+\usepackage{enumerate}
+\usepackage{textcomp}
+\usepackage{wrapfig}
+\usepackage[caption=false]{subfig}
+\usepackage{amsmath}
+\usepackage{setspace}
+\usepackage[update,prepend]{epstopdf}
+
+\linespread{1.15}
+\definecolor{darkblue}{rgb}{.1,.1,.6}
+\definecolor{darkgray}{rgb}{.5,.5,.5}
+\usepackage[linkbordercolor={0 0 0},
+ pdfborder={0 0 0},
+ bookmarks,
+ citecolor=blue,
+ linkcolor=darkblue,
+ colorlinks=true,
+ urlcolor=darkblue]{hyperref}
+\usepackage{cite}
+
+\newcolumntype{W}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
+\newcolumntype{L}{>{\arraybackslash}X}
+\newcolumntype{C}{>{\centering\arraybackslash}X}
+
+\usepackage{fancyhdr}
+\pagestyle{headings}%{fancy}
+\fancyhf{}
+\fancyhead[R]{\nouppercase{\leftmark}}
+\renewcommand{\headrulewidth}{0.5pt}
+\fancyfoot[C]{\thepage}
+
+\newenvironment{itemize*}%
+ {\begin{itemize}%
+ \setlength{\itemsep}{0pt}%
+ \setlength{\parskip}{0pt}%
+ \setlength{\topsep}{1pt}%
+ \setlength{\partopsep}{1pt}}%
+ {\end{itemize}}
+
+\newenvironment{description*}%
+ {\begin{description}%
+ \setlength{\itemsep}{0pt}%
+ \setlength{\parskip}{0pt}%
+ \setlength{\topsep}{1pt}%
+ \setlength{\partopsep}{1pt}}%
+ {\end{description}}
+
+\title{MAPS Read-out Data Formats}
+\date{\today ~-~\thistime}
+\author{Jan Michel}
+
+
+\newcommand{\files}[1]{\texttt{#1}}
+\newcommand{\signal}[1]{\textsc{#1}}
+\newcommand{\genericname}[1]{\textsc{#1}}
+\newcommand{\constname}[1]{\textsc{#1}}
+\newcommand{\netname}[1]{\textsc{#1}}
+\newcommand{\cmdname}[1]{\texttt{#1}}
+\newcommand{\addr}[1]{\texttt{#1}}
+\bibliographystyle{alpha}
+
+\usepackage{remreset}
+\makeatletter\@removefromreset{footnote}{chapter}\makeatother
+
+
+\lstset { language = bash, numbers = none, breaklines=true, stringstyle=\color{black}\ttfamily }
+
+\begin{document}
+\newcounter{line}
+\newcounter{ct}
+
+\maketitle
+
+\clearpage
+\tableofcontents
+\clearpage
+\input{DataFileStructure}
+
+\cleardoublepage
+
+
+\bibliography{biblio}
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End: