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

Index

%BUGS (McDoc section), 181
%D[ESCRIPTION] (McDoc section), 181
%E[ND] (McDoc section), 182
%EX[AMPLE] (McDoc section), 181
%I[DENTIFICATION] (McDoc section), 181
%IN[STRUMENT_SITE] (McDoc section), 182
%L[INK] (McDoc section), 182
%P[ARAMETERS] (McDoc section), 181
%VALIDATION (McDoc section), 181
%include (McStas keyword), 78, 147, 157, 285

ABSOLUTE (McStas keyword), 153
ABSORB (C macro, mcstas-r.h), 147, 154, 161, 169, 286
Absorption, 154, 169
adapt_tree-lib (library), 299
Adaptive sampling, 53
ALLOW_BACKPROP (C macro, mcstas-r.h), 169, 287
Arm, 305
AT (McStas keyword), 153
author (McDoc keyword), 181
Authors, 9

Backpropagation, 169
box_intersect (C function, mccode-r.c), 292
BROWSER (environment variable), 118
Bugs
    hard to detect, 31
    integer versus floating-point division, 153
    JUMPs, 162
    MPI, 130
    SPLIT, 163
    system errors, 89
    WHEN vs GROUP, 160

C code
    embedded, 147, 151, 152, 158
C functions, 285
Citing McStas, 22
Code generation
    options, 75
Comments, 142
Compilation
    failure, 147, 151, 179
    instrument definition, see mcstas (compiler)
COMPONENT (McStas keyword), 153
Component, 305
    declaration (TRACE), 153
    instance, 305
Constants, 301
Conversion
    of units, 301
Coordinate
    retrieval functions, 287
    system, 138
coords_add (C function, mccode-r.c), 290
coords_get (C function, mccode-r.c), 290
coords_set (C function, mccode-r.c), 290
COPY (McStas keyword), 159
cylinder_intersect (C function, mccode-r.c), 293

Data formats, 83, 98, 120, 121, 152, 170
date (McDoc keyword), 181
DECLARE (McStas keyword), 151, 168
DEFINE COMPONENT (McStas keyword), 165
DEFINE INSTRUMENT (McStas keyword), 148
Definition parameter, 305
DEFINITION PARAMETERS (McStas keyword), 165
DEG2RAD (constant), 301
DEPENDENCY (McStas keyword), 149, 167
Description
    McDoc section, 181
DETECTOR_OUT_0D (C macro, mccode-r.h), 170, 291
DETECTOR_OUT_1D (C macro, mccode-r.h), 171, 292
DETECTOR_OUT_2D (C macro, mccode-r.h), 172, 292
DETECTOR_OUT_3D (C macro, mccode-r.h), 174, 292
Direction focusing, 48
Documentation
    generator, see McDoc

EDITOR (environment variable), 97
Embedded C code, see C code
END (McStas keyword), 155, 176
Environment variables
    BROWSER, 118
    EDITOR, 97
    MCSTAS_FORMAT, 74, 83, 116, 120
    MCSTAS, 78, 285, 297
Error estimate, 46
Example
    McDoc section, 181
EXTEND (McStas keyword), 158, 178, 287

File
    search path, 78
FINALLY (McStas keyword), 155, 174
FLT_MAX (constant), 301
Focusing
    importance sampling, 48
Formats, see Data formats
FWHM2RMS (constant), 301

Graphical User Interface, see mcgui
Gravitation, 138
GROUP (McStas keyword), 158, 287
GUI, see mcgui

HBAR (constant), 301
HDF5, see NeXus format
HUP (signal), 91

Identification
    McDoc section, 181
Importance sampling
    direction focusing, 48
INDEX_CURRENT_COMP (C macro, mccode-r.h), 288
INHERIT (McStas keyword), 178
INITIALIZE (McStas keyword), 152, 169
Input parameter, 305
inside_rectangle (C function, mcstas-r.c), 292
Installation, 68
    directory, 78
Instrument, 305
Instrument definition, 148, 157
    units, 141, 149
Instrument site
    McDoc section, 182
INT (signal), 91, 155
ITERATE (McStas keyword), 161

JUMP (McStas keyword), 161

K2V (constant), 301
Kernel, 136–182, 305
Keywords, 146
    McDoc, 181–182
kill, 88

Language, see Meta-language
Library, 285
    adapt_tree-lib, 299
    Components
        data, 227, 229
    components, 78, 118, 154, 224
        data, 297
        share, 136, 147, 285
    mccode-r, 285
    mcstas-r, 285
    monitor_nd-lib, 298
    pol-lib, 198
    read_table-lib, 147, 295
    run-time, 79, 136, 147, 286
    shared, see Library/components/share
    vitess-lib, 300
Link
    McDoc section, 182

Mailing lists
    mcstas-users, 22
Mantid
    transfer events and monitor data, 214
MC_GETPAR (C macro, mccode-r.h), 168, 287
mccode-r (library), 285
mccoplot (McStas tool), 117
MCDISPLAY (McStas keyword), 174, 287
mcdisplay (McStas tool), 114
McDoc, 180–182
mcdoc (McStas tool), 118, 180
mcgui (McStas tool), 71–74, 96, 115, 116, 180
MCNP, 84
    exchange events, 219
MCPL, 83, 92
mcplot (McStas tool), 74, 84, 98, 106, 111, 116
mcplotdiff (McStas tool), 117
mcresplot (McStas tool), 117
mcrun (McStas tool), 110
MCSTAS (environment variable), 78, 285, 297
McStas
    authors, 9
    citing, 22
    compiler, see mcstas
    design, 33
    installation, 68
    mailing lists, 22
    meta-language, see Meta-language
    name, 306
    pronunciation, 306
    release scheme, 69
    running from the GUI, 71–74
    structure, 63, 66
mcstas (McStas compiler), 75
mcstas-r (library), 285
mcstas2vitess (McStas tool), 300
MCSTAS_FORMAT (environment variable), 74, 83, 116, 120
mctest (McStas tool), 119
mcviewtest (McStas tool), 119
Meta-language, 33, 136
METADATA (McStas keyword), 163
Microsoft Windows, see Windows
MIN2RAD (constant), 301
MNEUTRON (constant), 301
modified by (McDoc keyword), 181
monitor_nd-lib (library), 298
Monte Carlo method, 43
    accuracy, 54
    adaptive sampling, 53
    direction focusing, 48
    stratified sampling, 53
MPI, 97, 123, 124
    basic usage, 125
    limitations, 130
    mcrun, 125
    performance, 126
MS Windows, see Windows
MYSELF (McStas keyword), 161

NAME_CURRENT_COMP (C macro, mccode-r.h), 287
Neutron
    absorption, 154, 169
    state (position, velocity, time, spin, weight), 141
    weight, see Weight
Neutron polarisation, see Polarisation
NEXT (McStas keyword), 161
NeXus, 97, 121
    extension, 152
NOACC (McStas keyword), 167
NORM (C macro, mccode-r.h), 291
normal_vec (C function, mccode-r.c), 291

Optimization, 81, 92
    compiler option, 80
origin (McDoc keyword), 181
Output parameter, 306
OUTPUT PARAMETERS (McStas keyword), 166, 168

Parallel computing, see MPI, 123
Parameters
    definition, 153, 165
    Instruments, 148
    instruments, 82, 83, 110
    McDoc section, 181
    optimization, 93, 110
    optional, default value, 82, 149, 166
    protecting, see Keyword/OUTPUT
    scans, 110
    setting, 153, 165
Path
    file search, 78
PI (constant), 301
Polarisation, 188
    field functions, 200
    precession algorithm, 198
    SimpleNumMagnetPrecession, 199
POS_A_COMP (C macro, mccode-r.h), 288
POS_A_COMP_INDEX (C macro, mccode-r.h), 288
POS_A_CURRENT_COMP (C macro, mccode-r.h), 287
POS_R_COMP_INDEX (C macro, mccode-r.h), 288
Preprocessor macros, 285
PREVIOUS (McStas keyword), 154, 161
PRISMA, 265
PROP_DT (C macro, mcstas-r.h), 286
PROP_GRAV_DT (C macro, mcstas-r.h), 287
PROP_Z0 (C macro, mcstas-r.h), 169, 286
Propagation
    backward, 169

RAD2DEG (constant), 301
RAD2MIN (constant), 301
rand01 (C function, mccode-r.c), 293
randnorm (C function, mccode-r.c), 293
Random numbers
    generator, 279
    transformations, 277
randpm1 (C function, mccode-r.c), 293
randtriangle (C function, mccode-r.c), 293
randvec_target_circle (C function, mccode-r.c), 293
randvec_target_rect (C function, mccode-r.c), 294
randvec_target_rect_angular (C function, mccode-r.c), 294
read_table-lib (library), 295
RELATIVE (McStas keyword), 153
Release scheme, 69
Removed neutron events, 287
RESTORE_NEUTRON (C macro, mcstas-r.h), 289
RMS2FWHM (constant), 301
ROT_A_COMP (C macro, mccode-r.h), 288
ROT_A_CURRENT_COMP (C macro, mccode-r.h), 288
rot_apply (C function, mccode-r.c), 290
rot_copy (C function, mccode-r.c), 290
rot_mul (C function, mccode-r.c), 290
ROT_R_COMP (C macro, mccode-r.h), 288
ROT_R_CURRENT_COMP (C macro, mccode-r.h), 288
rot_set_rotation (C function, mccode-r.c), 290
rot_transpose (C function, mccode-r.c), 290
rotate (C macro, mccode-r.h), 291
ROTATED (McStas keyword), 154, 161
Run-time, 306

Sampling, 53
SAVE (McStas keyword), 155, 170
scalar_prod (C function, mccode-r.c), 291
SCATTER (C macro, mcstas-r.h), 158, 161, 169, 287, 289
SCATTERED (C macro, mccode-r.h), 158, 160, 170, 289
SE2V (constant), 301
SEARCH (McStas keyword), 150
Setting parameter, 306
SETTING PARAMETERS (McStas keyword), 165
SHARE (McStas keyword), 168, 285
SHELL (McStas keyword), 150
SIGHUP, 91
SIGINT, 91, 155
Signal handler, 88
    HUP signal, 91
    INT signal, 91, 155
    TERM signal, 91, 155
    USR1 signal, 91
    USR2 signal, 88, 91, 155
SIGTERM, 91, 155
SIGUSR1, 91
SIGUSR2, 88, 91, 155
solve_2nd_order (C function, mccode-r.c), 291
sphere_intersect (C function, mccode-r.c), 293
Spin-echo, 207
SPLIT (McStas keyword), 162
Statistics
    uncertainty, 46
STORE_NEUTRON (C macro, mcstas-r.h), 288
Stratified sampling, 53

Table_Free (C function, read_table-lib.c), 296
Table_Free_Array (C function, read_table-lib.c), 296
Table_Index (C function, read_table-lib.c), 296
Table_Info (C function, read_table-lib.c), 296
Table_Info_Array (C function, read_table-lib.c), 296
Table_Init (C function, read_table-lib.c), 295
Table_Read (C function, read_table-lib.c), 295
Table_Read_Array (C function, read_table-lib.c), 296
Table_Read_Offset (C function, read_table-lib.c), 295
Table_Read_Offset_Binary (C function, read_table-lib.c), 295
Table_Rebin (C function, read_table-lib.c), 296
Table_Value (C function, read_table-lib.c), 296
Table_Value2d (C function, read_table-lib.c), 296
TAS1, 248
TERM (signal), 91, 155
Time-of-flight spectrometer
    PRISMA, 265
Tools, 63
    external, see IDL, Matlab, NeXus, Perl, PGPLOT, VRML/OpenGL
    McStas, see mcdisplay, mcdoc, mcformat, mcgui, mcplot, mcresplot, mcrun, mcstas, mcstas2vitess
TRACE (McStas keyword), 153, 169
Triple-axis spectrometer
    TAS1, 248
Tripoli, 84

Units, 141
    constants and conversions, 301
USERVARS (McStas keyword), 151
USR1 (signal), 91
USR2 (signal), 88, 91, 155

V2K (constant), 301
Variance, 46
Variance reduction, 53
vec_prod (C function, mccode-r.c), 291
version (McDoc keyword), 181
Virtual sources, 53
Vitess, 84
vitess-lib (library), 300
VS2E (constant), 301

Weight, 45
    statistical uncertainty, 46
    transformation, 48
WHEN (McStas keyword), 160, 161
Windows
    file and directory names with spaces, 69
written by (McDoc keyword), 181