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
|
/*******************************************************************************
* McStas instrument definition URL=http://www.mcstas.org
*
* Instrument: RTP_Laue
*
* %Identification
* Written by: E. Farhi and Megat Harun Al-Rashid
* Date: June 2014
* Origin: ILL/RTP
* %INSTRUMENT_SITE: TRIGA
*
* The NR instrument installed at Reactor TRIGA PUSPATI (Malaysia)
*
* %Description
* This is a radiography installed on a radial beam port 3 at the Reactor TRIGA
* PUSPATI (RTP). It uses a thermal beam port.
*
* Example: mcrun RTP_SANS.instr lambda=5
*
* %Parameters
* theta: [deg] horizontal rotation of the object
* phi: [deg] vertical rotation of the object
* det_rotation: [deg] detector rotation around the sample
* reflections: [str] sample configuration
*
* %Link
* <a href="http://www.nuclearmalaysia.gov.my/Plant&Facilities/reactor.php">Nuclear Malaysia</a>
* %Link
* M. Sufi et al., J. AppL Cryst. (1997). 30, 884-888 [doi:10.1107/S0021889897001738]
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT RTP_Laue(theta=0, phi=0, det_rotation=0, string reflections="leucine.lau")
/* The DECLARE section allows us to declare variables or small */
/* functions in C syntax. These may be used in the whole instrument. */
USERVARS
%{
double sample_scattered;
%}
/* The INITIALIZE section is executed when the simulation starts */
/* (C code). You may use them as component parameter values. */
INITIALIZE
%{
%}
/* Here comes the TRACE section, where the actual */
/* instrument is defined as a sequence of components. */
TRACE
/* The Arm() class component defines reference points and orientations */
/* in 3D space. Every component instance must have a unique name. Here, */
/* Origin is used. This Arm() component is set to define the origin of */
/* our global coordinate system (AT (0,0,0) ABSOLUTE). It may be used */
/* for further RELATIVE reference, Other useful keywords are : ROTATED */
/* EXTEND GROUP PREVIOUS. Also think about adding a neutron source ! */
/* Progress_bar is an Arm displaying simulation progress. */
COMPONENT Origin = Progress_bar()
AT (0,0,0) ABSOLUTE
/* the source is focused in wavelength to provide 5 Angs neutrons */
/* to study the Be filter, use white beam e.g. dlambda = 4.5 */
COMPONENT source = Source_gen(
radius = .154/2,
dist = 1.16+1.50, focus_xw = .01, focus_yh = .01, lambda0 = 5,
dlambda = 4.5, I1 = 2.79e12/4/PI, T1 = 300)
AT (0, 0, 0) RELATIVE Origin
COMPONENT CoarseCollimator1 = Guide(w1=.154, h1=.154, l=1.16125,m=0)
AT (0, 0, .01) RELATIVE PREVIOUS
COMPONENT CoarseCollimator2 = Guide(w1=.2,h1=.2,l=1.5,m=0)
AT (0, 0, 1.16125+0.003) RELATIVE PREVIOUS
/* a slit that also detects wavelength */
COMPONENT lmon = Monitor_nD(
xwidth=.2, options="slit disk, auto wavelength", bins=50)
AT (0, 0, 1.5+0.01) RELATIVE PREVIOUS
COMPONENT slit1 = Slit(radius=.005)
AT (0, 0, 0.01) RELATIVE PREVIOUS
COMPONENT slit2 = Slit(radius=.005)
AT (0, 0, 0.35) RELATIVE PREVIOUS
COMPONENT sample_position = Arm()
AT (0,0,.4) RELATIVE lmon
/* sample position, with rotation */
COMPONENT sample_position_rotated = Arm()
AT (0,0,0) RELATIVE PREVIOUS
ROTATED (phi, 0, theta) RELATIVE PREVIOUS
EXTEND %{
sample_scattered=0;
%}
SPLIT COMPONENT sample_outer1 = Single_crystal(xwidth=0.01, yheight=0.05, zdepth=0.01,
reflections=reflections, mosaic=5, order=1)
AT (0,0,0) RELATIVE sample_position_rotated
EXTEND %{
if (SCATTERED) sample_scattered+=SCATTERED;
%}
COMPONENT detector_axis = Arm()
AT (0,0,0) RELATIVE sample_position
ROTATED (0,det_rotation,0) RELATIVE sample_position
/* image plate/film with efficiency */
COMPONENT image_plate_ideal = Monitor_nD(xwidth=.3, yheight=.3,
options="x y", bins=1000)
AT (0,0,.1) RELATIVE detector_axis
EXTEND %{
/* take into account ZnS scintillator efficiency */
double eff=0.5;
double v=sqrt(vx*vx+vy*vy+vz*vz);
p *= 1.0-exp(3960.0/v*log(1.0-eff/100.0));
%}
COMPONENT image_plate_eff = COPY(image_plate_ideal)
AT (0,0,.1+1e-3) RELATIVE detector_axis
COMPONENT image_plate_scattered = COPY(image_plate_ideal)
WHEN(sample_scattered)
AT (0,0,.1+1e-3) RELATIVE detector_axis
COMPONENT reactor = Shape(radius=.7/2, yheight=.4)
AT (0,0,-.35) RELATIVE Origin
/* This section is executed when the simulation ends (C code). Other */
/* optional sections are : SAVE */
FINALLY
%{
%}
/* The END token marks the instrument definition end */
END
|