\begin{itemize}
\item date2tape.pl -a hadesuser -d kgoebel/hld -f /home/hadaq/kgoebel.txt
\end{itemize}
-\end{itemize}
\ No newline at end of file
+\end{itemize}
+
+
+
+
+\section{Eventbuilder software for DABC}
+
+\subsection{Introduction}
+The future application for trbnet hardware for FAIR detector test beams (e.g. CBM, PANDA)
+requires to integrate such DAQ with other existing readout systems, such as MBS or certain CBMnet prototypes.
+This task has been solved in previous test beams with data acquisition framework \href{http://dabc.gsi.de}{DABC}.
+Therefore a hadaq plugin has been developed for dabc with all features required:
+
+\begin{itemize}
+ \item build trbnet events,
+ \item store them in hld format,
+ \item convert them to Mbs event format for combining with other daq subsystems,
+ \item provide online monitor server to connect Go4 (or other) analysis.
+\end{itemize}
+
+\subsection{Hadaq plugin for DABC}
+
+\subsubsection{Availability}
+The complete DABC framework is available at
+\href{https://subversion.gsi.de/dabc/trunk/}{https://subversion.gsi.de/dabc/trunk/}
+
+This contains the actual hadaq plugin at
+\href{https://subversion.gsi.de/dabc/trunk/plugins/hadaq}{https://subversion.gsi.de/dabc/trunk/plugins/hadaq}
+
+After checking out from repository to source installation directory:
+
+\verb!svn co https://subversion.gsi.de/dabc/trunk/ .!
+
+By invoking ``make'' the framework and the hadaq plugin is build.
+
+
+\subsubsection{Components:}
+
+\begin{description}
+ \item [HldFile] - input and output of hld file format
+
+ \item [HldInput] - read hadtu format from file
+
+ \item [HldOutput]- write hadtu format to file
+
+ \item [UdpDataSocket] - receive hadtu packets from trb frontend (single stream). This provides functionality of old daq\_netmem program.
+
+ \item [MbsTransmitterModule] - wrap hadtu format into MBS event container output to deliver it to MBS server or lmd file.
+this format is used in mbs subevent combiner and go4 monitoring unpacker
+
+ \item [CombinerModule] - do eventbuilding of hadtu format from several data streams.
+Output is full event in hadtu format. Should provide functionality of old daq\_evtbuild in the end.
+
+ \item [Observer] - Control system interface to hades shared memory. We use original hadaq code (worker and psxshm) and wrap it into dabc parameter scheme.
+\end{description}
+
+\subsubsection{Applications}
+
+DABC is steered via xlm configuration files. To start a special application, just type
+
+\verb!dabc_run Myconfig.xml!
+
+Note: Environment must be configured first by calling skript \verb!. dabclogin! that is automatically
+generated in the top directory of the framework installation at the build.
+Some example configurations are delivered with the plugin in subfolder {\em plugins/hadaq/app}:
+
+\begin{description}
+ \item [HldConverter.xml] - configuration to read hld file and write the hadtu events wrapped in mbs events to lmd file
+ \item [HldServer.xml] - configuration to read hld file and serve the hadtu events as mbs events at transport server dabc will wait 30 seconds before start processing, so go4 may connect to inspect data
+ \item [NetmemServer.xml] - configuration to receive hadtu buffers at udp socket and serve them as mbs events at transport/stream server
+ \item [EventBuilder.xml] -configuration to receive hadtu data at n udp sockets, and do a full eventbuilding. Output events can be served via mbs transmitter at transport/stream server. In parallel, output events can be written to hld file. May enable export of variables via shared mem to hades EPICS-based eventbuilder control system
+ \item [EventBuilderDim.xml] -as {\em EventBuilder.xml}, but shows how to activate additionally DIM control system export.
+\end{description}
+
+
+\subsubsection{Single trbnet input served to online monitor}
+This will read from specified port and transfer data to mbs stream server. This can be evaluated by Go4 online monitor with matching unpacker
+(see section \ref{go4:for:dabc}).
+
+Start with \verb!dabc_run NetmemServer.xml!
+
+
+\subsubsection{Eventbuilder on single node}
+
+Start with \verb!dabc_run EventBuilder.xml!
+
+Can do almost complete eventbuilding (emulates the \verb!daq_netmem! and \verb!daq_evtbuild! production system).
+This includes the EPICS run control via shared memory.
+Fig.\ref{fig:dabc:hadeb}) shows an example of DABC software components configured for HADES
+event building.
+
+% Sample configuration file is as follows:
+%
+% \small
+% \begin{verbatim}
+% <?xml version="1.0"?>
+% <dabc version="1">
+% <Context host="localhost" name="EventBuilder">
+% <Run>
+% <lib value="libDabcMbs.so"/>
+% <lib value="libDabcHadaq.so"/>
+% <func value="InitHadaqEvtbuilder"/>
+% <logfile value="hadaqevtbuild.log"/>
+% <loglimit value="1000000"/>
+% </Run>
+% <MemoryPool name="Pool">
+% <BufferSize value="65536"/>
+% <NumBuffers value="10000"/>
+% </MemoryPool>
+%
+% <!-- shmem control config -->
+% <Observer name="shm">
+% <DoShmControl value="true"/>
+% </Observer>
+%
+% <Module name="Combiner">
+% <PoolName value="Pool"/>
+% <DoShmControl value="true"/>
+% <DoFile value="true"/>
+% <DoServer value="true"/>
+% <BufferSize value="65536"/>
+% <NumInputs value="5"/>
+% <Port name="Input0">
+% <HadaqUdpPort value="10101"/>
+% </Port>
+% <Port name="Input1">
+% <HadaqUdpPort value="10102"/>
+% </Port>
+% <Port name="Input2">
+% <HadaqUdpPort value="10103"/>
+% </Port>
+% <Port name="Input3">
+% <HadaqUdpPort value="10104"/>
+% </Port>
+% <Port name="Input4">
+% <HadaqUdpPort value="10105"/>
+% </Port>
+% <Port name="Input*">
+% <HadaqUdpBuffer value="200000"/>
+% <DoShmControl value="true"/>
+% <!--HadaqUdpMTU value="64512"/-->
+% <BufferSize value="65536"/>
+% <InputQueueSize value="1000"/>
+% </Port>
+% <Port name="ServerOutput">
+% <OutputQueueSize value="1000"/>
+% </Port>
+% <Port name="FileOutput">
+% <HadaqFileName value="/data.local1/adamczew/hld/dabc.hld"/>
+% <HadaqEPICSControl value="true"/>
+% <HadaqFileSizeLimit value="1600"/>
+% </Port>
+% </Module>
+%
+% <Module name="OnlineServer">
+% <PoolName value="Pool"/>
+% <Port name="Output">
+% <MbsServerKind value="Stream"/>
+% <!--MbsServerPort value="6543"/-->
+% </Port>
+% </Module>
+% </Context>
+% </dabc>
+% \end{verbatim}
+% \normalsize
+
+\begin{figure}
+ \centering
+ \includegraphics[width=0.7\textwidth]{Hades-EB.png}
+ \caption[EB with DABC]{DABC components configured for HADES
+event building: Combined data channels can be saved as
+hld or lmd files. Go4 online monitoring may connect to
+MBS streamserver socket. The existing HADES event-
+builder control system with EPICS is fully supported.}
+ \label{fig:dabc:hadeb}
+\end{figure}
+
+\subsubsection{Eventbuilders on multiple nodes}
+Since the DABC process emulates the control via the standard EPICS {\em ebctrl} software (see Fig.\ref{fig:dabc:hadeb}),
+it would be possible to run multiple event building servers using the DABC software.
+However, the current startup procedure with scripts {\em startup.pl} etc.
+needs to be adjusted for this concerning the parameters. DABC needs the set up to be delivered as xml files, so the startup script would need
+to deliver this format before invoking the \verb!dabc_run!.
+
+Moreover, because DABC provides own script mechanisms to launch configured processes on different nodes, the HADES eventbuilder start would
+need to use these in case it ran with DABC implementations.
+Currently there were no investigations done in this directions, although one could think to replace the old eventbuilder software
+by a DABC solution in the future. Note that export of run information to Oracle data base is also still not implemented for the
+DABC plug-in.
+
+
+\subsubsection{Combination with other DAQ systems}
+This application is interesting in test beams for FAIR experiments that investigate the usage of HADES trb hardware for future
+detectors. Here different types of frontends should be combined. The data streams of different partially free running frontendes are synchronized by
+a sync counter ``message`` that is received by the CTS. For DABC, all inputs are wrapped in MBS subevent containers. The combination is done
+with existing MBS combiner module in dabc, regarding the position of the sync word in the CTS data payload.
+Figure \ref{fig:dabc:cbmeb} shows a typical set up as used for CBM test beam at CERN/PS in November 2012.
+Using the MBS event as generic containers and a sync counter in all data streams, the DABC Supercombiner builds corresponding data packets and
+stores them in a common file. Furthermore, the MBS containers allow simple online monitoring at ''streamserver`` sockets by tools like Go4.
+
+
+\begin{figure}
+ \centering
+ \includegraphics[width=0.7\textwidth]{DABC-EB.png}
+ \caption[DABC combining hadaq and other DAQ systems]{DABC components configured for combining
+trbnet udp data with other DAQ systems. Such setup was used for CBM test beam at CERN/PS in November 2012.
+} \label{fig:dabc:cbmeb}
+\end{figure}
+
+
+
+
+
+\subsection{Go4 online monitoring for DABC with hadaq plug-in}
+\label{go4:for:dabc}
+Several analysis codes for the analysis framework \href{http:go4.gsi.de}{Go4} exist that contain unpackers for the
+hadaq data format and specialized code for trb3 frontends.
+
+The complete Go4 framework is available at\\
+\href{https://subversion.gsi.de/go4/trunk/}{https://subversion.gsi.de/go4/trunk/}
+
+
+The hadaq skeleton (actually used for PANDA-DIRC) is at \\
+\href{https://subversion.gsi.de/go4/trunk/applications/hadaq-go4}{https://subversion.gsi.de/go4/trunk/applications/hadaq-go4}
+
+An more advanced analysis for CBM test beams can be found at \\
+\href{https://subversion.gsi.de/cbm/ROC/trunk/onlinemonitor/trbmonitor}{https://subversion.gsi.de/cbm/ROC/trunk/onlinemonitor/trbmonitor}.
+Note that the latter currently requires the full trunk to be checked out and the Makefile to be called in the top directory.
+
+
+
+\subsection{Further documentation}
+ This presentation for the GSI Experiment-Electronics Department meeting gives an overview of the software status in July 2012: \\
+\href{http://hades-wiki.gsi.de/pub/DaqSlowControl/EventBuilderDabc/DABC-TRB-EEmeeting.pdf}{http://hades-wiki.gsi.de/pub/DaqSlowControl/EventBuilderDabc/DABC-TRB-EEmeeting.pdf}
+
+An article for the GSI annual report 2012 is under preparation.
+