**More McStas simulations for HYSPEC guides**

**Vinita J. Ghosh**

**September 21, 2005**

**Introduction**

McStas \[1\] simulations had been performed in late 2004 to optimize the
configuration of the guide system for HYSPEC \[2,3\]. The results are
presented in ref 2. A schematic layout of the optimal HYSPEC guide
system is shown in Fig 1.

**Figure 1: Schematic layout of the HYSPEC guides upstream of the
monochromator**

The model includes a neutron guide starting at a distance of 2.5m from
the target, approximately 2.4m from the moderator. This guide extends
through the shutter, the biological shield and the chopper archway out
to a distance of 6.5m. The guide is 40mm wide and it expands from 132mm
tall at 2.5m to 150mm tall at 6.5m. The guide coating is m=3
supermirror.

The T0 and T1A choppers are placed just outside the biological shield of
the SNS target station. It had been decided that these two choppers
would be integrated together in a common containment "box". While this
may, or may not, be a box in the actual engineering we are conceptually
denoting this arrangement as a box, and giving it the name "Box A". This
box will contain guides at both ends of the box, which will flange onto
the guide protruding from the biological shield, and also contain guide
between the two choppers. It had been decided that Box A would start at
6.5m and will end at 7.9m.

It had been planned that the curved section of the supermirror guide
would start at 7.9m, immediately downstream of Box A. Following the
curved section of guide would be a straight guide with a total length of
4m. This 4m section would include the T1B and T2 choppers in its length
and would extend into the drum shield terminating at a distance of 30cm
from the center of the focusing crystal array. The T1B and T2 choppers
would also be integrated together in a common containment "box" which
has been given the name "Box B". This "Box B" has not been included in
the current simulations.

For a moderator-monochromator distance of 37m the length of the curved
guide was determined to be (37.0-7.9-4.3) = 24.8m. In order to have a
displacement of 16cm of the monochromator from the "line of sight" from
the moderator the radius of curvature of this curved guide was
determined to be 2542m. The baseline for this guide was to use m=3
supermirror on all 4 surfaces of the curved guide; however, the inner
surface of the curved guide could be replaced by m=2 supermirror coating
without significantly degrading the performance.

After the Preliminary Design Review (May 17-18, 2005) it was decided
that Box-A containing the T0 and T1A choppers would be moved away from
the moderator to improve crane coverage. The center of the T0 chopper
would be positioned at 8.5m and that of the T1A chopper at 9.35m from
the moderator. Repositioning the choppers and Box-A gives rise to
various options for the length of the curved section of guide. One
option would be to add a straight section of 4cm wide 15cm high guide
from the end of the 4m expander to Box-A, and start the curved section
of the guide immediately downstream of the T1A chopper, say at 9.4m from
the moderator. Another option would be to start the curved guide
immediately downstream of the 4m expander, approximately 6.4m from the
moderator. The length of the curved guide in the second option would be
about 3m larger than in the first case, and the radius of curvature
would be larger in order to get the same offset at the monochromator.
Therefore, the second option would yield better transmission at smaller
wavelengths.

McStas simulations have been performed to compare these two options to
the scenario which had been studied earlier where the 24.8m curved guide
started at 7.9m from the moderator. The model used in the simulations is
described in section 2, the simulation results in section 3, and the
conclusions in section 4.

Simulation model

A detailed description of the McStas model is provided in ref 2 as well
as Appendix 1. A few minor modifications were made to the old model. The
upstream end of the expanding guide G1 now starts at 2.32m from the
moderator. This is the actual distance to the upstream end of the BL14B
shutter, earlier a nominal value of 6.4m had been used. This change will
increase the length of the curved guide G2 by 8cm but it should have no
real impact on the guide transmission. Earlier at the end of the curved
guide G2 we had a 1.75m length of straight guide called G3 which
connected the curved guide G2 to Box-B. I now have a 4m length of
straight guide G3 instead and all values of fluence quoted in this
report are evaluated at the downstream end of this straight guide. The
earlier model was rerun with a 4m G3 guide in order to do an accurate
comparison.

Let us call the three guide layouts G2start_7.9m, G2start_9.4m and
G2start_6.32m to reflect the fact that the curved guide starts at 7.9,
9.4 or 6.32m from the moderator. The schematic layout of the new guide
option G2start_9.4m is shown in Fig 2 and that for the new guide option
G2start_6.32m is shown in Fig 3. Instrument files for options
G2start_9.4m and G2start_6.32m are included in Appendix B. In all
simulations the moderator-monochromator distance is 37m, and the radius
of curvature of G2 is calculated to ensure that the offset at the
monochromator is 16cm. The length and radius of curvature of G2 in the
three cases is listed in Table 1.

  ----------------------------- ------------------- ---------------------
                                LG2 (m)             R~C~ (m) for
                                                    offset=16cm

  G2start_9.4m                  23.3                2323

  G2start_7.9m                  24.8                2542

  G2start_6.32m                 26.38               2884
  ----------------------------- ------------------- ---------------------

**Table 1. Length and radius of curvature for curved guide G2 for
different starting points.**

**Figure 2: Schematic layout of option G2start_9.4m**

**Figure 3: Schematic layout of option G2start_6.32m**

Time, divergence, and spatial profiles as well as the fluence were
evaluated at the end of guides G1, G2, and G3. Comparisons of neutron
fluence at the end of guide G3 are discussed in the next section. The
impact of changing the supermirror coating of the curved guide was also
explored. The m=3 coating on the inner curved surface was replaced by
m=2.5, 2.0, 1.5 and 1.0 coatings and the values of the fluence were
again compared.

Simulation results

Instrument files for options G2start_9.4m and G2start_6.32m are included
in Appendices 2 and 3. Input parameters are listed in Appendix 1. The
instrument file for option G2start_7.9m is included in Appendix B of ref
2. The purpose of these simulations is to evaluate guide transmission so
the various choppers have not been included in the simulations. No gaps
have been left in the guide G3 for the T1B and the T2 Fermi chopper.
However, a 50cm gap has been left in the guides for the T0 chopper and a
10cm gap for the T1A chopper. These gaps had a significant impact on the
G2start_6.32m case, so the simulations were redone with no gaps in the
guide G2 for choppers T0 and T1A.

The fluence at the end of guide G3 is compared for the three cases
G2start_7.9m, G2start_9.4m and G2start_6.32m in Fig 4a. These
simulations are with m=3 supermirror coatings on all guide surfaces.
Since it is difficult to differentiate between various options using the
usual log plot of the fluence the ratios of the fluence with respect to
the G2start_7.9m case are plotted as a function of the energy in Fig 4b.

![](media/image2.wmf)

**Fig 4a. Comparison of the fluence at the end of guide G3 for the three
cases G2start_7.9m, G2start_9.4m and G2start_6.32m**

![](media/image3.wmf)

**Fig 4b. Ratio of the fluence at the end of guide G3 for the three
cases G2start_7.9m, G2start_9.4m and G2start_6.32m with respect to
G2start_7.9m.**

As the length of the curved guide decreases the radius of curvature of
the guide has to decrease in order to get the same offset at the
monochromator (see Table 1). The transmission through the guide for the
G2start_9.4m case would decrease with respect to the G2start_7.9m case,
and the transmission through the guide for the G2start_6.32m case would
increase with respect to the G2start_7.9m case. The simulation results
shown in Figs 4a and 4b turned out to be qualitatively close to what we
had expected. One surprising feature was the decrease in fluence for the
G2start_6.32m case with respect to the G2start_7.9m case for
3.46\<E\<30meV neutrons (green curve in Figs 4a and 4b). I had the same
gaps in the guides for the T0 and T1A choppers in all three cases. The
major difference was that the gaps in the guides were in the straight
section of the guide upstream of the curved guide in the G2start_7.9m
and the G2start_9.4m cases, but the gaps in the G2start_6.32m case were
actually in the curved section of guide. The G2start_6.32m case was
redone with no gaps in the curved guide, the results are the blue curves
in Figs 4a and 4b. A comparison of the green and blue curves suggests
that gaps in the curved guide result in substantial loss of transmitted
neutrons, and hence these gaps should be minimized.

The comparison of the red (G2start_9.4m) and green (G2start_6.32m)
curves in Fig 4b which shows that the fluence of 90meV neutrons is
approximately 25% larger when the curved guide starts at 6.32m than when
it starts at 9.4m from the moderator. In fact starting the curved guide
immediately downstream of the 4m expander results in increased neutron
transmission over the entire range of energies accessed with HYSPEC and
the gains are substantial at 30-90meV.

The impact of changing the coating of the inner surface of the curved
guide was explored for the various curved guide options. The results
were plotted as ratios of the fluence at the end of G3 with respect to
the similar simulation with m=3 guides. The results are summarized in
Figs 5a-5d.

![](media/image4.wmf)![](media/image5.wmf)

![](media/image6.wmf)![](media/image7.wmf)

**Fig 5a-d. Ratio of the fluence at the end of guide G3 when the guide
coating on the inner surface of the curved guide is different from m=3
to the fluence at the end of guide G3 when the guide coating on the
inner surface of the curved guide is m=3.**

As expected the guide transmission decreases as the value of m for the
coating decreases, and the impact is greatest at 15meV. Coating the
inner surface of the curved guide with m=2.5 or m=2 supermirror would
not result in substantial loss of transmission but m=1.5 or m=1 coatings
would result in unacceptably high losses.

**Summary and conclusions**

The McStas guide simulations show that starting the curved guide
immediately downstream of the 4m expander results in increased neutron
transmission over the entire range of energies accessed with HYSPEC and
that the neutron flux gains are substantial at 30-90meV. Coating the
inner surface of the curved guide with m=2.5 or m=2 supermirror would
not result in substantial loss of transmission. However, m=1.5 or m=1
coatings would result in unacceptably high losses, and they should not
be used for HYSPEC.

Appendix 1

Input parameters

1.  Moderator: Source_sct21a_td_05_1_dat, generated by Erik Iverson on
    March 27, 2002 \[4\].

2.  Interpolation code to generate source neutrons from the above data:
    source1.comp Written by G. Granroth, version 1.01 revised July 2004
    \[5\].

3.  Co-ordinate system: Origin of the co-ordinate system is the
    moderator. The guide starts at 232cm in the shutter.

4.  The guide G1 is split into two parts. G1A is the in-shutter section
    and is 2m long. G2 brings the neutrons out of the biological shield
    and is also 2m long. The G1A expands in height from 13.2 to 14.1 cm,
    G1B expands in height from 14.1 to 15.0 cm. Both sections have a
    uniform width of 4cm.

5.  Chopper Box-A: There is a 25cm gap in the guides for the chopper T0
    disk and a 5cm gap for the T1A chopper disk.

6.  The radius of the chopper disk (in Mcstas that is the distance
    between the center of the disk and the midpoint of the slot) is to
    be set at 27cm.

7.  Use the modified guide component Guide1.comp instead of the original
    Guide.comp as that component contains an error in the reflectivity
    function.

8.  Reflectivity function parameters: R0=0.98, m=3, q0=0.022,
    alpha=5.54, W=0.0001. Reflectivity function is plotted in Fig 6.

![](media/image8.wmf)

Fig 6. Reflectivity function for m=3 supermirror guide

Appendix 2

HY_9.4m.instr

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

\* HYSPEC - target-monochromator distance LMM=37m

\* sourcefile: source_sct21a_td_05_1.dat

\* interpolation code sns_source1.comp by Garrett Granroth

\* Guides G1: length 4m, 4x13.2-\>4x15

\* Guides G2: length (L2a+L2b+L2c)=23.3m, 4x15, curved

\* Guide G3: length 4.0m, 4x15-\>4x15, straight

\* Guides reflectivity 3theta R0=0.98

\* Box-A inserted between guides G1 and G2

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

DEFINE INSTRUMENT hy1(Edes, E_min, E_max, toffset, L2b)

DECLARE

%{

double samp_pos ;

double Fu_l ;

double Gu_m ;

double Gu_R ;

double Gu_alpha ;

double chan_num ;

double L2, L2a, L2b, L2c, L3, x_mono, Rc ;

double phase1, phase2, phase3, toffset ;

double t1_min, t1_max, t2_min, t2_max, t3_min, t3_max ;

double Edes, E_min, E_max, erange, ewidth ;

double dist_eff, vi_eff, fermi_speed ;

double WL_mean, r0m, dPG, k_m, Q_m, Cl_ang, Al_ang, R_vert, R_horz ;

double LMM, LCM, LMS, LSD, sin_tm ;

%}

INITIALIZE

%{

/\* Input parameters:

Incident energy - Edes (meV)

Minimum and maximum energies - E_min, E_max (meV)

Peak of time distribution - toffset (s)

Moderator to monochromator distance - LMM (m)

\*/

/\* set the desired energy and energy range \*/

/\*Edes = 50.0

Energy range = E_max - E_min

\*/

/\* Distances:

LMM - moderator to monochromator

LCM - chopper to monochromator

LMS - monochromator to sample

LSD - sample to detector

\*/

/\* Length and curvature of guide G2

L2 = L2a+L2b+L2c = 23.3m, L2c=1.7m

L2a= 23.3-1.7-L2b = 21.6-L2b

Radius of curvature Rc = (0.5\*L2 + L3)\*L2/x_mono

where x_mono in the displacement of the monochromator

Rc = 2323m ;

L3 = 4.0 ;

\*/

LMM = 37.0;

L2c = 1.70;

L2a = 21.6-L2b;

/\* Calculate the phase of the disc choppers or the time width at the
TOF monitors\*/

/\* calculate first chopper phase \*/

phase1=(9.3)/(sqrt(Edes)\*SE2V)+toffset;

t1_min=(9.3)/(sqrt(E_max)\*SE2V) - 0.0005 + toffset;

t1_max=(9.3)/(sqrt(E_min)\*SE2V) + 0.0020 + toffset;

/\* calculate second chopper phase \*/

phase2=(32.70)/(sqrt(Edes)\*SE2V)+toffset;

t2_min=(32.70)/(sqrt(E_max)\*SE2V) - 0.0005 + toffset;

t2_max=(32.70)/(sqrt(E_min)\*SE2V) + 0.0020 + toffset;

/\* calculate third chopper phase \*/

phase3=(36.70)/(sqrt(Edes)\*SE2V) + toffset;

t3_min=(36.70)/(sqrt(E_max)\*SE2V) - 0.0005 + toffset;

t3_max=(36.70)/(sqrt(E_min)\*SE2V) + 0.0020 + toffset;

%}

TRACE

COMPONENT arm1 = Arm()

AT(0,0,0) ABSOLUTE

/\* \-\-\-\-\-\-\-- The BL14B moderator source function
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*/

COMPONENT
mod=SNS_source1(S_filename=\"/home/vinita/hy0409/source_sct21a_td_05_1.dat\",

width=0.10, height=0.12, dist=2.5,

xw=0.04, yh=0.132, Emin=E_min, Emax=E_max)

AT(0, 0, 0.00) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Garrett\'s SNS moderator reading routine - emit\'s neutrons from
Emin to Emax \*/

COMPONENT Shutter_in_total = Monitor( xmin = -0.02, xmax = 0.02, ymin
=-0.066,ymax = 0.066)

AT(0, 0, 2.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check neutron flux just before the guide in shutter \*/

/\* \-\-\-\-\--The guide in the shutter (G1A) & biological shield (G1B)
\-- \*/

COMPONENT G1a_guide = Guide1( w1=0.04,h1=0.132,w2=0.04,h2=0.141,l=2.0,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0, 0, 2.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The guide in the shutter \*/

COMPONENT G1b_guide = Guide1( w1=0.04,h1=0.141,w2=0.04,h2=0.15,l=2.0,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0, 0, 4.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The guide in the biological shield \*/

COMPONENT G1c_guide = Guide1( w1=0.04,h1=0.15,w2=0.04,h2=0.15,l=1.68,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0, 0, 6.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* straight guide connecting to Box-A \*/

COMPONENT G1_guide_total = Monitor( xmin = -0.02, xmax = 0.02, ymin
=-0.075, ymax = 0.075)

AT(0, 0, 8.00) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check the flux coming out of the guide in the biological
shield \*/

/\* start Box-A containing T0 and T1A choppers
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*/

/\* 30cm gap for the T0 chopper blade, 10cm gap for the T1A chopper \*/

COMPONENT GA1guide = Guide1(

w1=0.04,h1=0.15,w2=0.04,h2=0.15,l=0.35,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0,0,8.00 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT GA2guide = Guide1(

w1=0.04,h1=0.15,w2=0.04,h2=0.15,l=0.65,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0,0,8.65 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT detBoxA = Monitor(

xmin = -.02, xmax = .02,

ymin =-.075, ymax = .075)

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--End Box-A
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*/

COMPONENT E1check = E_monitor(xmin =-.02, xmax = .02,

ymin =-.075, ymax = .075,

Emin = E_min, Emax = E_max,

nchan= 100, filename = \"z002e1.dat\")

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT T1check=TOF_monitor2(xmin = -.02, xmax = .02,

ymin =-.075, ymax = .075,

tmin = t1_min, tmax = t1_max,

nchan= 100, filename = \"z002t1.dat\")

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT D1check= Divergence_monitor(

xmin=-0.02,xmax=0.02, ymin=-0.075, ymax=0.075,

nh=100,nv=100,h_maxdiv=2.0, v_maxdiv=2.0,

filename=\"z002d1.dat\")

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT P1check= PSD_monitor(

xmin = -0.02, xmax = 0.02, ymin = -0.075, ymax = 0.075,

nx=20, ny=75 , filename=\"z002p1.dat\" )

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* \-\-\-\-\-\-\-\-\-\-\-\-\-- The curved guide G2 connecting Box-A and
G3\-\-\-\-\-\--\*/

COMPONENT G2a = Bender(

w=0.04, h=0.15, r=2323.0, l= L2a, d=0.001, k=1,

R0a=0.98, Qca=0.022, ma=3.0, alphaa=5.54, Wa=0.0001,

R0i=0.98, Qci=0.022, mi=3.0, alphai=5.54, Wi=0.0001,

R0s=0.98, Qcs=0.022, ms=3.0, alphas=5.54, Ws=0.0001)

AT(0,0,9.40 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The first length of curved guide from Box-A to the straight guide G3
\*/

COMPONENT G2a_total = Monitor( xmin = -0.02, xmax = 0.02, ymin = -0.075,
ymax = 0.075)

AT(0, 0, (L2a + 9.401)) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check the flux after the curved section of guide \*/

COMPONENT G2b = Bender(

w=0.04, h=0.15, r=2323.0, l= L2b, d=0.001, k=1,

R0a=0.98, Qca=0.022, ma=3.0, alphaa=5.54, Wa=0.0001,

R0i=0.98, Qci=0.022, mi=3.0, alphai=5.54, Wi=0.0001,

R0s=0.98, Qcs=0.022, ms=3.0, alphas=5.54, Ws=0.0001)

AT(0,0,9.401 + L2a ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The second length of curved guide from Box-A to the straight guide
G3 \*/

COMPONENT G2b_total = Monitor( xmin = -0.02, xmax = 0.02, ymin = -0.075,
ymax = 0.075)

AT(0, 0, (9.402 +L2a+L2b)) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check the flux after the curved section of guide \*/

COMPONENT G2c = Bender(

w=0.04, h=0.15, r=2323.0, l= L2c, d=0.001, k=1,

R0a=0.98, Qca=0.022, ma=3.0, alphaa=5.54, Wa=0.0001,

R0i=0.98, Qci=0.022, mi=3.0, alphai=5.54, Wi=0.0001,

R0s=0.98, Qcs=0.022, ms=3.0, alphas=5.54, Ws=0.0001)

AT(0,0,9.402+L2a+L2b ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The third length of curved guide from Box-A to the straight guide G3
\*/

COMPONENT G2c_total = Monitor( xmin = -0.02, xmax = 0.02, ymin = -0.075,
ymax = 0.075)

AT(0, 0, (9.403+L2a+L2b+L2c)) RELATIVE arm1 ROTATED (0,0,0) RELATIVE
arm1

/\* Detector to check the flux after the curved section of guide \*/

COMPONENT G2_guide_total = Monitor( xmin = -0.02, xmax = 0.02, ymin =
-0.075, ymax = 0.075)

AT(0, 0, 32.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check the flux after the curved section of guide \*/

COMPONENT E2check = E_monitor(xmin =-.02, xmax = .02,

ymin =-.075, ymax = .075,

Emin =E_min, Emax =E_max,

nchan= 100, filename = \"z002e2.dat\")

AT(0, 0, 32.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT T2check=TOF_monitor2(xmin = -.02, xmax = .02,

ymin =-.075, ymax = .075,

tmin = t2_min, tmax = t2_max,

nchan= 100, filename = \"z002t2.dat\")

AT(0, 0, 32.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT D2check= Divergence_monitor(

xmin=-0.02,xmax=0.02, ymin=-0.075, ymax=0.075,

nh=100,nv=100,h_maxdiv=2.0, v_maxdiv=2.0,

filename=\"z002d2.dat\")

AT(0, 0, 32.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT P2check= PSD_monitor(

xmin = -0.02, xmax = 0.02, ymin = -0.075, ymax = 0.075,

nx=20, ny=75 , filename=\"z002p2.dat\" )

AT(0, 0, 32.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-- The straight guide G3 before
Box-B \-\-\-\-\--\*/

COMPONENT G3Aguide = Guide1( w1=0.04,h1=0.15,w2=0.04,h2=0.15,l=4.0,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0, 0, 32.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* A piece of guide that is between G2 and Box-B \*/

COMPONENT G3_guide_total = Monitor( xmin = -0.02, xmax = 0.02, ymin
=-0.075, ymax =0.075)

AT(0, 0, 36.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector after the short guide G3
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*/

COMPONENT E3check = E_monitor(xmin =-.02, xmax = .02,

ymin =-.075, ymax = .075,

Emin =E_min, Emax =E_max,

nchan= 100, filename = \"z002e3.dat\")

AT(0, 0, 36.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT T3check=TOF_monitor2(xmin = -.02, xmax = .02,

ymin = -.075, ymax = .075,

tmin = t3_min, tmax = t3_max,

nchan= 100 , filename = \"z002t3.dat\")

AT(0, 0, 36.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT D3check= Divergence_monitor(

xmin=-0.02,xmax=0.02, ymin=-0.075, ymax=0.075,

nh=100,nv=100,h_maxdiv=2.0, v_maxdiv=2.0,

filename=\"z002d3.dat\")

AT(0, 0, 36.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT P3check= PSD_monitor(

xmin = -0.02, xmax = 0.02, ymin = -0.075, ymax = 0.075,

nx=20, ny=75 , filename=\"z002p3.dat\" )

AT(0, 0, 36.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

END

Appendix 3

HY_6.32m.instr

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

\* HYSPEC - target-monochromator distance LMM=37m

\* sourcefile: source_sct21a_td_05_1.dat

\* interpolation code sns_source1.comp by Garrett Granroth

\* Guides G1: length 4m, 4x13.2-\>4x15

\* Guides G2: length (L2a+L2b+L2c)=26.38m, 4x15, curved

\* Guide G3: length 4.0m, 4x15-\>4x15, straight

\* Guides reflectivity 3theta R0=0.98

\* Box-A inserted between guides G1 and G2

\* G2 starts immediately downstream of the 4m expander

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

DEFINE INSTRUMENT hy1(Edes, E_min, E_max, toffset)

DECLARE

%{

double samp_pos ;

double Fu_l ;

double Gu_m ;

double Gu_R ;

double Gu_alpha ;

double chan_num ;

double L2, L2a, L2b, L2c, L3, x_mono, Rc ;

double phase1, phase2, phase3, toffset ;

double t1_min, t1_max, t2_min, t2_max, t3_min, t3_max ;

double Edes, E_min, E_max, erange, ewidth ;

double dist_eff, vi_eff, fermi_speed ;

double WL_mean, r0m, dPG, k_m, Q_m, Cl_ang, Al_ang, R_vert, R_horz ;

double LMM, LCM, LMS, LSD, sin_tm ;

%}

INITIALIZE

%{

/\* Input parameters:

Incident energy - Edes (meV)

Minimum and maximum energies - E_min, E_max (meV)

Peak of time distribution - toffset (s)

Moderator to monochromator distance - LMM (m)

\*/

/\* set the desired energy and energy range \*/

/\*Edes = 50.0

Energy range = E_max - E_min

\*/

/\* Distances:

LMM - moderator to monochromator

LCM - chopper to monochromator

LMS - monochromator to sample

LSD - sample to detector

\*/

/\* Length and curvature of guide G2

Radius of curvature Rc = (0.5\*L2 + L3)\*L2/x_mono

where x_mono in the displacement of the monochromator

Rc = 2884m ;

L3 = 4.0 ;

\*/

LMM = 37.0;

/\* Calculate the phase of the disc choppers or the time width at the
TOF monitors\*/

/\* calculate first chopper phase \*/

phase1=(9.3)/(sqrt(Edes)\*SE2V)+toffset;

t1_min=(9.3)/(sqrt(E_max)\*SE2V) - 0.0005 + toffset;

t1_max=(9.3)/(sqrt(E_min)\*SE2V) + 0.0020 + toffset;

/\* calculate second chopper phase \*/

phase2=(32.70)/(sqrt(Edes)\*SE2V)+toffset;

t2_min=(32.70)/(sqrt(E_max)\*SE2V) - 0.0005 + toffset;

t2_max=(32.70)/(sqrt(E_min)\*SE2V) + 0.0020 + toffset;

/\* calculate third chopper phase \*/

phase3=(36.70)/(sqrt(Edes)\*SE2V) + toffset;

t3_min=(36.70)/(sqrt(E_max)\*SE2V) - 0.0005 + toffset;

t3_max=(36.70)/(sqrt(E_min)\*SE2V) + 0.0020 + toffset;

%}

TRACE

COMPONENT arm1 = Arm()

AT(0,0,0) ABSOLUTE

/\* \-\-\-\-\-\-\-\-- The BL14B moderator source function
\-\-\-\-\-\-\--\*/

COMPONENT
mod=SNS_source1(S_filename=\"/home/vinita/hy0409/source_sct21a_td_05_1.dat\",

width=0.10, height=0.12, dist=2.5,

xw=0.04, yh=0.132, Emin=E_min, Emax=E_max)

AT(0, 0, 0.00) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Garrett\'s SNS moderator reading routine - emit\'s neutrons from
Emin to Emax \*/

COMPONENT Shutter_in_total = Monitor( xmin = -0.02, xmax = 0.02, ymin
=-0.066,ymax = 0.066)

AT(0, 0, 2.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check the flux of neutrons just before the guide in the
shutter \*/

/\* \-\-\-\--The guide in the shutter (G1A) & biological shield (G1B)
\-\-- \*/

COMPONENT G1a_guide = Guide1( w1=0.04,h1=0.132,w2=0.04,h2=0.141,l=2.0,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0, 0, 2.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The guide in the shutter \*/

COMPONENT G1b_guide = Guide1( w1=0.04,h1=0.141,w2=0.04,h2=0.15,l=2.0,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0, 0, 4.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The guide in the biological shield \*/

COMPONENT G1c_guide = Bender(

w=0.04, h=0.15, r=2884.0, l= 1.679, d=0.001, k=1,

R0a=0.98, Qca=0.022, ma=3.0, alphaa=5.54, Wa=0.0001,

R0i=0.98, Qci=0.022, mi=3.0, alphai=5.54, Wi=0.0001,

R0s=0.98, Qcs=0.022, ms=3.0, alphas=5.54, Ws=0.0001)

AT(0, 0, 6.32) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* curved guide connecting to Box-A \*/

COMPONENT G1_guide_total = Monitor( xmin = -0.02, xmax = 0.02, ymin
=-0.075, ymax = 0.075)

AT(0, 0, 8.00) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check the flux coming out of the guide in the biological
shield \*/

/\* start Box-A containing T0 and T1A choppers
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*/

/\* 30cm gap for the T0 chopper blade, 10cm gap for the T1A chopper\*/

COMPONENT GA1guide = Bender(

w=0.04, h=0.15, r=2884.0, l= 0.35, d=0.001, k=1,

R0a=0.98, Qca=0.022, ma=3.0, alphaa=5.54, Wa=0.0001,

R0i=0.98, Qci=0.022, mi=3.0, alphai=5.54, Wi=0.0001,

R0s=0.98, Qcs=0.022, ms=3.0, alphas=5.54, Ws=0.0001)

AT(0,0,8.00 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT GA2guide = Bender(

w=0.04, h=0.15, r=2884.0, l= 0.65, d=0.001, k=1,

R0a=0.98, Qca=0.022, ma=3.0, alphaa=5.54, Wa=0.0001,

R0i=0.98, Qci=0.022, mi=3.0, alphai=5.54, Wi=0.0001,

R0s=0.98, Qcs=0.022, ms=3.0, alphas=5.54, Ws=0.0001)

AT(0,0,8.649 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT detBoxA = Monitor(

xmin = -.02,

xmax = .02,

ymin =-.075,

ymax = .075)

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\*\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--End Box-A
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*/

COMPONENT E1check = E_monitor(

xmin =-.02,

xmax = .02,

ymin =-.075,

ymax = .075,

Emin = E_min,

Emax = E_max,

nchan= 100,

filename = \"z002e1.dat\")

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT T1check=TOF_monitor2(

xmin = -.02,

xmax = .02,

ymin =-.075,

ymax = .075,

tmin = t1_min,

tmax = t1_max,

nchan= 100,

filename = \"z002t1.dat\")

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT D1check= Divergence_monitor(

xmin=-0.02,xmax=0.02, ymin=-0.075, ymax=0.075,

nh=100,nv=100,h_maxdiv=2.0, v_maxdiv=2.0,

filename=\"z002d1.dat\")

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT P1check= PSD_monitor(

xmin = -0.02, xmax = 0.02, ymin = -0.075, ymax = 0.075,

nx=20, ny=75 , filename=\"z002p1.dat\" )

AT(0,0,9.30 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* \-\-\-\-\-\-\-\-\-\-\-\-\-- The curved guide G2 connecting Box-A and
G3\-\-\-\-\-\-\--\*/

COMPONENT G2 = Bender(

w=0.04, h=0.15, r=2884.0, l= 23.3, d=0.001, k=1,

R0a=0.98, Qca=0.022, ma=3.0, alphaa=5.54, Wa=0.0001,

R0i=0.98, Qci=0.022, mi=3.0, alphai=5.54, Wi=0.0001,

R0s=0.98, Qcs=0.022, ms=3.0, alphas=5.54, Ws=0.0001)

AT(0,0,9.399 ) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* The curved guide from Box-A to the straight guide G3 \*/

COMPONENT G2_guide_total = Monitor( xmin = -0.02, xmax = 0.02, ymin =
-0.075, ymax = 0.075)

AT(0, 0, 32.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector to check the flux after the curved section of guide \*/

COMPONENT E2check = E_monitor(

xmin =-.02,

xmax = .02,

ymin =-.075,

ymax = .075,

Emin =E_min,

Emax =E_max,

nchan= 100,

filename = \"z002e2.dat\")

AT(0, 0, 32.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT T2check=TOF_monitor2(

xmin = -.02,

xmax = .02,

ymin =-.075,

ymax = .075,

tmin = t2_min,

tmax = t2_max,

nchan= 100 ,

filename = \"z002t2.dat\")

AT(0, 0, 32.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT D2check= Divergence_monitor(

xmin=-0.02,xmax=0.02, ymin=-0.075, ymax=0.075,

nh=100,nv=100,h_maxdiv=2.0, v_maxdiv=2.0,

filename=\"z002d2.dat\")

AT(0, 0, 32.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT P2check= PSD_monitor(

xmin = -0.02, xmax = 0.02, ymin = -0.075, ymax = 0.075,

nx=20, ny=75 , filename=\"z002p2.dat\" )

AT(0, 0, 32.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* \-\-\-\-\-\-\-\-\-\-\-- The straight guide G3 before Box-B
\-\-\-\-\-\-\-\-\--\*/

COMPONENT G3Aguide = Guide1( w1=0.04,h1=0.15,w2=0.04,h2=0.15,l=4.0,

R0=0.98,m=3.0,W=0.0001,Qc=0.022,alpha=5.54)

AT(0, 0, 32.703) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* A piece of guide that is between G2 and Box-B \*/

COMPONENT G3_guide_total = Monitor( xmin = -0.02, xmax = 0.02, ymin
=-0.075, ymax =0.075)

AT(0, 0, 36.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

/\* Detector after the short guide G3
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\*/

COMPONENT E3check = E_monitor(

xmin =-.02,

xmax = .02,

ymin =-.075,

ymax = .075,

Emin =E_min,

Emax =E_max,

nchan= 100,

filename = \"z002e3.dat\")

AT(0, 0, 36.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT T3check=TOF_monitor2(xmin = -.02,

xmax = .02,

ymin = -.075,

ymax = .075,

tmin = t3_min,

tmax = t3_max,

nchan= 100 ,

filename = \"z002t3.dat\")

AT(0, 0, 36.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT D3check= Divergence_monitor(

xmin=-0.02,xmax=0.02, ymin=-0.075, ymax=0.075,

nh=100,nv=100,h_maxdiv=2.0, v_maxdiv=2.0,

filename=\"z002d3.dat\")

AT(0, 0, 36.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

COMPONENT P3check= PSD_monitor(

xmin = -0.02, xmax = 0.02, ymin = -0.075, ymax = 0.075,

nx=20, ny=75 , filename=\"z002p3.dat\" )

AT(0, 0, 36.70) RELATIVE arm1 ROTATED (0,0,0) RELATIVE arm1

END

**References**

1.  User and Programmers Guide to the Neutron Ray-Tracing Package
    McStas, version 1.8, P.Willendrup, E. Farhi, K. Lefmann, P.O.
    Astrand, M. Hagen and K. Nielsen, Riso-R-1416(EN), Riso National
    Laboratory, Roskilde, Denmark, May 2004

2.  McStas simulations for guide configuration optimization, HYSPEC
    Technical Note 0009, V.J. Ghosh and M. Hagen, (February 2005)

3.  Description of the proposed neutron guides for Hyspec, HYSPEC
    Technical Note 0002, V.J. Ghosh and M. Hagen, (January 2005)

4.  E. Iverson, MCNP data for BL5 coupled H2 moderator obtained from
    <http://www.sns.gov/users/instrument_systems/components/moderator/HPTS-sct.shtml>
    as of 31st July 2002.

5.  G. Granroth, SNS_source1.comp, (private communication)