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
|
/*******************************************************************************
*
* Instrument: Test_MCPL_output
*
* %Identification
* Written by: Erik B Knudsen <erkn@fysik.dtu.dk>
* Date: Mar 2016
* Origin: DTU
* %INSTRUMENT_SITE: Tests
*
* A test instrument for MCPL_output
*
* %Description
*
* This is a unit test for the MCPL_output component.
*
* %Example: Ncount=1e3 -n1e3 merge=0 Detector: m1_I=7.9657e-08
*
* %Parameters
* merge: [1] Flag to indicate if we should merge the output in case of MPI
* Ncount:[1] Override the number of rays to simulate.
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_MCPL_output(merge=1, Ncount=1e3)
USERVARS
%{
double flag;
%}
INITIALIZE
%{
mcset_ncount((int)ceil(Ncount));
%}
TRACE
COMPONENT Origin = Progress_bar()
AT (0, 0, 0) ABSOLUTE
/* the source ============================================================== */
COMPONENT sa = Source_flat(
lambda0=1, dlambda=0.5,focus_xw=0.01, focus_yh=0.01, dist=10, xwidth=1e-3, yheight=1e-4)
AT(0,0,0) RELATIVE Origin
EXTEND %{
t=1e-3*rand01();
flag=(double)mcget_run_num();
%}
/* the output ============================================================== */
COMPONENT vout = MCPL_output(
filename="voutput", verbose=1, userflag="flag", userflagcomment="Photon Id", merge_mpi=merge)
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
END
|