-
Notifications
You must be signed in to change notification settings - Fork 60
mcdoc component header
Peter Willendrup edited this page Jan 14, 2026
·
5 revisions
Inspired from Beamstop.comp, with a few additions for completeness:
/*******************************************************************************
*
* McStas, neutron ray-tracing package
* Copyright 1997-2002, All rights reserved
* Risoe National Laboratory, Roskilde, Denmark
* Institut Laue Langevin, Grenoble, France
*
* Component: Beamstop
*
* %ID
*
* Written by: Kristian Nielsen
* Date: January 2000
* Origin: Risoe
*
* Rectangular/circular beam stop.
*
* %D
* A simple rectangular or circular beam stop.
* Infinitely thin and infinitely absorbing.
* The beam stop is by default rectangular. You may either
* specify the radius (circular shape), or the rectangular bounds.
*
* Example: Beamstop(xmin=-0.05, xmax=0.05, ymin=-0.05, ymax=0.05)
* Beamstop(radius=0.1)
*
* <div class="latex">
* $\frac{\alpha}{\beta}$
* </div>
*
* %PAR
*
* INPUT PARAMETERS
*
* radius: [m] radius of the beam stop in the z=0 plane, centered at Origo
* xmin: [m] Lower x bound
* xmax: [m] Upper x bound
* ymin: [m] Lower y bound
* ymax: [m] Upper y bound
* xwidth: [m] Width of beamstop (x). Overrides xmin, xmax.
* yheight: [m] Height of beamstop (y). Overrides ymin, ymax.
*
* %L
*
* %END
*******************************************************************************/
DEFINE COMPONENT Beamstop
SETTING PARAMETERS (xmin=-0.05, xmax=0.05, ymin=-0.05, ymax=0.05,
xwidth=0, yheight=0, radius=0)
-
Please consult existing components of similar type and write documentation in a similar style.
-
Ensure that the identifier
Component: Namematches
- the filename (i.e.
Name.comp) - the first code-line of
DEFINE COMPONENT Name
- The header lines should
- start with a
/*******...(c-style start comment-block) - all subsequent header lines should start with
*character - the last header line should end by
...*****/
- All of the
%-tags have a meaning and should be left in the component header - Fill in the
-
Written by:(good practice is to include an email-adress) -
Date:and -
Origin:fields
- Add description information:
- A short Description line before the
%Dtag (will be listed on mcdoc overview page) - A longer description below the
%Dtag (will be visible on the actual component mcdoc page)
- Add component input parameter description lines after
%Pand and before%END.
Such lines should always be of the form
* parameter: [unit] Descriptive information for parameter
- Optionally add links (in
htmlsyntax) under%L - It is possible to include (limited)
LaTeXformula-syntax in the %D long description, such as:
* <div class="latex">
* $\frac{\alpha}{\beta}$
* </div>
- Please keep the lines for
SETTING PARAMETERSfree of any comments such as// a comment. Put such things within the input parameter lines!
An example of a valid parameter line, including all McCode types:
SETTING PARAMETERS (par1=1, int par2=0, string par3=“NULL”, vector par4={0,0,0,0})
You may use mcdoc with the —-dir Directory parameter to build components under Directory. Your own component developments / edited components should appear in the Local components table at the bottom of the generated mcdoc page.
Please run a spell-checker, please use an AI agent etc. Bad spelling or poor writing does not look serious to another McStas/McXtrace user - or leaves work for others that you should have done yourself!