\section{DivPos\_monitor: A divergence and position sensitive monitor}
\label{s:divpos-monitor}
\index{Monitors!Divergence/position monitor}
%\component{DivPos\_monitor}{System}{$x_\textrm{min}$, $x_\textrm{max}$, $y_\textrm{min}$, $y_\textrm{max}$, $n_x$, $n_\textrm{h}$, $\eta_\textrm{h,max}$, filename}{}{}
\mcdoccomp{monitors/DivPos_monitor.parms}

\textbf{DivPos\_monitor} is a two-dimensional monitor component,
which is sensitive to both horizontal position ($x$) and horizontal divergence
defined by $\eta_\textrm{h} = \tan^{-1}(v_x/v_z)$.
The detector window is set
by the $x$ and $y$ input coordinates.

The neutron counts are being histogrammed
into $n_x \times n_\textrm{h}$ pixels. The horizontal divergence range accepted is
$[-\eta_\textrm{h,max}; \eta_\textrm{h,max}]$, and the horizontal position
range is the size of the detector.

The output from \textbf{PSD\_monitor} is the integrated counts, $n, I, M_2$,
as well as
three two-dimensional arrays of counts: $n(x,\eta_\textrm{h}),
I(x,\eta_\textrm{h}), M_2(x,\eta_\textrm{h})$.
The arrays are written to a file and can be read e.g. by the tool
\textbf{mcplot}, see the system manual.

This component can be used for measuring acceptance diagrams \cite{Cussen03}.
\textbf{PSD\_monitor} can easily be changed into being sensitive
to $y$ and vertical divergence by a 90 degree rotation around the $z$-axis.
