File: ISIS_SANS2d.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 (242 lines) | stat: -rw-r--r-- 8,962 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
/*******************************************************************************
*         McStas instrument definition URL=http://www.mcstas.org
*
* Instrument: ISIS_SANS2d 
*
* %Identification
* Written by: Richard Heenan with edits by Peter Willendrup
* Date: 2014
* Origin: ISIS, DTU Fysik
* %INSTRUMENT_SITE: ISIS
*
* This instrument models the ISIS TS2 SANS2d instrument.
*
* %Description
* This instrument models the ISIS TS2 SANS2d instrument up to the sample position.
*
* From the author:
* <p><b>IMPORTANT:</b> The instrument model does not currently include a correct moderator description 
* - and the results it produces have not been validated against experimental results.
* <p>The actual bender is continuously curved, here use straight segments approx.with gravity.
* 1/7/10 L1=4m  increased gap between bender exit and S1 slit from .247 to .286m
* At 4m we actually use 1.75 to 16.5 angstrom. 
* <p>Note "2m guides" are actually 1.985m long (new ones will be 1.981m) so "real gaps" are included below, losses are pro-rata the gap/guide lengths.
* <p>Both rear & front detectors are 980mm square and offset 150 above beam (would only use 100mm with hindsight) 
* <p>Rear detector can be offset -300mm or +269mm sideways.
* <p>Front detector is closest at approx 1.4m,  furthest at approx((read det position) - 1.6m) , offset  up to -1200mm sideways 
* there are 2 baffles between front & rear detector
* <p>NIMROD (W5) spectrum might better than SANS2d (E2) spectrum for liquid H2 face incurent use.
* Stu Ansell's McStas spectra for TS-2 actually have no angle variation included.
* In reality spectra and backgrounds will vary, fast background is likely much higher on ZOOM(E1) than SANS2d (E2)
* <p>RKH 2014
*
* %Parameters
* L1: [m]     Variable distance from 1st to 2nd variable slit
* S6: [m]     Radius of slit S6 (last of the optis slits)
* A1w: [m]    Width of first collimation slit, rectangular slit
* A1h: [m]    Height of first collimation slit, rectangular slit
* A2: [m]     Radius of second collimation slit, circular slit
* Lmin: [AA]  Minimum wavelength to produce at the source
* Lmax: [AA]  Maximum wavelength to produce at the source
*
* %Link
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT ISIS_SANS2d(L1=3.926, A1w=0.030, A1h=0.02, S6=0.006, A2=0.006, Lmin=1, Lmax=14)
/* F2409w3p5, cf run 5226, L1=4m, A1=30x20, S6=12, A2=12, 1.75-16.5 ang */
DECLARE
%{
%}

INITIALIZE
%{
%}

TRACE

COMPONENT Origin = Arm()
  AT (0,0,0) ABSOLUTE


COMPONENT isis_source = ISIS_moderator(
    Face = "E2", Emin = -Lmax, Emax = -Lmin, dist = 3.68,
    focus_xw = 0.0365, focus_yh = 0.021, xwidth = -1, yheight = -1,
    CAngle = 0.0, SAC = 1)
  AT (0.0, 0.0, 0.00001) RELATIVE Origin
  ROTATED(0.0, 0.0, 0.0) RELATIVE Origin

COMPONENT lmon1 = L_monitor(
    nL = 140, filename = "lmon1.dat", xmin = -0.04,
    xmax = 0.04, ymin = -0.03, ymax = 0.03, Lmin = 0.0,
    Lmax = 17.0)
  AT (0.0, 0.0, 3.698) RELATIVE isis_source

COMPONENT psd1 = PSD_monitor(
    nx = 100, ny = 100, filename = "psd1.dat", xmin = -0.05,
    xmax = 0.05, ymin = -0.05, ymax = 0.05)
  AT (0.0, 0.0, 3.699) RELATIVE isis_source

COMPONENT bender1 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 3.7) RELATIVE isis_source
  ROTATED (0.0, 0.137099, 0.0) RELATIVE isis_source

COMPONENT bender2 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender1
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender1

COMPONENT bender3 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender2
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender2

COMPONENT bender4 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender3
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender3

COMPONENT bender5 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender4
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender4

COMPONENT bender6 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender5
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender5

COMPONENT bender7 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender6
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender6

COMPONENT bender8 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender7
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender7

COMPONENT bender9 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender8
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender8

COMPONENT bender10 = Guide_gravity(
    w1 = .0355, h1 = .020, w2 = .0355, h2 = .020, d = .0005, nslit = 9,
    mleft = 1, mright = 3, mtop = 1, mbottom = 1, wavy = 0,  l = 0.3245)
  AT (0, 0, 0.325) RELATIVE bender9
  ROTATED (0.0, 0.1375099, 0.0) RELATIVE bender9

COMPONENT lmonb = L_monitor(
    nL = 140, filename = "lmonB.dat", xmin = -0.018,
    xmax = 0.018, ymin = -0.018, ymax = 0.018, Lmin = 0.0,
    Lmax = 17.0)
  AT (0.0, 0.0, 0.326) RELATIVE bender10

COMPONENT psd2 = PSD_monitor(
    nx = 100, ny = 100, filename = "psd2.dat", xmin = -0.025,
    xmax = 0.025, ymin = -0.025, ymax = 0.025)
  AT (0.0, 0.0, 0.001) RELATIVE lmonb

  /*                                  guide_in is S1 */
COMPONENT guide_in = Slit(
    xmin = -0.015, xmax = 0.015, ymin = -.01, ymax = +.01)
  AT (0, 0, 0.2845) RELATIVE psd2
  
/*                                    guide entrance = bender exit + 286.5 + 7.5mm = 6.95+.295= 7.245m 
*                                     old guides are 1.985m long (i.e. 7.5mm gap each end), new ones 1.981m */

COMPONENT guide_straight1 = Guide_gravity(
    w1 = .030, h1 = .020, w2 = .030, h2 = .020, l = 1.985, 
    mleft = 1, mright = 1, mtop = 1, mbottom = 1, wavy = 0)
  AT (0, 0, 0.0075) RELATIVE guide_in

COMPONENT guide_straight2 = Guide_gravity(
    w1 = .030, h1 = .020, w2 = .030, h2 = .020, l = 1.985, 
    mleft = 1, mright = 1, mtop = 1, mbottom = 1, wavy = 0)
  AT (0, 0, 2.000) RELATIVE guide_straight1

COMPONENT guide_straight3 = Guide_gravity(
    w1 = .030, h1 = .020, w2 = .030, h2 = .020, l = 1.985, 
    mleft = 1, mright = 1, mtop = 1, mbottom = 1, wavy = 0)
  AT (0, 0, 2.000) RELATIVE guide_straight2

COMPONENT guide_straight4 = Guide_gravity(
    w1 = .030, h1 = .020, w2 = .030, h2 = .020, l = 1.985, 
    mleft = 1, mright = 1, mtop = 1, mbottom = 1, wavy = 0)
  AT (0, 0, 2.000) RELATIVE guide_straight3

COMPONENT psd3 = PSD_monitor(
    nx = 100, ny = 100, filename = "psd3.dat", xmin = -0.030,
    xmax = 0.030, ymin = -0.030, ymax = 0.030)
  AT (0.0, 0.0, 7.999) RELATIVE guide_in

/*                                    APERTURE1 is Sn at guide exit */
COMPONENT aperture1 = Slit(
    xwidth = A1w, yheight=A1h)
  AT (0, 0, 8.000) RELATIVE guide_in

/*                                   proper Monitor 2, make fill whole beam */
COMPONENT lmonitor2 = L_monitor(
    nL = 140, filename = "lmonitor2.dat", xmin = -0.0155,
    xmax = 0.0155, ymin = -0.0105, ymax = 0.0105, Lmin = 0.0,
    Lmax = 17.0)
  AT (0.0, 0.0, 2.651) RELATIVE aperture1

/*                                    S6 is at ~ 18.087m ~.801m after S5 */
COMPONENT S6 = Slit(
    radius = S6 )
  AT (0, 0, 2.800) RELATIVE aperture1

 /*                         Asnout ~ shutter -150 ~ 19.362-.150 =19.212,    M3-Asnout = 19.497 - 19.212 = .285m 
*                           S2 at S1+4m = 11.2865m       19.212-11.286= 7.926 */
  COMPONENT APERTURE2 = Slit(
    radius = A2)
  AT (0, 0, L1 ) RELATIVE aperture1

COMPONENT lmon2 = L_monitor(
    nL = 140, filename = "lmonitor3.dat", xmin = -0.0075,
    xmax = 0.0075, ymin = -0.0075, ymax = 0.0075, Lmin = 0.0,
    Lmax = 17.0)
  AT (0.0, 0.0, 0.285) RELATIVE APERTURE2

COMPONENT psd4 = PSD_monitor(
    nx = 100, ny = 100, filename = "psd4.dat", xmin = -0.0075,
    xmax = 0.0075, ymin = -0.0075, ymax = 0.0075)
  AT (0.0, 0.0, 0.286) RELATIVE APERTURE2

FINALLY
%{
%}
END