File: Test_Source_pulsed.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 (104 lines) | stat: -rw-r--r-- 3,371 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
/*******************************************************************************
*         McStas instrument definition URL=http://mcstas.risoe.dk
*
* Instrument: Test_Source_pulsed
*
* %Identification
* Written by: Klaus LIEUTENANT (k.lieutenant@fz-juelich.de)  based on 'Test_9-Sources' by Emmanuel FARHI (farhi@ill.fr)
* Date: Mar 17, 2021
* Origin:FZJ
* %INSTRUMENT_SITE: Tests_optics
*
* A test instrument to check the component 'Source_pulsed'
*
* %Description
* A test instrument to check if the component 'Source_pulsed' provides valid spectra and intensities. 
*
* %Example: source=1 Detector: m1_I=4.680e+09
* %Example: source=2 Detector: m1_I=2.305e+09
* %Example: source=3 Detector: m1_I=5.292e+09
*
* %Parameters
* source: [1]  selection of the source to use in 1=Source_pulsed for HBS thermal, 2=Source_pulsed for HBS cold, 3=Source_pulsed for HBS bispectral 
* Lmin: [Ang] Minimum wavelength produced at source    
* Lmax: [Ang] Maximum wavelength produced at source      
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_Source_pulsed(int source=1, Lmin=0.1, Lmax=10.1)

DECLARE
%{
  double Lambda0, dLambda;
%}

INITIALIZE
%{
  printf("%s: ", instrument_name);
  switch (source) {
  case 1:
    printf("Using Source_pulsed for HBS thermal\n"); break;
  case 2:
    printf("Using Source_pulsed for HBS cold\n"); break;
  case 3:
    printf("Using Source_pulsed for HBS bispectral\n"); break;
  }
  printf("Studied wavelength range is [%g %g] AA\n", Lmin, Lmax);
  dLambda=(Lmax-Lmin)/2;
  Lambda0=(Lmax+Lmin)/2;
%}

TRACE

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

/* the sources ============================================================== */
COMPONENT HBS_thml = Source_pulsed
( xwidth=0.040, yheight=0.040, Lmin=Lmin, Lmax=Lmax, t_min=0.0, t_max=0.0015, 
  dist = 1.000, focus_xw = 0.020, focus_yh = 0.020, freq=96.0, t_pulse=0.000167, 
  T1=325.0, I1=7.13e09, tau1=0.000125, n_mod=10, I_um=2.57e08, chi_um=2.5
) WHEN (source == 1)
AT (0,0,0) ABSOLUTE

COMPONENT HBS_cold = Source_pulsed
( radius=0.010, Lmin=Lmin, Lmax=Lmax, t_min=0.0, t_max=0.0015, 
  dist = 1.000, focus_xw = 0.020, focus_yh = 0.020, freq=24.0, t_pulse=0.000667, 
  T1=60.0, I1=7.29e10, tau1=0.000170, n_mod=5, I_um=1.59e09, chi_um=0.9
) WHEN (source == 2)
AT (0,0,0) ABSOLUTE

COMPONENT HBS_bispec = Source_pulsed
( radius=0.022, r_i=0.010, Lmin=Lmin, Lmax=Lmax, t_min=0.0, t_max=0.0015, 
  dist = 1.000, focus_xw = 0.020, focus_yh = 0.020, freq=24.0, t_pulse=0.000667, 
  T1= 60.0, I1=7.29e10, tau1=0.000170,  
  T2=305.0, I2=2.32e10, tau2=0.000130, n_mod=5, I_um=1.59e09, chi_um=2.5
) WHEN (source == 3)
AT (0,0,0) ABSOLUTE


/* the monitor ============================================================== */

COMPONENT m0 = TOF_monitor
( xmin=-0.1, xmax=0.1, ymin=-0.1, ymax=0.1, 
  nt=150, filename="source.mtt", tmin=0.0, tmax=1500.0, dt=10.0
)
AT (0, 0, 0.0001) ABSOLUTE

COMPONENT m1 = L_monitor
( xmin=-0.1, xmax=0.1, ymin=-0.1, ymax=0.1, 
  nL=110, filename="source.mtl", Lmin=0, Lmax=11
)
AT (0, 0, 0.0002) ABSOLUTE

COMPONENT m2a = Monitor_nD(
  xwidth=0.06, yheight=0.06,
  options="x, y", bins=60, filename="source.pos"
) AT (0, 0, 0.0003) ABSOLUTE

COMPONENT m2b = Monitor_nD(
  xwidth=0.06, yheight=0.06,
  options="x, y", bins=60, filename="target.pos"
) AT (0, 0, 1.000) ABSOLUTE

END