File: ESRF_ID11.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 (128 lines) | stat: -rw-r--r-- 4,290 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
/*******************************************************************************
*         McXtrace instrument definition URL=http://www.mcxtrace.org
*
* Instrument: ESRF-ID11-nanofocus beamline
*
* %Identification
* Written by: E. Knudsen (erkn@risoe.dtu.dk)
* Date: Nov. 26th, 2009
* Release: McXtrace 0.1_alpha
* Version: $Revision$
* Origin: Risø DTU
* %INSTRUMENT_SITE: ESRF
*
* Model of the ESRF ID11 Transfocator based beamline.
*
* %Description
* Model of the ESRF ID11 Transfocator based beamline.
*
* %Example: ESRF_ID11.instr ANGLE=0 Detector: psd_eh3_sample_I=0.284963
*
* %Parameters
* ANGLE: [deg] Rotation (misalignment) of first transfocator 
* SOURCE: [ ] 1) Choose rectangular source with defined divergence. 2) Choose Gaussian cross-section source
* T1_N: [ ] Number of Be lenses in 1st IVT transfocator @31.5m
* T2_N: [ ] Number of Al lenses in 1st IVT transfocator @31.5m _currently deactivated by default_
* T3_N: [ ] Number of Al lenses in 2nd IVT transfocator @92.25 m
* SI_N: [ ] Number of Si lenses in Si microfocus chip transfocator @94 m
* IVT1BE: [ ] If nonzero the set of Be-lenses is chosen for the IVT @31.5m. If 0 the Al set is active.
* 
* %Link
* http://www.esrf.eu/UsersAndScience/Experiments/StructMaterials/ID11/ID11Source
* %End
*******************************************************************************/

DEFINE INSTRUMENT ESRF_ID11(ANGLE=0,SOURCE=0,T1_N=16,T2_N=16,T3_N=16,SI_N=2, IVT1BE=1)


DECLARE
%{
  const double source_h=57e-6*FWHM2RMS;
  const double source_v=10e-6*FWHM2RMS;
  const double source_div_h=88e-6*FWHM2RMS;
  const double source_div_v=5e-6*FWHM2RMS;

  double eh1_sample_offset,EH3TFOC_offset,chip2sample,eh3_sample_offset;
%}


INITIALIZE
%{
  /*set some geometry parameters*/
  eh1_sample_offset=0;
  EH3TFOC_offset=0;
  chip2sample=0.1;
  eh3_sample_offset=0;
%}

TRACE

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

COMPONENT id11_source=Source_div(
    xwidth=source_h,yheight=source_v,focus_aw=source_div_h,focus_ah=source_div_v, E0=30, dE=0.9, gauss=1

)
WHEN (SOURCE==0) AT (0,0,0) RELATIVE PREVIOUS

COMPONENT generic_source=Source_gaussian(
    lambda0=0.413, dlambda=0.412,
    sig_x=0.057e-3, sig_y=0.01e-3, 
    sigPr_x=0.6e-3,sigPr_y=0.6e-3, dist=29
)
WHEN (SOURCE==1) AT (0,0,0) RELATIVE PREVIOUS

COMPONENT psd0 = PSD_monitor(nx=301,ny=301,filename="psd0.dat",xwidth=0.002,yheight=0.002)
AT (0,0,28.9) RELATIVE Origin

COMPONENT aperture  = Slit(xwidth=0.6e-3, yheight=0.6e-3)
  AT(0,0,29) RELATIVE Origin

COMPONENT psd1 = PSD_monitor(nx=301,ny=301,filename="psd1.dat",xwidth=0.002,yheight=0.002)
AT (0,0,29.1) RELATIVE Origin


  /*in -vacuum transfocator*/
COMPONENT transfocator1=Lens_simple(
    xwidth=2e-1,yheight=2e-1, radius=0, N=T1_N, material_datafile="Be.txt",r=300e-6)
WHEN(IVT1BE) AT(0,0,31.5) RELATIVE Origin
ROTATED (0,ANGLE,0) RELATIVE PREVIOUS

COMPONENT transfocator2=Lens_simple(
    xwidth=2e-3,yheight=2e-3, radius=0, N=T2_N,material_datafile="Al.txt",r=300e-6)
WHEN (!IVT1BE) AT(0,0,31.5) RELATIVE Origin

COMPONENT psd2 = PSD_monitor(nx=301,ny=301,filename="psd2.dat",xwidth=0.002,yheight=0.002)
AT (0,0,0.1) RELATIVE PREVIOUS


/*EH1 sample position*/
COMPONENT eh1_sample_pt =Arm()
  AT(0,0,42.5+eh1_sample_offset) RELATIVE Origin
COMPONENT psd_eh1_sample = PSD_monitor(nx=301,ny=301,filename="psd_eh1.dat",xwidth=2e-3,yheight=2e-3)
  AT (0,0,1e-5) RELATIVE PREVIOUS
COMPONENT wavel_eh1_sample=L_monitor(filename="lmon_eh1.dat",Lmin=0,Lmax=3,xwidth=0.5,yheight=0.5,nL=101)
  AT(0,0,1e-5) RELATIVE PREVIOUS

/*EH3 transfoc*/
COMPONENT transfocator3=Lens_simple(
    xwidth=2e-3,yheight=2e-3, r=2e-3, radius=0, N=T3_N,material_datafile="Al.txt")
AT (0,0,92.25+EH3TFOC_offset) RELATIVE Origin

/*Si chip nanofocus*/
COMPONENT si_chip_nanofocus=Lens_simple(
    xwidth=1e-3,yheight=1e-3, r=100e-6, radius=0, N=SI_N,material_datafile="Si.txt")
AT (0,0,94-chip2sample) RELATIVE Origin

/*EH3 sample position*/
COMPONENT eh3_sample_pt = Arm()
AT(0,0,94+eh3_sample_offset) RELATIVE Origin

COMPONENT psd_eh3_sample = PSD_monitor(nx=301,ny=301,filename="psd_eh3.dat",xwidth=2e-3,yheight=2e-3)
  AT (0,0,1e-5) RELATIVE PREVIOUS
COMPONENT wavel_eh3_sample=L_monitor(filename="lmon_eh3.dat",Lmin=0,Lmax=1,xwidth=0.01,yheight=0.01,nL=101)
  AT(0,0,1e-5) RELATIVE PREVIOUS

END