/*******************************************************************************
*
* McStas, neutron ray-tracing package
*         Copyright (C) 1997-2008, All rights reserved
*         Risoe National Laboratory, Roskilde, Denmark
*         Institut Laue Langevin, Grenoble, France
*
* Instrument: Union_unit_test_logger_2D_kf
*
* %Identification
* Written by: Mads Bertelsen
* Date: June 2020
* Origin: ESS
* %INSTRUMENT_SITE: Union_demos
*
* Base instrument for logger unit tests
*
* %Description
* Base instrument for logger unit tests
*
* %End
*******************************************************************************/

DEFINE INSTRUMENT Union_unit_test_logger_2D_kf()

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

// Insert loggers to be tested here
COMPONENT Union_logger_2D_kf = Union_logger_2D_kf(
    Q_direction_1="z", Q1_min=-3.0, Q1_max=3.0, n1=200,
    Q_direction_2="x", Q2_min=-3.0, Q2_max=3.0, n2=200,
    filename="Union_logger_2D_kf.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
