File: Test_StatisticalChopper.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 (86 lines) | stat: -rw-r--r-- 2,708 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
/*******************************************************************************
*
* McStas, neutron ray-tracing package
*         Copyright (C) 1997-2008, All rights reserved
*         Risoe National Laboratory, Roskilde, Denmark
*         Institut Laue Langevin, Grenoble, France
*
* Instrument: Test_StatisticalChopper
*
* %Identification
* Written by: <a href="mailto:farhi@ill.fr">Emmanuel Farhi</a>
* Date: 1st Dec 2009.
* Origin: <a href="http://www.ill.fr">ILL (France)</a>
* %INSTRUMENT_SITE: Tests_optics
*
* An example using a statistical/correlation chopper and its de-correlation monitor
*
* %Description
* This instrument is a simple model of a kind of TOF instrument, with powder sample
* and statistical chopper. The de-correlation is also performed in a dedicated monitor.
*
* %Example: lambda=1 Detector: time_mon2_I=3.44e-12
*
* %Parameters
* lambda: [Angs]  source wavelength
*
* %L
* R. Von Jan and R. Scherm. The statistical chopper for neutron time-of-flight spectroscopy. Nuclear Instruments and Methods, 80 (1970) 69-76.
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_StatisticalChopper(lambda=1)

TRACE

COMPONENT base=Progress_bar()
AT (0,0,0) ABSOLUTE


// COMPONENT source1 = Moderator(radius = 0.0707, dist = 18, xw = 0.11, yh = 0.11,
//                    E0 = 10, E1 = 15, Ec = 9.0, t0 = 37.15, gam = 39.1)
// AT (0,0,0.01) RELATIVE PREVIOUS

COMPONENT source1 = Source_simple(xwidth=0.026, yheight=0.026,
  lambda0=lambda, dlambda=0.00001,
  focus_xw=0.005, focus_yh=0.05, dist=1.2)
AT (0,0,.001) relative PREVIOUS
EXTEND %{
  t=randpm1()*255/60/1487;
%}

COMPONENT before_stat_chop =  Monitor_nD(
         options = "auto time bins=1000",
         xwidth = 0.11, yheight = 0.11)
     AT (0,0,0) RELATIVE PREVIOUS

COMPONENT chop1 = StatisticalChopper(nu=1487.0*60/255, verbose=1)
AT (0,0,1) relative PREVIOUS

COMPONENT after_stat_chop =  Monitor_nD(
         options = "auto time bins=1001",
         xwidth = 0.11, yheight = 0.11)
     AT (0,0,0.01) RELATIVE PREVIOUS

SPLIT COMPONENT Sample = Isotropic_Sqw(xwidth=.005, yheight=.05, zdepth=2e-3,
  Sqw_coh="Na2Ca3Al2F14.laz", // Sqw_coh="Rb_liq_coh.sqw", Sqw_inc="Rb_liq_inc.sqw",
  p_interact=0.99, d_phi=atan2(0.1,2)*RAD2DEG)
AT (0,0,.2) relative PREVIOUS
EXTEND %{
  if (!SCATTERED) ABSORB;
%}

COMPONENT ChopMon2 = StatisticalChopper_Monitor(
  options ="banana auto time bins=500, y bins=100",
  radius=2,
  yheight=0.11,
  comp="chop1",
  restore_neutron=1)
AT (0,0,0) RELATIVE PREVIOUS

COMPONENT time_mon2 =  Monitor_nD(
         options = "banana, auto time,bins=1002",
         radius=2.1, yheight = 0.11)
     AT (0,0,0) RELATIVE PREVIOUS

END