File: templateSasView.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 (119 lines) | stat: -rw-r--r-- 3,791 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*******************************************************************************
*
* McStas, neutron ray-tracing package
*         Copyright (C) 1997-2023, All rights reserved
*         Risoe National Laboratory, Roskilde, Denmark
*         Institut Laue Langevin, Grenoble, France
*
* Instrument: templateSasView
*
* %Identification
* Written by: Torben Nielsen 
* Origin: DTU Physics / ESS DMSC
* 
*
* %INSTRUMENT_SITE: Templates
*
* Test instrument for some SasView_model components. No guide / velocity selector
* etc.
*
* %Description
*
* Very simple test instrument for the SasView_model component
*
* %Example: model_index=1 Ncount=1e6 par1=4 par2=1 par3=40 par4=20 par5=400 Detector: detector_I=5e6
* %Example: model_index=3 Ncount=1e6 par1=220 par2=0.06 par3=40 par4=4 par5=1 Detector: detector_I=3.3e4
* %Example: model_index=47 Ncount=1e6 par1=4 par2=2 par3=35 par4=75 par5=400 Detector: detector_I=2.5e6
*
* %Parameters
* lambda: [AA]   Mean wavelength of neutrons
* dlambda: [AA]  Wavelength spread of neutrons
* model_index: [ ] SASmodels model index (see SasView_model.comp mcdoc page)
* par1: [ ] Slot 1 in SASmodel parameter vector
* par2: [ ] Slot 2 in SASmodel parameter vector
* par3: [ ] Slot 3 in SASmodel parameter vector
* par4: [ ] Slot 4 in SASmodel parameter vector
* par5: [ ] Slot 5 in SASmodel parameter vector
* par6: [ ] Slot 6 in SASmodel parameter vector
* par7: [ ] Slot 7 in SASmodel parameter vector
* par8: [ ] Slot 8 in SASmodel parameter vector
*
* %Link
* %End
*******************************************************************************/
DEFINE INSTRUMENT templateSasView(lambda=6, dlambda=0.05, model_index=47, par1=0, par2=0, par3=0, par4=0, par5=0, par6=0, par7=0, par8=0, Ncount=0)

DECLARE %{
%}

INITIALIZE %{

  if (Ncount>0)
    mcset_ncount(Ncount);

%}

TRACE

COMPONENT a1 = Progress_bar()
  AT (0,0,0) ABSOLUTE

COMPONENT arm = Arm()
  AT (0, 0, 0) ABSOLUTE

COMPONENT source = Source_simple(
    radius = 0.02, dist = 3, focus_xw = 0.01, focus_yh = 0.01,
    lambda0 = lambda, dlambda = dlambda, flux = 1e8)
  AT (0, 0, 0) RELATIVE arm

COMPONENT coll1 = Slit(
    radius = 0.005)
  AT (0, 0, 3) RELATIVE arm

COMPONENT coll2 = Slit(
    radius = 0.005)
  AT (0, 0, 6) RELATIVE arm

SPLIT COMPONENT sample = Arm()
  AT (0, 0, 0.2) RELATIVE coll2

COMPONENT sample1= SasView_barbell(model_scale=1,model_abs=0.0,
				   sld=par1,sld_solvent=par2,radius_bell=par3,radius=par4,length=par5,
				      xwidth=0.01, yheight=0.01, zdepth=0.005,focus_xw=0.6, focus_yh=0.6, target_index=1)
WHEN (model_index==1) AT (0,0,0.2) RELATIVE coll2
EXTEND %{
  if (!SCATTERED) ABSORB;
%}

COMPONENT sample3= SasView_bcc_paracrystal(model_scale=1,model_abs=0.0,
					   dnn=par1, d_factor=par2, radius=par3, sld=par4, sld_solvent=par5,
				      xwidth=0.01, yheight=0.01, zdepth=0.005,focus_xw=0.6, focus_yh=0.6, target_index=1)
WHEN (model_index==3) AT (0,0,0.2) RELATIVE coll2
EXTEND %{
  if (!SCATTERED) ABSORB;
%}

COMPONENT sample47= SasView_parallelepiped(model_scale=1,model_abs=0.0,
				      sld=par1,sld_solvent=par2,length_a=par3,length_b=par4,length_c=par5,
				      xwidth=0.01, yheight=0.01, zdepth=0.005,focus_xw=0.6, focus_yh=0.6, target_index=1)
WHEN (model_index==47) AT (0,0,0.2) RELATIVE coll2
EXTEND %{
  if (!SCATTERED) ABSORB;
%}

COMPONENT detector = PSD_monitor(
    nx = 128, ny = 128, filename = "PSD.dat", xmin = -0.3,
    xmax = 0.3, ymin = -0.3, ymax = 0.3)
  AT (0, 0, 3) RELATIVE sample

COMPONENT Ldetector = L_monitor(
    nL = 1000, filename = "Edet.dat", xmin = -0.3,
    xmax = 0.3, ymin = -0.3, ymax = 0.3, Lmin = 5.5,
    Lmax = 6.5)
  AT (0, 0, 3.01) RELATIVE sample

COMPONENT PSDrad = PSD_monitor_rad(
    filename = "psd2.dat", filename_av = "psd2_av.dat", rmax = 0.3)
  AT (0, 0, 3.02) RELATIVE sample

END