DEFINE INSTRUMENT bogus(Gam, Gamcen, L1, L2) DECLARE %{ double Gambytwo; double lambdamin; double lambdamax; double L1a; double dspace; double L2a; double lambda; double L2; double L1; %} INITIALIZE %{ lambda = 2.0; Gambytwo = Gam/2.0; dspace = lambda/sin(Gambytwo * DEG2RAD)/2.0; lambdamin = lambda - 0.1; lambdamax = lambda + 0.1; L1a = L1 - 1.3; L2a = L2/cos((Gamcen - Gam) * DEG2RAD); printf("L2a = %g \n",L2a); %} TRACE COMPONENT water = Source_flat_lambda( radius = 0.1, dist = L1a, xw = 0.01, yh = 0.01, lambda_0 = lambda, d_lambda = 0.06) AT (0, 0, 0) ABSOLUTE COMPONENT guide = Guide( w1 = 0.01, h1 = 0.01, w2 = 0.01, h2 = 0.01, l = 0.3, m = 0) AT (0, 0, L1a) RELATIVE water COMPONENT predetector = TOF_monitor( nchan = 80000, filename = "bogus1.txt", xmin = -.0015, xmax = .0015, ymin = -.0015, ymax = .0015, dt = 0.5) AT (0, 0, L1a) RELATIVE water COMPONENT arm2 = Arm() AT (0,0,L1) RELATIVE water /* COMPONENT afterdetector = TOF_monitor( nchan = 80000, filename = "bogus2.txt", xmin = -.0015, xmax = .0015, ymin = -.0015, ymax = .0015, dt = 0.5) AT (0, 0, L1) RELATIVE water */ COMPONENT sample = Single_crystal( xwidth = 0.01, yheight = 0.01, zthick = 0.01, delta_d_d = 1e-4, mosaic = 5, ax = dspace, ay = 0, az = 0, bx = 0, by = dspace, bz = 0, cx = 0, cy = 0, cz = dspace, reflections = "YBaCuO4.dat") AT (0,0,0) RELATIVE arm2 ROTATED (0,Gambytwo,0) RELATIVE arm2 COMPONENT arm1 = Arm() AT (0,0,0) RELATIVE arm2 ROTATED (0,Gam,0) RELATIVE arm2 COMPONENT detector = TOF_monitor( nchan = 80000, filename = "bogus.txt", xmin = -.0015, xmax = .0015, ymin = -.0015, ymax = .0015, dt = 0.5) AT (0, 0, L2a) RELATIVE arm1 ROTATED (0, Gamcen, 0) RELATIVE arm1 END