File: Test_Source_quasi.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 (88 lines) | stat: -rw-r--r-- 3,037 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
/*******************************************************************************
*         McXtrace instrument definition URL=http://www.mcxtrace.org
*
* Instrument: Test_Source_quasi (rename also the example and DEFINE lines below)
*
* %Identification
* Written by: Erik B Knudsen (erkn@fysik.dtu.dk)
* Date: Feb 1st 2013
* Origin: DTU Fysik 
* Release: McXtrace 1.1
* Version: 1.0
* %INSTRUMENT_SITE: Tests_sources
*
* Test instrument to show that the quasi-stcohastic source component works
*
* %Description
* This instrument is a unit test for the quasi-stochastic source component.
*
* %Example: Test_Source_quasi.instr SRC=0 Detector: psd_I=1
* %Example: Test_Source_quasi.instr SRC=1 Detector: psd_I=1
*
* %Parameters
* SRC: [ ] Integer parameter picks a source model. 0=normal Source_div, 1=Quasi-stochastic
*
* %End
*******************************************************************************/

/* Change name of instrument and input parameters with default values */
DEFINE INSTRUMENT Test_Source_quasi(SRC=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 a photon source !    */
/* Progress_bar is an Arm displaying simulation progress.               */
COMPONENT Origin = Progress_bar()
  AT (0,0,0) ABSOLUTE

COMPONENT sd = Source_div(
    xwidth=1e-3, yheight=1e-3, focus_aw=0, focus_ah=0, lambda0=2.5, dlambda=0.2, gauss=1, gauss_a=0
)
WHEN (SRC==0) AT (0,0,0) RELATIVE Origin
COMPONENT sdq = Source_div_quasi(
    xwidth=1e-3, yheight=1e-3, focus_aw=0, focus_ah=0, lambda0=2.5, dlambda=0.2, gauss=1, gauss_a=0
)
WHEN (SRC==1) AT (0,0,0) RELATIVE Origin




COMPONENT lmon= L_monitor(
   restore_xray=1, xwidth=0.02, yheight=0.02,Lmin=2,Lmax=3.2,filename="lmon.dat")
AT(0,0,1) RELATIVE Origin
COMPONENT emon= E_monitor(
   restore_xray=1, xwidth=0.02, yheight=0.02,Emin=3,Emax=7,filename="emon.dat")
AT(0,0,1) RELATIVE Origin
COMPONENT psd= PSD_monitor(
   restore_xray=1, xwidth=0.0011, yheight=0.0011,nx=101, ny=101,filename="psdmon.dat")
AT(0,0,4) RELATIVE Origin



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