Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mcstas-comps/examples/Templates/template/template.instr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
* McStas instrument definition URL=http://www.mcstas.org
*
* Instrument: test (rename also the example and DEFINE lines below)
* Instrument: template (rename also the example and DEFINE lines below)
*
* %Identification
* Written by: Your name (email)
Expand All @@ -14,7 +14,7 @@
* %Description
* Instrument longer description (type, elements, usage...)
*
* Example: mcrun test.instr <parameters=values>
* Example: mcrun template.instr <parameters=values>
*
* once your instrument is written and functional:
* - replace INSTRUMENT_SITE entry above with your Institution name as a single word
Expand All @@ -24,6 +24,7 @@
* sensible parameter set.
*
* %Parameters
* Par: [unit] A parameter description
*
* %Link
* A reference/HTML link for more information
Expand Down
69 changes: 69 additions & 0 deletions mcxtrace-comps/examples/Templates/template/template.instr
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*******************************************************************************
* McXtrace instrument definition URL=http://www.mcxtrace.org
*
* Instrument: template (rename also the example and DEFINE lines below)
*
* %Identification
* Written by: Your name (email)
* Date: Current Date
* Origin: Your institution
* %INSTRUMENT_SITE: Templates
*
* !!Please write a short instrument (1 line) here!!
*
* %Description
* Instrument longer description (type, elements, usage...)
*
* Example: mcrun template.instr <parameters=values>
*
* once your instrument is written and functional:
* - replace INSTRUMENT_SITE entry above with your Institution name as a single word
* - rename the instrument name after DEFINE INSTRUMENT below
* - update the parameter help in the following Parameters section
* - update the instrument description, and better add a usage example with a
* sensible parameter set.
*
* %Parameters
* Par: [unit] A parameter description
*
* %Link
* A reference/HTML link for more information
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT template(Par1=1)

/* The DECLARE section allows us to declare variables or small */
/* functions in C syntax. These may be used in the whole instrument. */
DECLARE
%{
%}

/* The INITIALIZE section is executed when the simulation starts */
/* (C code). You may use them as component parameter values. */
INITIALIZE
%{
%}

/* Here comes the TRACE section, where the actual */
/* instrument is defined as a sequence of components. */
TRACE

/* The Arm() class component defines reference points and orientations */
/* in 3D space. Every component instance must have a unique name. Here, */
/* Origin is used. This Arm() component is set to define the origin of */
/* our global coordinate system (AT (0,0,0) ABSOLUTE). It may be used */
/* for further RELATIVE reference, Other useful keywords are : ROTATED */
/* EXTEND GROUP PREVIOUS. Also think about adding a neutron source ! */
/* Progress_bar is an Arm displaying simulation progress. */
COMPONENT Origin = Progress_bar()
AT (0,0,0) ABSOLUTE

/* This section is executed when the simulation ends (C code). Other */
/* optional sections are : SAVE */
FINALLY
%{
%}
/* The END token marks the instrument definition end */
END