/******************************************************************************* * Instrument: (V20_scans) * * %I * Written by: (your name (email)) * Date: (current date) * Origin: (your institution) * Release: (McStas V.X.X) * Version: (instrument version) * %INSTRUMENT_SITE: (your SITE) * * (instrument short description) * * %D * (instrument description) * * Example: (parameters=values) * * %P * (parameter1): [(unit)] (parameter1 description) * ... * * %L * (reference/HTML link) * * %E *******************************************************************************/ /* instrument definition: name, parameters & default values */ DEFINE INSTRUMENT V20_scans(frequency=14) /* declare variables and functions in C syntax */ DECLARE %{ double u = 1e-4, l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,g1w,g1h,g2w,g2h,g3w,g3h,g4w,g4h,g5w,g5h,g6w,g6h,g7w,g7h,g8w,g8h,g9w,g9h,g10w,g10h,g11w,g11h,g12w,g12h; %} /* any C code here is executed when the simulation starts */ INITIALIZE %{ /* guide lengths */ l1=1.87; l2=1.53; l3=5.50; l4=7.50; l5=3.00; l6=0.45; l7=6.50; l8=1.5; l9=1; l10=5.75; l11=3.5; l12=5; /* guide widths*/ g1w=0.06; g2w=0.06; g3w=0.06; g4w=0.06; g5w=0.06; g6w=0.06; g7w=0.06; g8w=0.06; g9w=0.06; g10w=0.06; g11w=0.06; g12w=0.06; /*guide heights*/ g1h=0.125; g2h=0.125; g3h=0.125; g4h=0.125; g5h=0.125; g6h=0.125; g7h=0.125; g8h=0.125; g9h=0.125; g10h=0.125; g11h=0.125; g12h=0.125; %} /* in the TRACE section, the instrument is defined as a sequence of components. */ TRACE /* Progress_bar() is an Arm() displaying simulation progress */ COMPONENT origin = Progress_bar() AT (0, 0, 0) ABSOLUTE COMPONENT Source = Source_simple( radius = 0.2, dist = 1.997, focus_xw = 0.1, focus_yh = 0.2, E0 = 4, dE = 3.99, flux = 6e13) AT (0, 0, 0) RELATIVE origin COMPONENT lmonfa = L_monitor( nL = 18, filename = "Cony_sp_p1.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, Lmin = 1, Lmax = 10) AT (0, 0, 1.53-3*u) RELATIVE PREVIOUS COMPONENT div_p1 = Divergence_monitor( nh = 35, nv = 120, filename = "Coni_div_p1.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, maxdiv_h = 5, maxdiv_v = 5) AT (0, 0, u) RELATIVE PREVIOUS COMPONENT psd_p1 = PSD_monitor( nx = 35, ny = 120, filename = "Coni_psd_p1.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06) AT (0, 0, u) RELATIVE PREVIOUS /* Elemente:*/ COMPONENT g1 = Guide( w1 = g1w, h1 = g1h, w2 = g1w, h2 = g1h, l = l1, alpha = 6.49, m = 3, W = 0.00333) AT (0, 0,u) RELATIVE PREVIOUS COMPONENT g2 = Guide( w1 = g2w, h1 = g2h, w2 = g2w, h2 = g2h, l = l2, alpha = 6.49, m = 3, W = 0.00333) AT (0, 0,l1+0.07) RELATIVE PREVIOUS COMPONENT g3 = Bender( w = g3w, h = g3h, r = 1500, l = l3) AT (0, 0, l2) RELATIVE PREVIOUS COMPONENT g4 = Bender( w = g4w, h = g4h, r = 2300, l = l4) AT (0, 0, l3+0.206) RELATIVE PREVIOUS COMPONENT g5 = Bender( w = g5w, h = g5h, r = 2300, l = l5) AT (0, 0, l4) RELATIVE PREVIOUS COMPONENT g6 = Bender( w = g6w, h = g6h, r = 2300, l = l6) AT (0, 0, l5) RELATIVE PREVIOUS COMPONENT Source_Chopper_1 = DiskChopper( theta_0 = 23, radius = 0.35, yheight = 0.15, nu = frequency, nslit = 1, isfirst = 1, n_pulse = 1, abs_out = 1, phase = 0+23*0.5) AT (0, 0, l6+0.044) RELATIVE PREVIOUS COMPONENT Source_Chopper_2 = DiskChopper( theta_0 = 50, radius = 0.35, yheight = 0.15, nu = -3*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 0+50*0.5) AT (0, 0, 0.01) RELATIVE PREVIOUS COMPONENT g7 = Bender( w = g7w, h = g7h, r = 2300, l = l7) AT (0, 0, 0.019) RELATIVE PREVIOUS COMPONENT lmonp2 = L_monitor( nL = 18, filename = "Cony_sp_p2.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, Lmin = 1, Lmax = 10) AT (0, 0, l7+0.01) RELATIVE PREVIOUS COMPONENT div_p2 = Divergence_monitor( nh = 35, nv = 120, filename = "Coni_div_p2.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, maxdiv_h = 5, maxdiv_v = 5) AT (0, 0, 0.01) RELATIVE PREVIOUS COMPONENT psd_p2 = PSD_monitor( nx = 35, ny = 120, filename = "Coni_psd_p2.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06) AT (0, 0, 0.01) RELATIVE PREVIOUS /* WFMC disk 1 assembly start*/ COMPONENT WFMC_1_a = DiskChopper( theta_0 = 10.99, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 83.71+10.99*0.5) AT (0, 0, 0.1107) RELATIVE PREVIOUS COMPONENT WFMC_1_b = DiskChopper( theta_0 = 15.3, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 140.49+15.3*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_1_c = DiskChopper( theta_0 = 19.3, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 193.26+19.3*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_1_d = DiskChopper( theta_0 = 23.01, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 242.32+23.01*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_1_e = DiskChopper( theta_0 = 26.46, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 287.91+26.46*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_1_f = DiskChopper( theta_0 = 29.7, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 330.3+29.7*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers /* WFMC disk 1 assembly end*/ COMPONENT lmonp9 = L_monitor( nL = 18, filename = "Cony_sp_p9.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, Lmin = 1, Lmax = 10) AT (0, 0, 0.01) RELATIVE PREVIOUS COMPONENT slit_1 = Slit( xwidth = 0.05, yheight = 0.1) AT (0, 0, 0.21) RELATIVE PREVIOUS /* WFMC disk 2 assembly start*/ COMPONENT WFMC_2_a = DiskChopper( theta_0 = 10.99, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 65.04+10.99*0.5) AT (0, 0, 0.25) RELATIVE PREVIOUS COMPONENT WFMC_2_b = DiskChopper( theta_0 = 15.3, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 126.1+15.3*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_2_c = DiskChopper( theta_0 = 19.3, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 182.88+19.3*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_2_d = DiskChopper( theta_0 = 19.3, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 235.67+19.3*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_2_e = DiskChopper( theta_0 = 23.01, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 284.73+23.01*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT WFMC_2_f = DiskChopper( theta_0 = 29.68, radius = 0.3, yheight = 0.13, nu = 5*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 330.32+29.68*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers /* WFMC disk 2 assembly end*/ COMPONENT lmonp10 = L_monitor( nL = 18, filename = "Cony_sp_p10.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, Lmin = 1, Lmax = 10) AT (0, 0, 0.01) RELATIVE PREVIOUS COMPONENT g8 = Bender( w = g8w, h = g8h, r = 2300, l = l8) AT (0, 0, 0.02) RELATIVE PREVIOUS /* FOC disk 1 assembly start*/ COMPONENT FOC_1_a = DiskChopper( theta_0 = 20.64, radius = 0.3, yheight = 0.13, nu = 4*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 64.35+20.64*0.5) AT (0, 0, l8+0.18) RELATIVE PREVIOUS COMPONENT FOC_1_b = DiskChopper( theta_0 = 23.24, radius = 0.3, yheight = 0.13, nu = 4*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 125.05+23.24*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_1_c = DiskChopper( theta_0 = 21.81, radius = 0.3, yheight = 0.13, nu = 4*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 183.41+21.81*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_1_d = DiskChopper( theta_0 = 17.87, radius = 0.3, yheight = 0.13, nu = 4*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 236.4+17.87*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_1_e = DiskChopper( theta_0 = 15.76, radius = 0.3, yheight = 0.13, nu = 4*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 287.04+15.76*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_1_f = DiskChopper( theta_0 = 24.47, radius = 0.3, yheight = 0.13, nu = 4*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 335.53+24.47*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT lmonp11 = L_monitor( nL = 18, filename = "Cony_sp_p11.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, Lmin = 1, Lmax = 10) AT (0, 0, 0.01) RELATIVE PREVIOUS /* FOC disk 1 assembly end*/ COMPONENT slit_2 = Slit( xwidth = 0.05, yheight = 0.1) AT (0, 0, 0.10) RELATIVE PREVIOUS COMPONENT g9 = Bender( w = g9w, h = g9h, r = 2300, l = l9) AT (0, 0, 0.10) RELATIVE PREVIOUS /* Band Chopper (BC) Disc 1 */ COMPONENT BC_1 = DiskChopper( theta_0 = 140, radius = 0.35, yheight = 0.15, nu = frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 0+140*0.5) AT (0, 0, l9) RELATIVE PREVIOUS /* Band Chopper Disc 2 */ COMPONENT BC_2 = DiskChopper( theta_0 = 202, radius = 0.35, yheight = 0.15, nu = frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 0+202*0.5) AT (0, 0, 0.01) RELATIVE PREVIOUS COMPONENT g10= Bender( w = g10w, h = g10h , r = 2300, l=l10) AT (0, 0, 0) RELATIVE PREVIOUS /* FOC disk 2 assembly start*/ COMPONENT FOC_2_a = DiskChopper( theta_0 = 36.6, radius = 0.3, yheight = 0.13, nu = 2*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 79.78+36.6*0.5) AT (0, 0, l10+0.14) RELATIVE PREVIOUS COMPONENT FOC_2_b = DiskChopper( theta_0 = 36.06, radius = 0.3, yheight = 0.13, nu = 2*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 136.41+36.06*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_2_c = DiskChopper( theta_0 = 30.21, radius = 0.3, yheight = 0.13, nu = 2*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 191.73+30.21*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_2_d = DiskChopper( theta_0 = 26.88, radius = 0.3, yheight = 0.13, nu = 2*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 240.81+26.88*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_2_e = DiskChopper( theta_0 = 24.56, radius = 0.3, yheight = 0.13, nu = 2*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 287.13+24.56*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT FOC_2_f = DiskChopper( theta_0 = 29.11, radius = 0.3, yheight = 0.13, nu = 2*frequency, nslit = 1, isfirst = 0, n_pulse = 1, abs_out = 1, phase = 330.89+29.11*0.5) AT (0, 0, 0) RELATIVE PREVIOUS GROUP Choppers COMPONENT lmonp12 = L_monitor( nL = 18, filename = "Cony_sp_p12.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, Lmin = 1, Lmax = 10) AT (0, 0, 0.01) RELATIVE PREVIOUS /* FOC disk 2 assembly end*/ COMPONENT slit_3 = Slit( xwidth = 0.02, yheight = 0.1) AT (0, 0, 0.10+l10) RELATIVE PREVIOUS COMPONENT g11= Bender( w = g11w, h = g11h , r = 2300, l=l11) AT (0, 0, 0) RELATIVE PREVIOUS COMPONENT g12 = Guide( w1 = g12w, h1 = g12h, w2 = g12w, h2 = g12h, l = l12, alpha = 6.49, m = 3, W = 0.00333) AT (0, 0,l11) RELATIVE PREVIOUS COMPONENT lmonpfinal = L_monitor( nL = 18, filename = "Cony_sp_pfinal.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, Lmin = 1, Lmax = 10) AT (0, 0, l12+0.01) RELATIVE PREVIOUS COMPONENT div_pfinal = Divergence_monitor( nh = 35, nv = 120, filename = "Coni_div_pfinal.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06, maxdiv_h = 5, maxdiv_v = 5) AT (0, 0, 0.01) RELATIVE PREVIOUS COMPONENT psd_pfinal = PSD_monitor( nx = 35, ny = 120, filename = "Coni_psd_pfinal.dat", xmin = -0.0175, xmax = 0.0175, ymin = -0.06, ymax = 0.06) AT (0, 0, 0.01) RELATIVE PREVIOUS COMPONENT Polarizing_S_bender = Pol_bender( xwidth = 0.06, yheight = 0.125, length = 0.05, radius = 10) AT (0, 0, l12+0.3) RELATIVE PREVIOUS /* any C code here is executed when the simulation ends */ FINALLY %{ %} /* The END token marks the instrument definition end */ END