Skip to content

Commit 4c55318

Browse files
author
Emmanuel FARHI
committed
mcxtrace: Test SX: add FluoCrystal test values. Remove TTH
1 parent 261327c commit 4c55318

1 file changed

Lines changed: 22 additions & 24 deletions

File tree

mcxtrace-comps/examples/Tests_samples/Test_SX/Test_SX.instr

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,56 @@
1515
* Simply a model source illuminating a SX sample.
1616
* The sample itself is a Mo bulk crystal.
1717
*
18-
* %Example: TTH=13.4 index=1 Detector: psd4pi_I=7.95747e-10
19-
* %Example: TTH=13.4 index=2 Detector: psd4pi_I=7.95747e-10
18+
* %Example: index=1 Detector: psd4pi_I=1.18843e-13
19+
* %Example: index=2 Detector: psd4pi_I=4.80386e-13
2020
*
2121
* %Parameters
22-
* TTH: [deg] Two theta rotation. Only places the last detector.
2322
* reflections: [str] List of powder reflections, LAU/CIF format.
2423
* index: [1] Index of the sample component to use. 1=Single_crystal, 2=FluoCrystal
2524
*
2625
* %End
2726
*******************************************************************************/
2827

29-
DEFINE INSTRUMENT Test_SX(TTH=13.4, string reflections="Mo.lau", index=1)
28+
DEFINE INSTRUMENT Test_SX(string reflections="Mo.lau", index=1)
29+
30+
USERVARS %{
31+
int Stype;
32+
%}
3033

3134
TRACE
3235
COMPONENT src = Source_flat(
3336
yheight = 1e-3, xwidth = 1e-3, dist = 10, focus_xw = 1e-3,
3437
focus_yh = 1e-3, E0 = 7, dE = 6.9)
3538
AT (0, 0, 0) ABSOLUTE
3639

37-
COMPONENT psd0 = PSD_monitor(
38-
nx = 100, ny = 100, filename = "psd0", xwidth = 2e-3, yheight = 2e-3)
39-
AT (0, 0, 1e-9) RELATIVE src
40-
4140
COMPONENT sample_pos=Arm()
4241
AT (0, 0, 10) RELATIVE PREVIOUS
4342

4443
COMPONENT sample = Single_crystal(reflections=reflections, material_datafile="NULL",
45-
radius = .5e-4, yheight = 1e-3,mosaic=1e-4)
44+
radius = .5e-4, yheight = 1e-3, mosaic=1)
4645
WHEN(index==1)
4746
AT (0, 0, 0) RELATIVE sample_pos
48-
/*EXTEND %{*/
49-
/* if(!SCATTERED) ABSORB;*/
50-
/*%}*/
47+
EXTEND %{
48+
if(!SCATTERED) ABSORB;
49+
else Stype=DIFFRACTION;
50+
%}
5151

5252
COMPONENT sampleF = FluoCrystal(material=reflections,
53-
radius = .5e-4, yheight = 1e-3,sx_mosaic=5)
53+
radius = .5e-4, yheight = 1e-3, sx_mosaic=5)
5454
WHEN(index==2)
5555
AT (0, 0, 0) RELATIVE sample_pos
56+
EXTEND %{
57+
if(!SCATTERED) ABSORB;
58+
else Stype=type;
59+
%}
5660

5761
COMPONENT psd4pi = PSD_monitor_4PI(
5862
nx = 180, ny = 180, filename = "psd4pi", radius = 0.1, restore_xray = 1)
5963
AT (0, 0, 0) RELATIVE sample
6064

61-
/*COMPONENT detector = PSD_monitor(*/
62-
/* nx=200, ny=200, xwidth=0.1, yheight=0.1, filename="psd1",restore_xray=1)*/
63-
/*AT(0,0,0.1) RELATIVE sample*/
64-
/**/
65-
/*COMPONENT ttharm= Arm()*/
66-
/*AT(0,0,0) RELATIVE sample*/
67-
/*ROTATED (TTH,TTH,0) RELATIVE sample*/
68-
/**/
69-
/*COMPONENT detector2 = PSD_monitor(*/
70-
/* nx=200, ny=200, xwidth=2e-3, yheight=1e-2, filename="psd2",restore_xray=1)*/
71-
/*AT(0,0,0.1) RELATIVE ttharm*/
65+
COMPONENT psd_Diff = PSD_monitor_4PI(
66+
nx = 180, ny = 180, filename = "psd4pi_diff", radius = 0.1, restore_xray = 1)
67+
WHEN (Stype == DIFFRACTION)
68+
AT (0, 0, 0) RELATIVE sample
69+
7270
END

0 commit comments

Comments
 (0)