User and Programmers Guide to the Neutron Ray-Tracing Package McStas, version 3.10.0

Index

%BUGS (McDoc section), 191
%D[ESCRIPTION] (McDoc section), 191
%E[ND] (McDoc section), 192
%EX[AMPLE] (McDoc section), 191
%I[DENTIFICATION] (McDoc section), 191
%IN[STRUMENT_SITE] (McDoc section), 192
%L[INK] (McDoc section), 192
%P[ARAMETERS] (McDoc section), 191
%VALIDATION (McDoc section), 191
%include (McStas keyword), 84, 158, 168, 332

ABSOLUTE (McStas keyword), 164
ABSORB (C macro, mcstas-r.h), 158, 165, 172, 180, 333
Absorption, 165, 180
adapt_tree-lib (library), 346
Adaptive sampling, 59
ALLOW_BACKPROP (C macro, mcstas-r.h), 180, 334
Arm, 352
AT (McStas keyword), 164
author (McDoc keyword), 191
Authors, 9

Backpropagation, 180
box_intersect (C function, mccode-r.c), 340
BROWSER (environment variable), 129
Bugs
    hard to detect, 32
    integer versus floating-point division, 164
    JUMPs, 173
    MPI, 141
    SPLIT, 174
    system errors, 96
    WHEN vs GROUP, 171

C code
    embedded, 158, 162, 163, 169
C functions, 332
Citing McStas, 23
Code generation
    options, 81
Comments, 153
Compilation
    failure, 158, 162, 189
    instrument definition, see mcstas (compiler)
COMPONENT (McStas keyword), 164
Component, 352
    declaration (TRACE), 164
    instance, 352
Constants, 348
Conversion
    of units, 348
Coordinate
    retrieval functions, 334
    system, 149
coords_add (C function, mccode-r.c), 337
coords_get (C function, mccode-r.c), 337
coords_set (C function, mccode-r.c), 337
COPY (McStas keyword), 170
cylinder_intersect (C function, mccode-r.c), 340

Data formats, 90, 105, 132, 133, 163, 181
date (McDoc keyword), 191
DECLARE (McStas keyword), 162, 179
DEFINE COMPONENT (McStas keyword), 176
DEFINE INSTRUMENT (McStas keyword), 159
Definition parameter, 352
DEFINITION PARAMETERS (McStas keyword), 176
DEG2RAD (constant), 348
DEPENDENCY (McStas keyword), 160, 178
Description
    McDoc section, 191
DETECTOR_OUT_0D (C macro, mccode-r.h), 181, 339
DETECTOR_OUT_1D (C macro, mccode-r.h), 182, 339
DETECTOR_OUT_2D (C macro, mccode-r.h), 183, 339
Direction focusing, 54
Documentation
    generator, see McDoc

EDITOR (environment variable), 104
Embedded C code, see C code
END (McStas keyword), 166, 187
Environment variables
    BROWSER, 129
    EDITOR, 104
    MCSTAS_FORMAT, 80, 90, 126, 132
    MCSTAS, 85, 332, 344
Error estimate, 52
Example
    McDoc section, 191
EXTEND (McStas keyword), 169, 188, 334

File
    search path, 84
FINALLY (McStas keyword), 166, 185
FLT_MAX (constant), 348
Focusing
    importance sampling, 54
Formats, see Data formats
FWHM2RMS (constant), 348

Graphical User Interface, see mcgui
Gravitation, 149
GROUP (McStas keyword), 169, 334
GUI, see mcgui

HBAR (constant), 348
HDF5, see NeXus format
HUP (signal), 98

Identification
    McDoc section, 191
Importance sampling
    direction focusing, 54
INDEX_CURRENT_COMP (C macro, mccode-r.h), 335
INHERIT (McStas keyword), 188
INITIALIZE (McStas keyword), 163, 180
Input parameter, 352
inside_rectangle (C function, mcstas-r.c), 339
Installation, 74
    directory, 85
Installing, 44
Instrument, 352
Instrument definition, 159, 168
    units, 152, 160
Instrument site
    McDoc section, 192
INT (signal), 98, 166
ITERATE (McStas keyword), 172

JUMP (McStas keyword), 172

K2V (constant), 348
Kernel, 147–192, 352
Keywords, 157
    McDoc, 191–192
kill, 95

Language, see Meta-language
Library, 332
    adapt_tree-lib, 346
    Components
        data, 274, 276
    components, 85, 129, 165, 271
        data, 344
        share, 147, 158, 332
    mccode-r, 332
    mcstas-r, 332
    monitor_nd-lib, 345
    pol-lib, 208
    read_table-lib, 158, 342
    run-time, 86, 147, 158, 333
    shared, see Library/components/share
    vitess-lib, 347
Link
    McDoc section, 192

Mailing lists
    mcstas-users, 23
Mantid
    transfer events and monitor data, 261
MC_GETPAR (C macro, mccode-r.h), 179, 334
mccode-r (library), 332
mccoplot (McStas tool), 127
MCDISPLAY (McStas keyword), 185, 334
mcdisplay (McStas tool), 123
McDoc, 190–192
mcdoc (McStas tool), 129, 190
mcgui (McStas tool), 77–80, 103, 125, 127, 190
MCNP, 90
    exchange events, 266
MCPL, 90, 99
mcplot (McStas tool), 80, 91, 105, 113, 118, 126
mcplotdiff (McStas tool), 127
mcresplot (McStas tool), 128
mcrun (McStas tool), 117
MCSTAS (environment variable), 85, 332, 344
McStas
    authors, 9
    citing, 23
    compiler, see mcstas
    design, 34
    installation, 74
    mailing lists, 23
    meta-language, see Meta-language
    name, 353
    pronunciation, 353
    release scheme, 75
    running from the GUI, 77–80
    structure, 69, 72
mcstas (McStas compiler), 81
mcstas-jupylab (McStas tool), 119
mcstas-pygen (McStas tool), 84
mcstas-r (library), 332
mcstas2vitess (McStas tool), 347
MCSTAS_FORMAT (environment variable), 80, 90, 126, 132
mctest (McStas tool), 130
mcviewtest (McStas tool), 130
Meta-language, 34, 147
METADATA (McStas keyword), 174
Microsoft Windows, see Windows
MIN2RAD (constant), 348
MNEUTRON (constant), 348
modified by (McDoc keyword), 191
monitor_nd-lib (library), 345
Monte Carlo method, 49
    accuracy, 60
    adaptive sampling, 59
    direction focusing, 54
    stratified sampling, 59
MPI, 104, 134, 135
    basic usage, 136
    limitations, 141
    mcrun, 136
    performance, 137
MS Windows, see Windows
MYSELF (McStas keyword), 172

NAME_CURRENT_COMP (C macro, mccode-r.h), 335
Neutron
    absorption, 165, 180
    state (position, velocity, time, spin, weight), 152
    weight, see Weight
Neutron polarisation, see Polarisation
NEXT (McStas keyword), 172
NeXus, 104, 133
    extension, 163
NOACC (McStas keyword), 178
NORM (C macro, mccode-r.h), 338
normal_vec (C function, mccode-r.c), 338

Optimization, 88, 99
    compiler option, 87
origin (McDoc keyword), 191
Output parameter, 353
OUTPUT PARAMETERS (McStas keyword), 177, 179

Parallel computing, see MPI, 134
Parameters
    definition, 164, 176
    Instruments, 159
    instruments, 89, 90, 117
    McDoc section, 191
    optimization, 100, 117
    optional, default value, 89, 160, 177
    protecting, see Keyword/OUTPUT
    scans, 117
    setting, 164, 176
Path
    file search, 84
PI (constant), 348
Polarisation, 198
    field functions, 210
    precession algorithm, 208
    SimpleNumMagnetPrecession, 209
POS_A_COMP (C macro, mccode-r.h), 335
POS_A_COMP_INDEX (C macro, mccode-r.h), 335
POS_A_CURRENT_COMP (C macro, mccode-r.h), 335
POS_R_COMP_INDEX (C macro, mccode-r.h), 336
Preprocessor macros, 332
PREVIOUS (McStas keyword), 165, 172
PRISMA, 312
PROP_DT (C macro, mcstas-r.h), 333
PROP_GRAV_DT (C macro, mcstas-r.h), 334
PROP_NO_G_DT (C macro, mcstas-r.h), 334
PROP_NO_G_X0 (C macro, mcstas-r.h), 334
PROP_NO_G_Y0 (C macro, mcstas-r.h), 334
PROP_NO_G_Z0 (C macro, mcstas-r.h), 334
PROP_Z0 (C macro, mcstas-r.h), 180, 333
Propagation
    backward, 180

RAD2DEG (constant), 348
RAD2MIN (constant), 348
rand01 (C function, mccode-r.c), 340
randnorm (C function, mccode-r.c), 340
Random numbers
    generator, 326
    transformations, 324
randpm1 (C function, mccode-r.c), 340
randtriangle (C function, mccode-r.c), 340
randvec_target_circle (C function, mccode-r.c), 341
randvec_target_rect (C function, mccode-r.c), 341
randvec_target_rect_angular (C function, mccode-r.c), 341
read_table-lib (library), 342
RELATIVE (McStas keyword), 164
Release scheme, 75
Removed neutron events, 334
RESTORE_NEUTRON (C macro, mcstas-r.h), 336
RMS2FWHM (constant), 348
ROT_A_COMP (C macro, mccode-r.h), 335
ROT_A_CURRENT_COMP (C macro, mccode-r.h), 335
rot_apply (C function, mccode-r.c), 338
rot_copy (C function, mccode-r.c), 337
rot_mul (C function, mccode-r.c), 337
ROT_R_COMP (C macro, mccode-r.h), 335
ROT_R_CURRENT_COMP (C macro, mccode-r.h), 335
rot_set_rotation (C function, mccode-r.c), 337
rot_transpose (C function, mccode-r.c), 337
rotate (C macro, mccode-r.h), 338
ROTATED (McStas keyword), 165, 172
Run-time, 353

Sampling, 59
SAVE (McStas keyword), 166, 181
scalar_prod (C function, mccode-r.c), 338
SCATTER (C macro, mcstas-r.h), 169, 172, 180, 334, 336
SCATTERED (C macro, mccode-r.h), 169, 171, 181, 336
SE2V (constant), 348
SEARCH (McStas keyword), 161
Setting parameter, 353
SETTING PARAMETERS (McStas keyword), 176
SHARE (McStas keyword), 179, 332
SHELL (McStas keyword), 161
SIGHUP, 98
SIGINT, 98, 166
Signal handler, 95
    HUP signal, 98
    INT signal, 98, 166
    TERM signal, 98, 166
    USR1 signal, 98
    USR2 signal, 95, 98, 166
SIGTERM, 98, 166
SIGUSR1, 98
SIGUSR2, 95, 98, 166
solve_2nd_order (C function, mccode-r.c), 338
sphere_intersect (C function, mccode-r.c), 340
Spin-echo, 217
SPLIT (McStas keyword), 173
Statistics
    uncertainty, 52
STORE_NEUTRON (C macro, mcstas-r.h), 336
Stratified sampling, 59

Table_Free (C function, read_table-lib.c), 343
Table_Free_Array (C function, read_table-lib.c), 343
Table_Index (C function, read_table-lib.c), 343
Table_Info (C function, read_table-lib.c), 343
Table_Info_Array (C function, read_table-lib.c), 343
Table_Init (C function, read_table-lib.c), 342
Table_Read (C function, read_table-lib.c), 342
Table_Read_Array (C function, read_table-lib.c), 343
Table_Read_Offset (C function, read_table-lib.c), 342
Table_Read_Offset_Binary (C function, read_table-lib.c), 342
Table_Rebin (C function, read_table-lib.c), 343
Table_Value (C function, read_table-lib.c), 343
Table_Value2d (C function, read_table-lib.c), 343
TAS1, 295
TERM (signal), 98, 166
Time-of-flight spectrometer
    PRISMA, 312
Tools, 69
    external, see IDL, Matlab, NeXus, Perl, PGPLOT, VRML/OpenGL
    McStas, see mcdisplay, mcdoc, mcformat, mcgui, mcplot, mcresplot, mcrun, mcstas, mcstas2vitess
TRACE (McStas keyword), 164, 180
Triple-axis spectrometer
    TAS1, 295
Tripoli, 90

Union, 224–255
    algorithm, 249
    conditionals, 247
    exit volume, 242
    geometry, 236
    loggers, 244
    masks, 242
    master, 243
    materials, 236
    MCViNE, 233
    processes, 230
    surfaces, 244
    tagging, 247
    Union_init, 230
    Union_stop, 230
Units, 152
    constants and conversions, 348
USERVARS (McStas keyword), 162
USR1 (signal), 98
USR2 (signal), 95, 98, 166

V2K (constant), 348
Variance, 52
Variance reduction, 59
vec_prod (C function, mccode-r.c), 338
version (McDoc keyword), 191
Virtual sources, 59
Vitess, 90
vitess-lib (library), 347
VS2E (constant), 348

Weight, 51
    statistical uncertainty, 52
    transformation, 54
WHEN (McStas keyword), 171, 172
Windows
    file and directory names with spaces, 75
written by (McDoc keyword), 191