/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Ex_1_3b * * %Identification * Written by: Emmanouela Rantsiou * Date: Sep 2013, Berlin * * Release: McStas 2.0 * * * * %Description * Instrument: excercise 1.3b * straight guide. To be compared with the ballistic guide of Exercise 1.3a * * * %Parameters * M: [1] Guide reflectivity * *******************************************************************************/ DEFINE INSTRUMENT Ex_1_3b(M=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 /***********************************************/ /* Straight guide and monitors 1.5m after exit */ /***********************************************/ COMPONENT guide1 = Guide( w1 = 0.06, h1 = 0.06, w2 = 0.06, h2 = 0.06, l = guide_length, m = M) AT (0, 0, 1.5) RELATIVE Source ROTATED (0, 0, 0) RELATIVE Source 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 guide1 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.07, xmax = 0.07, ymin = -0.07, ymax = 0.07, Lmin = 0.5, Lmax = 9.5) AT (0, 0, 0.0002) RELATIVE PREVIOUS FINALLY %{ %} END