128 lines
4.0 KiB
Plaintext
128 lines
4.0 KiB
Plaintext
DEFINE INSTRUMENT DMC_diff(TKOFF,lambda,char *samplefile, char *monfile)
|
|
DECLARE
|
|
%{
|
|
double mono_q = 1.87;
|
|
double OMA;
|
|
double RV;
|
|
double y_mono = 0.025;
|
|
double NV = 5;
|
|
double d_phi_0;
|
|
double TKOFF;
|
|
double sample_radius = 0.005;
|
|
double sample_height = 0.03;
|
|
double lambda;
|
|
double ldiff=0.5;
|
|
char *samplefile;
|
|
%}
|
|
|
|
INITIALIZE
|
|
%{
|
|
OMA = TKOFF/2;
|
|
RV = fabs(2*2.82*sin(DEG2RAD*OMA));
|
|
%}
|
|
|
|
TRACE
|
|
|
|
COMPONENT source_arm = Arm()
|
|
AT (0, 0, 0) ABSOLUTE
|
|
|
|
/* values for guide side window RNR12 */
|
|
COMPONENT csource = Source_gen(
|
|
radius = 0.08,xw = 0.02, yh = 0.12, dist = 1.5,
|
|
Lambda0 = lambda, dLambda = ldiff,
|
|
T1=150.42,I1=5.98e11,
|
|
T2=37.23,I2=5.637e11,T3=14.9,I3=0.962e11)
|
|
AT (0,0,0) RELATIVE source_arm ROTATED (0,0,0) RELATIVE source_arm
|
|
|
|
/* guide segment 1, m=2, 4.66 m */
|
|
COMPONENT guide1 = Guide(w1=0.02, h1=0.12, w2=0.02, h2=0.12,
|
|
l=4.66, R0=0.995, Qc=0.0217, alpha = 5.76,
|
|
m = 2.0, W = 0.0033)
|
|
AT (0,0,1.5) RELATIVE source_arm ROTATED (0,0,0) RELATIVE source_arm
|
|
|
|
/* guide segment 2, curved, m=2, 24.5 m */
|
|
COMPONENT guide2 = Bender(
|
|
w = 0.02, h = 0.12, r = 3612, R0a = 0.995, Qca = 0.0217,
|
|
alphaa = 5.76, ma = 2, Wa = 0.0033, R0i = 0.995, Qci = 0.0217,
|
|
alphai = 5.76, mi = 2, Wi = 0.0033, R0s = 0.995, Qcs = 0.0217,
|
|
alphas = 5.76, ms = 2, Ws = 0.0033, l = 24.5)
|
|
AT (0,0,6.16) RELATIVE source_arm ROTATED (0,0,0) RELATIVE source_arm
|
|
|
|
/* bunker wall, m=2, 3.0 m */
|
|
COMPONENT bunker = Guide(
|
|
w1=0.02, h1=.12, w2=0.02, h2=.12,
|
|
l=3.0, R0=0.995, Qc=0.0217, alpha = 5.76,
|
|
m = 2.0, W = 0.0033)
|
|
AT (0,0,30.66) RELATIVE source_arm ROTATED (0,0,0) RELATIVE source_arm
|
|
|
|
/* guide segment 3, m=2, 8.84 m */
|
|
|
|
COMPONENT guide3 = Guide(
|
|
w1=0.02, h1=.12, w2=0.02, h2=.12,
|
|
l=8.84, R0=0.995,Qc=0.0217, alpha = 5.76,
|
|
m = 2.0, W = 0.0033)
|
|
AT (0,0,33.66) RELATIVE source_arm ROTATED (0,0,0) RELATIVE source_arm
|
|
|
|
/* guide exit at 42.5 m - measured flux 2.46 10e8 cm-2 s-1 mA-1 */
|
|
|
|
COMPONENT in_slit = Slit(
|
|
xmin = -0.01, xmax=0.01 , ymin = -0.06, ymax = 0.06)
|
|
AT (0,0,42.5) RELATIVE source_arm ROTATED (0,0,0) RELATIVE source_arm
|
|
|
|
/* Monochromator description */
|
|
|
|
COMPONENT sma = Arm() /* source - monochromator arm */
|
|
AT (0, 0, 43.15) RELATIVE source_arm ROTATED (0,OMA,0) RELATIVE source_arm
|
|
|
|
|
|
COMPONENT foc_mono = Monochromator_2foc(
|
|
zwidth = 0.05, yheight = 0.025, gap = 0.0005, NH = 1, NV = 5,
|
|
mosaich = 38, mosaicv = 38, r0 = 0.7, Q = 1.8857, RV = RV,
|
|
RH = 0)
|
|
AT (0, 0, 0) RELATIVE sma
|
|
|
|
COMPONENT msa = Arm() /* monochromator - sample arm */
|
|
AT (0, 0, 0) RELATIVE sma ROTATED (0, TKOFF, 0) RELATIVE source_arm
|
|
|
|
COMPONENT out1_slit = Slit(
|
|
xmin=-0.01, xmax=0.01, ymin=-0.06, ymax=0.06)
|
|
AT (0,0,0.2) RELATIVE msa ROTATED (0,0,0) RELATIVE msa
|
|
|
|
COMPONENT Amoin_slit = Slit(
|
|
xmin=-0.01, xmax=0.01, ymin=-0.06, ymax=0.06)
|
|
AT (0,0,0.325) RELATIVE msa ROTATED (0,0,0) RELATIVE msa
|
|
|
|
COMPONENT Bmoin_slit = Slit(
|
|
xmin=-0.01, xmax=0.01, ymin=-0.06, ymax=0.06)
|
|
AT (0,0,0.525) 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 = PSD_monitor(
|
|
xmin=-0.02, xmax=0.02, ymin=-0.065, ymax=0.065,
|
|
nx=80, ny=80, filename="PSD_sample.dat",controlfile=monfile, dumpCount=500)
|
|
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=40,radius=sample_radius, h=sample_height,
|
|
pack=1, Vc=1076.98, reflections = samplefile,
|
|
sigma_a=0.2, target_index=+4)
|
|
AT ( 0, 0, 0) RELATIVE sa_arm
|
|
|
|
COMPONENT sda = Arm() /* sample-detector arm */
|
|
AT (0, 0, 0) RELATIVE sa_arm ROTATED (0, -93.8, 0) RELATIVE sa_arm
|
|
|
|
COMPONENT Det9 = Monitor_nD(
|
|
xwidth=3.0,yheight=0.09,
|
|
options="banana theta limits [19 99] bins=400, file=det9.dat")
|
|
AT (0,0,0) RELATIVE sa_arm
|
|
ROTATED (0, 0, 180) RELATIVE sa_arm
|
|
|
|
END
|