Update model from DMSC version for McStas 3.x

This commit is contained in:
2025-10-24 14:48:27 +02:00
parent 6e0d611e73
commit c85792ef22
3 changed files with 70 additions and 38 deletions

View File

@@ -79,8 +79,6 @@ double selene1_center;
double selene1_shift;
double selene1_rot;
int p_int=0; // a flag that gets incremented if a polarizer mirror scatters
// Selene 2
@@ -107,14 +105,22 @@ double velocity_max ; // m/s neutron velocity of lambda_min
double analyzer_max_height = 0.01; // Maximum sample height to be covered by te polarization analyzers
double analyzer_flipper_start = 0.4; // Distance from sample to analyzer flipper
double analyzer1_start = 0.65; // Distance to sample to start the first analyzer
double analyzer1_length = 1.3; // length of first analyzer
double analyzer2_start = 0.7; // Distance to sample to start the first analyzer
double analyzer2_length = 1.6; // length of first analyzer
double Theta1_analyzer1, Theta1_analyzer2, Theta2_analyzer1, Theta2_analyzer2, dist_ana_vfocus; // quantities calculated out of values above and 1.5 degree covered divergence
%}
USERVARS %{
int p_int; // a flag that gets incremented if a polarizer mirror scatters
%}
INITIALIZE
%{
// chopper coupling together
@@ -237,17 +243,15 @@ COMPONENT chopper = DiskChopper(radius=chopper_diameter/2.0, yheight=0.02,
AT (0, 0, chopper_pos-2*NBOA_c) RELATIVE arm_virtual_source_beam
COMPONENT vs_divergence_h = DivPos_monitor(nh=21, ndiv=41, filename="vs_hordiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv_h=2.0,
COMPONENT vs_divergence_h = DivPos_monitor(nb=21, ndiv=41, filename="vs_hordiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv=2.0,
restore_neutron=1)
AT (0, 0, -0.5*sample_length-0.001) RELATIVE arm_selene1
COMPONENT vs_divergence_v = DivPos_monitor(nh=21, ndiv=41, filename="vs_verdiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv_h=2.0,
restore_neutron=1)
COMPONENT vs_divergence_v = DivPos_monitor(nb=21, ndiv=41, filename="vs_verdiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv=2.0,
restore_neutron=1, vertical=1)
AT (0, 0, -0.5*sample_length-0.001) RELATIVE arm_selene1
ROTATED (0,0,90) RELATIVE arm_selene1
/* The actual virtual source mask, two L-shaped absorbers (first top-right) */
COMPONENT virtual_source_TR = Slit(
@@ -345,13 +349,43 @@ COMPONENT si_sample = Mirror(
ROTATED (0, 90, 0) RELATIVE arm_sample
COMPONENT arm_analyzer = Arm()
/* Rotate spin 90 degrees*/
COMPONENT arm_hack = Arm()
AT (0, 0, 0) RELATIVE arm_sample
EXTEND %{
double tmp = sy;
sy = sx;
sx = -tmp;
%}
/* flipped arm detector to position analyzer correctly for beam path 1*/
COMPONENT arm_detector2 = Arm()
AT (0, 0, 0) RELATIVE arm_detector
ROTATED (-selene_theta+(Theta1_analyzer1-Theta2_analyzer1)/2.0, 0, 0) RELATIVE arm_detector
ROTATED (0,0,180) RELATIVE arm_detector
COMPONENT arm_analyzer = Arm()
AT (0, 0, 0) RELATIVE arm_detector2
ROTATED (-selene_theta+(Theta1_analyzer1-Theta2_analyzer1)/2.0, 0, 0) RELATIVE arm_detector2
COMPONENT virtual_analyzer_flipper = Arm() // Gone -> Pol_SF_ideal(ny=1, xwidth=1, yheight=1, zdepth=0.001)
WHEN (enable_analyzer>2)
AT (0, 0, analyzer_flipper_start) RELATIVE arm_analyzer
ROTATED (0,0,0.0) RELATIVE arm_analyzer
EXTEND %{
if(INSTRUMENT_GETPAR(enable_analyzer)>2) sx *=-1;
%}
COMPONENT arm_analyzer2 = Arm()
AT (0, 0, 0) RELATIVE arm_detector
ROTATED (-selene_theta+(Theta1_analyzer2-Theta2_analyzer2)/2.0, 0, 0) RELATIVE arm_detector
AT (0, 0, 0) RELATIVE arm_detector2
ROTATED (-selene_theta+(Theta1_analyzer2-Theta2_analyzer2)/2.0, 0, 0) RELATIVE arm_detector2
/* polarization analyser */
COMPONENT analyzer1 = Polariser(enable_ref=1, d_substrate = 5e-4, reflect_d=0, reflect_u=0, lin=analyzer1_start, length=analyzer1_length,
@@ -365,8 +399,8 @@ COMPONENT analyzer2 = Polariser(enable_ref=1, d_substrate = 5e-4, reflect_d=0, r
delta_theta=(Theta1_analyzer2+Theta2_analyzer2+0.05)*PI/180.0, h2=0.2, h1=0.05, abs_out=0,
m_u=5.0, m_d=0.65, both_coated=1, alpha=2.3, W = 0.0014)
WHEN enable_analyzer==2
AT (0, 0.0, analyzer2_start) RELATIVE arm_analyzer
ROTATED (0,0,0.0) RELATIVE arm_analyzer
AT (0, 0.0, analyzer2_start) RELATIVE arm_analyzer2
ROTATED (0,0,0.0) RELATIVE arm_analyzer2
/* detector */
COMPONENT tof_detector = Monitor_nD(

View File

@@ -144,7 +144,7 @@ COMPONENT NBOA_window=Al_window(thickness=NBOA_Al_entrance_length)
AT (0,0,NBOA_Al_entrance_start) RELATIVE ISCS
COMPONENT NBOA_side = AbsorberFixed(xmin=NBOA_side_x, xmax=NBOA_side_x+0.012,
COMPONENT NBOA_side = Absorber(xmin=NBOA_side_x, xmax=NBOA_side_x+0.012,
ymin=-0.2, ymax=0.2,
zmin=0.0, zmax=E02_01_01_Cu_length+E02_01_01_length+E02_01_02_length+E02_01_03_length)
AT (0, 0, E02_01_01_Cu_start) RELATIVE ISCS
@@ -181,7 +181,7 @@ COMPONENT NBOA_Cu_collimator=Guide_gravity(
* feeder neutron guide *
************************/
COMPONENT E02_01_011_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_01_011_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_01_011_wh/2.0, ymax=E02_01_011_wh/2.0,
zmin=0.0, zmax=E02_01_01_length-0.5)
AT (0, 0, E02_01_01_start) RELATIVE ISCS
@@ -190,7 +190,7 @@ COMPONENT E02_01_011_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_01_012_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_01_012_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_01_012_wh/2.0, ymax=E02_01_012_wh/2.0,
zmin=0.5-E02_01_01_Cu_length, zmax=E02_01_01_length)
AT (0, 0, E02_01_01_start) RELATIVE ISCS
@@ -210,7 +210,7 @@ COMPONENT E02_01_01 = Elliptic_guide_gravity(
enableGravity=enable_gravity)
AT (0, 0, E02_01_01_start) RELATIVE ISCS
COMPONENT E02_01_021_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_01_021_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_01_021_wh/2.0, ymax=E02_01_021_wh/2.0,
zmin=0.0, zmax=E02_01_02_length/2.0)
AT (0, 0, E02_01_02_start) RELATIVE ISCS
@@ -219,7 +219,7 @@ COMPONENT E02_01_021_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_01_022_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_01_022_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_01_022_wh/2.0, ymax=E02_01_022_wh/2.0,
zmin=E02_01_02_length/2.0, zmax=E02_01_02_length)
AT (0, 0, E02_01_02_start) RELATIVE ISCS
@@ -238,7 +238,7 @@ COMPONENT E02_01_02 = Elliptic_guide_gravity(
enableGravity=enable_gravity)
AT (0, 0, E02_01_02_start) RELATIVE ISCS
COMPONENT E02_01_031_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_01_031_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_01_031_wh/2.0, ymax=E02_01_031_wh/2.0,
zmin=0.0, zmax=0.5)
AT (0, 0, E02_01_03_start) RELATIVE ISCS
@@ -247,7 +247,7 @@ COMPONENT E02_01_031_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_01_032_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_01_032_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_01_032_wh/2.0, ymax=E02_01_032_wh/2.0,
zmin=0.5, zmax=1.0)
AT (0, 0, E02_01_03_start) RELATIVE ISCS
@@ -256,7 +256,7 @@ COMPONENT E02_01_032_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_01_033_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_01_033_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_01_033_wh/2.0, ymax=E02_01_033_wh/2.0,
zmin=1.0, zmax=E02_01_03_length)
AT (0, 0, E02_01_03_start) RELATIVE ISCS
@@ -299,7 +299,7 @@ COMPONENT NFGA_Al_window_in=Al_window(
WHEN enable_windows
AT (0,0,NFGA_Al_start) RELATIVE ISCS
COMPONENT NFGA_side1 = AbsorberFixed(xmin=NFGA_side_x1, xmax=NFGA_side_x1+0.008,
COMPONENT NFGA_side1 = Absorber(xmin=NFGA_side_x1, xmax=NFGA_side_x1+0.008,
ymin=-0.2, ymax=0.2,
zmin=0.002, zmax=0.502)
AT (0, 0, E02_02_01_start-0.002) RELATIVE ISCS
@@ -309,7 +309,7 @@ COMPONENT NFGA_side1 = AbsorberFixed(xmin=NFGA_side_x1, xmax=NFGA_side_x1+0.008,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT NFGA_side2 = AbsorberFixed(xmin=NFGA_side_x2, xmax=NFGA_side_x2+0.008,
COMPONENT NFGA_side2 = Absorber(xmin=NFGA_side_x2, xmax=NFGA_side_x2+0.008,
ymin=-0.2, ymax=0.2,
zmin=0.502, zmax=E02_02_01_length+E02_02_02_length+E02_02_03_length+0.002)
AT (0, 0, E02_02_01_start-0.002) RELATIVE ISCS
@@ -321,7 +321,7 @@ COMPONENT NFGA_side2 = AbsorberFixed(xmin=NFGA_side_x2, xmax=NFGA_side_x2+0.008,
%}
// in-bunker feeder segments
COMPONENT E02_02_011_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_02_011_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_02_011_wh/2.0, ymax=E02_02_011_wh/2.0,
zmin=0.0, zmax=E02_02_01_length/2.0)
AT (0, 0, E02_02_01_start) RELATIVE ISCS
@@ -330,7 +330,7 @@ COMPONENT E02_02_011_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_02_012_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_02_012_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_02_012_wh/2.0, ymax=E02_02_012_wh/2.0,
zmin=E02_02_01_length/2.0, zmax=E02_02_01_length)
AT (0, 0, E02_02_01_start) RELATIVE ISCS
@@ -349,7 +349,7 @@ COMPONENT E02_02_01 = Elliptic_guide_gravity(
enableGravity=enable_gravity)
AT (0, 0, E02_02_01_start) RELATIVE ISCS
COMPONENT E02_02_021_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_02_021_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_02_021_wh/2.0, ymax=E02_02_021_wh/2.0,
zmin=0.0, zmax=E02_02_02_length/2.0)
AT (0, 0, E02_02_02_start) RELATIVE ISCS
@@ -358,7 +358,7 @@ COMPONENT E02_02_021_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_02_022_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_02_022_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_02_022_wh/2.0, ymax=E02_02_022_wh/2.0,
zmin=E02_02_02_length/2.0, zmax=E02_02_02_length)
AT (0, 0, E02_02_02_start) RELATIVE ISCS
@@ -377,7 +377,7 @@ COMPONENT E02_02_02 = Elliptic_guide_gravity(
enableGravity=enable_gravity)
AT (0, 0, E02_02_02_start) RELATIVE ISCS
COMPONENT E02_02_031_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_02_031_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_02_031_wh/2.0, ymax=E02_02_031_wh/2.0,
zmin=0.0, zmax=0.5)
AT (0, 0, E02_02_03_start) RELATIVE ISCS
@@ -386,7 +386,7 @@ COMPONENT E02_02_031_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_02_032_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_02_032_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_02_032_wh/2.0, ymax=E02_02_032_wh/2.0,
zmin=0.5, zmax=1.0)
AT (0, 0, E02_02_03_start) RELATIVE ISCS
@@ -395,7 +395,7 @@ COMPONENT E02_02_032_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
ALLOW_BACKPROP;
PROP_Z0;
%}
COMPONENT E02_02_033_wedge = AbsorberFixed(xmin=-0.1, xmax=0.0,
COMPONENT E02_02_033_wedge = Absorber(xmin=-0.1, xmax=0.0,
ymin=-E02_02_033_wh/2.0, ymax=E02_02_033_wh/2.0,
zmin=1.0, zmax=E02_02_03_length)
AT (0, 0, E02_02_03_start) RELATIVE ISCS

View File

@@ -153,7 +153,6 @@ COMPONENT polarizer2_lin = Pol_mirror(zwidth = pol2_lin_length, yheight = pol_hf
GROUP polarizer2_set
EXTEND
%{
p_int=0; // reset for each trace
if (SCATTERED==2) {
p_int +=2;
}
@@ -223,14 +222,13 @@ COMPONENT replacement_pol1_set = Slit(xwidth=0.2, yheight=0.2)
COMPONENT mf_divergence_h = DivPos_monitor(nh=21, ndiv=41, filename="mf_hordiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv_h=2.0)
COMPONENT mf_divergence_h = DivPos_monitor(nb=21, ndiv=41, filename="mf_hordiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv=2.0)
AT (0, 0, 0) RELATIVE arm_polarizer
COMPONENT mf_divergence_v = DivPos_monitor(nh=21, ndiv=41, filename="mf_verdiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv_h=2.0)
COMPONENT mf_divergence_v = DivPos_monitor(nb=21, ndiv=41, filename="mf_verdiv",
xmin=-0.02, xmax=0.02, ymin=-0.02, ymax=0.02, maxdiv=2.0, vertical=1)
AT (0, 0, 0) RELATIVE arm_polarizer
ROTATED (0,0,90) RELATIVE arm_polarizer