/*******************************************************************************
*         McStas instrument definition URL=http://www.mcstas.org
*
* Instrument: Vout_test 
*
* %Identification
* Written by: Peter Willendrup (pkwi@fysik.dtu.dk)
* Date: September 2014
* Origin: DTU Physics
* %INSTRUMENT_SITE: DTU
*
* Simple test instrument for the Virtual_input component
*
* %Description
*
* Simple test instrument for the Virtual_input component
*
* %Parameters
* Vinfile: [string]  Filename for Virtual_output-created event file
*
* %Link
* A reference/HTML link for more information
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Vin_test(string Vinfile="Vout_text.dat")

/* 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

COMPONENT Vin = Virtual_input(
    filename = Vinfile, verbose=1)
  AT (0, 0, 0) RELATIVE Origin

COMPONENT PSD = PSD_monitor(
    restore_neutron = 1, filename = "PSD.dat", xwidth = 0.1,
    yheight = 0.1)
  AT (0, 0, 1) RELATIVE Origin


/* 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



