File: Test_MCPL_input.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 (90 lines) | stat: -rw-r--r-- 2,598 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
/*******************************************************************************
*         McXtrace instrument definition URL=http://www.mcxtrace.org
*
* Instrument: Test_MCPL_input
*
* %Identification
* Written by: Erik B Knudsen <erkn@fysik.dtu.dk>
* Date: Mar 2016
* Origin: DTU
* %INSTRUMENT_SITE: Tests
*
* A test instrument for MCPL_input
*
* %Description
*
* This is a unit test for the MCPL_input component.
*
* %Example: -n1e3 repeat=1 Detector: m1_I=7.9657e-08
*
* %Parameters
*
* repeat: [1]       Repeat the contents of the inputfile this many times. NB: When using MPI you implicitly repeat by #mpi processes
* E_smear: [1]      When repeating, make Gaussian MC choice on particle energy with spread E_smear * particle energy
* pos_smear: [m]    When repeating, make uniform MC choice on sphere of radius pos_spear around particle position
* dir_smear: [deg]  When repeating, make Gaussian MC choice in cone of opening dir_smear around particle direction
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_MCPL_input(repeat=1,E_smear=0.1,pos_smear=0.001,dir_smear=0.01)
DEPENDENCY "-DMCPLPATH=GETPATH(data/voutput.mcpl)"

DECLARE
%{
  long long ncount_i;
  
  #define QUOTE(name) #name
  #define STR(macro) QUOTE(macro)

  #ifndef MCPLPATH
  #define MCPLPATH=/usr/share/mcxtrace/1.6/MCPL/voutput.mcpl
  #endif

  #define MCPLFILE STR(MCPLPATH)
%}

INITIALIZE
%{


printf("Using the input file: %s\n", MCPLFILE);

 ncount_i=0;
%}

TRACE

COMPONENT Origin = Progress_bar()
  AT (0, 0, 0) ABSOLUTE /* read particles from an mcpl file*/

/* read photons from an mcpl file*/
COMPONENT vin = MCPL_input(filename=MCPLFILE,verbose=1,repeat_count=repeat,E_smear=E_smear,pos_smear=pos_smear,dir_smear=dir_smear)
AT( 0,0,0) RELATIVE PREVIOUS

COMPONENT m1 = Monitor_nD(
  xwidth=0.2, yheight=0.2,
  options="lambda limits=[0.1 11], parallel, previous", bins=40
) AT (0,0,0) ABSOLUTE

COMPONENT m2 = Monitor_nD(
  xwidth=0.2, yheight=0.2,
  options="x limits=[-0.005 0.005],  y limits=[-0.005 0.005], parallel, previous", bins=40
) AT (0,0,0) ABSOLUTE

COMPONENT m3 = Monitor_nD(
  xwidth=0.2, yheight=0.2,
  options="t limits=[0 1e-3]parallel, previous", bins=40
) AT (0,0,0) ABSOLUTE

COMPONENT m4 = Monitor_nD(
  xwidth=0.2, yheight=0.2,
  options="E, limits=[0 90] parallel, previous", bins=40
) AT (0,0,0) ABSOLUTE

COMPONENT m5 = Monitor_nD(
  xwidth=0.2, yheight=0.2, user1="22", username1="photons",
  options="parallel, previous, photon, user1, energy, x, y, z, vx, vy, vz, time, list all photons"
) AT (0,0,0) ABSOLUTE


END