Skip to content

Commit 867a2ce

Browse files
committed
Add a test to FZ_Juelich/FZJ_BenchmarkSfin2 (based on defaults)
1 parent 8384c28 commit 867a2ce

1 file changed

Lines changed: 43 additions & 6 deletions

File tree

mcstas-comps/examples/FZ_Juelich/FZJ_BenchmarkSfin2/FZJ_BenchmarkSfin2.instr

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
*
1313
* %INSTRUMENT_SITE: FZ_Juelich
1414
*
15+
* Test instrument for the H Frielinghaus SANS_benchmark2 component.
16+
*
17+
* The below test uses defaults of the instrument (SANS_benchmark2 modnum=11)
18+
* %Example: -y Detector: PSDnear_I=8000
19+
*
1520
* %Parameters
1621
* cnum: [] Set to 0.0 for no polarizer as for benchmarking the normal SANS samples, to 2.0 for two cavities, keep default values as much as possible
1722
* lbdmin: []
@@ -53,6 +58,13 @@ bandwidth for detector distances:
5358
DECLARE
5459
%{
5560
%}
61+
62+
USERVARS
63+
%{
64+
int BS1; // Flag to signal if below radius of "virtual beamstop 1"
65+
int BS2; // Flag to signal if below radius of "virtual beamstop 2"
66+
%}
67+
5668
INITIALIZE
5769
%{
5870
%}
@@ -178,17 +190,42 @@ COMPONENT det = TOFSANSdet( plength=0.003163, ssdist=22.0124+2.0*bendL+PolTot
178190
AT (0,0,20.0100) RELATIVE guide2
179191
ROTATED (0,0,0) RELATIVE vorpl
180192

181-
/*
182-
COMPONENT det1 = Monitor_nD_mod(xmin=-0.5, xmax=0.5, ymin=-0.5, ymax=0.5, xytr=0.1,
193+
COMPONENT Virtual_Beamstop_near = Arm()
194+
AT (0,0,Clen*0.2-0.001) RELATIVE sample
195+
EXTEND %{
196+
PROP_Z0;
197+
double r2=x*x + y*y;
198+
if ( r2 < 0.1*0.1 || r2 > 0.5*0.5 ) {
199+
BS1=1;
200+
}
201+
%}
202+
203+
COMPONENT PSDnear = PSD_monitor(xwidth=1, yheight=1, restore_neutron=1, nx=300, ny=300)
204+
WHEN !BS1 AT (0,0,Clen*0.2) RELATIVE sample
205+
206+
COMPONENT det1 = Monitor_nD(xmin=-0.5, xmax=0.5, ymin=-0.5, ymax=0.5,
183207
options ="kxy bins=300 limits=[0.0025,0.80]", filename ="short_dist.txt")
184-
AT (0,0, Clen*0.2) RELATIVE sample
208+
WHEN !BS1 AT (0,0, Clen*0.2) RELATIVE sample
185209
ROTATED (0,0,0) RELATIVE vorpl
186210

187-
COMPONENT det2 = Monitor_nD_mod(xmin=-0.5, xmax=0.5, ymin=-0.5, ymax=0.5, xytr=0.02,
211+
COMPONENT Virtual_Beamstop_far = Arm()
212+
AT (0,0,Clen-0.001) RELATIVE sample
213+
EXTEND %{
214+
PROP_Z0;
215+
double r2=x*x + y*y;
216+
if ( r2 < 0.02*0.02 || r2 > 0.5*0.5 ) {
217+
BS2=1;
218+
}
219+
%}
220+
221+
COMPONENT PSDfar = PSD_monitor(xwidth=1, yheight=1, restore_neutron=1, nx=300, ny=300)
222+
WHEN !BS2 AT (0,0,Clen) RELATIVE sample
223+
224+
COMPONENT det2 = Monitor_nD(xmin=-0.5, xmax=0.5, ymin=-0.5, ymax=0.5,
188225
options ="kxy bins=300 limits=[0.0005,0.16]", filename ="long__dist.txt")
189-
AT (0,0, Clen ) RELATIVE sample
226+
WHEN !BS2 AT (0,0, Clen ) RELATIVE sample
190227
ROTATED (0,0,0) RELATIVE vorpl
191-
*/
228+
192229

193230
FINALLY
194231
%{

0 commit comments

Comments
 (0)