Skip to content

Commit

Permalink
Cleaning headers and code for Union tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mads-bertelsen committed Jul 23, 2024
1 parent 979b458 commit f90c9c9
Show file tree
Hide file tree
Showing 25 changed files with 42 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
* Origin: University of Copenhagen
* %INSTRUMENT_SITE: Tests_union
*
* Test of all Union conditional components
*
* %Description
* Use of all conditional components
* Use of all conditional components in one instrument file
*
* %Example: dummy=1 Detector: detector_scat_I=40.2053
* Example: dummy=1 Detector: test_logger_2D_space_zx_con_time_I=76662.3
* Example: dummy=1 Detector: test_logger_2D_space_zx_con_PSD_I=387.97
* %Example: dummy=1 Detector: test_logger_2D_space_zx_con_time_I=76662.3
* %Example: dummy=1 Detector: test_logger_2D_space_zx_con_PSD_I=387.97
*
* %Parameters
* dummy: [ ] Dummy input parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
* Origin: University of Copenhagen
* %INSTRUMENT_SITE: Tests_union
*
* Inserts external component in Union system with exit volumes and number_of_activations
*
* %Description
* Demonstration of the use of "number_of_activations" and exit volumes to
* include a regular McStas component in an ensemble of Union components.
* include a regular McStas component in an ensemble of Union components.
*
* Example: Detector: detector_I=213.109
* %Example: Detector: detector_I=213.109
*
* %Parameters
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Origin: University of Copenhagen
* %INSTRUMENT_SITE: Tests_union
*
* Test of all Union geometry components in one file
*
* %Description
* Use of all basic geometries, sphere, cylinder, cone and box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* Origin: Johns Hopkins University, Baltimore
* %INSTRUMENT_SITE: Tests_union
*
* Test of IncoherentPhonon_process
*
* %Description
* Test instrument for the IncoherentPhonon_process physics process from
* V. Laliena, Uni Zaragoza.
Expand All @@ -33,10 +35,10 @@
* %End
*******************************************************************************/

DEFINE INSTRUMENT IncoherentPhonon_test(int comp_select=1,sample_radius=0.01,sample_height=0.03,pack=1,
sigma_inc_vanadium=5.08,sigma_abs_vanadium=5.08,Vc_vanadium=13.827,geometry_interact=0.5,
int nphe_exact=1,int nphe_approx=0,int approx=0,int mph_resum=0,
T=294,density=6.0,M=50.94,sigmaCoh=0.0184,sigmaInc=5.08,string dosfn="dos_meV.txt",nxs=1000,kabsmin=0.1,kabsmax=25,
DEFINE INSTRUMENT IncoherentPhonon_test(int comp_select=1, sample_radius=0.01, sample_height=0.03, pack=1,
sigma_inc_vanadium=5.08, sigma_abs_vanadium=5.08, Vc_vanadium=13.827, geometry_interact=0.5,
int nphe_exact=1, int nphe_approx=0, int approx=0, int mph_resum=0,
T=294, density=6.0, M=50.94, sigmaCoh=0.0184, sigmaInc=5.08, string dosfn="dos_meV.txt", nxs=1000, kabsmin=0.1, kabsmax=25,
interact_fraction=-1)

DECLARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,10 @@ COMPONENT al_in_box_cut = Union_box(xwidth=0.01,yheight=0.001,zdepth=0.001, prio
AT (0,0.0019,-0.0019) RELATIVE sample_box_cut
ROTATED (30,0,0) RELATIVE sample_box_cut


COMPONENT sample_holder_under_sample = Union_box(xwidth=0.01, yheight=0.025, zdepth=0.002, priority=21, material_string="Al", p_interact=0.3)
AT (0,0,-0.005-0.0011) RELATIVE sample
ROTATED (0,0,0) RELATIVE sample


COMPONENT long_piece_center = Arm()
AT (0,-0.0225,0) RELATIVE beam_center
ROTATED (0,0,0) RELATIVE beam_center
Expand Down Expand Up @@ -252,7 +250,6 @@ COMPONENT test_logger_3D_space = Union_logger_3D_space(
AT (0,0,0) RELATIVE sample_pos
ROTATED (0,0,0) RELATIVE sample_pos


COMPONENT test_sample = Union_master()
AT(0,0,0) RELATIVE sample_pos
ROTATED(0,0,0) RELATIVE sample_pos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* without processes and just the make_material component, and requires
* a few special cases.
*
* Example: Detector: screen_I=5.91451e-06
* %Example: Detector: screen_I=5.91451e-06
*
* %End
*******************************************************************************/
Expand Down Expand Up @@ -59,7 +59,6 @@ COMPONENT cylinder = Union_cylinder(
AT (0,0,0) RELATIVE beam_center
ROTATED (0,0,0) RELATIVE beam_center


COMPONENT test_sample = Union_master()
AT(0,0,0) RELATIVE beam_center
ROTATED(0,0,0) RELATIVE beam_center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Simple test instrument showing absorption image of a cryostat with vanadium
* sample using the Union components.
*
* Example: Detector: screen_I=0.00925
* %Example: Detector: screen_I=0.00925
*
* %Parameters
* stick_displacement: [m] Displacement of sample stick
Expand Down Expand Up @@ -59,7 +59,6 @@ AT (0,0,0) ABSOLUTE
COMPONENT Absorber = Union_make_material(my_absorption=1000,absorber=1)
AT (0,0,0) ABSOLUTE


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

Expand All @@ -70,7 +69,6 @@ COMPONENT source = Source_div(
AT (0,0.35,0) RELATIVE a1
ROTATED (0,0,0) RELATIVE a1


// Sample position
COMPONENT beam_center = Arm()
AT (0,0,1.4) RELATIVE a1
Expand Down Expand Up @@ -194,7 +192,6 @@ COMPONENT sample = Union_cylinder(radius=0.008,yheight=0.042,priority=38,materia
AT (0,-0.01,-0.011) RELATIVE sample_holder3
ROTATED (-7,0,32) RELATIVE sample_holder3


COMPONENT test_sample = Union_master()
AT(0,0,0) RELATIVE beam_center
ROTATED(0,0,0) RELATIVE beam_center
Expand Down
10 changes: 1 addition & 9 deletions mcstas-comps/examples/Tests_union/Test_box/Test_box.instr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* be set, and when two or more geometries overlap, the one with highest
* priority determines what material is simulated in that region.
*
* Example: Detector: m4pi_both_I=4.8716e-10
* %Example: Detector: m4pi_both_I=4.8716e-10
*
* %End
*******************************************************************************/
Expand Down Expand Up @@ -59,23 +59,15 @@ COMPONENT source = Source_div(
dE = 0)
AT (0,0,0) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1

// test
//COMPONENT start_volume_test = cylinder(radius=0.03,yheight=1.4,priority=99,material_string="Vacuum")
//AT (0,0,0.7-0.02) RELATIVE a1
//ROTATED (90,0,0) RELATIVE a1


// Sample position
COMPONENT beam_center = Arm()
AT (0,0,1.4) RELATIVE a1
ROTATED (0,0,0) RELATIVE a1


COMPONENT tube_point = Arm()
AT (0,0,0) RELATIVE beam_center
ROTATED (0,0,0) RELATIVE beam_center


// V1
COMPONENT box_tube1 = Union_box(xwidth=0.1, yheight=0.15, xwidth2=0.03, yheight2=0.03, zdepth=0.045, priority=5, material_string="test_material")
AT (0,0,0) RELATIVE tube_point
Expand Down
6 changes: 1 addition & 5 deletions mcstas-comps/examples/Tests_union/Test_mask/Test_mask.instr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Masks allow restricing some geometry to the internal part of a mask
* geometry. All Union geometry components can be used as masks.
*
* Example: Detector: m4pi_I=2.27579e-07
* %Example: Detector: m4pi_I=2.27579e-07
*
* %End
*******************************************************************************/
Expand Down Expand Up @@ -62,7 +62,6 @@ COMPONENT beam_center = Arm()
AT (0,0,10.4) RELATIVE a1
ROTATED (0,0,0) RELATIVE a1


// Children tests
COMPONENT volume_1 = Union_box(xwidth=0.1,yheight=0.1,zdepth=0.1,priority=10,material_string="test_material")
AT (0,0,0) RELATIVE beam_center
Expand All @@ -88,8 +87,6 @@ COMPONENT mask_2_2 = Union_box(xwidth=0.015,yheight=0.015,zdepth=0.055,priority=
AT (0,0.0,0.0) RELATIVE beam_center
ROTATED (0,0,0) RELATIVE beam_center



COMPONENT test_sample = Union_master()
AT(0,0,0) RELATIVE beam_center
ROTATED(0,0,0) RELATIVE beam_center
Expand Down Expand Up @@ -122,5 +119,4 @@ COMPONENT m4pi_both = PSD_monitor_4PI(radius=1, nx=180, ny=180, filename="Events
COMPONENT stop = Union_stop()
AT (0,0,0) ABSOLUTE


END
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ AT (0,0,0) ABSOLUTE
COMPONENT test_material = Union_make_material(my_absorption=4)
AT (0,0,0) ABSOLUTE


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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ ROTATED (0,0,0) RELATIVE beam_center
SPLIT 1000 COMPONENT simulation_master = Union_master()
AT(0,0,0) RELATIVE beam_center
ROTATED(0,0,0) RELATIVE beam_center
EXTEND
%{
%}

COMPONENT monitor = L_monitor(filename="L_monitor_transmission.dat",
nL = 420, xwidth = 2.0*sample_wx, yheight = 2.0*sample_wy, Lmin = 1.9, Lmax = 6.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ COMPONENT transmission = PSD_monitor(
filename="PSD.dat", restore_neutron=1)
AT (0,0,1) RELATIVE geometry_center


COMPONENT stop = Union_stop()
AT (0,0,0) ABSOLUTE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT abs_logger_1D = Union_abs_logger_1D_space_event(
yheight=0.2, n=100, fake_event=1,
filename="Union_abs_logger_1D_space_event.dat")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* %Description
* Tests absorption logger measuring position projected onto a line and the
* time of absorption in a histogram.
* time of absorption in a histogram.
*
* %Example: Detector: abs_logger_1D_space_tof_I=1.12682e-09
*
Expand Down Expand Up @@ -73,7 +73,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT abs_logger_1D_space_tof = Union_abs_logger_1D_space_tof(
yheight=0.2, n=100,
time_min=0.0013, time_max=0.0022, time_bins=1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ AT (0.03,0,0.02) RELATIVE geometry_center
COMPONENT cylinder = Union_cylinder(radius=0.02, yheight=0.8, priority=7, material_string="material")
AT (-1.0,0,0.0) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT abs_logger_1D_space_tof_to_lambda = Union_abs_logger_1D_space_tof_to_lambda(
yheight=0.8, yn=100,
target_geometry="cylinder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT Union_abs_logger_2D_space_zx = Union_abs_logger_2D_space(
D_direction_1="z", D1_min=-0.15, D1_max=0.15, n1=200,
D_direction_2="x", D2_min=-0.1, D2_max=0.1, n2=200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT Union_abs_logger_event = Union_abs_logger_event(filename="Union_abs_logger_event")
AT (0,0,0) RELATIVE geometry_center

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT Union_logger_2D_space_zx = Union_logger_2D_space(
D_direction_1="z", D1_min=-0.15, D1_max=0.15, n1=200,
D_direction_2="x", D2_min=-0.1, D2_max=0.1, n2=200,
Expand Down Expand Up @@ -107,8 +106,6 @@ AT (0,0,0) RELATIVE geometry_center
COMPONENT master = Union_master()
AT (0,0,0) RELATIVE geometry_center



COMPONENT transmission = PSD_monitor(
xwidth=0.1, yheight=0.08, nx=200, ny=200,
filename="PSD.dat", restore_neutron=1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
* Origin: ESS
* %INSTRUMENT_SITE: Tests_union
*
* Base instrument for logger unit tests
* Test of Union 1D logger
*
* %Description
* Base instrument for logger unit tests
* Test instrument for the Union 1D logger component that can log scattering
* intensity as a function of one of several quantities, here time.
*
* %End
*******************************************************************************/
Expand Down Expand Up @@ -70,7 +71,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT Union_logger_1D = Union_logger_1D(
variable="time", min_value=0.0013, max_value=0.0022, n1=200,
filename="Union_logger_1D.dat")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
* Origin: ESS
* %INSTRUMENT_SITE: Tests_union
*
* Base instrument for logger unit tests
* Test of the Union 2DQ logger that shows scattering vector projected onto 2D plane
*
* %Description
* Base instrument for logger unit tests
* This instrument uses a basic Union system and investigates scattering within
* using the 2DQ logger that histograms occurances of the scattering vectors for
* scattering events in the Union system projected onto a chosen 2D plane.
*
* %End
*******************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
* Origin: ESS
* %INSTRUMENT_SITE: Tests_union
*
* Base instrument for logger unit tests
* Test of Union logger 2D kf that records the final wavevector
*
* %Description
* Base instrument for logger unit tests
* Test instrument for the Union logger component 2D kf that records the final
* wavevector after each scattering event, projects it onto a specified 2D plane
* and histograms these using the scattered intensity.
*
* %End
*******************************************************************************/
Expand Down Expand Up @@ -70,7 +72,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT Union_logger_2D_kf = Union_logger_2D_kf(
Q_direction_1="z", Q1_min=-3.0, Q1_max=3.0, n1=200,
Q_direction_2="x", Q2_min=-3.0, Q2_max=3.0, n2=200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
* Origin: ESS
* %INSTRUMENT_SITE: Tests_union
*
* Base instrument for logger unit tests
* Tests Logger_2D_kf_time that records final wavevector in several time steps
*
* %Description
* Base instrument for logger unit tests
* Tests the 2D kf time logger that histograms the final wavevector after each
* scattering event in a 2D plane, and these are further distributed into a number
* of time bins so the time evolution of final wavevectors can be monitored.
*
* %End
*******************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ AT (-0.03,0,0.02) RELATIVE geometry_center
COMPONENT cone = Union_cone(radius_top=0.02, radius_bottom=0.055, yheight=0.09, priority=8, material_string="material")
AT (0.03,0,0.07) RELATIVE geometry_center

// Insert loggers to be tested here
COMPONENT Union_logger_2D_space_zx = Union_logger_2D_space(
D_direction_1="z", D1_min=-0.15, D1_max=0.15, n1=200,
D_direction_2="x", D2_min=-0.1, D2_max=0.1, n2=200,
Expand Down
Loading

0 comments on commit f90c9c9

Please sign in to comment.