File: Test_shells.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 (122 lines) | stat: -rw-r--r-- 4,190 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
/*******************************************************************************
*         McXtrace instrument definition URL=http://www.mcxtrace.org
*
* Instrument: Test_shells
*
* %Identification
* Written by: Erik B Knudsen <erkn@fysik.dtu.dk> & Desiree D. M. Ferreira <desiree@space.dtu.dk> (email)
* Date: 12/12/2016
* Origin: DTU Physics/DTU Space
* Release: McXtrace 1.2
* Version: 1.0
* %INSTRUMENT_SITE: AstroX_ESA
*
* Single shell model of a true Wolter Type I optic
*
* %Description
* Single shell example telescope using a combinatiopn of parabolic/hyperbolic shell
* optical plates covering the full circle. Reflectivity is 1 for all energies.
*
* Example: Test_shells.instr shell_type=1
*
* %Parameters
* FL: [m]        The focal length of the optical system
* plate_zdepth: [m]     Plate length.
* channel_yheight: [m]  Channel height.
* radiusin: [m]  Radius at the entry to the primary (parabolic) shell.
* radiusout: [m]  Radius at the optics centre and at the exit of the secondary (hyperbolic) shell.
* shell_type: [1] Shell type 0=parabolic; 1=hyperbolic; 2=conical
*
* %End
*******************************************************************************/

/* Change name of instrument and input parameters with default values */
DEFINE INSTRUMENT Test_shells(FL=12, plate_zdepth=0.5, channel_yheight=1e-2, radiusin=0.535532 , radiusout=0.533113, shell_type=1)

/* The DECLARE section allows us to declare variables or  small      */
/* functions in C syntax. These may be used in the whole instrument. */
USERVARS
%{
  int interacted;
%}

/* The INITIALIZE section is executed when the simulation starts     */
/* (C code). You may use them as component parameter values.         */
INITIALIZE
%{
%}
/* instrument is defined as a sequence of components.  */
TRACE

/* The Arm() class component defines reference points and orientations  */
/* in 3D space. Every component instance must have a unique name. Here, */
/* Origin is used. This Arm() component is set to define the origin of  */
/* our global coordinate system (AT (0,0,0) ABSOLUTE). It may be used   */
/* for further RELATIVE reference, Other useful keywords are : ROTATED  */
/* EXTEND GROUP PREVIOUS. Also think about adding an xray source !    */
/* Progress_bar is an Arm displaying simulation progress.               */
COMPONENT Origin = Progress_bar()
AT (0,0,0) ABSOLUTE
EXTEND
%{
  interacted=0;
%}

COMPONENT src = Source_div(
    radius=radiusin,yheight=0, xwidth=0,focus_aw=0,focus_ah=0,E0=5,dE=1)
AT(0,0,0) RELATIVE Origin

COMPONENT detector_pre_optics = PSD_monitor(restore_xray=1, xwidth=radiusin*2*1.2, yheight=radiusin*2*1.2, nx=101, ny=51, filename="det_preo.dat")
AT(0,0,1) RELATIVE Origin

COMPONENT optics_centre = Arm()
AT(0,0,1) RELATIVE Origin

COMPONENT Shell_p_1 = Shell_p(
    radius_p=radiusin, radius_m=radiusout, zdepth=plate_zdepth, Z0=FL, yheight=channel_yheight, R_d=1)
WHEN (shell_type==0) AT(0,0,plate_zdepth) RELATIVE optics_centre
EXTEND
%{
  if (SCATTERED)interacted+=SCATTERED;
%}

COMPONENT Shell_h_1 = Shell_h(
    radius_m=radiusin, radius_h=radiusout, zdepth=plate_zdepth, Z0=FL, yheight=channel_yheight, R_d=1)
WHEN(shell_type==1)AT(0,0,0) RELATIVE optics_centre
EXTEND
%{
  if (SCATTERED)interacted+=SCATTERED;
%}

COMPONENT shell_c_1 = Shell_c(
    radius_m=radiusin,Z0=FL,yheight=channel_yheight,length=plate_zdepth,primary=0, R_d=1)
WHEN(shell_type==2) AT(0,0,0) RELATIVE optics_centre
EXTEND
%{
  if (SCATTERED)interacted+=SCATTERED;
%}

COMPONENT filter = Arm()
AT(0,0,0) RELATIVE optics_centre
EXTEND
%{
  /*filter rays wich have not reflected*/
  if (!interacted){
    ABSORB;
  }
%}

COMPONENT detector_post_optics = PSD_monitor(restore_xray=1,xwidth=radiusin*2*1.2, yheight=radiusin*2*1.2, nx=201, ny=101, filename="det_posto.dat")
AT(0,0,1) RELATIVE optics_centre

COMPONENT FLmond= Monitor_nD(
        restore_xray=1,filename="FLmond",xwidth=0.1, yheight=0.1, options="x y auto",bins=501)
AT(0,0,FL) RELATIVE optics_centre
/* This section is executed when the simulation ends (C code). Other    */
/* optional sections are : SAVE                                         */
FINALLY
%{
%}
/* The END token marks the instrument definition end */
END