DEFINE INSTRUMENT guide(RV=-1) INITIALIZE %{ if (RV<0) RV = 2*2.65*sin(DEG2RAD*47); %} TRACE COMPONENT a1 = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT source = Source_Maxwell_3( height=0.2, width=0.2, l_low=1, l_high=2, 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 rotor_2 = Slit( xmin = -0.04, xmax = 0.04, ymin = -0.085, ymax = 0.085) AT (0, 0, 3.34) RELATIVE a1 COMPONENT rotor_3 = Slit( xmin = -0.045, xmax = 0.045, ymin = -0.09, ymax = 0.09) AT (0, 0, 4.25) RELATIVE a1 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.25) 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 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=1.089) AT (0, 0, 0) RELATIVE a2 ROTATED (0,47,0) RELATIVE a2 COMPONENT a3 = Arm() AT (0, 0, 0) RELATIVE previous ROTATED (0,94,0) RELATIVE a2 COMPONENT detector = PSD_monitor( nx = 40, ny =40, filename = "PSD.dat", xmin = -0.05, xmax = 0.05, ymin = -0.12, ymax = 0.12) AT (0, 0,2.5) RELATIVE previous ROTATED (0, 0, 0) RELATIVE previous COMPONENT virtual_output = Virtual_output( file = "mysource.dat") AT (0, 0, 2.6) RELATIVE a3 END