/*******************************************************************************
*
* McStas, neutron ray-tracing package
*         Copyright (C) 1997-2008, All rights reserved
*         Risoe National Laboratory, Roskilde, Denmark
*         Institut Laue Langevin, Grenoble, France
*
* Instrument: Unit_test_logger_1D
*
* %Identification
* Written by: Mads Bertelsen
* Date: June 2020
* Origin: ESS
* %INSTRUMENT_SITE: Tests_union
*
* Test of Union 1D logger
*
* %Description
* Test instrument for the Union 1D logger component that can log scattering
* intensity as a function of one of several quantities, here time.
*
* %End
*******************************************************************************/

DEFINE INSTRUMENT Unit_test_logger_1D()

DECLARE
%{
%}

INITIALIZE
%{
%}

TRACE

COMPONENT init = Union_init()
AT (0,0,0) ABSOLUTE

COMPONENT incoherent = Incoherent_process(sigma=0.2, packing_factor=1, unit_cell_volume=66.4)
AT (0,0,0) ABSOLUTE

COMPONENT powder = Powder_process(reflections="Cu2MnAl.laz")
AT (0,0,0) ABSOLUTE

COMPONENT material = Union_make_material(my_absorption=4.0,
    process_string="incoherent,powder")
AT (0,0,0) ABSOLUTE

COMPONENT Origin = Progress_bar()
  AT (0,0,0) ABSOLUTE

COMPONENT source = Source_div(
        xwidth=0.02, yheight=0.002,
        focus_aw=0.01, focus_ah=0.01,
        E0=10, dE=0.1)
AT (0,0,0) RELATIVE Origin

COMPONENT geometry_center = Arm()
AT (0,0,2.0) RELATIVE source

COMPONENT box = Union_box(xwidth=0.10, yheight=0.15, zdepth=0.03, priority=5, material_string="material")
AT (-0.03,0,-0.05) RELATIVE geometry_center

COMPONENT sphere = Union_sphere(radius=0.05, priority=6, material_string="material")
AT (0.03,0,-0.04) RELATIVE geometry_center

COMPONENT cylinder = Union_cylinder(radius=0.045, yheight=0.1, priority=7, material_string="material")
AT (-0.03,0,0.02) RELATIVE geometry_center

COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

COMPONENT Union_logger_1D = Union_logger_1D(
    variable="time", min_value=0.0013, max_value=0.0022, n1=200,
    filename="Union_logger_1D.dat")
AT (0,0,0) RELATIVE geometry_center

COMPONENT master = Union_master()
AT(0,0,0) RELATIVE geometry_center

COMPONENT transmission = PSD_monitor(
    xwidth=0.1, yheight=0.08, nx=200, ny=200,
    filename="PSD.dat", restore_neutron=1)
AT (0,0,1) RELATIVE geometry_center

COMPONENT stop = Union_stop()
AT (0,0,0) ABSOLUTE

END
