File: Test_Detector_pn.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 (73 lines) | stat: -rw-r--r-- 2,228 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
/*******************************************************************************
* Instrument: <instrument name>
*
* %Identification
* Written by: Erik B Knudsen <erkn@fysik.dtu.dk>
* Date: Apr 20
* Origin: DTU Physics
* Version: 1.0
* %INSTRUMENT_SITE: Tests
*
* Unit test for Detector_pn
*
* %Description
* A simple unit test instrument for the Detector_pn component. It consists merely of
* two sets of monitor each with: 
*  1 regular PSD_monitor and 2 instances of Detector_pn with a scinitillator screen of
*  Si and Pb respectively. Obviously, no sane person would use Pb, but it's there for 
*  illustration purposes.
* A restore_flag parameter may be passed to Detector_pn which negates the absorption
* effect for subsequent components.
*
* %Example: Test_Detector_pn restore_flag=1 Detector: detap2_I=1.02182e-06
*
* %Parameters
* restore_flag: [ ]   Should the monitor/detector instances restore the x-ray to its pre-detector state
* E0:           [keV] The central simulation energy to use. A 1% BW will be added. 
* DE:           [keV] Half energy width of the simulation energy.
* 
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_Detector_pn(restore_flag=0, E0=12.4, DE=0.124)

DECLARE
%{	
	char material1[]="Si.txt";
	char material2[]="Pb.txt";
%}

INITIALIZE
%{
%}

TRACE

COMPONENT origin = Progress_bar()
AT (0, 0, 0) RELATIVE ABSOLUTE

COMPONENT source = Source_flat(xwidth=1e-3,yheight=1e-3, focus_xw=0.5e-2, focus_yh=0.45e-2,dist=1, E0=E0, dE=DE)
AT(0,0,0) RELATIVE origin 

COMPONENT psrc = PSD_monitor(restore_xray=restore_flag, filename="psrc", xwidth=1e-2, yheight=1e-2)
AT(0,0,1) RELATIVE source

COMPONENT detsrc1 = Detector_pn(restore_xray=restore_flag,filename="detsrc1", material_datafile=material1, xwidth=1e-2, yheight=1e-2,zdepth=1e-5)
AT(0,0,0.1) RELATIVE psrc

COMPONENT detsrc2 = COPY(detsrc1)(filename="detsrc2", material_datafile=material2)
AT(0,0,1e-4) RELATIVE detsrc1

COMPONENT pap = COPY(psrc)(filename="pap")
AT(0,0,0.1) RELATIVE PREVIOUS

COMPONENT detap1 = COPY(detsrc1)(filename="detap1")
AT(0,0,0.1) RELATIVE pap 

COMPONENT detap2 = COPY(detsrc2)(filename="detap2")
AT(0,0,1e-4) RELATIVE detap1

FINALLY
%{
%}

END