DEFINE INSTRUMENT guide(RV=-1) INITIALIZE %{ if (RV<0) RV = 2*2.65*sin(DEG2RAD*22.4889); %} TRACE COMPONENT a1 = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT source = Source_Maxwell_3( height=0.2, width=0.2, l_low=2, l_high=3, dist=4.25, xw=0.09, yh=0.18, T1=330, I1=4.23e12) AT (0, 0, 0) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1 /* exit of graphite nose of beamtube */ COMPONENT beamtube_nose = Slit( xmin = -0.04, xmax = 0.04, ymin = -0.085, ymax = 0.085) AT (0, 0, 0.35) RELATIVE a1 /* exits of the 2 rotating slits in the "bouchon" */ COMPONENT rotor_1 = Slit( xmin = -0.04, xmax = 0.04, ymin = -0.085, ymax = 0.085) AT (0, 0, 2.75) RELATIVE a1 COMPONENT PSDslit1 = PSD_monitor( nx = 200, ny = 200, filename = "PSDafterSlit1", restore_neutron = 0, xwidth = 0.2, yheight = 0.2) AT (0, 0, 0.001) RELATIVE PREVIOUS COMPONENT rotor_2 = Slit( xmin = -0.04, xmax = 0.04, ymin = -0.085, ymax = 0.085) AT (0, 0, 3.34) RELATIVE a1 COMPONENT PSDslit2 = PSD_monitor( nx = 200, ny = 200, filename = "PSDafterSlit2", restore_neutron = 0, xwidth = 0.2, yheight = 0.2) AT (0, 0, 0.001) RELATIVE PREVIOUS COMPONENT rotor_3 = Slit( xmin = -0.045, xmax = 0.045, ymin = -0.09, ymax = 0.09) AT (0, 0, 4.25) RELATIVE a1 COMPONENT PSDslit3 = PSD_monitor( nx = 200, ny = 200, filename = "PSDafterSlit3", restore_neutron = 0, xwidth = 0.2, yheight = 0.2) AT (0, 0, 0.001) RELATIVE PREVIOUS COMPONENT CG=Bender(w=0.01,h=0.17,r=515.6,Win=0.0149472,k=1, R0a=0.97,Qca=0.0219,alphaa=3.2,ma=2,Wa=0.003, R0i=0.97,Qci=0.0219,alphai=3.2,mi=2,Wi=0.003, R0s=0.97,Qcs=0.0219,alphas=3.2,ms=2,Ws=0.003) AT (0, 0, 4.251) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1 COMPONENT a2 = Arm() AT (0, 0, 8) RELATIVE previous ROTATED (0,0.0149472,0) RELATIVE previous COMPONENT PSD = PSD_monitor( nx = 200, ny = 200, filename = "PSDafterbender", restore_neutron = 1, xwidth = 0.2, yheight = 0.2) AT (0, 0, 8) RELATIVE CG COMPONENT Lmon_in = L_monitor( nchan = 21, filename = "Lmon_in", restore_neutron = 1, xwidth = 0.2, yheight = 0.2, Lmin=1,Lmax=4) AT (0, 0, 8) RELATIVE CG COMPONENT Monochromator=Monochromator_curved(zwidth=0.093, yheight=0.0155, gap=0.0002, NH=1, NV=13, mosaich=18, mosaicv=18, r0=0.7, RH=0.00, RV=RV, DM=3.355) AT (0, 0, 0) RELATIVE a2 ROTATED (0,22.4889,0) RELATIVE a2 EXTEND %{ if (!SCATTERED) ABSORB; %} COMPONENT a3 = Arm() AT (0, 0, 0) RELATIVE previous ROTATED (0,44.9778,0) RELATIVE a2 COMPONENT slit1 = Slit( width = 0.025, height = 0.15) AT (0, 0, 1.65) RELATIVE a3 COMPONENT slit2 = Slit( width = 0.025, height = 0.15) AT (0, 0, 0.08) RELATIVE slit1 COMPONENT Lmon_out = L_monitor( nchan = 201, filename = "Lmon_out", restore_neutron = 1, xwidth = 0.05, yheight = 0.25, Lmin=2,Lmax=3) AT (0, 0, 2.5) RELATIVE a3 COMPONENT detector = PSD_monitor( nx = 40, ny =40, filename = "PSD.dat", xwidth=0.05, yheight=0.25) AT (0, 0,2.5) RELATIVE a3 COMPONENT virtual_output = Virtual_output( file = "mysource.dat") AT (0, 0, 2.6) RELATIVE a3 END