File: Test_KB.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 (110 lines) | stat: -rw-r--r-- 2,471 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
105
106
107
108
109
110
/*******************************************************************************
* Instrument: Test_KB.instr
*
* %Identification
* Written by: Antoine Padovani
* Date: March 2022
* Origin: SOLEIL
* Version: 1.0
* %INSTRUMENT_SITE: Tests_optics
*
* Test of Kirkpatrick Baez (KB) mirrors
*
* %Description
* Two curved mirrors in a Kirkpatrick Baez geometry. Default parameters
* are set for a focusing f_m=f_s= 10 m.
* The KB should satisfy f_m=R.sin(theta/2) and f_s=R/2.sin(theta)
*
* Example: Test_KB L=12
*
* %Parameters
* L:     [m]   Distance to the PSD detector, with a shift by 1.5 m
* theta: [rad] Mirror glancing angle 
* R:     [m]   Mirror curvature radius
* 
* %Link
* https://github.com/McStasMcXtrace/Schools/tree/master/2023/SOLEIL_May_2023/Day2_Wednesday_May_10th/5_Optics/2_KB_mirrors
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_KB(L=12,theta=0.003,R=6.66e3)

TRACE

COMPONENT origin = Progress_bar()
AT (0, 0, 0) RELATIVE ABSOLUTE

// insert components here (e.g. Insert -> Source -> ...)
COMPONENT source_gaussian = Source_gaussian(
    sig_x=48.2e-6, 
    sig_y=9.5e-6, 
    sigPr_x=100e-6, 
    sigPr_y=4.3e-6, 
    dist=31.5, 
    focus_xw=0.001,
    focus_yh=0.001,
    gauss=1, 
    E0=23.32, 
    dE=1)
AT (0, 0, 0) RELATIVE origin

COMPONENT mirror_curved = Mirror_curved(
    radius=R,
    //radius=0.001,
    length=1,
    width=1)
AT (0, 0, 31.5) RELATIVE PREVIOUS
ROTATED (0, RAD2DEG*theta, 0) RELATIVE PREVIOUS
EXTEND
%{ 
	if (!SCATTERED) ABSORB; 
%}

COMPONENT arm = Arm()
AT (0, 0, 0) RELATIVE PREVIOUS
ROTATED (0, RAD2DEG*theta, 0) RELATIVE PREVIOUS

COMPONENT arm_2 = Arm()
AT (0, 0, 1.5) RELATIVE PREVIOUS
ROTATED (0, 0, 90) RELATIVE PREVIOUS

COMPONENT mirror_2 = Mirror_curved(
    radius=R,   
    length=1,
    width=1)
AT (0, 0, 0) RELATIVE PREVIOUS
ROTATED (0, RAD2DEG*theta, 0) RELATIVE PREVIOUS
EXTEND
%{ 
	if (!SCATTERED) ABSORB; 
%}

COMPONENT arm_3 = Arm()
AT (0, 0, 0) RELATIVE PREVIOUS
ROTATED (0, RAD2DEG*theta, 0) RELATIVE PREVIOUS


COMPONENT slit = Slit(
    radius=0.0001)
    //radius=0.0001)
AT (0, 0, 0.5 + L) RELATIVE PREVIOUS

COMPONENT psd_monitor = PSD_monitor(
    filename="psd.dat", 
    xwidth=0.01, 
    yheight=0.01
    )
AT (0, 0, 0.001) RELATIVE PREVIOUS


COMPONENT e_monitor = E_monitor(
    filename="energy.dat", 
    xwidth=0.01, 
    yheight=0.01,     
    Emin=23.32-1, 
    Emax=23.32+1)
AT (0, 0, 0) RELATIVE PREVIOUS


END