/******************************************************************************** * * McStas, neutron ray-tracing package * Copyright (C) 1997-2008, All rights reserved * Risoe National Laboratory, Roskilde, Denmark * Institut Laue Langevin, Grenoble, France * * This file was written by McStasScript, which is a * python based McStas instrument generator written by * Mads Bertelsen in 2019 while employed at the * European Spallation Source Data Management and * Software Centre * * Instrument NMX * * %Identification * Written by: Python McStas Instrument Generator * Date: 14:30:25 on September 09, 2024 * Origin: ESS DMSC * %INSTRUMENT_SITE: Generated_instruments * * * %Parameters * * %End ********************************************************************************/ DEFINE INSTRUMENT NMX_Mantid ( double mon_shift = 0, double lmin = 1.8, // [AA] Minimum wavelength for monitors double lmax = 3.55, // [AA] Maximum wavelength for monitors double LambdaMin = 1.8, // [AA] Controls simulated wavelength band double LambdaMax = 3.55, // [AA] Controls simulated wavelength band double L_min = 1.8, // [AA] Controls choppers and monitors double L_max = 3.55, // [AA] Controls choppers and monitors n_pulses = 1, // [1] Number of simulated pulses acc_power = 2, // [MW] Accelerator power Slit1_width = 0.02, // [m] First slit width Slit1_height = 0.02, // [m] First slit height Slit2_width = 0.008, // [m] Second slit width Slit2_height = 0.008, // [m] Second slit height PinholeCollimator_width = 0.006, // [m] Collimation width PinholeCollimator_height = 0.006, // [m] Collimation height //string XtalReflections = "leucine.lau", // [filename] Crystal reflections // Rubredoxin.lau string XtalReflections = "Rubredoxin.lau", // [filename] Crystal reflections // Rubredoxin.lau XtalDelta_d_over_d = 0.0001, // [1] Delta d over d for crystal sample XtalMosaicity = 30, // [ArcMin] Crystal mosaicity XtalSize_width = 0.005, // [m] Sample width XtalSize_height = 0.005, // [m] Sample height XtalSize_depth = 0.005, // [m] Sample depth double XtalPhiX = 0, // [deg] Sample rotation around X double XtalPhiY = 0, // [deg] Sample rotation around Y double DetectorX = 0.6, // [m] Detector width double DetectorY = 0.6, // [m] Detector height double TT1 = -110, // [deg] Detector two theta double DetectorDist1 = 0.25, // [m] Distance to detector double TT2 = 0, // [deg] Detector two theta double DetectorDist2 = 0.32, // [m] Distance to detector double TT3 = 110, // [deg] Detector two theta double DetectorDist3 = 0.25 // [m] Distance to detector ) //SEARCH "/Users/peterwillendrup/Projects/dmsc-instrumentmodels/nmx/Make_NMX/required_mcstas_components" DECLARE %{ const double h = 6.62607E-34; const double m_n = 1.67493E-27; double ESSpulselength = 0.00286; double distModGuide = 6; double Position_postcurvedguide = 24.5; double Position_poststraightguide2 = 153.91; double LengthStraight_1 = 3.317; double distModMonolithwindow = 5.372; double chopperDiskSpace; double chopper1OpenT; double chopper1Delay; double chopper2OpenT; double chopper2ADelay; double chopper2BDelay; double chopperFreq; double Position_sample = 157.5; char srcdef[128]; double deltaz = 0.0001; double Upper_bound_preCurvedGuide; double Lower_bound_preCurvedGuide; double Upper_bound_postCurvedGuide; double Lower_bound_postCurvedGuide; double Upper_bound_postStraightGuide2; double Lower_bound_postStraightGuide2; double Upper_bound_sample; double Lower_bound_sample; double SegmentArray[30] = {0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25}; double LengthCurveSeg = 0.5; double AngleRotSegHorizontal = 0.0352593; double GuideDim_s1_w1 = 0.05; double GuideDim_s1_w2 = 0.05; double GuideDim_s1_h1 = 0.05; double GuideDim_s1_h2 = 0.05; double calcOpenTime(double pos, double minL, double maxL){ // Base calculation on minL from start of pulse, // maxL from end of pulse. // It is assumed that maxL-minL is not greater than frame width double opentime; printf("pos=%g; minL=%g; maxL=%g;\n",pos,minL,maxL); opentime = ((maxL-minL)*(pos)/3.95603)+2.86; return opentime; } double calcDisk1Delay(double pos, double opening, double minL, double freq){ // Base calculation on leading edge at guide centre // Delay is TOF for leading edge + rotation of half opening double delay; delay = minL*pos/3.95603 + (opening/2.0)*1000/(freq*360) + 2.86/2.0; return delay; } double calcDisk2Delay(double pos, double opening, double maxL, double freq){ // Base calculation on trailing edge at guide centre // Delay is TOF for trailing edge - rotation of half opening double delay; delay = maxL*pos/3.95603 - (opening/2.0)*1000/(freq*360) + 2.86/2.0; return delay; } #ifndef MCSX_REFL_SLIST_SIZE #define MCSX_REFL_SLIST_SIZE 2056 #endif %} INITIALIZE %{ // Start of initialize for generated NMX LengthStraight_1 = distModMonolithwindow - distModGuide; chopperDiskSpace = 0.025; chopperFreq = 14.0; chopper1OpenT = calcOpenTime(28.4, L_min, L_max); chopper1Delay = calcDisk1Delay(28.4,77.76,L_min,14.0); chopper2OpenT = calcOpenTime(51, L_min, L_max); chopper2ADelay = calcDisk1Delay(51-chopperDiskSpace,140,L_min,14.0); chopper2BDelay = calcDisk2Delay(51+chopperDiskSpace,140,L_max,14.0); printf("---- Chopper1 Open Time = %g ms\n",chopper1OpenT); printf("---- Chopper1 Delay = %g ms\n",chopper1Delay); printf("---- Chopper2 Open Time = %g ms\n",chopper2OpenT); printf("---- Chopper2A Delay = %g ms\n",chopper2ADelay); printf("---- Chopper2B Delay = %g ms\n",chopper2BDelay); Lower_bound_preCurvedGuide = (distModGuide+LengthStraight_1)/(h/(m_n * LambdaMin*1e-10))*1e6; Upper_bound_preCurvedGuide = ((distModGuide+LengthStraight_1)/(h/(m_n * LambdaMax*1e-10))+ESSpulselength)*1e6; Lower_bound_postCurvedGuide = (Position_postcurvedguide)/(h/(m_n * LambdaMin*1e-10))*1e6; Upper_bound_postCurvedGuide = ((Position_postcurvedguide)/(h/(m_n * LambdaMax*1e-10))+ESSpulselength)*1e6; Lower_bound_postStraightGuide2 = (Position_poststraightguide2)/(h/(m_n * LambdaMin*1e-10))*1e6; Upper_bound_postStraightGuide2 = ((Position_poststraightguide2)/(h/(m_n * LambdaMax*1e-10))+ESSpulselength)*1e6; Lower_bound_sample = (Position_sample)/(h/(m_n * LambdaMin*1e-10)) * 1e6; Upper_bound_sample = ((Position_sample)/(h/(m_n * LambdaMax*1e-10)) + ESSpulselength)*1e6; %} TRACE COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT Source = ESS_butterfly( sector = "W", beamline = 1, yheight = 0.03, cold_frac = 1, target_index = 3, focus_xw = 0.045, focus_yh = 0.0495, Lmin = LambdaMin-0.2, Lmax = LambdaMax+2, n_pulses = n_pulses, acc_power = acc_power) AT (0,0,0) RELATIVE Origin COMPONENT PortOrig = Arm() AT (0.036,0,0) RELATIVE Origin ROTATED (0,-1.0,0) RELATIVE Origin COMPONENT sourceMantid = Arm() AT (0,0,0) RELATIVE PortOrig COMPONENT MonolithGuide = Guide_gravity( w1 = 0.045, h1 = 0.035, w2 = 0.045, h2 = 0.045, l = 4, m = 1) AT (0,0,1.9999) RELATIVE PortOrig ROTATED (0,0,0) RELATIVE PortOrig COMPONENT armCurvedGuide = Arm() AT (0,0,6) RELATIVE PortOrig COMPONENT CurvedGuide1 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz) RELATIVE armCurvedGuide ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide2 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide1 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide3 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide2 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide4 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide3 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide5 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide4 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide6 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide5 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide7 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide6 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide8 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide7 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide9 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide8 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide10 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide9 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide11 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide10 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide12 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide11 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide13 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide12 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide14 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide13 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide15 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide14 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide16 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide15 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide17 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide16 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide18 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide17 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide19 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide18 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide20 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide19 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide21 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide20 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide22 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide21 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide23 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide22 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide24 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide23 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide25 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide24 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide26 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide25 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide27 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide26 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide28 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide27 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide29 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide28 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide30 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide29 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide31 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide30 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide32 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide31 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide33 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide32 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide34 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide33 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide35 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide34 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide36 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide35 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT CurvedGuide37 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = LengthCurveSeg, mleft = 1, mright = 3, mtop = 1, mbottom = 1) AT (0,0,deltaz + LengthCurveSeg) RELATIVE CurvedGuide36 ROTATED (0,AngleRotSegHorizontal,0) RELATIVE PREVIOUS COMPONENT armEndCurved = Arm() AT (0,0,LengthCurveSeg+deltaz) RELATIVE CurvedGuide37 COMPONENT StraightSegment = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = 3.5, mleft = 1, mright = 1, mtop = 1, mbottom = 1) AT (0,0,3*deltaz) RELATIVE armEndCurved COMPONENT armSecondaryShutter_1 = Arm() AT (0,0,3.5+deltaz) RELATIVE StraightSegment COMPONENT Slit_secondary_shutter_1_1 = Slit( xwidth = 0.045, yheight = 0.045) AT (0,0,0.3) RELATIVE armSecondaryShutter_1 COMPONENT Chopper1_pos = Arm() AT (0,0,0.1 + 2.0*deltaz) RELATIVE Slit_secondary_shutter_1_1 COMPONENT Chopper1 = DiskChopper( theta_0 = 77.7, radius = 0.35, yheight = 0.05, nu = 14, nslit = 1, delay = chopper1Delay/1000, abs_out = 1) AT (0,0,0) RELATIVE Chopper1_pos COMPONENT armEndChopper1 = Arm() AT (0,0,0.1) RELATIVE Chopper1_pos COMPONENT NeutronGuide5_2 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = 22.45, m = 1) AT (0,0,0) RELATIVE armEndChopper1 COMPONENT armChopper2 = Arm() AT (0,0,22.45) RELATIVE NeutronGuide5_2 COMPONENT Chopper2A_pos = Arm() AT (0,0,0.025) RELATIVE armChopper2 COMPONENT Chopper2A = DiskChopper( theta_0 = 140, radius = 0.35, yheight = 0.05, nu = 14, nslit = 1, delay = chopper2ADelay/1000, abs_out = 1) AT (0,0,0) RELATIVE Chopper2A_pos COMPONENT Chopper2B_pos = Arm() AT (0,0,0.025) RELATIVE Chopper2A_pos COMPONENT Chopper2B = DiskChopper( theta_0 = 140, radius = 0.35, yheight = 0.05, nu = 14, nslit = 1, delay = chopper2BDelay/1000, abs_out = 1) AT (0,0,0) RELATIVE Chopper2B_pos COMPONENT armEndChopper2 = Arm() AT (0,0,0.1) RELATIVE armChopper2 COMPONENT NeutronGuide7 = Guide_gravity( w1 = 0.045, h1 = 0.045, w2 = 0.045, h2 = 0.045, l = 92.813, m = 1) AT (0,0,0) RELATIVE armEndChopper2 COMPONENT armEndStraight2 = Arm() AT (0,0,92.813) RELATIVE NeutronGuide7 COMPONENT armStartFocusing = Arm() AT (0,0,0) RELATIVE armEndStraight2 COMPONENT EllipticGuide = Elliptic_guide_gravity( xwidth = 0.045, yheight = 0.045, l = 10, linxw = 1000, loutxw = 9, linyh = 1000, loutyh = 9, dimensionsAt = "entrance", R0 = 0.99, Qc = 0.0219, alpha = 6.07, m = 1, W = 0.003) AT (0,0,0) RELATIVE armStartFocusing COMPONENT armEndFocusing = Arm() AT (0,0,10) RELATIVE EllipticGuide COMPONENT Slit_1 = Slit( xwidth = Slit1_width, yheight = Slit1_height) AT (0,0,0.5) RELATIVE armEndFocusing COMPONENT Scraper_1 = Slit( xwidth = 0.03, yheight = 0.03) AT (0,0,0.15) RELATIVE Slit_1 COMPONENT Scraper_2 = Slit( xwidth = 0.03, yheight = 0.03) AT (0,0,0.55) RELATIVE Scraper_1 COMPONENT Scraper_3 = Slit( xwidth = 0.03, yheight = 0.03) AT (0,0,0.85) RELATIVE Scraper_2 COMPONENT Slit_2 = Slit( xwidth = Slit2_width, yheight = Slit2_height) AT (0,0,0.1) RELATIVE Scraper_3 COMPONENT sample_position = Arm() AT (0,0,0.7) RELATIVE Slit_2 COMPONENT sampleMantid = Arm() AT (0,0,0) RELATIVE sample_position COMPONENT arm_detector_2_direction = Arm() AT (0,0,0) RELATIVE sample_position ROTATED (0,TT3,0) RELATIVE sample_position COMPONENT arm_detector_2 = Arm() AT (0,0,DetectorDist3) RELATIVE arm_detector_2_direction COMPONENT arm_detector_1_direction = Arm() AT (0,0,0) RELATIVE sample_position ROTATED (0,TT2,0) RELATIVE sample_position COMPONENT arm_detector_1 = Arm() AT (0,0,DetectorDist2) RELATIVE arm_detector_1_direction COMPONENT arm_detector_0_direction = Arm() AT (0,0,0) RELATIVE sample_position ROTATED (0,TT1,0) RELATIVE sample_position COMPONENT arm_detector_0 = Arm() AT (0,0,DetectorDist1) RELATIVE arm_detector_0_direction COMPONENT psdSample = PSD_monitor( filename = "Sample_psd", xwidth = 0.03, yheight = 0.03, restore_neutron = 1) AT (0,0,0) RELATIVE sample_position COMPONENT divAtSample = Divergence_monitor( nh = 100, nv = 100, filename = "At_SampleDIVVDIVH.pos", xwidth = 0.005, yheight = 0.005, maxdiv_h = 0.2, maxdiv_v = 0.2, restore_neutron = 1) AT (0,0,0) RELATIVE sample_position COMPONENT divAtSampleOverview = Divergence_monitor( nh = 100, nv = 100, filename = "At_SampleOverviewDIVVDIVH.pos", xwidth = 0.005, yheight = 0.005, maxdiv_h = 0.5, maxdiv_v = 0.5, restore_neutron = 1) AT (0,0,0) RELATIVE sample_position COMPONENT toflSample = TOFLambda_monitor( nL = 500, nt = 500, tmin = Lower_bound_sample, tmax = Upper_bound_sample, filename = "Sample_tofl", xwidth = XtalSize_width, yheight = XtalSize_height, Lmin = L_min -0.1, Lmax = L_max+0.1, restore_neutron = 1) AT (0,0,0) RELATIVE sample_position COMPONENT divlSample = DivLambda_monitor( nL = 100, nh = 100, filename = "sample_divl", xwidth = XtalSize_width, yheight = XtalSize_height, maxdiv_h = 0.5, Lmin = L_min, Lmax = L_max, restore_neutron = 1) AT (0,0,0) RELATIVE sample_position COMPONENT init = Union_init() AT (0,0,0) ABSOLUTE COMPONENT Al_incoherent = Incoherent_process( sigma = 0.0328, unit_cell_volume = 66.4) AT (0,0,0) ABSOLUTE COMPONENT Al_powder = Powder_process( reflections = "Al.laz") AT (0,0,0) ABSOLUTE COMPONENT Al = Union_make_material( process_string = "Al_incoherent,Al_powder", my_absorption = 1.39157) AT (0,0,0) ABSOLUTE COMPONENT Gd_incoherent = Incoherent_process( sigma = 302, unit_cell_volume = 66.21) AT (0,0,0) ABSOLUTE COMPONENT Gd_powder = Powder_process( reflections = "Gd.laz") AT (0,0,0) ABSOLUTE COMPONENT Gd = Union_make_material( process_string = "Gd_incoherent,Gd_powder", my_absorption = 150128) AT (0,0,0) ABSOLUTE COMPONENT Kapton_total = NCrystal_process( cfg = "Kapton_C22H10N2O5.ncmat;temp=25C") AT (0,0,0) ABSOLUTE COMPONENT Kapton = Union_make_material( process_string = "Kapton_total", my_absorption = 1.61127) AT (0,0,0) ABSOLUTE COMPONENT Detector_gas_total = NCrystal_process( cfg = "gasmix::0.70xCO2+0.30xAr/1bar/25C") AT (0,0,0) ABSOLUTE COMPONENT Detector_gas = Union_make_material( process_string = "Detector_gas_total", my_absorption = 0.000498532) AT (0,0,0) ABSOLUTE COMPONENT Air_total = NCrystal_process( cfg = "gasmix::air/25C/1.0atm/0.30relhumidity") AT (0,0,0) ABSOLUTE COMPONENT Air = Union_make_material( process_string = "Air_total", my_absorption = 0.00726555) AT (0,0,0) ABSOLUTE COMPONENT test_incoherent = Incoherent_process( sigma = 0.00328, unit_cell_volume = 66.4) AT (0,0,0) ABSOLUTE COMPONENT Simple_Air = Union_make_material( process_string = "test_incoherent", my_absorption = 0.0139157) AT (0,0,0) ABSOLUTE COMPONENT surrounding_air = Union_cylinder( material_string = "Air", priority = 1, radius = 0.03, yheight = 1) AT (0,0,-0.4) RELATIVE sample_position ROTATED (90,0,0) ABSOLUTE COMPONENT pinhole_Gd = Union_box( material_string = "Gd", priority = 4, xwidth = 0.075, yheight = 0.075, zdepth = 2.5E-05, p_interact = 0.25) AT (0,0,0.69) RELATIVE Slit_2 COMPONENT pinhole_air = Union_box( material_string = "Air", priority = 5, xwidth = PinholeCollimator_width, yheight = PinholeCollimator_height, zdepth = 0.000125) AT (0,0,0) RELATIVE pinhole_Gd COMPONENT surrounding_air_exit = Union_box( material_string = "Exit", priority = 2, xwidth = 1.01*XtalSize_width, yheight = 1.01*XtalSize_height, zdepth = 1.01*XtalSize_depth) AT (0,0,0) RELATIVE sample_position ROTATED (XtalPhiX,XtalPhiY,0) RELATIVE sample_position COMPONENT master_1 = Union_master( allow_inside_start = 1) AT (0,0,0) ABSOLUTE COMPONENT Xtal = Single_crystal( reflections = XtalReflections, xwidth = XtalSize_width, yheight = XtalSize_height, zdepth = XtalSize_depth, delta_d_d = XtalDelta_d_over_d, mosaic = XtalMosaicity, p_transmit = 0.01, order = 1) AT (0,0,0) RELATIVE sample_position ROTATED (XtalPhiX,XtalPhiY,0) RELATIVE sample_position EXTEND %{ if (!SCATTERED) ABSORB; %} COMPONENT surrounding_air_after = Union_cylinder( material_string = "Air", priority = 1, radius = 2, yheight = 1) AT (0,0,0) RELATIVE sample_position COMPONENT full_logger_space_zx = Union_logger_2D_space( D_direction_1 = "z", D1_min = -0.4, D1_max = 0.4, n1 = 300, D_direction_2 = "x", D2_min = -0.4, D2_max = 0.4, n2 = 300, filename = "full_logger_zx.dat") AT (0,0,0) RELATIVE sample_position COMPONENT full_logger_space_xy = Union_logger_2D_space( D_direction_1 = "x", D1_min = -0.4, D1_max = 0.4, n1 = 300, D_direction_2 = "y", D2_min = -0.4, D2_max = 0.4, n2 = 300, filename = "full_logger_xy.dat") AT (0,0,0) RELATIVE sample_position COMPONENT time_logger = Union_logger_1D( min_value = 0.065, max_value = 0.145, variable = "time", filename = "time.dat") AT (0,0,0) RELATIVE sample_position COMPONENT full_logger_space_zx_time = Union_logger_2D_space_time( D1_min = -0.4, D1_max = 0.4, D2_min = -0.4, D2_max = 0.4, time_min = 0.065, time_max = 0.145, D_direction_1 = "z", D_direction_2 = "x", filename = "full_logger_zx_movie.dat", n1 = 300, n2 = 300, time_bins = 50) AT (0,0,0) RELATIVE sample_position COMPONENT detector_0_active_Gd = Union_box( material_string = "Gd", priority = 220, xwidth = DetectorX, yheight = DetectorY, zdepth = 0.00025, p_interact = 0.25) AT (0,0,0) RELATIVE arm_detector_0 COMPONENT nD_Mantid_0 = Union_abs_logger_event_Mantid(pixelmin=0, target_geometry = "detector_0_active_Gd", filename = "detector_0_event_signal.dat", xwidth = DetectorX, xbins = 3000, yheight = DetectorY, ybins = 3000) AT (0,0,0) RELATIVE detector_0_active_Gd COMPONENT detector_0_GEM_0 = Union_box( material_string = "Kapton", priority = 210, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.002) RELATIVE arm_detector_0 COMPONENT detector_0_GEM_1 = Union_box( material_string = "Kapton", priority = 211, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.004) RELATIVE arm_detector_0 COMPONENT detector_0_GEM_2 = Union_box( material_string = "Kapton", priority = 212, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.006) RELATIVE arm_detector_0 COMPONENT detector_0_Al_window = Union_box( material_string = "Al", priority = 205, xwidth = DetectorX, yheight = DetectorY, zdepth = 5E-05) AT (0,0,-0.016) RELATIVE arm_detector_0 COMPONENT detector_0_Al_box = Union_box( material_string = "Al", priority = 200, xwidth = DetectorX + 0.03, yheight = DetectorY + 0.03, zdepth = 0.04) AT (0,0,0.01) RELATIVE detector_0_Al_window COMPONENT detector_0_gas_box = Union_box( material_string = "Detector_gas", priority = 201, xwidth = DetectorX + 1E-3, yheight = DetectorY + 1E-3, zdepth = 0.04) AT (0,0,-0.001) RELATIVE detector_0_Al_box COMPONENT detector_1_active_Gd = Union_box( material_string = "Gd", priority = 320, xwidth = DetectorX, yheight = DetectorY, zdepth = 0.00025, p_interact = 0.25) AT (0,0,0) RELATIVE arm_detector_1 COMPONENT nD_Mantid_1 = Union_abs_logger_event_Mantid(pixelmin=10000000, target_geometry = "detector_1_active_Gd", filename = "detector_1_event_signal.dat", xwidth = DetectorX, xbins = 3000, yheight = DetectorY, ybins = 3000) AT (0,0,0) RELATIVE detector_1_active_Gd COMPONENT detector_1_GEM_0 = Union_box( material_string = "Kapton", priority = 310, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.002) RELATIVE arm_detector_1 COMPONENT detector_1_GEM_1 = Union_box( material_string = "Kapton", priority = 311, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.004) RELATIVE arm_detector_1 COMPONENT detector_1_GEM_2 = Union_box( material_string = "Kapton", priority = 312, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.006) RELATIVE arm_detector_1 COMPONENT detector_1_Al_window = Union_box( material_string = "Al", priority = 305, xwidth = DetectorX, yheight = DetectorY, zdepth = 5E-05) AT (0,0,-0.016) RELATIVE arm_detector_1 COMPONENT detector_1_Al_box = Union_box( material_string = "Al", priority = 300, xwidth = DetectorX + 0.03, yheight = DetectorY + 0.03, zdepth = 0.04) AT (0,0,0.01) RELATIVE detector_1_Al_window COMPONENT detector_1_gas_box = Union_box( material_string = "Detector_gas", priority = 301, xwidth = DetectorX + 1E-3, yheight = DetectorY + 1E-3, zdepth = 0.04) AT (0,0,-0.001) RELATIVE detector_1_Al_box COMPONENT detector_2_active_Gd = Union_box( material_string = "Gd", priority = 420, xwidth = DetectorX, yheight = DetectorY, zdepth = 0.00025, p_interact = 0.25) AT (0,0,0) RELATIVE arm_detector_2 COMPONENT nD_Mantid_2 = Union_abs_logger_event_Mantid(pixelmin=20000000, target_geometry = "detector_2_active_Gd", filename = "detector_2_event_signal.dat", xwidth = DetectorX, xbins = 3000, yheight = DetectorY, ybins = 3000) AT (0,0,0) RELATIVE detector_2_active_Gd COMPONENT detector_2_GEM_0 = Union_box( material_string = "Kapton", priority = 410, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.002) RELATIVE arm_detector_2 COMPONENT detector_2_GEM_1 = Union_box( material_string = "Kapton", priority = 411, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.004) RELATIVE arm_detector_2 COMPONENT detector_2_GEM_2 = Union_box( material_string = "Kapton", priority = 412, xwidth = DetectorX, yheight = DetectorY, zdepth = 1E-05) AT (0,0,-0.006) RELATIVE arm_detector_2 COMPONENT detector_2_Al_window = Union_box( material_string = "Al", priority = 405, xwidth = DetectorX, yheight = DetectorY, zdepth = 5E-05) AT (0,0,-0.016) RELATIVE arm_detector_2 COMPONENT detector_2_Al_box = Union_box( material_string = "Al", priority = 400, xwidth = DetectorX + 0.03, yheight = DetectorY + 0.03, zdepth = 0.04) AT (0,0,0.01) RELATIVE detector_2_Al_window COMPONENT detector_2_gas_box = Union_box( material_string = "Detector_gas", priority = 401, xwidth = DetectorX + 1E-3, yheight = DetectorY + 1E-3, zdepth = 0.04) AT (0,0,-0.001) RELATIVE detector_2_Al_box COMPONENT master = Union_master( allow_inside_start = 1) AT (0,0,0) ABSOLUTE COMPONENT stop = Union_stop() AT (0,0,0) ABSOLUTE FINALLY %{ // Start of finally for generated NMX %} END