\section{Slit: A beam defining diaphragm}
\label{s:slit}
\index{Optics!Slit}

\mcdoccomp{optics/Slit.parms}

The component \textbf{Slit} is a very simple construction.
It sets up an opening at $z=0$, and propagates the photon rays
onto this plane (by the kernel call PROP\_Z0).
Photons within the slit opening are unaffected,
while all other photons are discarded by the kernel call ABSORB.

By using \textbf{Slit}, some photons contributing to the background
in a real experiment will be neglected.
These are, for instance, the ones that scatter off the inner side
of the slit, penetrate the slit material, or clear the outer edges of the slit.

The opening of the slit is determined by specifying either a \textit{radius}, a
width \textit{(xwidth)} and a height \textit{(yheight)}, or absolute limits in $x$
and $y$ \textit{(xmin, xmax, ymin, ymax)}, in order of precedence.
If \textit{radius} is set, the opening is considered circular.

The slit component can also be used to discard insignificant 
({\em i.e.}\ very low weight)
 rays, that in some simulations may be very abundant and therefore
time consuming. If the optional parameter \textit{cut} is set, all
x-rays with $p<\mathit{cut}$ are ABSORB'ed.
This use is recommended in connection with \textbf{Virtual\_output}.

\textbf{Slit} may be used to model slit diffraction, thourgh judicious use of the resmapling
parameters: \textit{focus\_xw,focus\_yh, focus\_x0, focus\_y0}. The similarity in parameter
naming for sources (chapter~\ref{c:sources}) is intentional as computationally the processes are
the same. If present the focus parameters cause the ray to be regarded as a Huygens wave and a new direction
going towards the resampling window is computed. The resulting difference in phase gives rise to maxima and minima as expected.
This feature should be used with care: the further away from the optical
axis, the more statistics and finer binning is needed to get meaningful results. Please refer to \cite{knudsen2013mcxtrace} for more deatils.

