|
| 1 | +/******************************************************************************* |
| 2 | +* McXtrace instrument definition URL=http://www.mcxtrace.org |
| 3 | +* |
| 4 | +* Instrument: template (rename also the example and DEFINE lines below) |
| 5 | +* |
| 6 | +* %Identification |
| 7 | +* Written by: Your name (email) |
| 8 | +* Date: Current Date |
| 9 | +* Origin: Your institution |
| 10 | +* %INSTRUMENT_SITE: Templates |
| 11 | +* |
| 12 | +* !!Please write a short instrument (1 line) here!! |
| 13 | +* |
| 14 | +* %Description |
| 15 | +* Instrument longer description (type, elements, usage...) |
| 16 | +* |
| 17 | +* Example: mcrun template.instr <parameters=values> |
| 18 | +* |
| 19 | +* once your instrument is written and functional: |
| 20 | +* - replace INSTRUMENT_SITE entry above with your Institution name as a single word |
| 21 | +* - rename the instrument name after DEFINE INSTRUMENT below |
| 22 | +* - update the parameter help in the following Parameters section |
| 23 | +* - update the instrument description, and better add a usage example with a |
| 24 | +* sensible parameter set. |
| 25 | +* |
| 26 | +* %Parameters |
| 27 | +* Par: [unit] A parameter description |
| 28 | +* |
| 29 | +* %Link |
| 30 | +* A reference/HTML link for more information |
| 31 | +* |
| 32 | +* %End |
| 33 | +*******************************************************************************/ |
| 34 | +DEFINE INSTRUMENT template(Par1=1) |
| 35 | + |
| 36 | +/* The DECLARE section allows us to declare variables or small */ |
| 37 | +/* functions in C syntax. These may be used in the whole instrument. */ |
| 38 | +DECLARE |
| 39 | +%{ |
| 40 | +%} |
| 41 | + |
| 42 | +/* The INITIALIZE section is executed when the simulation starts */ |
| 43 | +/* (C code). You may use them as component parameter values. */ |
| 44 | +INITIALIZE |
| 45 | +%{ |
| 46 | +%} |
| 47 | + |
| 48 | +/* Here comes the TRACE section, where the actual */ |
| 49 | +/* instrument is defined as a sequence of components. */ |
| 50 | +TRACE |
| 51 | + |
| 52 | +/* The Arm() class component defines reference points and orientations */ |
| 53 | +/* in 3D space. Every component instance must have a unique name. Here, */ |
| 54 | +/* Origin is used. This Arm() component is set to define the origin of */ |
| 55 | +/* our global coordinate system (AT (0,0,0) ABSOLUTE). It may be used */ |
| 56 | +/* for further RELATIVE reference, Other useful keywords are : ROTATED */ |
| 57 | +/* EXTEND GROUP PREVIOUS. Also think about adding a neutron source ! */ |
| 58 | +/* Progress_bar is an Arm displaying simulation progress. */ |
| 59 | +COMPONENT Origin = Progress_bar() |
| 60 | + AT (0,0,0) ABSOLUTE |
| 61 | + |
| 62 | +/* This section is executed when the simulation ends (C code). Other */ |
| 63 | +/* optional sections are : SAVE */ |
| 64 | +FINALLY |
| 65 | +%{ |
| 66 | +%} |
| 67 | +/* The END token marks the instrument definition end */ |
| 68 | +END |
| 69 | + |
0 commit comments