wrong bitfile to be written into the wrong module, but still you can screw up
some things if you try hard enough.
-\noindent \textbf{You have been warned.}
\ No newline at end of file
+\noindent \textbf{You have been warned.}
+
+
+\section{HadPlot}
+HadPlot is a perl script that plots essentially every register available somewhere in the DAQ network in various forms. There are predefined settings that can be loaded, or the user can specify any register and way to display the data. The full syntax is:
+\\\verb!hadplot [-d delay] [-n samples] [-o downscaling]!
+\\\verb! [-s system] [-g geometry] [-z style] [-c windowtitle]!
+\\\verb! [-a address -r register -w regwidth -p regoffset [-t title]]*!
+\\\verb! plotname!
+
+
+\subsection{Notes}
+\begin{itemize}
+ \item Please not that closing the plot window will not stop the program. The perl script itself needs to canceld by pressing Ctrl-C on the terminal where it has been started.
+ \item If the PC can not keep up the desired refresh rate, closing the program might be delayed by several ten seconds. Please be patient.
+ \item If the PC can not keep up the desired refresh rate, there might be some error messages from gnuplot. Lower the refresh rate or ignore the messages.
+ \item One can zoom into the plots by drawing a rectangle with the right mouse button. Pressing 'p' reverts to the former zoom level.
+\end{itemize}
+
+\subsection{Common Options}
+There are a few common options that can be used with any command:
+\begin{description}
+ \item[-d delay] Sets the update interval with which the selected registers are read out. The value is given in milliseconds.
+ \item[-n samples] For histograms only. Selects how many samples should be kept in the history.
+ \item[-o downscaling] For histograms only. Selects how often the plot should be updated. If set to 2, the plot is refreshed only after each second register reading.
+ \item[-z style] Some plots provide different style settings. The selection is made by a numeric value. The description is given for each plot individually.
+ \item[-g geometry] Gives the geometry of the plot window in standard X notation.
+ \\\verb!-g 640x480+50+200!
+ \\This produces a window in VGA size, placed 50 pixel from the left and 200 pixels from the upper display border. By adding quotation marks around the argument, one can also give other X settings to gnuplot, e.g.
+ \\\verb!-g "640x480+50+200 -bg 'yellow' -fg 'blue'"!
+ \\This will set the background color to yellow and the font color to blue.
+ \item[-c windowtitle] Sets the title of the window. The given string will be put to the title bar of the plot window.
+
+\end{description}
+
+
+\subsection{User Defined Plots}
+\begin{description}
+ \item[-a address] The address of the board(s) from which the data should be read
+ \item[-r register] The register address from which the data will be read
+ \item[-w width] Width of the value in bits. Used if one register contains more than 1 value
+ \item[-p offset] Offset of the value in bits. Used if one register contains more than 1 value
+ \item[-t title] Title of the data set to be shown in the keys of the plot
+\end{description}
+E.g. \verb!-w 12 -p 10! takes a value from Bits 21..12 from the given register. All options a/r/w/p are mandatory, only the title can be left blank. In that case, the information from a/r/w/p is shown in the key. There might be more than one set of options a/r/w/p/t to plot more than one set of data in one window.
+
+These are the possible \verb!plotname!s for user defined plots:
+\begin{description}
+ \item[genreg] Plots the values from the selected register. The x-axis shows the boards, the y-axis the value read from the given board. The \verb!-z style! option selects the labels for the x-axis: 0 shows numbers, 1 displays the actual board addresses for every data point. Please note, that the display of board addresses is usually not readable in the full view but can be used to identify boards when zooming into the plot.
+ \item[genregdiff] The same as genreg, but plots only the differences in register values between the current and the last reading. The available styles are:
+ \begin{description}
+ \item[0] Plots the values as data points
+ \item[1] Same as 0, but with address labels on the x-axis
+ \item[2] Plots a bargraph of the values. If more than one data set is shown, the bars are placed next to each other
+ \item[3] Same as 2, but with address labels on the x-axis
+ \item[4] Plots a bargraph of the values. If more than one data set is shown, the bars are placed on top of each other
+ \item[5] Same as 4, but with address labels on the x-axis
+ \item[12,13] The same as 4,5, but the values are assumed to be time in microseconds. The upper limit is fixed to the value defined by the delay setting and the readings show time in milliseconds.
+ \end{description}
+ \item[genhist] To be implemented. Plots a history of a register value. If the address is a broadcast and answers from multiple boards are received, the plotted value is the sum of all values.
+ \item[genhistdiff] The same as genhist, but shows only the relative changes to the registers. (Already implemented)
+\end{description}
+
+\subsection{Predefined Plots}
+For predefined plots the syntax is as follows:
+\\\verb!hadplot [-d delay] [-n samples] [-o downscaling] [-z style] plotname!
+The default values for the settings vary depending on the selected plot. They can always be overwritten by hand. The available plots are
+\begin{description}
+ \item[timerate] A histogram of datarates with -s the user can select one of the following systems: all, shower, mdc, tof
+ \item[eventrate] Histogram of the trigger rate
+ \item[busy] A bargraph with the current busy times of the eight major parts of the system
+ \item[busytime] Histogram of the busy time. Eight major parts of the detector are shown
+ \item[filllevel] The fill level of all front-end data buffers
+ \item[oepfill] The fill level of the OEP data buffers
+ \item[showerfill] The fill level of the Shower data buffers
+ \item[oepretrrecv] Number of received retransmission request per OEP
+ \item[oepretrsent] Number of sent retransmission request per OEP
+ \item[oepretr] Combined plot of retransmission requests sent and received by each OEP
+ \item[oepretrhist] Combined histogram of retransmission requests sent and received
+ \item[oepspike] Number of spikes on the CMS input of OEP
+ \item[oepspikehist] Histogram of number of spikes per interval on all OEP
+ \item[oepmulttrg] Number of multiple triggers detected per OEP
+ \item[oepinvtrg] Number of invalid triggers detected per OEP
+ \item[oepspurtrg] Number of spurious trigger detected per OEP
+ \item[oeptrgerr] Combined plot of multiple, invalid and spurious triggers and spikes on CMS for each OEP
+ \item[oeptrgerr] Combined histogram for multiple, invalid and spurious triggers and spikes on CMS
+ \item[oepworktime] Bargraph of the time the OEP spends in different states of the trigger handler:
+ \begin{description}
+ \item[Init] Settings are loaded to TDC and the MBO is initialized
+ \item[Calib] Settings to take calibration data are being loaded
+ \item[Readout] Time between sending the token to the MBO and getting it background
+ \item[Waiting] Time the handler is waiting, e.g. waiting while data buffers are almost full
+ \item[Idle] The rest of the time. Includes the time, the endpoint trigger handler is waiting for the LVL1 trigger information.
+ \end{description}
+ \item[oeptemp] The temperature of all OEP
+ \item[oepretransmit] Number of retransmits for each OEP
+ \item[oepdatarate] Datarate for each OEP
+ \item[oep5V] Voltage monitor for 5V input and regulated 5V on OEP
+ \item[oep3.3V] Voltage monitor for 3.3V input and regulated 3.3V on OEP
+ \item[oep1.2V] Voltage monitor for 1.2V input and regulated 1.2V on OEP
+ \item[oep3V] Voltage monitor for +3V and -3V input on OEP
+
+\end{description}