File: Test_source_lab.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 (86 lines) | stat: -rw-r--r-- 3,036 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
/*******************************************************************************
*         McXtrace instrument definition URL=http://www.mcxtrace.org
*
* Instrument: Test_source_lab
*
* %Identification
* Written by: Erik B Knudsen 
* Date: Jul. 8th 2014 
* Origin: DTU Physics
* Release: McXtrace 1.2
* %INSTRUMENT_SITE: Tests_sources
*
* Unit test instrument for the Source_lab component
*
* %Description
* This instrument serves as a unit test for the Source_lab component.
* The emon1-monitor catches the Kalpha-peaks, and emon2 the Kbeta peaks.
*
* %Example: Test_source_lab.instr Emax=40 Detector: emon1_I=7.16e+15
* %Example: Test_source_lab.instr Emax=40 Detector: emon2_I=1.17e+15
*
* %Parameters
* Emin: [keV] minimal energy of the photons at the source
* Emax: [keV] maximal energy of the photons at the source
* LO:   [0/1] activate Lorentzian line profile at the source
*
* %End
*******************************************************************************/

/* Change name of instrument and input parameters with default values */
DEFINE INSTRUMENT Test_source_lab(Emin=1, Emax=40, LO=1)

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

/* The INITIALIZE section is executed when the simulation starts     */
/* (C code). You may use them as component parameter values.         */
INITIALIZE
%{
%}

/* Here comes the TRACE section, where the actual      */
/* 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

/* /usr/local/lib/mcxtrace-1.1/data/Ga.tx t*/
COMPONENT source = Source_lab(
    width=1e-3,height=1e-3,thickness=200e-6,dist=1e-2,tube_current=5,
    E0=40,focus_xw=1e-3,focus_yh=1e-3,material_datafile="Mo.txt",
    Emin=Emin, Emax=Emax, lorentzian=LO)
AT (0, 0, 0) RELATIVE Origin

COMPONENT emon0=E_monitor(
      Emin=0, Emax=80, nE=400, filename="emon0", xwidth=1e-2, yheight=1e-2)
AT(0,0,0.1) RELATIVE source

COMPONENT emon1=E_monitor(
      Emin=16, Emax=18, nE=400, filename="emon1", xwidth=1e-2, yheight=1e-2)
AT(0,0,0.11) RELATIVE source

COMPONENT emon2=E_monitor(
    Emin=18, Emax=22, nE=400, filename="emon2", xwidth=1e-2, yheight=1e-2)
AT(0,0,0.12) RELATIVE source

/* 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