DEFINE INSTRUMENT DMC_diff(Det_start, char *samplefile, char *monfile, char *lambdafile,int repeat) DECLARE %{ double sample_radius = 0.005; double sample_height = 0.03; double Det_start; double Det_end; char option_list[150]; %} INITIALIZE %{ Det_end= Det_start + 80; sprintf(option_list,"banana theta limits [%f %f] bins=400, file=det9.dat",Det_start,Det_end); printf("%s \n",option_list); %} TRACE COMPONENT msa = Arm() /* monochromator - sample arm */ AT (0, 0, 0) ABSOLUTE /* COMPONENT progress = Progress_bar(percent=5,flag_save=1) AT (0,0,.1) ABSOLUTE */ COMPONENT in = Virtual_input(file=lambdafile,repeat_count=repeat) AT (0,0,0.64) RELATIVE msa ROTATED (0,0,0) RELATIVE msa COMPONENT out2_slit = Slit( xmin=-0.01, xmax=0.01, ymin=-0.06, ymax=0.06) AT (0,0,0.65) RELATIVE msa ROTATED (0,0,0) RELATIVE msa COMPONENT PSD_sample = MKMonitor( xmin=-0.05, xmax=0.05, ymin=-0.07, ymax=0.07,controlfile=monfile) AT ( 0, 0, 1.5) RELATIVE msa /* COMPONENT PSD_sample = PSD_monitor( xmin=-0.05, xmax=0.05, ymin=-0.07, ymax=0.07, nx=80, ny=80, filename="PSD_sample.dat",controlfile=monfile,dumpCount=1000) AT ( 0, 0, 1.5) RELATIVE msa COMPONENT PSD_sample = PSD_monitor( xmin=-0.05, xmax=0.05, ymin=-0.07, ymax=0.07, nx=80, ny=80, filename="PSD_sample.dat") AT ( 0, 0, 1.5) RELATIVE msa */ COMPONENT sa_arm = Arm() AT (0, 0, 2.82) RELATIVE msa ROTATED (0, 0, 0) RELATIVE msa COMPONENT sample = PowderN ( d_phi0=0, radius=sample_radius, h=sample_height, pack=1, Vc=1076.98, reflections = samplefile, sigma_a=0.2, focus_aw=80, focus_ah=3.5, target_index=+1) AT ( 0, 0, 0) RELATIVE sa_arm COMPONENT Det9 = Monitor_nD( xwidth=3.0,yheight=0.09, options=option_list) AT (0,0,0.000001) RELATIVE sa_arm ROTATED (0, 0, 180) RELATIVE sa_arm END