/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Ex_1_4 * * %Identification * Written by: Emmanouela Rantsiou * Date: Sep 2013, Berlin * * Release: McStas 2.0 * * * * %Description * Instrument: excercise 1.4 * elliptic guide . To be compared with the ballistic guide and straight guide * of Exercise 1.3a and 1.3b respectively * * * %Parameters * M: [1] Guide reflectivity * *******************************************************************************/ DEFINE INSTRUMENT Ex_1_4(Mx=1, My=1) DECLARE %{ double guide_length, guide_height, guide_width; %} INITIALIZE %{ guide_length = 20.0; guide_height = 0.06; guide_width = 0.06; %} TRACE COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE /***********************************************/ /* Source and monitors after it */ /***********************************************/ COMPONENT Source = Source_simple( radius = 0.12, dist = 1.5, focus_xw = 0.06, focus_yh = 0.06, lambda0 = 5, dlambda = 4) AT (0, 0, 0) RELATIVE Origin COMPONENT psd_source = PSD_monitor( nx = 1000, ny = 1000, filename = "psd_source.dat", xmin = -0.035, xmax = 0.035, ymin = -0.035, ymax = 0.035) AT (0, 0, 1.495) RELATIVE Source COMPONENT lambda_source = L_monitor( nL = 100, filename = "lambda_source.dat", xmin = -0.035, xmax = 0.035, ymin = -0.035, ymax = 0.035, Lmin = 0.5, Lmax = 9.5) AT (0, 0, 1.496) RELATIVE Source COMPONENT Div_source = Divergence_monitor( nh = 100, nv = 100, filename = "div_source.dat", xwidth = 0.6, yheight = 0.6, maxdiv_h = 7, maxdiv_v = 7) AT (0, 0, 1.497) RELATIVE Source /***********************************************/ /* Elliptic guide and monitors 1.5m from exit */ /***********************************************/ COMPONENT elliptic_guide = Guide_tapering( option = "elliptical", w1 = guide_width, h1 = guide_height, l = 20, linw = 1.5, loutw = 1.5, linh = 1.5, louth = 1.5, mx = Mx, my = My) AT (0, 0, 1.5) RELATIVE Source ROTATED (0, 0, 0) RELATIVE Source /***********************************************/ /* Slit of 2x2cm^2 infront of monitors */ /***********************************************/ /*COMPONENT slit1 = Slit( xmin = -0.01, xmax = 0.01, ymin = -0.01, ymax = 0.01) AT (0, 0, guide_length + 1.4999) RELATIVE elliptic_guide */ COMPONENT PSD_after_guide = PSD_monitor( filename = "psd_after_guide.dat", xmin = -0.07 ,xmax = 0.07, ymin = -0.07, ymax = 0.07) AT (0, 0, guide_length+1.5) RELATIVE elliptic_guide COMPONENT psd_linX = PSDlin_monitor( nx = 100, filename = "psd_linX.dat", xmin = -0.07, xmax = 0.07, ymin = -0.07, ymax = 0.07) AT (0, 0, 0.0001) RELATIVE PREVIOUS COMPONENT psd_linY = PSDlin_monitor( nx = 100, filename = "psd_linY.dat", xmin = -0.07, xmax = 0.07, ymin = -0.07, ymax = 0.07) AT (0, 0, 0.0001) RELATIVE PREVIOUS ROTATED (0, 0, 90) RELATIVE PREVIOUS COMPONENT Div_after_guide = Divergence_monitor( nh = 100, nv = 100, filename = "div_after_guide.dat", xwidth = 0.1, yheight = 0.1, maxdiv_h = 5, maxdiv_v = 5) AT (0, 0, 0.0001) RELATIVE PREVIOUS COMPONENT lambda_after_guide= L_monitor( nL = 100, filename = "lambda_after_guide.dat", xmin = -0.1, xmax = 0.1, ymin = -0.1, ymax = 0.1, Lmin = 0.5, Lmax = 9.5) AT (0, 0, 0.0002) RELATIVE PREVIOUS FINALLY %{ %} END