File: SAXS_saxlab.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 (174 lines) | stat: -rw-r--r-- 5,923 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*********************************************************
 * McXtrace instrument definition URL=http://www.mcxtrace.org
*
* Instrument : SAXS_saxslab
*
* %Identification
* Written by : Erik Knudsen ( erkn@fysik.dtu.dk ) & Jana Baltser ( jana.baltser@fys.ku.dk )
* Date : Apr 2017
* Origin : NBI
* Release : 1.4
* Version : 1.0
* %INSTRUMENT_SITE: SAXSLAB
*
* SAXSLab small-angle scattering (SAXS)
*
* %Description
* The small-angle scattering (SAXS) instrument generally consists of the following parts:
* the X-ray source ( the system includes rotating copper anode and KB multilayermirrors), 
* a pinhole collimation system and a detector.
* 
* The geometry of this instument is such that an x-ray source (turned 45 deg.) shines light
* on Montel mirror pair. The mirror pair is mounted such that the doubly reflected radiation
* is deflected downwards (negative y-axis). This means the the mirror join is pointing upwards, and th
* mirrors themselves extending +-45 degrees downwards.
* There are slits attached to the mirror exits
* This arrangement is designed to closesly resemble the SAXSlab system installed at
* NBI (University of Copenhagen)
* 
* The evolution of the beam is tracked using a series of 2D PSD monitors situated along the beam axis,
* which points slightly down.
* In real life the beam axis is parallel to the ground and the source is shining slightly upwards.
*
* %Example: Energy=8.05 Detector: detector_I=1.28656e+07
* 
* %Parameters
* Gamma:    [deg] Nominal mirror glancing  angle
* S1:       [m]   Distance from the source to the multilayer's surface
* S2:       [m]   Focal distance of the multilayer
* L:        [m]   Distance between two mirrors
* Energy:   [keV] Primary energy of the photon beam
* mirrorin: [ ]   Flag controlling whether or not the mirror is active.
* pin1:     [ ]   Flag controlling whther the 1st pinhole is active.
* pin2:     [ ]   Flag controlling whther the 2nd pinhole is active.
* pin3:     [ ]   Flag controlling whther the 3rd pinhole is active.
* Lpsd1:    [m]   Distance from mirror centre to 1st diagnostic PSD.
* Lpsd2:    [m]   Distance from vacumm chamber entry to 2nd diagnostic PSD.
* Lpsd3:    [m]   Distance from vacumm chamber entry to 3rd diagnostic PSD.
* detPos:   [m]   Distance from vacuum chamber entry to Detector.
* GammaP: [deg]   When given, Gamma=Gamma/sqrt(2)
* detOffSet: [m]  Final detector shift along Y
*
* %End
**************************************************************/
DEFINE INSTRUMENT SAXS_saxlab(Gamma=1.2 ,GammaP=0 ,S1=.045, S2 =.9, Energy=8.05,
        int mirrorin=3, int pin1=1, int pin2=1, int pin3=1, Lpsd1=0.160, Lpsd2=0.15,Lpsd3=1.2,
        detPos=1.41, detOffSet=3e-2)

DECLARE
%{
  const double sourceh =10e-6;
  const double sourcev =10e-6;
  const double divh=9e-3;
  const double divv =9e-3;
  const double slitsize =1.5e-3;
  const double xdet = 0.106 ;
  const double ydet = 0.084 ;

  const double pin1_xw=1e-3;
  const double pin1_yh=1e-3;

  const double pin2_pos=0.2;
  const double pin2_xw=1e-3;
  const double pin2_yh=1e-3;

  const double pin3_pos=0.4;
  const double pin3_xw=1e-3;
  const double pin3_yh=1e-3;
  
#define NXval 619
#define NYval 487
  double mwidth = 0.02;
  double mlength = 0.06;
  int Scatt;
  double delta ;




%}


INITIALIZE
%{
  if (GammaP) Gamma=GammaP/sqrt(2);
%}

TRACE

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

COMPONENT Source=Source_gaussian ( sig_x=sourceh , sig_y=sourcev ,
sigPr_x=divh , sigPr_y=divv , dist =0.015 , E0 =8.07 ,dE=0.5 , flux =1e15 )
AT( 0 , 0 , 0 ) RELATIVE Origin
ROTATED (0,0,45) RELATIVE Origin

COMPONENT energy_BEF=E_monitor (nE=500 , filename="energyBEF.dat",
    xwidth=xdet ,yheight=ydet , Emin=7 ,Emax=9 , restore_xray =1)
AT(0,0,1e-3) RELATIVE Origin

COMPONENT mirrorentryslit=Slit (
    xwidth=slitsize , yheight= slitsize )
AT(0.0,0.63e-3, S1-mlength/2.0) RELATIVE Origin
ROTATED (0,0,-135) RELATIVE Origin

COMPONENT mirrormnt=Arm( )
AT ( 0.0 , 0 , S1 ) RELATIVE Origin
ROTATED ( 0 , 0 , -135 ) RELATIVE Origin

COMPONENT xmirrorrot=Arm( )
AT( 0 , 0 , 0 ) RELATIVE mirrormnt
ROTATED(-Gamma, 0 , 0 ) RELATIVE mirrormnt

COMPONENT ymirrorrot=Arm( )
AT( 0 , 0 , 0 ) RELATIVE mirrormnt
ROTATED ( 0 ,Gamma, 0 ) RELATIVE xmirrorrot

COMPONENT mirror=TwinKB_ML( theta=Gamma, s1=S1 , s2=S2 , length=mlength , 
        width=mwidth , R0=0 , reflectivity_datafile="Ref_W_B4C.txt")
WHEN ( mirrorin ) AT(0,0,0) RELATIVE mirrormnt
ROTATED (0,0,0) RELATIVE ymirrorrot

COMPONENT mirrorout=Arm( )
AT( 0 , 0 , 0 ) RELATIVE mirrormnt
ROTATED (2*M_SQRT2*Gamma,0,0) RELATIVE Origin

COMPONENT mirrorexit=Slit (
  xwidth= slitsize , yheight= slitsize )
AT( 0 ,-0.90e-3 - 2.17e-3, S1+mlength/2.0 ) RELATIVE Origin
ROTATED ( 0 , 0 , -135 ) RELATIVE Origin

COMPONENT pinhole1=Slit(xwidth=pin1_xw,yheight=pin1_yh)
WHEN(pin1) AT(0,0,0.15) RELATIVE mirrorout

COMPONENT psd1=PSD_monitor ( filename ="psd1.dat" , xwidth=xdet , yheight=ydet , restore_xray=1,
        nx=NXval , ny=NYval )
AT (0 ,0 ,Lpsd1 ) RELATIVE mirrorout

COMPONENT pinhole2=Slit(xwidth=pin2_xw,yheight=pin2_yh)
WHEN(pin2) AT(0,0,pin2_pos) RELATIVE mirrorout

// now - inside the vacuum chamber mode
COMPONENT psdin1=PSD_monitor (filename="psdin1.dat", xwidth=xdet,
yheight=ydet, restore_xray=1 ,nx=NXval , ny=NYval )
AT ( 0 , 0 , 1.540 ) RELATIVE mirrorout

COMPONENT psdin2=PSD_monitor ( filename="psdin2.dat" , xwidth=xdet ,
yheight=ydet , restore_xray =1 ,nx=NXval , ny=NYval )
AT ( 0 , 0 , Lpsd2) RELATIVE psdin1

COMPONENT pinhole3=Slit(xwidth=pin3_xw,yheight=pin3_yh)
    WHEN(pin3) AT(0,0,pin3_pos) RELATIVE mirrorout

COMPONENT psdin3=PSD_monitor ( filename="psdin3.dat" , xwidth=xdet ,
yheight=ydet , restore_xray =1 ,nx=NXval , ny=NYval )
AT ( 0 , 0 , Lpsd3) RELATIVE psdin1

COMPONENT detector=PSD_monitor ( filename ="detector.dat" , xwidth=xdet ,
yheight=ydet , restore_xray =0 ,nx=NXval , ny=NYval )
AT ( 0 , detOffSet, detPos ) RELATIVE psdin1


END