File: BNL_H8.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-- 7,153 bytes parent folder | download | duplicates (28)
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, neutron ray-tracing package
*         Copyright (C) 1997-2008, All rights reserved
*         Risoe National Laboratory, Roskilde, Denmark
*         Institut Laue Langevin, Grenoble, France
*
* Instrument: BNL_H8
*
* %Identification
* Written by: <a href="mailto:farhi@ill.fr">Emmanuel Farhi</a>
* Date: 1st Feb 2001.
* Origin: <a href="http://www.ill.fr">ILL (France)</a>
* %INSTRUMENT_SITE: Brookhaven
*
* The former thermal H8 triple-axis spectrometer from Brookhaven reactor
*
* %Description
* This instrument is a simple model of the thermal H8 triple-axis spectrometer
* from former Brookhaven reactor. It is directly illuminated by the moderator,
* and has flat monochromator and analyzer. Sample is a vanadium cylinder.
* Such an instrument was used for the Monte Carlo neutron simulation package
* cross comparison related in paper "A Model Instrument for Monte Carlo Code
* Comparisons", Neutron News 13 (No. 4), 24-29 (2002).
*
* %Example: lambda=2.36 Detector: He3H_I=9.84026e-10
*
* %Parameters
* lambda: [Angs]  source energy
*
* %Link
* Neutron News 13 (No. 4), 24-29 (2002).
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT BNL_H8(lambda=2.36)

DECLARE
%{
  double DM         = 3.3539;   /* Monochromator d-spacing in Angs */
                                /* PG002 Orders : 1st 3.355 2e 1.6775, 3e 1.1183 */

/* to compute */
  double A1,A2;
  double A3,A4;
  double A5,A6;
  double mono_q, Ei;
%}
/* end of DECLARE */

INITIALIZE
%{
  int    ORDER = 1;
  double vi, Ki;
  int    SM,SS,SA;
  char hostname[256];

  /* SM : scattering at mono to the right (-1)/left(+1) */
  /* SS : scattering at sample to the right (-1)/left(+1) */
  /* SA : scattering at analyser to the right (-1)/left(+1) */
  SM = 1; SS = -1; SA = 1;

/*  SM = 0; SS = -0; SA = 0; */

  mono_q = 2*PI*ORDER/DM;  /* Q mono in Angs-1 */

  Ki = 2*PI/lambda;
  vi = K2V*fabs(Ki);
  Ei = VS2E*vi*vi;

  A2 = asin(mono_q/2/Ki)*RAD2DEG*2;
  A4 = A2; A6 = A2;

  A2 *= SM;       /* A1 : mono theta (crystal) */
  A1 = A2/2;    /* A2 : mono 2 theta (arm to sample) */
  A4 *= SS;       /* A3 : sample theta */
  A3 = A4/2;    /* A4 : sample 2 theta (arm to analyser) */
  A6 *= SA;       /* A5 : analyser theta (crystal) */
  A5 = A6/2;    /* A6 : analyser 2 theta (arm to Dector) */

  strcpy(hostname, getenv("HOSTNAME") ? getenv("HOSTNAME") : "localhost");

  printf("Instrument:     BNL_H8 on %s.\n", hostname);
  printf("Monochromator : DM = %g\n",DM);
  printf("A1 = %.2f, A2 = %.2f (deg)\n",A1,A2);
  printf("Ki = %.4g Angs-1 Energy = %.4g meV\nVelocity = %.4g m/s, lambda = %.4g Angs\n", Ki, Ei, vi,
lambda);
%}
/* end of INITIALIZE */

TRACE
/* Source description */
COMPONENT Origin=Progress_bar()
AT (0,0,0) ABSOLUTE

/* a flat constant source */
COMPONENT Source = Source_simple(
  radius  = 0.10,
  dist = 2.7473,
  focus_xw = 0.031, focus_yh = 0.054,
  E0 = Ei,
  dE = 0.03*Ei)
AT (0,0,0) ABSOLUTE

COMPONENT D0_Source = PSD_monitor(
  xwidth = 0.03, yheight= 0.054,
  nx=20, ny=20, filename="D0_Source.psd")
AT (0, 0, 0.0001) RELATIVE Source

/* SC1 collimator. 40'=3 slots, 20'=6 slots */

COMPONENT SC1 = Guide(
  w1 = 0.031, h1 = 0.054, l = 0.9144,
  R0 = 1.0, Qc=0.021, alpha=6, m=1, W=0.0003)
AT (0.0, 0, 2.7473) RELATIVE Source

COMPONENT D1_SC1_Out = PSD_monitor(
  xwidth = 0.03, yheight= 0.054,
  nx=20, ny=20, filename="D1_SC1_Out.psd")
AT (0.0, 0, 0.9145) RELATIVE SC1

COMPONENT As1 = Slit(
  xwidth = 0.04450, yheight= 0.0635)
AT (0, 0, 3.6998) RELATIVE Source

COMPONENT As2 = Slit(
  xwidth = 0.04450, yheight= 0.0635)
AT (0, 0, 4.0808) RELATIVE Source

COMPONENT As3 = Slit(
  xwidth = 0.04450, yheight= 0.0635)
AT (0, 0, 4.1189) RELATIVE Source

COMPONENT As4 = Slit(
  xwidth = 0.04450, yheight= 0.0635)
AT (0, 0, 4.4141) RELATIVE Source

COMPONENT D2_A4 = PSD_monitor(
  xwidth = 0.04450, yheight= 0.0635,
  nx=20, ny=20, filename="D2_A4.psd")
AT (0, 0, 0.0001) RELATIVE As4

COMPONENT Mono_Cradle = Arm()
  AT (0, 0, 5.2746) RELATIVE Source ROTATED (0, A1, 0) RELATIVE Source

SPLIT COMPONENT PG1Xtal = Monochromator_flat(
  zwidth = 0.1, yheight = 0.08,
  mosaich = 40, mosaicv = 40,
  r0 = 0.7, Q=mono_q)
AT (0, 0, 0.0001) RELATIVE Mono_Cradle

/*                                on mono, pointing towards sample */
COMPONENT Mono_Out = Arm()
  AT (0,0,0.0002) RELATIVE Mono_Cradle ROTATED (0, A2, 0) RELATIVE Source

/* D3 should be in transmission, there at 222.2 mm */

COMPONENT D4_SC2_In = PSD_monitor(
  xwidth = 0.0318, yheight = 0.0495,
  nx=20, ny=20, filename="D4_SC2_In.psd")
AT (0, 0, 0.2222) RELATIVE Mono_Out

/* SC2 collimator. 40'=4 slots, 20'=8 slots */
COMPONENT SC2 = Guide(
  w1 = 0.0318, h1 = 0.0495, l = 0.6096,
  R0 = 1.0, Qc=0.021, alpha=6, m=1, W=0.0003)
AT (0, 0, 0.2223) RELATIVE Mono_Out

COMPONENT D5_SC2_Out = PSD_monitor(
  xwidth = 0.0318, yheight = 0.0495,
  nx=20, ny=20, filename="D5_SC2_Out.psd")
AT (0, 0, 0.6097) RELATIVE SC2

COMPONENT Sample_Cradle = Arm()
AT (0, 0, 0.7811) RELATIVE D5_SC2_Out ROTATED (0, A3, 0) RELATIVE Mono_Out

COMPONENT Sample_Out = Arm() /*        this is the sample-ana axis */
AT (0,0,0) RELATIVE Sample_Cradle ROTATED (0, A4, 0) RELATIVE Mono_Out

SPLIT COMPONENT Sample = V_sample(
 radius = 0.0064, yheight = 0.0254,
 focus_xw = 0.0478, focus_yh = 0.049, pack = 1,
 target_index = +1)
AT (0,0,0) RELATIVE Sample_Out

/* D6 should be in transmission, there at 235.0 mm */

COMPONENT D7_SC3_In = PSD_monitor(
  xwidth = 0.0478, yheight = 0.049,
  nx=20, ny=20, filename="D7_SC3_In.psd")
AT (0, 0, 0.2349) RELATIVE Sample_Out

/* SC3 collimator. 40' = 12 slots, 20'=24 slots */
COMPONENT SC3 = Guide(
  w1 = 0.0478, h1 = 0.0490, l = 0.3048,
  R0 = 1.0, Qc=0.021, alpha=6, m=1, W=0.0003)
AT (0, 0, 0.2350) RELATIVE Sample_Out

COMPONENT D8_SC3_Out = PSD_monitor(
  xwidth = 0.0478, yheight = 0.049,
  nx=20, ny=20, filename="D8_SC3_Out.psd")
AT (0, 0, 0.3047) RELATIVE SC3

COMPONENT Ana_Cradle = Arm()
  AT (0, 0, 0.1397) RELATIVE D8_SC3_Out ROTATED (0, A5, 0) RELATIVE Sample_Out

SPLIT COMPONENT PG2Xtal = Monochromator_flat(
  zwidth = 0.10, yheight = 0.08,
  mosaich = 40, mosaicv = 40,
  r0 = 0.7, Q=mono_q)
AT (0, 0, 0) RELATIVE Ana_Cradle

COMPONENT Ana_Out = Arm() /*        this is the sample-ana axis */
AT (0,0,0) RELATIVE Ana_Cradle ROTATED (0, A6, 0) RELATIVE Sample_Out

/* D9 should be in transmission, there at 336.6 mm */

COMPONENT D10_SC4_In = PSD_monitor(
  xwidth = 0.0478, yheight = 0.049,
  nx=20, ny=20, filename="D10_SC4_In.psd")
AT (0, 0, 0.3365) RELATIVE Ana_Out

/* SC4 collimator. 80' = 6 slots */
COMPONENT SC4 = Guide(
  w1 = 0.0478, h1 = 0.0490, l = 0.3048,
  R0 = 1.0, Qc=0.021, alpha=6, m=1, W=0.0003)
AT (0, 0, 0.3366) RELATIVE Ana_Out

/* vertical 3He Detector */
/*
COMPONENT He3S = PSD_monitor(
  xmin = -0.025400, xmax = 0.025400,
  ymin = -0.042850, ymax = 0.042850,
  options="x y, all bins=50")
AT (0, 0, 0.3048+0.00001) RELATIVE SC4
*/
COMPONENT He3H = PSD_monitor(
  xwidth = 0.0508, yheight = 0.0857,
  nx=20, ny=20, filename="He3.psd")
AT (0, 0, 0.3049) RELATIVE SC4

END