Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a105ad6
Draft adapted mcdoc that produces .md and .tex outputs
willend Apr 16, 2026
73ee44a
Add option for md's within repo
willend Apr 16, 2026
7c86d5a
Add in-repo md files for comps / instrs
willend Apr 16, 2026
7ccb61a
Add McXtrace .md docs
willend Apr 16, 2026
e0b16be
Merge branch 'mccode-dev:main' into mcdoc-multiple-output-formats
willend Apr 21, 2026
7981290
Don't generate TeX 'overview doc'
willend Apr 21, 2026
aee57fc
Remove header/preamble in generated .tex snippets
willend Apr 21, 2026
d94ceda
Add outdir option for writing e.g. TeX comp snippets
willend Apr 21, 2026
5e9eafd
Suppress debug logging
willend Apr 21, 2026
7576436
Add static comp snippets
willend Apr 21, 2026
880d842
Add inclusion of _static tex if present in doc catalogue
willend Apr 21, 2026
0967030
Half-baked verbatim mode
willend Apr 21, 2026
60b107e
Modified preamble and CMake listing
willend Apr 21, 2026
fa97213
Add tex hack
willend Apr 21, 2026
3d7975f
Unified listing options
willend Apr 21, 2026
7d64c63
Move ISIS_moderator tex snippetwq
willend Apr 21, 2026
44bf50a
For now, suppress ISIS moderator doc which is in ../contrib...wq
willend Apr 21, 2026
862518d
Remove sync stuff...
willend Apr 21, 2026
4719dba
Suppress \mcdoccomp
willend Apr 21, 2026
77a120b
Re-add link to source code
willend Apr 21, 2026
8c3a80d
Add generated .tex snippets
willend Apr 21, 2026
4039f26
Remove touch cmd - mcdoc call only
willend Apr 21, 2026
a28f3a2
Use mcdoc to generate .tex and .md snippets, update preamble
willend Apr 21, 2026
e370053
Dont link to comp code
willend Apr 21, 2026
efc814d
Update comp manual authors
willend Apr 21, 2026
f665420
Remove, called from CMake/TeX
willend Apr 21, 2026
47afe1c
Updated manuals...
willend Apr 21, 2026
1b22633
Use basename for the md files
willend Apr 21, 2026
17c3f5e
Author update
willend Apr 21, 2026
13eb82e
Further updated pdfs
willend Apr 21, 2026
9a690ea
Use basename
willend Apr 21, 2026
c8b135c
Fix md files, link to local files
willend Apr 21, 2026
7b34bab
Remove before name-change to README.md for instruments
willend Apr 22, 2026
4fd7634
Prepare for incoming README.md's that will include instr-named md's w…
willend Apr 22, 2026
ff6d039
Add README.md's per instrument
willend Apr 22, 2026
1955574
Generate README.md's for instruments (and include link to local name.…
willend Apr 22, 2026
5d97552
Restore as instr file
willend Apr 22, 2026
4f7f688
Add local file previously known as README.md
willend Apr 22, 2026
e94b491
Remove suffix
willend Apr 22, 2026
59e30d0
Update README's
willend Apr 22, 2026
8c746f9
Add missing author info
willend Apr 22, 2026
d901664
Update MD
willend Apr 22, 2026
0e680f8
Add note that additional info is not always included
willend Apr 22, 2026
25f3138
Update README.md's
willend Apr 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions buildscripts/build_manuals_mcstas
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ fi

# Ensure our 3rd party modules are in place and updated

./3rdparty/sync.sh

./mkdist mcstas-manuals $1 docs/manuals/mcstas/ "" noarch "o" -- NONE
echo
echo LaTeX build of McStas manuals v $1 done!
Expand Down
Binary file modified docpkg/manuals/mcstas/Component_manual.pdf
Binary file not shown.
Binary file modified docpkg/manuals/mcstas/manual.pdf
Binary file not shown.
22 changes: 17 additions & 5 deletions docs/manuals/mcstas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,24 @@ message( "LaTeX configuration" )
# set(LATEX_OUTPUT_PATH ".")
file(GLOB LIST RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "*.tex" "*.sty" "*.bib" "*.bst" "[m-s]*/*.tex" "[m-s]*/*.parms" "figures/*")

# TeX snippets
foreach(NAME sources samples optics monitors misc)
add_custom_command(
OUTPUT "${NAME}.done"
COMMAND "${PROJECT_SOURCE_DIR}/get_mcdoc_snippets.sh" "${NAME}" "${PROJECT_SOURCE_DIR}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
)
# PWFIXME: ONLY SEMI-FUNCTIONAL
add_custom_command(
OUTPUT "${NAME}.done"
COMMAND "mcdoc" "--tex" "--in-repo" "--dir=${CMAKE_SOURCE_DIR}/../../../mcstas-comps/${NAME}" "--outdir=${PROJECT_BINARY_DIR}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
)
endforeach()

# MD files
foreach(NAME sources samples optics monitors misc)
# PWFIXME: ONLY SENMI-FUNCTIONAL
add_custom_command(
OUTPUT "${NAME}.mddone"
COMMAND "mcdoc" "--md" "--in-repo" "--dir=${CMAKE_SOURCE_DIR}/../../../mcstas-comps/${NAME}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
)
endforeach()

set(LATEX_OUTPUT_PATH "${PROJECT_BINARY_DIR}")
Expand Down
38 changes: 38 additions & 0 deletions docs/manuals/mcstas/contrib/Al_window.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
\section{The \texttt{Al\_window} McStas Component}
Aluminium window in the beam

\subsection*{Identification}
\begin{itemize}
\item \textbf{Site:}
\item \textbf{Author:} S. Roth
\item \textbf{Origin:} FRM-II
\item \textbf{Date:} Jul 31, 2001
\end{itemize}

\subsection*{Description}
\begin{lstlisting}
Aluminium window in the beam

Example: Al_window(thickness=0.002)

%BUGS
Only handles the absorption, and window has infinite width/height
\end{lstlisting}

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.

\begin{longtable}{p{0.22\textwidth}p{0.12\textwidth}p{0.46\textwidth}p{0.14\textwidth}}
\toprule
\textbf{Name} & \textbf{Unit} & \textbf{Description} & \textbf{Default} \\
\midrule
\endhead
thickness & m & Al Window thickness & 0.001 \\
\bottomrule
\end{longtable}

\subsection*{Links}
\begin{itemize}
\item \href{run:/home/willend/willend-McCode/mcstas-comps/contrib/Al_window.comp}{Source code} for \texttt{Al\_window.comp}.
\end{itemize}
\IfFileExists{Al_window_static.tex}{\input{Al_window_static.tex}}{}
40 changes: 40 additions & 0 deletions docs/manuals/mcstas/contrib/CavitiesIn.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
\section{The \texttt{CavitiesIn} McStas Component}
Slit - sorting in channels

\subsection*{Identification}
\begin{itemize}
\item \textbf{Site:}
\item \textbf{Author:} Henrich Frielinghaus
\item \textbf{Origin:} JCNS - FZ-Juelich
\item \textbf{Date:} Oct 2007
\end{itemize}

\subsection*{Description}
\begin{lstlisting}
This routine sorts the 'full' neutron beam (given by xw,yw)
in xc,yc channels. These can be imagined as cavities.
CavitiesOut sorts these channels back to normal coordinates.

Example: Slit(xw=0.05, yw=0.05, xc=4, yc=1)
\end{lstlisting}

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.

\begin{longtable}{p{0.22\textwidth}p{0.12\textwidth}p{0.46\textwidth}p{0.14\textwidth}}
\toprule
\textbf{Name} & \textbf{Unit} & \textbf{Description} & \textbf{Default} \\
\midrule
\endhead
xw & m & width in X-dir & 0.05 \\
yw & m & width in Y-dir & 0.05 \\
xc & m & channels in X-dir & 1 \\
yc & m & channels in Y-dir & 1 \\
\bottomrule
\end{longtable}

\subsection*{Links}
\begin{itemize}
\item \href{run:/home/willend/willend-McCode/mcstas-comps/contrib/CavitiesIn.comp}{Source code} for \texttt{CavitiesIn.comp}.
\end{itemize}
\IfFileExists{CavitiesIn_static.tex}{\input{CavitiesIn_static.tex}}{}
40 changes: 40 additions & 0 deletions docs/manuals/mcstas/contrib/CavitiesOut.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
\section{The \texttt{CavitiesOut} McStas Component}
Slit - sorting in channels

\subsection*{Identification}
\begin{itemize}
\item \textbf{Site:}
\item \textbf{Author:} Henrich Frielinghaus
\item \textbf{Origin:} JCNS - FZ-Juelich
\item \textbf{Date:} Oct 2007
\end{itemize}

\subsection*{Description}
\begin{lstlisting}
This routine sorts the 'full' neutron beam (given by xw,yw)
in xc,yc channels. These can be imagined as cavities.
CavitiesOut sorts these channels back to normal coordinates.

Example: Slit(xw=0.05, yw=0.05, xc=4, yc=1)
\end{lstlisting}

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.

\begin{longtable}{p{0.22\textwidth}p{0.12\textwidth}p{0.46\textwidth}p{0.14\textwidth}}
\toprule
\textbf{Name} & \textbf{Unit} & \textbf{Description} & \textbf{Default} \\
\midrule
\endhead
xw & m & width in X-dir (full width, might be larger for trumpets) & 0.05 \\
yw & m & width in Y-dir (full width, might be larger for trumpets) & 0.05 \\
xc & 1 & Number of x-channels & 1 \\
yc & 1 & Number of y-channels & 1 \\
\bottomrule
\end{longtable}

\subsection*{Links}
\begin{itemize}
\item \href{run:/home/willend/willend-McCode/mcstas-comps/contrib/CavitiesOut.comp}{Source code} for \texttt{CavitiesOut.comp}.
\end{itemize}
\IfFileExists{CavitiesOut_static.tex}{\input{CavitiesOut_static.tex}}{}
58 changes: 58 additions & 0 deletions docs/manuals/mcstas/contrib/Collimator_ROC.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
\section{The \texttt{Collimator\_ROC} McStas Component}
Radial Oscillationg Collimator (ROC)

\subsection*{Identification}
\begin{itemize}
\item \textbf{Site:}
\item \textbf{Author:} \textless{}a href="mailto:hansen@ill.fr"\textgreater{}Thomas C Hansen\textless{}/a\textgreater{}
\item \textbf{Origin:} \textless{}a href="http://www.ill.fr"\textgreater{}ILL\textless{}/a\textgreater{} (Dif/\textless{}a href="http://www.ill.fr/YellowBook/D20"\textgreater{}D20\textless{}/a\textgreater{})
\item \textbf{Date:} 15 May 2000
\end{itemize}

\subsection*{Description}
\begin{lstlisting}
ESCRIPTION

This is an implementation of an Ideal radial oscillating collimator,
which is usually placed between a polycrystalline sample and a linear
curved position sensitive detector on a 2-axis diffractometer like D20.
The transfer function has been implemented analytically, as this is
much more efficient than doing Monte-Caqrlo (MC) choices and to absorb
many neutrons on the absorbing blades. The function is basically triangular
(except for rather 'exotic' focuss apertures) and depends on the distance
from the projection of the focus centre to the plane perpendicular to the
collimator planes to the intersection of the same projection of the velocity
vector of the neutron with a line that is perpendicular to it and containing
the same projection of the focus centre. The oscillation is assumed to be
absolutely regular and so shading each angle the same way. All neutrons not
hitting the collimator core will be absorbed.

Example: Collimator_ROC(
ROC_pitch=5, ROC_ri=0.15, ROC_ro=0.3, ROC_h=0.15,
ROC_ttmin=-25, ROC_ttmax=135, ROC_sign=-1)
\end{lstlisting}

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.

\begin{longtable}{p{0.22\textwidth}p{0.12\textwidth}p{0.46\textwidth}p{0.14\textwidth}}
\toprule
\textbf{Name} & \textbf{Unit} & \textbf{Description} & \textbf{Default} \\
\midrule
\endhead
ROC\_pitch & deg & Angular pitch between the absorbing blades & 1 \\
ROC\_ri & m & Inner radius of the collimator & 0.4 \\
ROC\_ro & m & Outer radius of the collimator & 1.2 \\
ROC\_h & m & Height of the collimator & 0.153 \\
ROC\_ttmin & deg & Lower scattering angle limit & 0 \\
ROC\_ttmax & deg & Higher scattering angle limit & 100 \\
ROC\_sign & 1 & Chirality/takeoff sign & 1 \\
\bottomrule
\end{longtable}

\subsection*{Links}
\begin{itemize}
\item \href{run:/home/willend/willend-McCode/mcstas-comps/contrib/Collimator_ROC.comp}{Source code} for \texttt{Collimator\_ROC.comp}.
\item \textless{}a href="http://www.ill.fr/d20/"\textgreater{}D20 diffractometer at the ILL\textless{}/a\textgreater{}
\end{itemize}
\IfFileExists{Collimator_ROC_static.tex}{\input{Collimator_ROC_static.tex}}{}
58 changes: 58 additions & 0 deletions docs/manuals/mcstas/contrib/Commodus_I3.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
\section{The \texttt{Commodus\_I3} McStas Component}
ISIS Moderators (Tested with McStas 3.1 (Windows))

\subsection*{Identification}
\begin{itemize}
\item \textbf{Site:}
\item \textbf{Author:} G. Skoro, based on ViewModerator4 from S. Ansell
\item \textbf{Origin:} ISIS
\item \textbf{Date:} July 2022
\end{itemize}

\subsection*{Description}
\begin{lstlisting}
Produces a neutron distribution at the ISIS TS1 or TS2 corresponding moderator front face position.
The Face argument determines which TS1 or TS2 beamline is to be sampled by using corresponding file.
Neutrons are created having a range of energies determined by the E0 and E1 arguments.
Trajectories are produced such that they pass through the moderator face (defined by
modXsize and modZsize) and a focusing rectangle (defined by xw, yh and dist).
--- HOW TO USE ---

Example: Commodus_I3(Face="TS1verBase2016_LH8020_newVM-var_South04_Merlin.mcstas", E0 = E_min, E1 = E_max,
modXsize = 0.12, modZsize = 0.12, xw = 0.094, yh = 0.094, dist = 1.6)

MERLIN simulation; TS1 baseline model.
In this example, xw and yh are chosen to be identical to the shutter opening dimension.
dist = 1.6 is the real distance to the shutter front face:
(This is TimeOffset value (=160 [cm]) from TS1verBase2016_LH8020_newVM-var_South04_Merlin.mcstas file.)

N.B. Absolute normalization: The result of the Mc-Stas simulation will show neutron intensity for beam current of 1 uA.
\end{lstlisting}

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.

\begin{longtable}{p{0.22\textwidth}p{0.12\textwidth}p{0.46\textwidth}p{0.14\textwidth}}
\toprule
\textbf{Name} & \textbf{Unit} & \textbf{Description} & \textbf{Default} \\
\midrule
\endhead
Face & string & TS1 (or TS2) instrument McStas filename & "TS1\_S04\_Merlin.mcstas" \\
\textbf{E0} & meV & Lower edge of energy distribution & \\
\textbf{E1} & meV & Upper edge of energy distribution & \\
modPosition & & & 0 \\
dist & m & Distance from moderator surface to the focusing rectangle & 1.7 \\
verbose & int & Flag to output debugging information & 0 \\
beamcurrent & uA & ISIS beam current & 1 \\
modXsize & m & Moderator width & 0.12 \\
modZsize & m & Moderator height & 0.12 \\
xw & m & Width of focusing rectangle & 0.094 \\
yh & m & Height of focusing rectangle & 0.094 \\
\bottomrule
\end{longtable}

\subsection*{Links}
\begin{itemize}
\item \href{run:/home/willend/willend-McCode/mcstas-comps/contrib/Commodus_I3.comp}{Source code} for \texttt{Commodus\_I3.comp}.
\end{itemize}
\IfFileExists{Commodus_I3_static.tex}{\input{Commodus_I3_static.tex}}{}
61 changes: 61 additions & 0 deletions docs/manuals/mcstas/contrib/Conics_EH.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
\section{The \texttt{Conics\_EH} McStas Component}
Release: McStas 2.7
Date: September 2021

Elliptic-Hyperbolic shells for Wolter optic

\subsection*{Identification}
\begin{itemize}
\item \textbf{Site:}
\item \textbf{Author:} Peter Wilendrup and Erik Knudsen \textless{}br\textgreater{}(derived from Giacomo Resta skeleton-component)
\item \textbf{Origin:} DTU
\item \textbf{Date:} September 2021
\end{itemize}

\subsection*{Description}
\begin{lstlisting}
Implements a set of nshells Wolter Ellipsoid/Hyperboloid pairs using conics.h from ConicTracer.

The component has two distinct modes of specifying the geometry:
a) Via the radii vector, parametrized from largest to smallest radius with a length of 'nshells'

b) By specifying radii rmax and rmin, between which a quadratic law distributes 'nshells' surfaces.

The mirrors are assumed to be touching at the mid-optic plane, i.e. there is no gap between primary
and secondary mirror.
By definition the ratio between primary and secondary mirror glancing angles is 1/3.
At present a single m-value is used for all mirrors.
\end{lstlisting}

\subsection*{Input parameters}
Parameters in \textbf{boldface} are required; the others are optional.

\begin{longtable}{p{0.22\textwidth}p{0.12\textwidth}p{0.46\textwidth}p{0.14\textwidth}}
\toprule
\textbf{Name} & \textbf{Unit} & \textbf{Description} & \textbf{Default} \\
\midrule
\endhead
rmin & m & Midoptic plane radius of innermost mirror pair. & 0.0031416 \\
rmax & m & Midoptic plane radius of outermost mirror pair. & 0.05236 \\
focal\_length\_u & m & Focal length (upstream) of the mirror pairs. & 10 \\
focal\_length\_d & m & Focal length (downstream) of the mirror pairs. & 10 \\
le & m & Paraboloid mirror length. & 0.25 \\
lh & m & Hyperboloid mirror length. & 0.25 \\
nshells & 1 & Number of nested shells to expect & 4 \\
m & 1 & Critical angle of mirrors as multiples of Ni\_c. & 1 \\
mirr\_thick & m & Thickness of mirror shell surfaces - NOT YET IMPLEMENTED & 0 \\
disk & & Flag. If nonzero, insert a disk to block the central area within the innermost mirror. & 1 \\
radii & m & Optional vector of radii (length should match nshells) & NULL \\
R0 & 1 & Reflectivity at Low angles for reflectivity curve approximation & 0.99 \\
Qc & AA-1 & Critical scattering vector & 0.021 \\
W & AA-1 & Width of supermirror cut-off & 0.003 \\
alpha & AA & Slope of reflectivity for reflectivity curve approximation & 6.07 \\
transmit & 1 & Fraction of statistics to assign to transmitted beam - NOT YET IMPLEMENTED & 0 \\
\bottomrule
\end{longtable}

\subsection*{Links}
\begin{itemize}
\item \href{run:/home/willend/willend-McCode/mcstas-comps/contrib/Conics_EH.comp}{Source code} for \texttt{Conics\_EH.comp}.
\end{itemize}
\IfFileExists{Conics_EH_static.tex}{\input{Conics_EH_static.tex}}{}
Loading
Loading