File: Reflectometer.instr

package info (click to toggle)
mccode 3.5.19%2Bds5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,113,256 kB
  • sloc: ansic: 40,697; python: 25,137; yacc: 8,438; sh: 5,405; javascript: 4,596; lex: 1,632; cpp: 742; perl: 296; lisp: 273; makefile: 226; fortran: 132
file content (264 lines) | stat: -rw-r--r-- 8,870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
/*******************************************************************************
*         McStas instrument definition URL=http://www.mcstas.org
*
* Instrument: reflectometer
*
* %Identification
* Written by:  Pia Jensen (bozack@bozack.dk)
* Date:        13.08.2012
* Origin:      Niels Bohr Instute, University of Copenhagen
* Release:     McStas 2.x
* Version:     0.2
* %INSTRUMENT_SITE: e-learning
*
* Simple reflectometer with two slits, a sample (either none, mirror or multilayer),
* and a detector. For use in the OMIC summer school 2012.
*
* %Description
* This simple reflectometer consists of a source (using the standard PSI parameters
* for three Maxwellian distributions), on which the user can control the bandwidth
* by simply choosing a minumum and maximum value. Two slits handle the divergence
* distribution on the sample. The sample itself can either be an empty spot, a simple
* mirror, or a multilayer. A simple PSD detector is used for detecting the scattered
* beam. The scattering is in the horizontal plane.
* 
* Example: mcrun reflectometer.instr <parameters=values>
*
* %Parameters
* lambda_min:           [AA]   Minimum wavelength from source
* lambda_max:           [AA]   Maximum wavelength from source
* slittranslation:      [m]    Translation of slit (horizontal)
* sampletranslation:    [m]    Sample translation (horizontal)
* slitwidth:            [m]    Width of slit pinholes                  
* slitheight:           [m]    Height of slit pinholes                 
* dist_source2slit:     [m]    Distance between source and first slit  
* dist_slit2slit:       [m]    Distance between slits                  
* dist_slit2sample:     [m]    Distance between second slit and sample 
* dist_sample2detector: [m]    Distance between sample and detector    
* sampletype:           [1]    Sample type: 0 none, 1 mirror, 2+ multilayer
* samplesize:           [m]    Side-length of the (quadratic) sample plate
* substratethickness:   [m]    Thickness of the substrate
* MR_Qc:                [AA]   Critical Q-vector length of mirror sample
* sampleangle:          [deg]  Rotation angle of sample (theta)
* detectorangle:        [deg]  Rotation angle of detector (2 theta)
*
* The sample types are as follows:
*  0  no sample (for looking at direct beam)
*  1  simple mirror (for alignment purposes)
*  2  d54DMPC-D2O
*  3  d54DMPC-H2O
*  4  hDMPC-D2O
*  5  hDMPC-H2O
*  6  silicon-D2O
*  7  silicon-H2O
* 
* %End
*******************************************************************************/

DEFINE INSTRUMENT Reflectometer(
  lambda_min           = 5.3,
  lambda_max           = 5.45,
  slittranslation      = 0,   
  sampletranslation    = 0,   
  slitwidth            = 0.001, 
  slitheight           = 0.002, 
  dist_source2slit     = 1,     
  dist_slit2slit       = 3.2,   
  dist_slit2sample     = 0.18,  
  dist_sample2detector = 2,     
  sampletype           = 1,    
  samplesize           = 0.15, 
  substratethickness   = 0.003,
  MR_Qc                = 0.15, 
  sampleangle          = 2.5,  
  detectorangle        = 5     
)

DECLARE
%{
double blocktranslation;
%}

INITIALIZE
%{
blocktranslation = -slittranslation;
%}

// Begin instrument
TRACE

// Origin
COMPONENT Origin = Progress_bar()
  AT (0,0,0) ABSOLUTE

// Source (so far just with the PSI source distribution)
COMPONENT Source = Source_Maxwell_3(
    size = 0.12, 
    Lmin = lambda_min, 
    Lmax = lambda_max, 
    dist = dist_source2slit+dist_slit2slit,
    focus_xw = slitwidth, focus_yh = slitheight, 
    T1 = 150.42, T2 = 38.72, T3 = 14.84,
    I1 = 3.67E11, I2 = 3.64E11, I3 = 0.95E11)
  AT (0, 0, 0) RELATIVE Origin

  /*COMPONENT mon_PSD_atSource = PSD_monitor(
    nx = 100, ny = 100, 
    filename = "mon_PSD_atSource.dat",
    xwidth = 0.2, yheight = 0.2, 
    restore_neutron = 1)
  AT (0, 0, 0.01) RELATIVE Source

COMPONENT mon_div_atSource = Divergence_monitor(
    nh = 100, nv = 100, 
    filename = "mon_div_atSource",
    restore_neutron = 1, 
    xwidth = 0.2, yheight = 0.2, 
    maxdiv_h = 10, maxdiv_v = 10)
  AT (0, 0, 1e-6) RELATIVE PREVIOUS

COMPONENT mon_Lmon_atSource = L_monitor(
    nL = 100, 
    filename = "mon_Lmon_atSource.dat", 
    xwidth = 0.2, yheight = 0.2, 
    Lmin = 0, Lmax = 22, 
    restore_neutron = 1)
  AT (0, 0, 1e-6) RELATIVE PREVIOUS
  */
// First slit
COMPONENT Slit1 = Slit(
    xwidth = slitwidth, yheight = slitheight)
  AT (0, 0, dist_source2slit) RELATIVE Source
  /*
COMPONENT mon_PSD_afterSlit1 = PSD_monitor(
    nx = 100, ny = 100, 
    filename = "mon_PSD_afterslit1.dat",
    xwidth = slitwidth+0.1, yheight = slitheight+0.1, 
    restore_neutron = 1)
  AT (0, 0, 0.01) RELATIVE Slit1

COMPONENT mon_div_afterSlit1 = Divergence_monitor(
    nh = 100, nv = 100, 
    filename = "mon_div_afterSlit1",
    restore_neutron = 1, 
    xwidth = slitwidth+0.1, yheight = slitheight+0.1, 
    maxdiv_h = 10, maxdiv_v = 10)
  AT (0, 0, 1e-6) RELATIVE PREVIOUS

COMPONENT mon_Lmon_afterSlit1 = L_monitor(
    nL = 100, 
    filename = "mon_Lmon_afterSlit1.dat", 
    xwidth = slitwidth+0.1, yheight = slitheight+0.1, 
    Lmin = 0, Lmax = 22, 
    restore_neutron = 1)
  AT (0, 0, 1e-6) RELATIVE PREVIOUS
  */
// Second slit
COMPONENT Slit2 = Slit(
    xwidth = slitwidth, yheight = slitheight)
  AT (0, 0, dist_slit2slit) RELATIVE Slit1

  /*COMPONENT mon_PSD_afterSlit2 = PSD_monitor(
    nx = 100, ny = 100, 
    filename = "mon_PSD_afterslit2.dat",
    xwidth = slitwidth+0.1, yheight = slitheight+0.1, 
    restore_neutron = 1)
  AT (0, 0, 0.01) RELATIVE Slit2

COMPONENT mon_div_afterSlit2 = Divergence_monitor(
    nh = 100, nv = 100, 
    filename = "mon_div_afterSlit2",
    restore_neutron = 1, 
    xwidth = slitwidth+0.1, yheight = slitheight+0.1, 
    maxdiv_h = 10, maxdiv_v = 10)
  AT (0, 0, 1e-6) RELATIVE PREVIOUS

COMPONENT mon_Lmon_afterSlit2 = L_monitor(
    nL = 100, 
    filename = "mon_Lmon_afterSlit2.dat", 
    xwidth = slitwidth+0.1, yheight = slitheight+0.1, 
    Lmin = 0, Lmax = 22, 
    restore_neutron = 1)
  AT (0, 0, 1e-6) RELATIVE PREVIOUS
  */
// Sample position and rotation arms
COMPONENT Arm_sampleNOROTNOTRANS = Arm()
  AT (blocktranslation, 0, dist_slit2sample) RELATIVE Slit2

COMPONENT Arm_sampleNOROT = Arm()
  AT (sampletranslation, 0, 0) RELATIVE Arm_sampleNOROTNOTRANS  //Slit2    //??

COMPONENT Arm_sample = Arm()
  AT (0, 0, 0) RELATIVE Arm_sampleNOROT
  ROTATED (0, sampleangle, 0) RELATIVE Arm_sampleNOROT // originally Source...

// MIRROR sample
COMPONENT Sample_Mirror = Mirror(
    xwidth = samplesize, yheight = samplesize, center = 1,
    R0 = 0.99, Qc = MR_Qc, alpha = 6.07, m = 1, W = 0.003)
  WHEN (sampletype == 1) AT (0, 0, 0) RELATIVE Arm_sample
  ROTATED (0, 90, 0) RELATIVE Arm_sample

COMPONENT Sample_Mirror_backside = Isotropic_Sqw(
    rho=1/13.827, sigma_abs=500.08, sigma_inc=4.935, sigma_coh=0,
    xwidth = samplesize, yheight = samplesize, zdepth = substratethickness)
  WHEN (sampletype == 1) AT (0, 0, -substratethickness/2-1e-6) RELATIVE Sample_Mirror

// MULTILAYER samples
COMPONENT Sample_Multilayer1 = Mirror(
    xwidth = samplesize, yheight = samplesize, center = 1,
    reflect = "d54DMPC-D2O.dat")
  WHEN (sampletype == 2) AT (0, 0, 0) RELATIVE Arm_sample
  ROTATED (0, 90, 0) RELATIVE Arm_sample
  
COMPONENT Sample_Multilayer2 = Mirror(
    xwidth = samplesize, yheight = samplesize, center = 1,
    reflect = "d54DMPC-H2O.dat")
  WHEN (sampletype == 3) AT (0, 0, 0) RELATIVE Arm_sample
  ROTATED (0, 90, 0) RELATIVE Arm_sample
  
COMPONENT Sample_Multilayer3 = Mirror(
    xwidth = samplesize, yheight = samplesize, center = 1,
    reflect = "hDMPC-D2O.dat")
  WHEN (sampletype == 5) AT (0, 0, 0) RELATIVE Arm_sample
  ROTATED (0, 90, 0) RELATIVE Arm_sample
  
COMPONENT Sample_Multilayer4 = Mirror(
    xwidth = samplesize, yheight = samplesize, center = 1,
    reflect = "hDMPC-H2O.dat")
  WHEN (sampletype == 6) AT (0, 0, 0) RELATIVE Arm_sample
  ROTATED (0, 90, 0) RELATIVE Arm_sample
  
COMPONENT Sample_Multilayer5 = Mirror(
    xwidth = samplesize, yheight = samplesize, center = 1,
    reflect = "silicon-D2O.dat")
  WHEN (sampletype == 6) AT (0, 0, 0) RELATIVE Arm_sample
  ROTATED (0, 90, 0) RELATIVE Arm_sample
  
COMPONENT Sample_Multilayer6 = Mirror(
    xwidth = samplesize, yheight = samplesize, center = 1,
    reflect = "silicon-H2O.dat")
  WHEN (sampletype == 7) AT (0, 0, 0) RELATIVE Arm_sample
  ROTATED (0, 90, 0) RELATIVE Arm_sample

// Detector
COMPONENT Arm_detectorONLYROT = Arm()
  AT (0, 0, 0) RELATIVE Arm_sampleNOROTNOTRANS
  ROTATED (0, detectorangle, 0) RELATIVE Source

COMPONENT Arm_detector = Arm()
  AT (0, 0, dist_sample2detector) RELATIVE Arm_detectorONLYROT

COMPONENT Detector = PSD_monitor(
    nx = 200, ny = 200, 
    filename = "mon_detector",
    restore_neutron = 1, 
    xwidth = 0.025, yheight = 0.05)
  AT (0, 0, 0) RELATIVE Arm_detector

FINALLY
%{
%}

END