File: Unittest_SPLIT.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 (67 lines) | stat: -rw-r--r-- 1,148 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
/*******************************************************************************
* Instrument: Unittest_SPLIT
*
* %I
* Written by: Peter Willendrup
* Date: Oct 28th, 2021
* Origin: DTU
* %INSTRUMENT_SITE: Tests_grammar
*
* SPLIT unittest
*
* %D
* SPLIT unittest.
* 
* One unit of intensity is emitted from a 1x1 m.
*
*
* %Example: SPLITS=1 Detector: PSD_I=1
* %Example: SPLITS=10 Detector: PSD_I=1
* %Example: SPLITS=100 Detector: PSD_I=1
*
* %P
* SPLITS: [1] Number of SPLIT to do
* Pp0:   [1] Dummy input parameter used internally
*
* %L
* <reference/HTML link>
*
* %E
*******************************************************************************/
DEFINE INSTRUMENT Unittest_SPLIT(int SPLITS=10, Pp0=1)

DECLARE
%{
%}

USERVARS
%{
%}

INITIALIZE
%{
  Pp0=1.0/mcget_ncount();
%}

TRACE

COMPONENT Arm = Arm()
  AT (0,0,0) ABSOLUTE
EXTEND %{
  // position x in one of 100 bins
  x = rand01()-0.5;
  y = rand01()-0.5;
  p = INSTRUMENT_GETPAR(Pp0);
%}

SPLIT SPLITS COMPONENT Slit = Arm()
  AT (0,0,0) ABSOLUTE
  
COMPONENT PSD = PSD_monitor(xwidth=2.0, yheight=2.0, filename="splits", nx=100, ny=100)
  AT (0,0,0.1) ABSOLUTE
  
FINALLY
%{
%}

END