Home
Component Manual for the neutron ray
Contents
1. 2 COMPONENT mysource Source_adapt 3 38 4 OOMPONENT mycheck Adapt_check source_comp mysource Sl Only one instance of Adapt_check is allowed in an instrument We suggest as alternative method to make use of the SPLIT keyword as described in the McStas User Manual 39 oR WN FH 3 9 Source Optimizer A general Optimizer for McStas Input Parameters for component Source_Optimizer from sources lt Parameter value gt Unit Description lt bins 10 gt 1 Number of cells for sampling neutron states lt step 0 1 gt 0 100 Optimizer step in percent of simulation lt keep 0 1 gt 0 100 Percentage of initial source distribution that is kept lt options 0 gt str string of options See lt b gt Description lt b gt The component Source_Optimizer is not exactly a source but rather a neutron beam modifier It should be positioned after the source anywhere in the instrument description The component optimizes the whole neutron flux in order to achieve better statistics at each Monitor_Optimizer location s see section for this latter com ponent It acts on any incoming neutron beam from any source type and more than one optimization criteria location can be placed along the instrument The usage of the optimizer is very simple and usually does not require any configura tion parameter Anyway the user can still customize the optimization through various options In
2. Other column based file formats may also be imported e g with parameters such as format Crystallographica format Fullprof format 1 2 3 4 0 0 0 0 In the latter case the indices define order of columns parameters multiplicity lattice spacing F Debye Waller factor and intrinsic line width The column signification may as well explicitely be set in the data file header using any of the lines column_j lt index of the multiplicity j column gt column_d lt index of the d spacing d column gt column_F2 lt index of the squared str factor F 2 column b gt column_F lt index of the structure factor norm F column gt column_DW lt index of the Debye Waller factor DW column gt column_ Dd lt index of the relative line width Delta d d Dd column gt column_inv2d lt index of the 1 2d sin theta lambda inv2d column gt gt gt column_q lt index of the scattering wavevector q column gt Other component parameters may as well be specified in the data file header with lines e g V rho lt value of atom number density at Angs 3 gt PVC lt value of unit cell volume Vc Angs 3 gt sigma_abs lt value of Absorption cross section barns gt sigma_inc lt value of Incoherent cross section barns gt Debye_Waller lt value of Debye Waller factor DW Delta_d d lt value of Detla_d d width for all lines gt density lt value of materia
3. but it is recommended to rather use PowderN for faster and accurate powder diffraction eventthough this latter does not implement multiple scattering Such files can only handle elastic scattering A list of common powder definition files is available in Table 1 2 page 15 Concentric geometries sample environment The component has been designed in a way which enables to describe complex imbricated set ups i e what you need to simulate sample environments To do so one has first to use hollow shapes then keep in mind that each surrounding geometry should be first declared before the central position usually the sample with the concentric 1 parameter but also duplicated with an other instance name at a symmetric position with regards to the centre as in the example shown in Fig 6 COMPONENT s_in Isotropic_Sqw thickness 0 001 radius 0 02 yheight 0 015 Sqw_coh Al laz concentric 1 AT 0 0 1 RELATIVE a COMPONENT sample Isotropic_Sqw xwidth 0 01 yheight 0 01 zdepth 0 01 Sqw_coh Rb_liq_coh sqw AT 0 0 1 RELATIVE a COMPONENT s_out Isotropic_Sqw thickness 0 001 radius 0 02 yheight 0 015 Sqw coh Al laz AT 0 0 1 RELATIVE a Central component may be of any type not specifically an Isotropic_Sqw instance It could be for instance a Single_crystal or a PowderN In principle the number of sur rounding shells is not restricted The only restriction is that neutrons t
4. Guide_curved Non focusing curved neutron guide R Stewart ILL e A suite of sample components Inelastic_Incoherent Inelastic incoherent sample with quasielastic and elas tic contributions K Lefmann Risg Phonon_simple An isotropic acoustic phonon K Lefmann Risg PowderN N lines powder diffraction P K Willendrup Ris Sans_spheres hard spheres in thin solution mono disperse L Arleth the Royal Veterinary and Agricultural University DK K Lefmann Ris Isotropic_Sqw isotropic inelastic sample powder liquid glass elastic inelas tic scattering from S q w data E Farhi V Hugouvieux ILL SANS_ A collection of samples for SANS H Frielinghaus FZ Jiilich We would like to kindly thank all McStas component contributors This is the way we improve the software alltogether The McStas project has been supported by the European Union initially through the XENNI program and the RTD Cool Neutrons program in FP4 In FP5 McStas was supported strongly through the SCANS program Currently in FP6 McStas is supported through the Joint Research Activity MCNSI under the Integrated Infras tructure Initiative NMI3 see the WWW home pages Nmil If you appreciate this software please subscribe to the neutron mc risoe dk email list send us a smiley message and contribute to the package We also encourage you to refer to this software when publishing results with the following citations
5. 1 set to 1 2 or 3 gives debugging information lt yheight 0 08 gt m height of slit package lt curvature 0 gt m 1 Curvature of slits 1 radius of curvature lt delay 0 gt s sets phase so that transmision is centered on delay 62 6 2 1 The chopper geometry and parameters The Fermi chopper is a rotating vertical cylinder containing a set of collimating slits slit package Main geometry parameters are the radius R minimum and maximum height Ymin and Ymar see Fig 6 3 In this implementation the slits are by default straight but may be coated with super mirror and curved Main parameters for the slits are the number of slits Nslit the length length and width w of each slit the width of the separating Cd blades is neglected The slit walls reflectivity is modelled just like in guide components by the m value m gt 1 for super mirrors the critical scattering vector Qe the slope of reflectivity a the low angle reflectivity Ro and the width of supermirror cut off W For m 0 the blades are completly absorbing The AT position of the component is its center The angular speed of the chopper is w 2av where v is the rotation frequency The angle phase for which the chopper is in the open state for most of the neutrons coming in z axis of the rotating frame parallel to the z axis of the static frame is also an input parameter The time window may optionally be shifted to zero when setting t
6. What we use to characterize the polarizing monochromator in practice is not Fy K and Fy k but instead the reflection probabilities R and R for the reflection of interest If we assume that the reflection probabilities are directly proportional to the cross sections with proportionality constant k i e Ry kdo dQ P 7 and Ry kdo dQ P 7 then we can use Eq A 28 to determine Fy k and Fy h Ry k Fy Fry A 31 Ry k Fy Fue A 32 The values of VkFy x and VkFy are then between 1 and 1 and unit less like the reflection probabilities In the following we ignore k and just talk about Fiy K and Fuy k In principle there are four solutions for Fy k and Fy K so in the code we currently choose the values where Fy k Fu r R and Fy x Fulk y R so that Fiy K gt 0 and Fy k gt Fu r We then find Fy k U a A 33 VR VR A 34 2 Fu k 154 When Fy k and Fy k are determined from these equations Eq A 28 and Eq can easily be used to handle any situation This solution is both used for monochromators and guides It is not clear that this solution is correct If we make a simple example with R 1 and R 0 25 then we could in principle have four solutions but let us just quote the two where Fy k is positive since the last two are found by inserting a minus before all the solutions and this does not change the physics The two solutions are Fy k 0 7
7. Compute the reflection from the side Update the neutron weight factor by the amount 7 R Q Repeat this process until the neutron leaves the guide There are a few optimizations possible here to avoid redundant computations Since the neutron is always inside the guide during the computations we always have O ro n lt 0 Thust lt 0 if v n gt 0 so in this case there is no need to actually compute t Some redundant computations are also avoided by utilizing symmetry and the fact that many components of n and O are zero 54 5 3 Guide channeled A guide section component with multiple channels Name Guide_channeled Author System Input parameters w1 hi We he l k Mg My Optional parameters d Ro Qer Qey W Qz Qy Notes validated no gravitation support The component Guide_channeled is a more complex variation of Guide described in the previous section It allows the specification of different supermirror parameters for the horizontal and vertical mirrors and also implements guides with multiple channels as used in neutron bender devices By setting the m value of the supermirror coatings to zero nonreflecting walls are simulated this may be used for a very detailed simulation of a Soller collimator see section 4 5 The input parameters are w1 hi wa he and l to set the guide dimensions as for Guide entry window exit window and length k to set the number of channels d to se
8. This example records the correlation between position and divergence of neutrons at a given instrument location 138 03D O0AaAQNA Name PreMonitor_nD Author System E Farhi Input parameters comp Optional parameters Notes But it is also possible to search for cross correlation between two part of the in strument simulation One example is the acceptance phase diagram which shows the neutron caracteristics at the input required to reach the end of the simulation This spatial correlation may be revealed using the PreMonitor_nD component This latter stores the neutron parameters at a given instrument location to be used at an other Monitor_nD location for monitoring The only parameter of PreMonitor_nD is the name of the associated Monitor_nD instance which should use the premonitor option as in the following example COMPONENT CorrelationLocation PreMonitor_nD comp CorrelationMonitor AT oss e g a guide system COMPONENT CorrelationMonitor Monitor nD options x dx auto all bins 30 premonitor AT which performs the same monitoring as the previous example but with a spatial cor relation constrain Indeed it records the position vs the divergence of neutrons at the correlation location but only if they reach the monitoring position All usual Moni tor_nD variables may be used except the user variables These latter may be defined as described in section 9 8 7 in
9. fm AA 3 Excess scattering length density lt sigma_abs 0 50 gt m 1 Absorption cross section density at 2200 m s lt xwidth 0 gt m horiz dimension of sample as a width lt yheight 0 gt m vert dimension of sample as a height for cylinder box lt zdepth 0 gt depth of sample lt radius 0 gt Outer radius of sample in x z plane for cylinder sphere lt target_x 0 gt lt target_y 0 gt m position of target to focus at lt target _z 6 gt lt target_index 0 gt 1 Relative index of component to focus at e g next is m m aril lt focus_xw 0 gt m horiz dimension of a rectangular area lt focus_yh 0 gt m vert dimension of a rectangular area lt focus_aw 0 gt deg horiz angular dimension of a rectangular area lt focus_ah 0 gt deg vert angular dimension of a rectangular area lt focus_r 0 gt m Detector disk shaped radius The component Sans_spheres models a sample of small independent spheres of radius R which are uniformly distributed in a rectangular volume w X yp X Zz with a volume fraction The absorption cross section density for the spheres is ca in units of m t specified for neutrons at 2200 m s Absorption and incoherent scattering from the medium is neglected The difference in scattering length density the contrast between the hard spheres and the medium is called Ap d denotes the distance to the presumed circular SANS detector of radius R
10. g cm 3 Density of material rho density weight le24 N_A lt weight 0 gt g mol Atomic molecular weight of material lt barns 1 gt 1 Flag to indicate if F 2 from reflections is in barns or fm 2 barns 1 for laz barns 0 for lau type files lt Strain 0 gt ppm Global relative delta_d_d d shift when the Strain column is not available Use O if ideal The powder diffraction component PowderN models a powder sample with back 88 E N A 00 DO 0ON0AQDNAEA COOAMONDA KWH HE ground coming only from incoherent scattering and no multiple scattering At the users choice a given percentage of the incoming events may be transmitted attenuated to model the direct beam The component can also assume concentric shape i e be used for describing sample environment cryostat sample container etc The description of the powder comes from a file in one of the standard output formats LAZY FULLPROF or CRYSTALLOGRAPHICA A usage example of this component can be found in the Neutron site Tutorial templateDIFF instrument from the mcgui 8 3 1 Files formats powder structures Data files of type lau and laz in the McStas distribution data directory are self documented in their header A list of common powder definition files is available in Table 1 2 page 15 They do not need any additional parameters to be used as in the example PowderN lt geometry parameters gt filename Al laz
11. where t is the absolute time to is the chopper delay and o is the chopper phase The chopper should better be time focussing slow neutrons should pass before the fast ones so that they finally hit the detectors at the same time Therefore the signs of w and 6 are very important For t gt to 6 is positive and points anti clockwise 63 Parameter unit meaning radius m chopper cylinder radius ymin m lower y bound of cylinder ymax m upper y bound of cylinder Nslit 1 number of chopper slits length m channel length of the Fermi chopper w m width of one chopper slit May also be specified as width w Nslit for total width of slit package nu Hz chopper frequency phase deg chopper phase at t 0 zero_time 1 shit time window around 0 if true curvature mt Curvature of slits 1 radius of curvature m 1 alpha A Qc A slit coating parameters See section 5 1 1 A RO 1 Table 6 1 FermiChopper component parameters Since the rotation is applied along the y axis we can simplify the problem to two dimensions The orthogonal transformation matrix T from the static zx to the rotating frame 2 x is _ cos d sin Tosara sin 9 cos 9 641 Together with the equation for a non accelerated linear propagation 7 r vt the orthogonal transformation produces a curve in the Z X plane known as archidemic spiral as can be seen in figu
12. Polarization after a component outgoing 7 Unit vector in direction of atomic spin 7 B 1 fora ferromagnet Fy Unit cell nuclear structure factor Fy Unit cell magnetic structure factor The unit cell nuclear structure factor is defined as Fn x X explir d ba A 11 d where the d is the position of the d th atom within the unit cell and bg is the average of ba In the simple case of a single atom Bravais crystal one finds Fy x b The unit cell magnetic structure factor is useful when the atoms in the crystal only have spin orbital angular momentum and simple when the magnet is saturated all spins are parallel or anti parallel to one direction gg 1 It is then given as 1 a Furl Jaro Y expli d 94 Saa 4 12 d where ro e 2 818 x 10m g 2 is the Land splitting factor and F4 x is the magnetic form factor which is the Fourier transform of the magnetization density normalized so that F4 0 1 and Sz is the thermal average of the ordered atomic spin In the following the Debye Weller factor exp Wa have been ignored in all cross sections A 2 1 Example Magnetic fields The magnetic moment operator of the neutron is An Yn where yn 2Un 3 826 is the gyromagnetic ratio spin and magnetic moment is anti parallel as for an electron A magnetic field B will exert a torque ds dt 1 yn du dt on the neutron magnetic moment pxB A 13 The magneti
13. The coating is specified as for the Guide and Mirror components by mean of the parameters Ro m Qe W and a or alternatively from the reflectivity file reflect Waviness effects supposed to be randomly distributed i e non periodic waviness can be specified globally or for each part of the guide section Additionally chamfers may be defined the same way Chamfers originate from the substrate manufacturing so that operators do not harm themselves with cutting edges Usual dimensions are about tens of millimeters They are treated as absorbing edges around guide plates both on the input and output surfaces but also aside each mirror The straight section of length l may be divided into n bits of same length within which chamfers are taken into account The component has also the capability to rotate at a given frequenccy in order to approximate a Fermi Chopper including phase shift The approximation resides in the fact that the component is considered fixed during neutron propagation inside slits Beware that this component is then located at its entry window not centered as the other Fermi choppers To activate gravitation support either select the McStas gravitation support mcrun gravitatio or from the Run dialog of mcgui or set the gravitation field strength G e g 9 81 on Earth This component is about 50 slower than the Guide component but has much more capabilities A contributed version Guide_honeycomb of this compon
14. giving f 1 lfun The direction focusing on the detector gives in an small angle approximation fo d TR2 Hence the total weight tranformation factor becomes Tj ltn TR e d A NA py V F q exp hal 8 37 where a is the linear attenuation factor due to absorption and l is the total neutron path length within the sample This component does NOT simulate absolute intensities This latter depends on the detector parameters Some alternative implementations exist as contributed components The SANS test example instrument exists in the distribution for this component 105 00 JO d0N0ACQDNAEA Rh oRWNrF OW 16 17 18 19 20 8 6 Phonon_simple A simple phonon sample Input Parameters for component Phonon_simple from samples lt Parameter value gt Unit Description lt radius gt m Outer radius of sample in x z plane lt yheight gt m Height of sample in y direction lt sigma_abs gt barns Absorption cross section at 2200 m s per atom lt sigma_inc gt barns Incoherent scattering cross section per atom lt a gt AA fcc Lattice constant lt b gt fm Scattering length lt M gt a u Atomic mass lt c gt meV AA 1 Velocity of sound lt DW gt 1 Debye Waller factor lt T gt K Temperature lt target_x 0 gt m position of target to focus at Transverse coordinate lt target_y 0 gt m position of target to focus at Vertical coordinate lt ta
15. lt verbose 0 gt 1 Set to 1 to display Disk chopper configuration To cut a continuous neutron beam into short pulses or to control the pulse shape in time from a pulsed source one can use a disc chopper see figure 6 1 This is a fast rotating disc with the rotating axis parallel to the neutron beam The disk consists of neutron absorbing materials To form the pulses the disk has openings through which the neutrons can pass Component DiskChopper is an infinately thin absorbing disc of radius R with n slit openings of height h and angular width 67 The slits are symmetrically disposed on the disc If unset the slit height h will extend to the centre of the disc h R The DiskChopper is self centering meaning that the centre of the slit openings will automatically be positioned at the centre of the beam axis see figure 6 1 To override this behaviour set the paramter compat 1 positioning the chopper centre at height R as implemented in the original Chopper component 59 Optionally each slit can have a central absorbing insert a beamstop of angular width 6 For more exotic chopper definitions use the GROUP keyword see below for an example The direction of rotation can be controlled which allows to simulate e g counter rotating choppers The phase or time delay to in seconds is defined by the time where the first of the n slits is positioned at the top As an alternative an angular phase can be given u
16. px py pz or when randomOn 0 to set the polarization vector to a random vector on the unit sphere 155 e Monochromator_pol A monochromator that only does the n 1 reflection For each neutron it calculates the wavelength which would give Bragg reflection ABragg and it then calculates based on one mosaicity and one d spread the reflection probability given the neutrons actual A The reflection probability is a Gaussian in AA A Apragg With the peak reflectivity and polarization calculated as described in section A 3 2 NB Note that this monochromator reflects the neutrons billiard like In Monochromator_flat the mosaicity of the reflecting crystal is taken into account but the d spread is not taken into account One should implement d spread and mosaicity in a way similar to what is done in Single crystal Pol_mirror Plane with a reflection probability for up and down There are 3 options always reflect always transmit or random select transmit reflect NB Note that at the moment the plane only reflects from one side because it uses PROP _ZO Pol_bender Curved guide with the possibilities to insert multiple slits and have the end gap parallel to the entrance or following the guide angle It is possible to select different coatings mirror parameters for each of the four sides Pol_guide_vmirror Straight guide with non polarizing coatings with two polar izing super mirrors sitting in a V shape inside Note
17. 1 l1 dl will be Pal u Fella dl 8 4 while the probability for a neutron to be scattered from within this interval into the solid angle Q and not being scattered further or absorbed on the way out of the sample is P l1 Q dldQ p fave 11 fate IDAN 8 5 81 Figure 8 1 The geometry of a scattering event within a powder sample where y 0 is the directional distribution of the scattered neutrons and lz is determined by Monte Carlo chocies of l1 Q and from the sample geometry see e g figure 8 1 In our Monte Carlo simulations we may choose the scattering parameters by making a Monte Carlo choice of l and 2 from a distribution different from P l1 Q By doing this we must adjust m according to the probability transformation rule If we e g choose the scattering depth l from a flat distribution in 0 ltn and choose the directional dependence from g Q we have a Monte Carlo probability F a Q 90 ln 8 6 len is here the path length through the sample as taken by a non scattered neutron although we here assume that all simulated neutrons are being scattered According to the neutron weight factor is now adjusted by the amount Ti l Q lean exp 11 l2 u p AO 8 7 9 g In analogy with the source components it is possible to define interesting directions for the scattering One will then try to focus the scattered neutrons choosing a g Q which peaks arou
18. 1 Number of energy bins lt filename 0 gt text Name of file in which to store the detector image lt xmin 0 05 gt m Lower x bound of detector opening lt xmax 0 05 gt m Upper x bound of detector opening lt ymin 0 05 gt m Lower y bound of detector opening lt ymax 0 05 gt m Upper y bound of detector opening lt xwidth 0 gt m Width of detector Overrides xmin xmax lt yheight 0 gt m Height of detector Overrides ymin ymax lt Emin gt meV Lower bound of energy lt Emax gt meV Upper bound of energy lt restore_neutron 0 gt 1 If set the monitor does not influence the neutron state The component PSD_monitor resembles other monitors e g TOF Monitor and also propagates the neutron ray to the detector surface in the zx y plane where the detector window is set by the x and y input coordinates The PSD monitor though is not sensitive to the arrival time of the neutron ray but rather to its position The rectangular monitor window given by the x and y limits is divided into nz x ny pixels 128 SCNIowrwnr Pere wWwnrowo 14 15 16 QT AUNE The output from PSD monitor is the integrated counts n I M2 as well as three two dimensional arrays of counts n x y I x y Ma x y The arrays are written to a file filename and can be read e g by the tool mcplot see the system manual 9 6 Divergence_monitor A divergence sensitive monitor Input Parameters for compon
19. 1 if 2w 2 lt x lt 2w 2 AND yh 2 lt y lt yh 2 Else return 0 e box_intersect 4t amp t2 Y Z Ur Vy Vz dx dy dz Calculates the 0 1 or 2 intersections between the neutron path and a box of dimensions dg dy and dz centered at the origin for a neutron with the parameters x Y Z Uz Uy Uz The times of intersection are returned in the variables t and t2 with t lt tg In the case of less than two intersections t and possibly t2 are set to zero The function returns true if the neutron intersects the box false otherwise e cylinder_intersect amp t amp t2 x Y Z Uz Vy Uz T h Similar to box_intersect but using a cylinder of height h and radius r centered at the origin e sphere_intersect amp t amp t2 x Y Z Uz Uy Uz r Similar to box_intersect but using a sphere of radius r B 1 7 Random numbers e rand01 Returns a random number distributed uniformly between 0 and 1 e randnorm Returns a random number from a normal distribution centered around 0 and with o 1 The algorithm used to sample the normal distribution is explained in Ref Pre 86 ch 7 e randpm1 Returns a random number distributed uniformly between 1 and 1 e randtriangle Returns a random number from a triangular distribution between 1 and 1 163 o D0oON0AQDNA e randvec target _circle 40v amp v amp vz amp dQ aim aimy aim rf Generates a random vector Ur y Uz
20. At Bt C 0 and returns the smallest positive solution into pointer t B 1 5 Output from detectors Details about using these functions are given in the McStas User Manual 162 DETECTOR_OUT_OD Used to output the results from a single detector The name of the detector is output together with the simulated intensity and estimated statistical error The output is produced in a format that can be read by McStas front end programs e DETECTOR OUT _1D Used to output the results from a one dimensional detector Integrated intensities error etc is also reported as for DETECTOR_OUT_0D e DETECTOR_OUT_2D Used to output the results from a two dimentional detector Integrated intensities error etc is also reported as for DETECTOR_OUT_OD e DETECTOR_OUT_3D Used to output the results from a three dimentional detector Arguments are the same as in DETECTOR_OUT_2D but with an ad ditional z axis Resulting data files are treated as 2D data but the 3rd dimension is specified in the type field Integrated intensities error etc is also reported as for DETECTOR_OUT_0D e mcinfo_simulation FILE f mcformat char pre char name is used to ap pend the simulation parameters into file f see for instance Res_monitor Inter nal variable mcformat should be used as specified Please contact the authors for further information B 1 6 Ray geometry intersections e inside _rectangle amp z amp y x xw yh Return
21. CBANODTEWNEH Rp N 00 00 DOAANNA 9 4 L_monitor The wavelength sensitive monitor Input Parameters for component L_monitor from monitors lt Parameter value gt Unit Description lt nL 20 gt 1 Number of wavelength channels lt filename 0 gt text Name of file in which to store the detector image lt xmin 0 05 gt m Lower x bound of detector opening lt xmax 0 05 gt m Upper x bound of detector opening lt ymin 0 05 gt m Lower y bound of detector opening lt ymax 0 05 gt m Upper y bound of detector opening lt xwidth 0 gt m Width of detector Overrides xmin xmax lt yheight 0 gt m Height of detector Overrides ymin ymax lt Lmin gt AA Minimum wavelength to detect lt Lmax gt AA Maximum wavelength to detect lt restore_neutron 0 gt 1 If set the monitor does not influence the neutron state The component L_monitor is very similar to TOF_monitor and E_monitor This component is just sensitive to the neutron wavelength The wavelength spectrum is output in a one dimensional histogram between Amin and Amax measured in A As for the two other 1 dimensional monitors this component outputs the total counts and a file with the histogram 9 5 PSD monitor The PSD monitor Input Parameters for component PSD_monitor from monitors lt Parameter value gt Unit Description lt nx 20 gt 1 Number of pixel columns in scattering plane lt nE 20 gt
22. Check if n lt 6 otherwise ABSORB 3 Simulate the collimator transmission by a weight transformation mi T 1 tan na tan 4 1 4 6 Collimator_radial A radial Soller blade collimator Name Collimator_radial Author System E Farhi ILL Input parameters w1 hi wa ha len Omin Qmax nchan radius Optional parameters divergence nblades roc and others Notes Validated This radial collimator works either using an analytical approximation like Collima tor_linear see section 4 5 or with an exact model The input parameters are the inner radius radius the radial length len the input and output window dimensions w1 h1 w2 ha the number of Soller channels nchan each of them being a single linear collimator covering the angular interval Omin O max angle with respect to the z axis If the divergence parameter is defined the approximation level is used as in Colli mator_linear see section 4 5 On the other hand if you perfer to describe exactly the 48 Radial collimator Y A i u A iin NA yim So a Figure 4 2 A radial collimator number of blades nblades assembled to build a single collimator channel then the model is exact and traces the neutron trajectory inside each Soller The computing efficiency is then lowered by a factor 2 The component can be made oscillating with an amplitude of roc times w1 which supresses the channels sha
23. The neutron parameters that can be monitored 133 9 8 3 Important options e o 133 psa o ba bee ae ew A Es 134 if Sl desi sh Regal oe aah ee ee a 134 Bok ede ae kt fle eae eee Yee ee a 134 eee ae GB a A ed ee a aa 136 ee 140 A 141 e 141 E 143 10 4 TOF Res sample A sample like component for TOF resolution calculation 144 K ne doh as 145 10 6 Progress_bar Simulation progress and automatic saving 147 foe dee eee be ee ee 2 ee ee ee 147 148 i Teves i A ae a e he Se 148 Sb b wed a eee dae a HS 148 ra ia axe toned et 150 eo a EA a bee bt Se ees 151 oe Bae PG oR hae Bow a we eek ghd 152 On 153 AN 155 Sue ie Sele ay Som Gee ci Sree os ee in de e aa 155 io hae ge doe Da Soe Bg Ae bo bd a e 156 op Hp Seta oe ee dn as Gh lee eee ok 157 etek Miedo tie deh a eens ban ed 157 OE ie ds Oe Aiea a5 157 159 B 1 Run time calls and functions mestas r 159 DAA ES ae Ge Bw Rae a 159 B 1 2 Coordinate and component variable retrieval 160 B 1 3 Coordinate transformations 162 B 1 4 Mathematical routines o o 162 ETE EE E ie OD Bs yee Se E 162 m hes ee Sea a ee eee Se 163 B 1 7 Random numbers 0 0 0 0 0 0 0 000000 eee eee 163 B 2 Reading a data file into a vector matrix Table input read table 1ib 164 eek IE Aho pee a ue ee amp Ad 167 LAA SRR eae Se 167 A do oe Oe Be eee ay et et to ae 167 poe ee eas ee
24. an EXTEND block 139 10 Special purpose components The chapter deals with components that are not easily included in any of the other chapters because of their special nature but which are still part of the McStas system One part of these components deals with splitting simulations into two or more stages For example a guide system is often not changed much and a long simulation of neutron rays surviving through the guide system could be reused for several sim ulations of the instrument back end speeding up the simulations by typically one or two orders of magnitude The components for doing this trick is Virtual_input and Virtual_output which stores and reads neutron rays respectively Other components perform the simulation of the instrument resolution functions These are Res sample and TOF_Res_sample which are to be placed at the sample position and Res_monitor that should be localized at the position of the instrument detector Progress_bar is a simulation utility that displays the simulation status but assumes the form of a component 140 oF WN RA 10 1 Virtual_output Saving the first part of a split simulation Input Parameters for component Virtual_output from sources lt Parameter value gt Unit Description lt filename 0 gt str Name of neutron file to write Default is standard output string If not given a unique name will be used lt bufsize 0 gt 1 Size of neutron output buff
25. be cast into the form IQ 2Ik sin 0 8 11 where Q is a vector of the reciprocal lattice and k is the wave vector of the neutron It is seen that only reciprocal vectors fulfilling Q lt 2 k contribute to the scattering For a complete treatment of the powder sample one needs to take into account all these Q values since each of them contribute to the attenuation The strength of the Bragg reflections is given by their structure factors 2 Y by exp Rj Q 8 12 j where the sum runs over all atoms in one unit cell This structure factor is non zero only when Q equals a reciprocal lattice vector The textbook expression for the scattering cross section corresponding to one Debye Scherrer cone reads ch 3 6 with V NV being the total sample volume 3 Ocone Tip POP 8 13 Q For our purpose this expression should be changed slightly Firstly the sum over struc ture factors for a particular Q is replaced by the sum over essentially different reflections 91 00 D ON0ACQDNA multiplied by their multiplicity j Then a finite packing factor f is defined for the powder and finally the Debye Waller factor is multiplied on the elastic cross section to take lattice vibrations into account no inelastic background is simulated however We then reach j 2W y AN F Q 8 14 OCcone Q jaf exp y Ten Q N 47 jo F Q fexpl d Jal a 8 15 in the thin sample approximation For samples of
26. call the interesting directions The idea in focusing is to avoid wasting computation time on neutrons scattered in the other directions This trick is an instance of what in Monte Carlo terminology is known as importance sampling If e g a sample scatters isotropically over the whole 47 solid angle and all interesting directions are known to be contained within a certain solid angle interval AQ only these solid angles are used for the Monte Carlo choice of scattering direction This implies fuc AQ 1 However if the physical events are distributed uniformly over the unit sphere we would have P AQ AQ 47 according to Eq 2 9 One thus ensures that the mean simulated intensity is unchanged during a correct direction focusing while a too narrow focusing will result in a lower i e wrong intensity since we cut neutrons rays that should have reached the final detector 2 4 Adaptive and Stratified sampling Another strategy to improve sampling in simulations is adaptive importance sampling also called variance reduction technique where McStas during the simulations will de termine the most interesting directions and gradually change the focusing according to that Implementation of this idea is found in the Source_adapt and Source_Optimizer components An other class of efficiency improvement technique is the so called stratified sampling It consists in partitioning the event distributions in representative sub spaces which ar
27. d phi 0 gt deg scattering vertical angular spreading usually the height of the next component detector Use 0 for full space This is only relevant for single scattering order 1 lt concentric 0 gt 1 Indicate that this component has a hollow geometry and may contain other components It should then be duplicated after the inside part only for box cylinder sphere 1 See description for an example lt rho 0 gt AA 3 Density of scattering elements nb atoms unit cell V_0 lt sigma_abs 0 gt barns Absorption cross section at 2200 m s Use 1 to unactivate lt sigma_coh 0 gt barns Coherent Scattering cross section Use 1 to unactivate lt sigma inc 0 gt barns Incoherent Scattering cross section Use 1 to unactivate lt classical 1 gt 1 Assumes the S q w data from the files is a classical S q w and multiply that data by exp hw 2kT on up down energy sides Use 0 when obtained from raw experiments 1 from molecular dynamics Use 1 to guess from a data set including both energy sides 109 40 41 42 43 44 45 46 47 48 49 50 Isotropic Sqw concentric arrangement Figure 8 6 An He sample in a cryostat simulated with the Isotropic Sqw component in concentric geometry lt powder_Dd 0 gt 1 global Delta_d d spreading or 0 if ideal lt powder_DW 0 gt 1 global Debey Waller factor if not in F2 or 1 lt powder_Vc 0 gt AA 3 volume
28. for elastic scattering ky kj In a real crystal however reflections are not perfectly sharp Because of imperfection and finite size effects there will be a small region around 7 in reciprocal space of possible scattering vectors Single crystal simulates a crystal with a mosaic spread 7 and a lattice plane spacing uncertainty Ad d In such crystals the reflections will not be completely sharp there will be a small region around each reciprocal lattice point of the crystal that contains valid scattering vectors We model the mosaicity and Ad d of the crystal with 3 dimensional Gaussian functions in reciprocal space see figure 8 4 Two of the axes of the Gaussian are perpendicular to the reciprocal lattice vector T and model the mosaicity The third one is parallel to T and models Ad d We assume that the mosaicity is small so that the possible directions of the scattering vector may be approximated with a Gaussian in rectangular coordinates If the mosaic is isotropic the same in all directions the two Gaussian axes perpen dicular to T are simply arbitrary normal vectors of equal length given by the mosaic But if the mosaic is anisotropic the two perpendicular axes will in general be different for each scattering vector In the absence of anything better Single_crystal uses a model which is at least mathematically plausible and which works as expected in the two common cases 1 isotropic mosaic and 2 two mosaic directions hor
29. gt angstrom monochromator d spacing instead of Q 2 pi DM This component simulates an infinitely thin single crystal with a single scattering vector Qo 27 d m perpendicular to the surface A typical use for this component is to simulate a simple monochromator or analyzer The monochromator dimensions are given by the length zw and the height y As the parameter names indicate the monochromator is placed in the z y plane of the local coordinate system This definition is made to ensure that the physical monochromator angle often denoted A1 will equal the McStas rotation angle of the Monochromator component around the y axis R is the maximal reflectivity and n and ny are the horizontal and vertical mosaicities respectively see explanation below 7 1 1 Monochromator physics and algorithm The physical model used in Monochromator_flat is a rectangular piece of material composed of a large number of small micro crystals The orientation of the micro 73 crystals deviates from the nominal crystal orientation so that the probability of a given micro crystal orientation is proportional to a Gaussian in the angle between the given and the nominal orientation The width of the Gaussian is given by the mosaic spread n Of the crystal given in units of arc minutes 7 is assumed to be large compared to the inherent Bragg width of the scattering vector often a few arc seconds The mosaicity gives rise to a Gaussian reflectivit
30. improve significantly the speed of the computation Additionally if you restrict the scattering to the first order only parameter order 1 then you may specify the angular vertical extension d of the scattering area to gain optimised focusing This option does not apply when handling multiple scattering which emits in 47 many times before exiting the sample A bilinear interpolation for the q w determination is used to improve the accuracy on the scattered intensity but it may be unactivated when setting parameter interpolate 0 This will often result in a discrete g w sampling As indicated in the previous section the Isotropic_ Sqw component is not as efficient as PowderN for powder single scattering but handles scattering processes in a more accurate way secondary extinction multiple scattering 8 7 4 The implementation Geometry The geometry for the component may be box cylinder and sphere shaped either filled or hollow Relevant parameters for this purpose are as follow e box dimensions are Lwidth X Yheight X Zdepth e box hollow dem and the side wall thickness is set with thickness cylinder dimensions are r for the radius and Yheight for the height e cylinder hollow idem and hollow part is set with thickness sphere dimension is r for the radius 119 120 Parameter type meaning Sqw_coh string Coherent scattering data file name Use 0 NULL or to disable Sqw
31. in the whole sample volume Its implementation in a propagative Monte Carlo neutron code such as McStas can be summarised as follows 1 Compute the propagation path length in the material by geometrical intersections between the neutron trajectory and the sample volume 2 Evaluate the total cross section from the integration of the scattering law over the accessible dynamical range Section 8 7 3 3 Use the total cross section to determine the probability of interaction for each neutron along the path length and select a scattering position 4 Weight neutron interaction with the absorption probability and select the type of interaction coherent or incoherent 5 Select the wave vector and energy transfer from the dynamic structure factor S q w used as a probability distribution Section 8 7 3 Apply the detailed bal ance 6 Check whether selection rules can be solved Section 8 7 3 If they cannot repeat 5 This procedure is iterated until the neutron leaves the sample We shall now detail the key steps of this implementation 113 Evaluating the cross sections and interaction probability Following Sears Sea75 the total scattering cross section for incoming neutrons with initial energy EF is _ No ky E paa as z qs 3 q w d QE 8 53 where the integration runs over the entire space and all final neutron energies As the dynamic structure factor is defined in the q w space the integration requires a
32. m containing wavevector q values in H 2 A vector of length n containing energy w values in meV 3 A matrix of size m rows by n columns of S q w values in meV Any line beginning with any character of is considered to be a comment and lines which can not be read as vectors matrices are ignored The file header may optionally contain parameter settings for the material as com ments with keywords as in the following example V 0 35 cell volume Angs 3 V rho 0 07 atom number density at Angs 3 sigma abs 5 absorption cross section barns sigma_inc 4 8 incoherent cross section barns sigma_coh 1 coherent cross section barns Temperature 10 for detailed balance K 121 7 density 1 material density g cm 3 8 weight 18 material molar weight g mol 9 nb_atoms 6 number of atoms per unit cell Some sqw data files are included in the McStas distribution data directory and they contain material parameter settings in their header so that you may use 1 Isotropic_Sqw lt geometry parameters gt Sqw_coh He4_liq_coh sqw T 4 Example files are listed as sqw files in directory MCSTAS data A table of S q w data files for a few liquids are listed in Table page 16 File formats S q liquids This file format provides a mean to import directly an S q data set when setting parameters 1 powder_format qSq The Sqw _coh or Sqw inc file should contains a single
33. numerical block which column assignment is defaulted as q and S q being the first and second column respectively This may be overridden from the file header with 4column keywords as in the example 1 column_q 2 2 column_Sq 1 Such files can only handle elastic scattering File formats powder structures LAZY Fullprof Crystallographica Data files as used by the component PowderN may also be read Data files of type lau and laz in the McStas distribution data directory are self documented in their header They do not need any additional parameters to be used as in the example 1 Isotropic Sqw lt geometry parameters gt Sqw coh Al laz Other column based file formats may also be imported e g with parameters such as powder_format Crystallographica powder_format Fullprof powder_Dd 0 powder_DW l Ae VN The last two parameters may as well be specified in the data file header with lines E Debye_Waller 1 Delta_d d le 3 N The powder description is then translated into S q by using Eq 8 65 In this case the density p n Vo is the number of atoms in the inverse volume of the unit cell 122 00 JO dONACQDNRE As the component builds an S q from the powder structure description the accuracy of the Isotropic_Sqw component is limited by the binning during that conversion This is usually enough to describe sample environments including powders aluminium cop per
34. nz y bins ny IMIN L min TMAT Lmax YMIN Ymin YMAL Ymax filename file options theta bins ng time bins nt limits to t cylin der filename file yheight height xwidth 2 radius options lambda bins n limits Ap Ai time bins nt limits to t1 filename file options log time bins nt limits to t1 options time bins nt limits to t1 Table 9 1 Using Monitor_nD in place of other components All limits specifications may be advantageously replaced by an auto word preceeding each monitored variable Not all file and dimension specifications are indicated e g filename xmin xmax ymin ymax 135 e options banana theta limits 10 130 auto time is a theta time of flight banana detector e options x bins 30 limits 0 05 0 05 y will set the monitor to look at x and y For y default bins 20 and limits values monitor dimensions are used e options x y auto all bins 30 will determine itself the required limits for x and y e options multiple x bins 30 y limits 0 05 0 05 all auto will monitor the neutron x and y in two 1D files e options x y z kx ky kz all auto will monitor each of theses variables in six 1D files e options x y z kx ky kz list all all auto will monitor all theses neutron variables in one long list one row per neutron event e options multiple x y z kx ky kz and list 2000 all auto will monitor all theses neutron variables in one lis
35. of the same length as aim aimy aim which is targeted at a disk centered at aim aim aim with radius rf in meters and perpendicular to the aim vector All directions that intersect the circle are chosen with equal probability The solid angle of the circle as seen from the po sition of the neutron is returned in dQ This routine was previously called rand vec target _sphere which still works e randvec_target_rect_angular amp v amp v amp vz amp dQ aim aimy aim h w Rot does the same as randvec_target_circle but targetting at a rectangle with angular dimensions h and w in radians not in degrees as other angles The rotation matrix Rot is the coordinate system orientation in the absolute frame usually ROT_A_CURRENT_COMP e randvec_target_rect amp vz Kuy 2v amp dQ aim aimy aim height width Rot is the same as randvec_target_rect_angular but height and width dimensions are given in meters This function is useful to e g target at a guide entry window or analyzer blade B 2 Reading a data file into a vector matrix Table input read_table lib The read_table 1ib provides functionalities for reading text and binary data files To use this library add a include read_table lib in your component definition DE CLARE or SHARE section Tables are structures of type t_Table see read_table lib h file for details t_Table structure most important members x double data Use Table
36. of the unit cell lt density 0 gt g cm 3 density of material V_rho density weight 1e24 N_A lt weight 0 gt g mol atomic molecular weight of material lt p interact l gt 1 Force a given fraction of the beam to scatter keeping intensity right to enhance small signals 1 unactivate lt norm 1 gt 1 Normalize S q w when 1 default Use raw data when 0 multiply S q w when norm gt 0 lt powder_barns 1 gt 1 0 when F2 data in powder file are fm 2 1 when in barns barns 1 for laz barns 0 for lau type files The sample component Isotropic_Sqw has been developed in order to simulate neutron scattering from any isotropic material such as liquids glasses amorphous systems poly mers and powders currently mono crystals cannot be handled The component treats coherent and incoherent neutron scattering and may be used to model most materials including sample environments with concentric geometries The structure and dynamics of isotropic samples can be characterised by the dynamic structure factor S q w which determines the interaction between neutrons and the sample and therefore can be used as a probability distribution of w energy and g momentum transfers It handles coherent 110 and incoherent processes both for elastic and inelastic interactions The main input for the component is S q w tables or powder structure files Usage examples of this component can be found in the Neutron site tests
37. opening or hitting the top and bottom caps are absorbed yellow dots in Fig 6 3 The side from which the neutron approaches the chopper is known positive or negative z axis of the rotating frame so that the calculation of the time of interaction with the slit package entrance t is performed solving z Length in Eq 6 2 Using the result of the numerical algorithms the neutron propagates to the entrance of the slit package orange circles in Fig 6 3 Neutrons getting aside the slit package entrance are absorbed Additionally the slit package exit time tg is estimated the same way with y ae in order to evaluate the whole time of flight in the chopper The index of the slit which was hit is also computed as we know the z coordinate in the rotating frame at the slit entrance Differentiating Eq 6 2 for x coordinate a t v t vg w z vz t cos w t to vz w x vz t sin w t to 6 4 we may estimate the tangents to the spiral neutron trajectory in the rotating frame at times t and t2 The intersection of these two lines gives an intermediate time t3 65 Figure 6 5 The different steps in the algorithm left A neutron trajectory in a slit right If the neutron remains in the same slit at this point then there is no intersection with the slit walls direct flight and the neutron may be propagated to the slit output and then to the cylinder output A last che
38. options parameter The data will be sorted into bins cells default is 20 between some default limits that can also be set by user The auto option will automatically determine what limits should be used to have a good sampling of signals 9 8 3 Important options Each monitoring records the flux sum of weights p versus the given variables except if the signal lt variable gt word is used in the options The cm2 option will ask to normalize the flux to the monitor section surface and the capture option uses the gold foil integrated capture flux weightening up to the cadmium cut off 0 5eV 1 MEL d 0 d A2200m s The auto option is probably the most useful one it asks the monitor to determine automatically the best limits for each variable in order to obtain the most significant monitored histogram This option should preceed each variable or be located after all variables in which case they are all affected On the other hand one may manually set the limits with the limits min max option The log and abs options should be positioned before each variable to specify loga rithmic binning and absolute value respectively The borders option will monitor variables that are outside the limits These values are then accumulated on the borders of the signal 9 5 133 9 8 4 The output files By default the file names will be the component name followed by a time stamp and automatic extensions showing what
39. radius of sample in x z plane lt xwidth 0 gt m Horiz dimension of sample bounding box if off file as a width lt yheight 0 gt m Vert dimension of sample bounding box if off file as a height A sphere shape is used when 0 and radius is set lt zdepth 0 gt m Depth of sample bounding box if off file lt thickness 0 gt m Thickness of hollow sample lt target_x 0 gt lt target_y 0 gt m position of target to focus at lt target_z 0 gt lt focus_r 0 gt m Radius of disk containing target Use 0 for full space lt focus_xw 0 gt m horiz dimension of a rectangular area lt focus yh 0 gt m vert dimension of a rectangular area lt focus_aw 0 gt deg horiz angular dimension of a rectangular area lt focus_ah 0 gt deg vert angular dimension of a rectangular area lt target index 0 gt 1 Relative index of component to focus at e g next is pl lt pack 1 gt 1 Packing factor lt p interact 1 gt 1 MC Probability for scattering the ray otherwise transmit lt fQE 0 gt 1 Fraction of quasielastic scattering rest is elastic lt gamma 0 gt 1 Lorentzian width of quasielastic broadening HWHM lt sigma_abs 5 08 gt barns Absorption cross section pr unit cell at 2200 m s lt sigma inc 5 08 gt barns Incoherent scattering cross section pr unit cell lt Vc 13 827 gt AA 3 Unit cell volume lt concentric 0 gt 1 Indicate that this component has a
40. that for all the polarizing guides it is possible to define analytical functions or use tables for the up and down reflectivity descriptions A 4 2 Detectors 156 e Pol monitor One defines a vector m mz my mz for the monitor and mea sures the projection of the spin along this vector i e m S e PolLambda_monitor Measures the projection of the spin along the defined vector m see Pol_monitor as a function of the wavelength A e MeanPolLambda_monitor Measures the average projection of the spin along the defined vector m see Pol monitor as a function of the wavelength A NB currently the error on the mean is shown a N but it might make more sense to show the spread 0 A 4 3 Magnetic fields Much inspiration for the components and the tests have been found in SDO1 e Pol constBfield A rectangular box with a constant magnetic field in the y direction The x and z components of the spin precess with the Larmor frequency wy It is possible to define the field in terms of a wavelength so that the spin will precess 180 degrees for the given wavelength The component can be rotated to have the field along another axis e Pol simpleBfield The first attempt at a component for handling general mag netic fields It is a concentric component where you define a start and stop com ponent for each field but this allows other components e g monitors to be put inside the field The component overloads the propagat
41. thickness 0 gt Thickness of hollow cylinder in x z plane lt radius 0 01 gt m Outer radius of hollow cylinder lt focus_r 0 05 gt m Radius of sphere containing target lt E0 14 gt meV Center of scattered energy range lt dE 2 gt meV half width of scattered energy range lt target_x 0 gt lt target_y 0 gt m position of target to focus at lt target_z 5 gt lt focus_xw 0 gt m lt focus_yh 0 gt m horiz dimension of a rectangular area vert dimension of a rectangular area lt focus_aw 0 gt deg horiz angular dimension of a rectangular area lt focus_ah 0 gt deg vert angular dimension of a rectangular area lt xwidth 0 gt m horiz dimension of sample as a width lt yheight 0 05 gt m vert dimension of sample as a height lt zdepth 0 gt m depth of sample lt target_index 0 gt 1 relative index of component to focus at e g next is 1 The component Res_sample scatters neutron rays isotropically in direction and uni formly in energy Regardless of the state of the incoming neutron ray all directions and energies for the scattered ray have the same probability within specified intervals The component is meant for computation of the resolution function but may also be used for test and debugging purposes For actual calculations of the resolution function Res_sample should be used together with Res_monitor described in section 10 5 The shape of Res_sa
42. variable change Using the momentum conservation law and the solid angle relation Q 27 1 cos were 0 is the solid angle opening we draw oS q w E 8 ff ee dqdw 8 54 This integration runs over the whole accessible g w dynamical range for each incoming neutron In practice the knowledge of the dynamic structure factor is defined over a lim ited area with q qmin maz and w Wmin Wmax which is constrained by the method for obtaining S q w i e from previous experiments molecular dynamics simulations and analytical models It is desirable that this area be as large as possible starting from 0 for both ranges If we use wmin gt 0 Qmin gt 0 Umar gt 4E and qmaz gt 2ki we completely describe all scattering processes for incoming neutrons with wavevector This means that in order to correctly estimate the total intensity and multiple scat tering the knowledge of S q w must be wider at least twice in q as stated previously than the measurable range in the corresponding experiment As a side effect a self con sistent iterative method for finding the true scattering law from the measurement itself is not theorically feasible except for providing crude approximations However that measured dynamic structure factor may be used to estimate the multiple scattering for a further measurement using longer wavelength neutrons In that case extrapolating the scattering law beyond the accessible measurement ranges might i
43. vj Two basic operations are possible on the distribution An update adds a number a to a bin setting vu ged a A search finds for given input b the minimum 7 such that b lt So yy 3 17 j l The search operation is used to sample from the distribution p If r is a uniformly distributed random number on the interval 0 ae vj then i search r is a random number distributed according to p This is seen from the inequality 1 1 i Y ara a 3 18 from which r Do uss ug ya vj which is an interval of length v Hence the probability of i is v Na vj The update operation is used to adapt the distribution to the problem at hand during a simulation Both the update and the add operation can be performed very efficiently As an alternative you may use the Source_Optimizer component see section 3 9 3 8 Adapt_check The adaptive importance sampling monitor Input Parameters for component Adapt_check from sources l lt Parameter value gt Unit Description 1 The component Adapt_check is used together with the Source_adapt component see section 3 7 for details When placed somewhere in an instrument using Source_adapt as a source the source will optimize for neutrons that reach that point without being absorbed regardless of neutron position divergence wavelength etc The Adapt_check component takes as single input parameter source_comp the name of the Source_adapt component instance for example
44. 3 1 Files formats powder structures o o e 89 8 3 2 Geometry physical properties concentricity 90 8 3 3 Powder scattering e ee ee 90 a e e E a 92 8 4 Single crystal The single crystal component o 94 8 4 1 The physical modell o e e 96 a a Ged ee Do as 98 a ea sa UO a ls Os ae 99 mise 101 8 4 5 Implementation details o o e 102 8 5 Sans _spheres A sample of hard spheres for small angle scattering 104 hep ee oe eh eS oe as a 104 See boa E Oe ae eee A ee Bs ee eS 105 prea he ge Se careers sh ee a et tice S 105 paa Soe oP eek ae ao a 106 8 6 1 The phonon cross section 2 2 ee 107 paras ia Ale 2 Yack Seg dod Be ats 107 stds SORE Csaba AN 108 8 7 Isotropic_Sqw A general S q w coherent and incoherent scatterer 109 8 7 1 Neutron interaction with matter overview 111 8 7 2 Theoretical side e 111 td aa 113 a da a ye eae oe ee 119 8 amp 5 Validation ia errar Sw ee ek ee yd ae 123 N 125 ee 126 9 2 TOF2E_ monitor A time of flight monitor with simple energy analysis 126 A ae a Deg e E Ge 127 eee ee ee 128 9 5 PSD monitor The PSD monitor 2 00004 128 ee ee 129 9 7 DivPos_monitor A divergence and position sensitive monitor 129 N 131 9 8 1 The Monitor nD geometry o e o 132 9 8 2
45. 5 Fu k 0 25 and Fy k 0 75 Fy x 0 25 All solutions gives the same cross section but if the incoming beam is polarized and only then the outgoing beam will have two different polarization values since P Fy K Fyy and 72 7 P Fy K are different for the two solutions It seems that one needs some additional information to choose between the two solutions NB The simplifying geometry shown in Figure A 1 only applies for the sides of the guide wall and not the top and bottom assuming that the magnetizing field is pointing up or down so there another set of equations should really be used The same physics could also be used for a polarizing powder or single crystal sample if Fy k and Fyy K can be calculated with some other program but one would have to use the general form of Eq and Eq without the simplifying geometrical constraints for monochromators and guides A 4 New McStas Components The components written so far can be divided into four groups e Polarizers Components used to make the beam polarized e Monitors Unphysical detectors that can measure the polarization of the neu trons e Magnetic fields Components used to handle magnetic fields e Samples Samples that affects the polarization A 4 1 Polarizers Some of the most common ways of polarizing a beam have been implemented e Set_pol This unphysical component can be used in two ways Either to hard code the polarization to the vector
46. 5 3 4 5 1 Collimator transmission The horizontal divergence np is defined as the angle between the neutron path and the vertical y z plane along the collimator axis We then define the collimation angle as the maximal allowed horizontal divergence 5 tan d L see Fig 4 1 Neutrons with a horizontal divergence angle 7 gt 6 will always hit at least one collimator blade and will thus be ABSORB ed For smaller divergence angles n lt the fate of the neutron depends on its exact entry point Assuming that a typical collimator has many blades the absolute position of each blade perpendicular to the collimator axis is thus mostly unimportant A simple statistical consideration now shows that the transmission probability is T 1 tan a tan Often the approximation T 1 n 0 is used giving a triangular transmission profile 4 5 2 Algorithm The algorithm of Collimator_linear is roughly as follows 1 Check by propagation if the neutron ray clear the entry and exit slits otherwise ABSORB 47 y A delta L ymax 4 paz L Z ymin pea L 3 i n d Figure 4 1 The geometry of a simple Soller blade collimators The real Soller collimator seen from the top left and a sketch of the component Soller right The symbols are defined in the text 2
47. A 4 the spin wave function x for a neutron spin 1 2 is x ax bX A 5 where xy and x are eigenfunction of and the complex coefficients a and b satisfy la pb 1 By calculation we find P x Gx x 2Re a b A 6 Py d 2lm a b A 7 P x z x Jal b A 8 This shows the relation of the polarization vector to the neutron wave function The neutron magnetic moment operator can be expressed in terms of as which as shown above is related to the polarization vector In our simulation we represent the polarization by the vector S sz Sy Sz which is propagated through the different components so it has the correct relative orientation in each component The probability for the spin to be parallel a given direction n is then 1l n S P t n SE A 10 This equation from SDO1 is easy to understand The average spin along n is n S and the probability then follows from Eq For an unpolarized beam S 0 and all directions are equally probable 50 Note that in our approach we do not decide if the neutron is up or down after a given component but instead keep track of as much information for as long as possible 149 In the following we will use P to denote the polarization vector T he most important variables used are K Scattering vector P Polarization before a component ingoing PL Polarization perpendicular to scattering vector P amp x P x amp P
48. A usage example of this component can be found in the Neutron site tests SANS instrument from the mcgui 8 5 1 Small angle scattering cross section The neutron intensity scattered into a solid angle AQ for a flat isotropic SANS sample in transmission geometry is given by DLO03 doy aq D where Y is the neutron flux T is the sample transmission A is the illuminated sample area and Zmax the length of the neutron path through the sample In this component we consider only scattering from a thin solution of monodisperse hard spheres of radius R where the volume specific scattering cross section is given by DLO03 I q VAQT Azmax 8 35 do 79 n Ap V f q 8 36 104 2 where f q 3 Se an paR n is the number density of spheres and V 4 3mR 4R is the sphere volume The density is thus n p V Multiple scattering is ignored 8 5 2 Algorithm All neutrons which hit the sample volume are scattered Hence no direct beam is simulated For scattered neutrons the following steps are taken 1 Choose a value of q uniformly in the interval 0 gmax 2 Choose a polar angle a for the q vector uniformly in 0 7 3 Scatter the neutron according to q a 4 Calculate and apply the correct weight factor correction 8 5 3 Calculating the weight factor The scattering position is found by a Monte Carlo choice uniformly along the whole unscattered beam path with the sample length lg
49. COMPONENT MyMonitor Monitor_nD 2 xmin 0 1 xmax 0 1 3 ymin 0 1 ymax 0 1 4 options energy auto limits will monitor the neutron energy in a single 1D file a kind of E_monitor e options banana theta limits 10 130 bins 120 y bins 30 is a theta height banana detector 134 McStas monitor Monitor_nD equivalent Divergence_monitor DivLambda_monitor DivPos_monitor E_monitor EPSD_monitor Hdiv_monitor L_monitor Monitor_4PI Monitor PSDcyl_monitor PSDlin_monitor PSD_monitor_4PI PSD_monitor TOF_cylPSD_monitor TOFLambda_monitor TOFlog_mon TOF_monitor options dx bins ndiv _ limits a 2a 2 lambda bins nlam limits Ap A1 file file options dx bins nh limits hmaz 2hmar 2 dy bins nv limits Umaz 2Umax 2 filename file options dx bins ndiv limits a 2a 2 x bins npos LIMIN Lmin CMAL L max options energy bins nchan limits EminEmazx options energy bins ng limits EminEmax x bins nzx LIMIN L min CMAL L max options dx bins nh limits hmaz 2hmaz 2 filename file options lambda bins nh limits Amax 2Amazx 2 filename file options sphere options unactivate options theta bins nr y bins ny cylinder filename file yheight height cwidth 2 radius options x bins nx IMIN L min TMAL L max YMIN Ymin ymax Ymax filename file options theta y sphere options x bins
50. D 10 11 12 13 14 15 16 17 18 19 20 zr 5 Al Cd slit package length Z m Absorbing Chopper walls 0 04 a y 0 04 0 02 0 0 02 0 04 SS wee X m Figure 6 3 Geometry of the Fermi chopper left and Neutrons in the chopper right 6 2 FermiChopper The Fermi chopper Input Parameters for component FermiChopper from optics lt Parameter value gt Unit Description lt phase 0 gt deg chopper phase at t 0 lt radius 0 04 gt m chopper cylinder radius lt nu 100 gt Hz chopper frequency Omega 2 Plx nu in rad s nu 60 in rpm Positive value corresponds to a clockwise rotation from X towards Z from above y gt 0 lt w 0 00022475 gt m width of one chopper slit lt nslit 200 gt 1 number of chopper slits lt RO 0 0 gt 1 low angle reflectivity lt Qc 0 02176 gt AA 1 critical scattering vector lt alpha 2 33 gt AA slope of reflectivity lt m 0 0 gt 1 m value of material Zero means completely absorbing lt W 2e 3 gt AA 1 width of supermirror cut off lt length 0 012 gt m channel length of the Fermi chopper lt eff 0 95 gt 1 efficiency transmission x fraction of transparent material lt zero_time 0 gt 1 set time to zero 0 no 1 once per half cycle 2 auto adjust phase lt xwidth 0 gt m optional total width of slit package lt verbose 0 gt
51. In the following we refer to an arbitrary guide side by its origin O and normal n With these definitions the time of intersection of the neutron with a guide side can be computed by considering the projection onto the normal O3 ro ng a ven B 3 5 3 where a and are indices for the different guide walls assuming the values h v and 1 2 respectively For a neutron that leaves the guide directly through the guide exit we have l z0 5 4 texit Uz The reflected velocity vf of the neutron with incoming velocity v i is computed by the formula Vi Ve Vi 2n n 5 5 This expression is arrived at by again considering the projection onto the mirror normal see figure 5 3 The reflectivity of the mirror is taken into account as explained in section 53 Figure 5 3 Neutron reflecting from mirror v and vf are the initial and final velocities respectively and n is a vector normal to the mirror surface 5 2 2 Algorithm 1 2 7 8 The neutron is initially propagated to the z 0 plane of the guide entrance If it misses the entrance it is ABSORB ed Otherwise repeatedly compute the time of intersection with the four mirror sides and the guide exit The smallest positive t thus found gives the time of the next intersection with the guide or in the case of the guide exit the time when the neutron leaves the guide Propagated the neutron ray to this point
52. NNN FP RP ARA ARA OONDTHWNFOWHOAWANDTHWNHF OHO Example Number of neutron bounces in a guide In the following example we show how the number of bounces in a polygonal guide may be monitored Let us have a guide made of many Guide_gravity instances We declare a global simulation variable nbounces set it to 0 for each neutron entering the guide and sum up all bounces from each section accessing the Gvars OUTPUT variable of component Guide_gravity Then we ask Monitor_nD to look at that value DECLARE double nbounces TRACE COMPONENT Guide in Arm AT EXTEND nbounces 0 COMPONENT Guidel Guide gravity AT RELATIVE PREVIOUS EXTEND if SCATTERED nbounces GVars N reflection 0 many guide instances copy paste and change names automatically COMPONENT COPY Guidel COPY Guide1 AT RELATIVE PREVIOUS EXTEND if SCATTERED nbounces GVars N reflection 0 monitor nbounces COMPONENT UserMonitor Monitor_nD userl nbounces usernamel Number of bounces options auto userl AT aa 9 8 8 Monitoring neutron parameter correlations PreMonitor_nD The first imediate usage of the Monitor nD component is when one requires to identify cross correlations between some neutron parameters e g position and divergence aka phase space diagram This latter monitor would be merely obtained with options x dx auto bins 30
53. NT_COMP with x y and z members coords_get P amp amp y amp z copies the x y and z members of the Coord structure P into x y z variables coords add a b coords sub a b coords neg a enable to operate on coor dinates and return the resulting Coord structure rot_set_rotation Rotation t dz y z Get transformation matrix for rotation first z around x axis then around y and last f around z t should be a Rotation 3 3 double matrix rot_mul Rotation t1 Rotation t2 Rotation t3 performs t3 t1 t2 rot_copy Rotation dest Rotation src performs dest src for Rotation arrays t rot_transpose Rotation src Rotation dest performs dest src rot_apply Rotation t Coords a returns a Coord structure which is t a B 1 4 Mathematical routines NORM z y z Normalizes the vector x y z to have length 1 scalar_prod a dy az br by bz Returns the scalar product of the two vectors ax ay az and bz by bz vec_prod amp az amp ay amp az bz by bz Cx Cy Cz Sets ax ay az equal to the vector product bz by bz X Cx Cy z rotate amp z amp y amp z Vr Vy Uz P Ax Ay az Set x y z to the result of rotating the vector Vg Uy vz the angle y in radians around the vector az ay az normal_vec amp n amp ny amp nz x Y 2 Computes a unit vector Ng Ny Nz normal to the vector x y z solve_2nd_order t A B C Solves the 2 order equation
54. Physics Physics Department Technical University of Denmark 2800 Kongens Lyngby Denmark We Component Manual for the Neutron Ray Tracing Package McStas version 2 1 P Willendrup E Farhi E Knudsen U Filges K Lefmann September 2014 The software package McStas is a tool for carrying out Monte Carlo ray tracing sim ulations of neutron scattering instruments with high complexity and precision The simulations can compute all aspects of the performance of instruments and can thus be used to optimize the use of existing equipment design new instrumentation and carry out virtual experiments for e g training experimental planning or data analysis McStas is based on a unique design where an automatic compilation process translates high level textual instrument descriptions into efficient ISO C code This design makes it simple to set up typical simulations and also gives essentially unlimited freedom to handle more unusual cases This report constitutes the reference manual for McStas and together with the man ual for the McStas components it contains documentation of most aspects of the pro gram It covers the various ways to compile and run simulations a description of the meta language used to define simulations and some example simulations performed with the program This report documents McStas version 2 1 released September 2014 The authors are Peter Kj r Willendrup lt pkwi fysik dtu dk gt Physics Departm
55. SAC int 0 1 n a Solid Angle Correction Table 3 3 Brief Description of Variables if SAC is set to zero It is advisable to select this variable at all times as it will give the most realistic results 3 6 3 Comparing TS1 and TS2 The Flux data provided in both sets of h face files is for 60 Amp sources To compare TS1 and TS2 the TS1 data must be multiplied by three current average strength of TS1 source 180 Amps When the 300 Amp upgrade happens this factor should be revised accordingly 3 6 4 Bugs Sometimes if a particularly long wavelength gt 20 A is requested there may be problems with sampling the data In general the data used for long wavelengths should only be taken as a guide and not used for accurate simulations At 9 Athere is a kink in the 33 distribution which is also to do with the MCNPX model changing If this energy is sampled over then the results should be considered carefully 34 00 ODO0dRAQ0NAEA Nh SCO ONOOBRWNF OO 21 22 23 3 7 Source_adapt A neutron source with adaptive importance sampling Input Parameters for component Source_adapt from sources lt Parameter value gt Unit Description lt N_E 20 gt 1 Number of bins in energy or wavelength dimension lt N_xpos 20 gt 1 Number of bins in horizontal position lt N_xdiv 20 gt 1 Number of bins in horizontal divergence lt xmin 0 gt m Left edge of rectangular source lt xmax 0 gt m Rig
56. Test_Isotropic_Sqw the Neutron site ILL ILL_H15_IN6 and the ILL_TOF_Env instruments from the mcgui 8 7 1 Neutron interaction with matter overview When a neutron enters a material according to usual models it sees atoms as disks with a surface equal to the total cross section of the material 0 The latter includes absorption coherent and incoherent contributions which all depend on the incoming neutron energy The transmission probability follows an exponential decay law account ing for the total cross section For the neutron which is not transmitted we select a scattering position along the path taking into account the secondary extinction and absorption probability In this process the neutron is considered to be a particle or an attenuated wave Once a scattering position has been assigned the neutron interacts with a material excitation Here we turn to the wave description of the neutron which interacts with the whole sample volume The distribution of excitations which determines their relative intensity in the scattered beam is simply the dynamic structure factor or scattering law S q w We shall build probability distributions from the scattering law in order to improve the efficiency of the method by favoring the q w choice towards high S q w regions The neutron leaves the scattering point when a suitable q w choice has been found to satisfy the conservation laws The method is iterated until the neutron le
57. _Index Table i j to get element i j long rows number of rows long columns number of columns Char header the header with comments char filename x file name or title double min_x minimum value of 1st column vector double maxx mazimum value of 1st column vector Available functions to read a single vector matrix are e Table_Init amp Table rows columns returns an allocated Table structure Use rows columns 0 not to allocate memory and return an empty table Calls to Table_Init are optional since initialization is being performed by other functions already e Table _Read 4T able filename block reads numerical block number block 0 to concatenate all data from text file filename into Table which is as well initialized in the process The block number changes when the numerical data changes its size or a comment is encoutered lines starting by If the data could 164 not be read then Table data is NULL and Table rows 0 You may then try to read it using Table_Read_Offset_Binary Return value is the number of elements read e Table Read Of set T able filename block offset Nrows does the same as Table_Read except that it starts at offset offset 0 means begining of file and reads Nrows lines 0 for all The offset is returned as the final offset reached after reading the Nrows lines e Table Read Offset Binary GT able filename type block offs
58. _inc string Incoherent scattering data file name Use 0 NULL or to scatter isotropically Vanadium like sigma_coh barns Coherent scattering cross section 1 to disable sigma_inc barns Incoherent scattering cross section 1 to disable sigma_abs barns Absorption cross section 1 to disable V_rho A 3 atomic number density May also be specified with molar weight weight in g mol and material density in g cm T K Temperature 0 disables detailed balance xwidth m yheight m dimensions of a box shaped geometry zdepth m radius_o m dimensions of a cylinder shaped geometry radiusi m sphere geometry if radius_i 0 thickness m thickness of hollow shape auto_qw boolean Automatically optimise probability tables during simulation auto_norm scalar Normalize S q w when 1 use raw data when 0 mul tiply S by given value when positive order integer Limit multiple scattering up to given order 0 means all orders concentric boolean Enables to enter inside concentric hollow geometries Table 8 2 Main Isotropic_Sqw component parameters aow rwnr e sphere hollow idem and hollow part is set with thickness The AT position corresponds to the centre of the sample Hollow shapes are particularly useful to model complex sample environments Refer to the dedicated section below for more details on this topic Dynamical structure factor The material behaviour is specified thro
59. a Akf and hence Aq of Aq pk sin 260 7 5 see figure 7 2 Hence we may sample from a Gaussian with standard deviation 2ksin9 _ 2ksin 0 ke sin 20 ksin0cos cosd 7 6 to get good statistics What remains is to determine the neutron weight The distribution from which the scattering event is sampled is a Gaussian in of width 2 cos 0 1 2 2 fme ee 2 0 c08s 0 7 7 e v2r 0 cos 0 ep In the physical model the probability of the scattering event is proportional to a Gaus sian in the angle between the nominal scattering vector Qo and the actual scattering vector q The normalization condition is that the integral over all y should be 1 Thus the probability of the scattering event in the physical model is d y T alp Ip e 2 e 2 de 7 8 TT 75 2ksin2t V V Figure 7 2 Scattering into the part of the Debye Scherrer cone covered by the mosaic where d y denotes the angle between the nominal scattering vector and the actual scattering vector corresponding to y According to equation the weight adjustment Tj is then given by Tj 1L p fucle 7 9 In the implementation the integral in 7 8 is computed using a 15 order Gaussian quadrature formula with the integral restricted to an interval of width 50 cos 0 for the same reasons discussed above on the sampling of 7 2 Monochromator_curved A curved mosaic crystal with a single scattering vector I
60. acing Ad d is assumed to be zero Hence this component is not suitable for simulating backscattering instruments or to investigate multiple scattering effects The theory and algorithm for scattering from the individual blades is described under Monochromator_flat 7 3 Single_crystal Thick single crystal monochromator plate with multiple scattering The Single_crystal component may be used to study more complex monochromators including incoherent scattering thickness and multiple scattering Please refer to section 7 4 Phase space transformer moving monochromator Eventhough there exist a few attempts to write dedicated phase space transformer com ponents there is an elegant way to put a monochromator into move by mean of the EXTEND keyword If you define a SPEED parameter for the instrument the idea is to change the coordinate system before the monochromator and restore it afterwards as follow in the TRACE section DEFINE INSTRUMENT PST SPEED 200 TRA COMPONENT Mono_PST_on Arm AT is EXTEND f vx vx SPEED monochromator moves transversaly by SPPED m s 2 COMPONENT Mono Monochromator AT 0 0 0 RELATIVE PREVIOUS COMPONENT Mono_PST_off Arm AT 0 0 0 RELATIVE PREVIOUS EXTEND 78 17 vz vz SPEED puts back neutron in static coordinate frame 18 This solution does not contain acceleration but is far enough for most studies and it is very simple In the latter exa
61. age polarization after a thick vanadium target is therefore a sum of different contributions A 3 2 Example Polarizing Monochromator and Guides n Figure A 1 Principle and geometry of a polarizing monochromator 153 In a polarized monochromator and polarizing guides we have a ferromagnetic crystal in an external magnetic field The scattering potential is now both nuclear no internal direction and magnetic internal direction so in general the outgoing polarization can be quite complex However as illustrated in Figure the typical setup has many geometrical constraints 7 amp 0 7 P 7 P and kx 7 x K which simplifies the problem In the calculation for a centrosymmetric ferromagnetic crystal is done and inserting the constraints above one finds Lov84 Eq 10 96 and Eq 10 110 da dQ Fy k 2Fy k Fu K P 7 Fulk A 28 P do dQ P Fw K Fu e 2Fw Fu 2 7 P Fu x A 29 NB Note that in Wil88 Eq 2 2 25 there is a minus in front of the second term in Eq We have not been able to understand this discrepancy which is probably due to notation Most other authors agree with the minus in front of the second term e g Squires and Francis Tasset For a beam which is initially unpolarized we find the outgoing polarization to be _ 72F y K Fy K o 2Fy k Fu K n dod END Fulk so that the beam is fully polarized along 7 if Fy K Fy K P A 30
62. al Reference source is sent unmodified default is 10 The Optimized source is thus 40 OU0VO0OJIDOdOaAao0NA E Optimized keep Reference 1 keep Neutrons that will reach monitor 4 The Source_Optimizer transforms the bad neutrons into good ones from the Optimized source The resulting optimised flux is normalised to the non optimized one f Reference 3 19 Poptimized Pinitial O timized and thus the overall flux at Monitor_Optimizer location is the same as without the optimizer Usually the process sends more good neutrons from the Optimized source than that in the Reference one The energy and velocity spectra of neutron beam is also kept as far as possible For instance an optimization of v will induce a modification of vz or vy to try to keep v constant 5 When the continuous optimization option is activated by default the process loops to Step 3 every step percent of the simulation This parameter is computed automatically usually around 10 in auto mode but can also be set by user During steps 1 and 2 some non optimized neutrons with original weight Pinitial may lead to spikes on detector signals This is greatly improved by lowering the weight p during these steps with the smooth option The component optimizes the neutron pa rameters on the basis of independant variables 1D phase space optimization However it usually does work fine when these variables are correlated whic
63. and outgoing polarization we have to average over the nuclear spin which we assume is random oriented so that terms linear in three last terms in Eq disappears The scattering cross section ends up being see p 159 do i 1 dQ XO expli Ria Rya 14d dy da a Aal Aal gPa aUa 1 1 1d V d A 26 152 where the first term is the coherent cross section and the second term is the site incoherent cross section Both terms are independent of P as expected for a system without a preferred internal direction The polarization in the final state is do _ 1 P Y explir Ria Rya P 144 01 108 0 144 2144 Ba Ta Ta 1 dQ iara 12 A 27 Comparing Eq A 26 and Eq 4 27 we find that 1 The nuclear coherent polarization is the same as the initial polarization 2 The same is true for the incoherent scattering due to the random isotope distribution 3 The nuclear incoherent scattering due to the random nuclear spin orientations has polarization P 1 3P for a random nuclear spin the associated Pauli matrix will 2 3 of the time point in the direction of 6 and Gy which according to Eq flips the spin For Vanadium where there is only one isotope and coherent scattering is negligible we find P 1 3P There is however one catch If the probability for multiple scattering is large one has to take into account that after two scattering one has P 2 1 9P and so forth The aver
64. arameters for component TOF2E_monitor from monitors lt Parameter value gt Unit Description lt nE 20 gt 1 Number of energy channels lt filename 0 gt text Name of file in which to store the detector image lt xmin 0 05 gt m Lower x bound of detector opening lt xmax 0 05 gt m Upper x bound of detector opening lt ymin 0 05 gt m Lower y bound of detector opening lt ymax 0 05 gt m Upper y bound of detector opening lt xwidth 0 gt m Width of detector Overrides xmin xmax lt yheight 0 gt m Height of detector Overrides ymin ymax 126 10 lt Emin gt meV Minimum energy to detect 11 lt Emax gt meV Maximum energy to detect 12 lt T_zero gt s Zero point in time 13 lt L_flight gt m flight length user in conversion l14 lt restore neutron 0 gt 1 If set the monitor does not influence the neutron state The component TOF2E_monitor resembles TOF_monitor to a very large extent Only this monitor converts the neutron flight time to energy as would be done in an experiment The apparent neutron energy Eapp is calculated from the apparent velocity given by Laight Vapp t as gt 9 1 where the time offset to defaults to zero Eapp is binned in nchan bins between Emin and Emax in meV The output parameters from TOF2E_monitor are the total counts and a file with 1 dimensional data vs Eapp similar to TOF_monitor 9 3 E_monitor The energy sensitive mo
65. ast neutrons k gt 6 A7 Table 4 1 Some transmission data files to be used with e g the Filter_gen component Filter_gen may act as a source options set or a filter options multiply de fault mode The table itself is a 2 column free format file which accept comment lines The first table column represents wavevector energy or wavelength as specified in the options parameter whereas the second column is the transmission weight modifier A usage example as a source would use options wavelength set if the first column in the data is supposted to be A in A Another example using the component as a filter would be options energy multiply if the first column is E in meV The input parameters are the filter window size tmin Emax Ymins Ymax the behaviour specification string options and the file to use file Additionally rescaling can be made automatic with the scaling and relative thickness parameters If for instance the trans mission data file corresponds to a 5 cm thick filter and one would like to simulate a 10 cm thick filter then use thickness 2 Some example data files are given with McStas in the MCSTAS data directory as trm files for transmission The filter geometry is a flat plane A geometry with finite thickness can be simulated by surrounding this component with two slits 46 V00 J DOOaANNA 4 5 Collimator linear The simple Soller blade collimator Input Parameters for c
66. ator this makes no significant difference to the other moderator faces 31 3 6 2 Using the McStas Module You MUST first set the environment variable MCTABLES to be the full path of the directory containing the table files BASH export MCTABLES usr local lib mecstas contrib ISIS_tables TCSH setenv MCTABLES usr local lib mcstas contrib ISIS_tables In Windows this can be done using the My Computer properties and selecting the Advanced tab and the Environment variables button This can of course be overridden by placing the appropriate moderator h face files in the working directory The module requires a set of variables listed in Table and described below The Face variable determines the moderator surface that will be viewed There are two types of Face variable i Views from the centre of each moderator face defined by the name of the moderator for TS1 Water H2 CH4 Merlin and TS2 Hydrogen Groove Narrow Broad ii Views seen by each beamline for TS1 Prisma Maps crisp etc and for TS2 E1 E9 East and W1 W9 West The McStas distribution includes some example moderator files for TS1 water h2 ch4 and TS2 broad narrow hydrogen groove but others are available at http www isis rl ac uk Computing Software MC including instrument specific models Variables E0 and E1 define an energy window for sampled neutrons This can be used to increase the statistical accuracy of chopper and mirrored in
67. attice_a lt value flattice a lt value lattice_a lt value lattice_bb lt value of the beta lattice angle deg lattice_cc lt value of the of of of of of of lattice_aa lt value of the alpha lattice angle deg Absorption cross section barns gt Incoherent cross section barns gt Detla_d d width for all lines gt the a lattice parameter Angs gt the b lattice parameter Angs gt the c lattice parameter Angs gamma lattice angle Example data lau files are given in directory MCSTAS data These files contain an extensive self documented header defining most the sample parameters so that only the file name and mosaicity should be given to the component Single_crystal xwidth 0 01 yheight 0 01 zdepth 0 01 mosaic 5 reflections YBaCuO lau Powder files from ICSD LAZY and Fullprof may also be used see Table 1 2 page 15 We do not recommend to use these as the equivalent q vectors are superposed not all Bragg spots will be simulated and the intensity will not be scaled by the multiplicity for each spot 103 SGNIow1rwnr Pere WwWwnroeow 14 15 16 17 18 8 5 Sans_spheres A sample of hard spheres for small angle scattering Input Parameters for component Sans_spheres from samples lt Parameter value gt Unit Description lt R 100 gt AA Radius of scattering hard spheres lt Phi le 3 gt 1 Particle volume fraction lt Delta_rho 0 6 gt
68. aves the volume of the material therefore allowing multiple scattering contributions which will be considered in more details below No experimental method makes it possible to accurately measure the multiple scat tering contribution even though it can become significant at low q transfers below the first diffraction maximum where the single scattering coherent signal is weak in most materials This is why attemps have been made to reduce the multiple scattering con tribution by partitioning the sample with absorbing layers However this is not always applicable thus makiong the simulation approach very valuable The method presented here for handling neutron interaction with isotropic materials is similar in many respects to the earlier MSC FMW72 Discus and MSCAT methods but the implementation presented here is part of a more general treat ment of a sample in an instrument 8 7 2 Theoretical side Pair correlation function g r and Dynamic structure factor S q w In the following we consider an isotropic medium irradiated with a cold or thermal neu tron beam We ignore the possible thermal fission events and assume that the incoming 111 neutron energy does not correspond to a Breit Wigner resonance in the material Fur thermore we do not take into account quantum effects in the material nor refraction and primary extinction Following Squires Squ78 the experimental counterpart of the scattering law S q w is the neutro
69. be automated with the COPY or 57 the JUMP ITERATE mechanisms see User manual An implementation of a continuous curved guide has been contributed as component Guide_curved 58 6 Moving optical components Choppers and velocity selectors We list in this chapter some moving optical components like choppers that may be used for TOF class instrument simulations and velocity selector used for partially monochro matize continuous beams 6 1 DiskChopper The disc chopper Input Parameters for component DiskChopper from optics lt Parameter value gt Unit Description lt theta 0 0 gt deg Angular width of the slits lt radius 0 5 gt m Radius of the disc lt yheight gt m Slit height if 0 equal to radius Auto centering of beam at half height lt nu gt Hz Frequency of the Chopper omega 2 PI nu algebraic sign defines the direction of rotation lt nslit 3 gt 1 Number of slits regularly arranged around the disk lt jitter 0 gt s Jitter in the time phase lt delay 0 gt s Time delay lt isfirst 0 gt 0 1 Set it to 1 for the first chopper position in a cw source it then spreads the neutron time distribution lt n_pulse 1 gt 1 Number of pulses Only if isfirst lt abs_out 1 gt 0 1 Absorb neutrons hitting outside of chopper radius lt phase 0 gt deg Angular delay overrides delay lt xwidth 0 gt m Horizontal slit width opening at beam center
70. blocks The format of text files is free Lines starting by characters are considered to be comments and stored in Table header Data blocks are vectors and matrices Block numbers are counted starting from 1 and changing when a comment is found or the column number changes For instance the file MCSTAS data BeO trm Transmission of a Berylium filter looks like 165 oR WN RA woorna 10 11 12 oF WN Fr ANAND PWNEHE BeO transmission as measured on IN12 Thickness 0 05 m k Angs 1 Transmission 0 1 wavevector multiply 1 0500 0 74441 1 0750 0 76727 1 1000 0 80680 Binary files should be of type float i e REAL 32 and double i e REAL 64 and should not contain text header lines These files are platform dependent little or big endian The filename is first searched into the current directory and all user additional locations specified using the I option see the Running McStas chapter in the User Manual and if not found in the data sub directory of the MCSTAS library location This way you do not need to have local copies of the McStas Library Data files see table L 1 A usage example for this library part may be t_Table Table declare a t_Table structure char file BeO trm a file name double x y Table_Read amp Table file 1 initialize and read the first numerical block Table_Info Table display table
71. c moment y can be related to the polarization as y y P 2 and inserting in Eq A 13 we find dP mPxB A 14 dt Note that if we had used S with values S 1 to define yn we would get yn 1 913 which is also commonly used 150 In the simple case where B 0 0 B we find the solution Wil88 p 18 Px t cos wzt Px 0 sin wt Py 0 Py t sin wt Px 0 cos wzt Py 0 A 15 P t Pz 0 where wy 7 B h is the Larmor frequency The equations above were checked against the equations in the polarimetrie neutronique notes by Francis Tasset and found to be consistent There can be sign differences between different publications depending on whether they use a right handed like e g McStas or a left handed like e g NISP coordinate system A 3 Polarized Neutron Scattering First we will give a short introduction to how calculations are done and then quote some results which are important for implementing the first McStas components All the potentials nuclear magnetic and electric we will be interested in can be written on the form 6 B 4 6 A 16 The first term does not affect the spin while the second term can change the spin Let us just remind here that FeXt Xl FyXt X X Xt A 17 rX EX SyX tXt FX X4 So that the interaction proportional to 0 and 0 results in spin flips while the interactions with conserves the spin It turns out to be smart to
72. ces in the result To avoid this the component emits early neutrons with a lower weight and later neutrons with a higher weight to compensate This way the neutrons that are emitted with the best adaption contribute the most to the result The factor with which the neutron weights are adjusted is given by a logistic curve Yo ONS ee age where j is the index of the particular neutron history 1 lt j lt Nhpist The constants yo ro and C are given by 8 3 9 Wi 3 10 2 Yo 3 11 Nbin 1 1 1 ro os 2 3 12 a Nhist Yo J C 1 log v ron 3 13 Nhist The number a is given by the user and specifies as a fraction between zero and one the point at which the adaption is considered good The initial fraction a of neutron histories are emitted with low weight the rest are emitted with high weight Nbin 1 Wj AQA real Wy sim bin Wi po j F 5 3 14 The choice of the constants yo ro and C ensure that Nhist i FGj 1 3 15 0 37 so that the total intensity over the whole simulation will be correct Similarly the adjustment of sampling weights is modified so that the actual formula used is o B Yo Yi ni 1 roj Nbi Nbin yo 1 yo e 0 35 ias wh m w i 3 16 3 7 3 The implementation The heart of the algorithm is a discrete distribution p The distribution has N bins 1 N Each bin has a value v the probability of bin is then ODA
73. ch neutron is at any time either present or lost In many instruments only a very small fraction of the initial neutrons will ever be detected and simulations of this kind will therefore waste much time in dealing with neutrons that never hit the relevant detector or monitor An important way of speeding up calculations is to introduce a neutron weight factor for each simulated neutron ray and to adjust this weight according to the path of the ray If e g the reflectivity of a certain optical component is 10 and only reflected neutrons ray are considered later in the simulations the neutron weight will be multiplied by 0 10 when passing this component but every neutron is allowed to reflect in the component In contrast the totally realistic simulation of the component would require in average ten incoming neutrons for each reflected one Let the initial neutron weight be po and let us denote the weight multiplication factor in the j th component by mj The resulting weight factor for the neutron ray after passage of the n components in the instrument becomes the product of all contributions n p Pn 0 7 2 2 j 1 Each adjustment factor should be 0 lt m lt 1 except in special circumstances so that total flux can only decrease through the simulation see section For convenience the value of p is updated within each component during the simulation Simulation by weight adjustment is performed whenever possible This inclu
74. city z 7 for powders and F structure factors including Debye Waller factors as in Eq When doing diffraction and neglecting inelastic contribution as first approximation we may integrate Eq keeping kj ky ae dd Poor N Ocoh a da O ae Scon 4 8 63 2 T 2 N v D a from Eq 8 18 8 64 with Vo 1 p being the volume of a lattice unit cell Then we come to the formal equivalence in the powder case Squ78 integration over Debye Scherrer cones Scon q ae Dir in a powder 8 65 CO for each lattice Bragg peak wave vector q The normalisation rule Eq can not usually be applied for powders as the S q is a set of Dirac peaks for which the f a S q dg is difficult to compute and S q does not converge to unity for large q Each F Dirac contribution may be broaden when specifiying a diffraction peak width Of course the component PowderN see section 8 3 can handle powder samples ef ficiently faster better accuracy but does not take into account multiple scattering nor secondary extinction which is significant for materials with large absorption cross sections On the other side the current Isotropic Sqw component assumes a powder packing factor of 1 massive sample To change into a lower packing factor use a lower powder density Important remarks and limitations Since the choice of the interaction type we know that the neutron must scatter with an appropriate kr outgoing wave ve
75. ck is made for the neutron to pass the chopper aperture in the cylinder If the neutron changes of slit channel at this point we may determine the intersection time of the neutron trajectory within t1 t3 or tz to as seen in Fig If walls are not reflecting we just absorb neutrons here The reflections super mirror slits If slit walls are reflecting neutron is first propagated to the slit separating surface Then the velocity in the rotating frame is computed using Eq 6 2 Perpendicular velocity v is reverted for reflection and inverse T transformation is performed Reflected intensity is computed the same way as for the guide component see section 5 1 The remaining time tg to the slit output is estimated and the tangent intersection process is iterated until neutron exits Remember that super mirror m lt 1 parameters behave like m 1 materials see section 5 1 1 Selecting m 0 sets the blabes absorbing The propagation is finalized when determining the intersection of the neutron trajec tory with the outer surface of the chopper cylinder The neutron must then pass its aperture else it is absorbed Curved slit packages The effect of curvature can significantly improve the flux and energy resolution shape As all zx cordinates are transformed into 2 x the most efficient way to take into account the curvature is to include it in the transformation Eq by morphing the curved rotating real space to a s
76. coherent or incoherent scattering is f coh f inc 1 The physical probability of coherent or incoherent scattering is P coh P inc Teoh Fine Otot 101 oF WN RA so again a weight adjustment r cohlinc H cohlinc f coh inc is needed When choosing the reciprocal lattice vector T to scatter from the relative probability for T is r Ocon r F7 This is done to get better statistics for weak reflections The Monte Carlo probability for the reciprocal lattice vector T is thus Tr Ar Tr whereas the physical probability is P T Ocoh r 0con A weight adjustment is thus needed of f T P T _ Ccoh r a Tr 7 7 FCT o Ocoh Tr In most cases however only one reflection is possible whence m 1 8 4 5 Implementation details The equations describing Single_crystal are quite complex and consequently the code is fairly sizeable Most of it is just the expansion of the vector and matrix equations in individual coordinates and should thus be straightforward to follow The implementation pre computes a lot of the necessary values in the INITIALIZE section It is thus actually very efficient despite the complexity If the list of reciprocal lattice points is big however the search through the list will be slow The precomputed data is stored in the structures hk1_info and in an array of hk1_data structures one for each reciprocal lattice point in the list In addition for every neutron event an arra
77. component is shown straight on geometrical views mcdisplay Trace and the next component may be placed directly at distance r W in 1 without rotation Results have been compared succesfully with analytical formula in the case of an ideal reflection and cross checked with the program haupt An other implementation of the Bender is available as the contributed component Guide_curved 5 6 Curved guides Real curved guides are usually made of many straight elements about 1 m long sep arated with small gaps e g 1 mm Sections of about 10 m long are separated with bigger gaps for accessibility and pumping purposes We give here an example description of such a section Let us have a curved guide of total length L made of n elements with a curvature radius R Gaps of size d separate elements from each other The rotation angle of individual straight guide elements is a L d R x 180 7 in degrees In order to build an independent curved guide section we define Arm components at the begining and end of it COMPONENT CG_In Arm AT COMPONENT CG_1 Guide gravity l L n AT 0 0 0 RELATIVE PREVIOUS COMPONENT CG2 Guide gravity l L n AT 0 0 L n d RELATIVE PREVIOUS ROTATED 0 L n d R 180 PI 0 RELATIVE PREVIOUS COMPONENT CG_Out Arm AT 0 0 L n RELATIVE PREVIOUS The Guide component should be duplicated n times by copy paste but changing the instance name e g CG_1 CG_2 CG_n This may
78. contrast to Source_adapt this optimizer does not record correlations between neutron parameters Nevertheless it is rather efficient enabling the user to increase the number of events at optimization criteria locations by typically a factor of 20 Hence the signal error bars will decrease by a factor 4 5 since the overall flux remains unchanged 3 9 1 The optimization algorithm When a neutron reaches the Monitor_Optimizer location s the component records its previous position x y and speed vz vy vz when it passed in the Source_Optimizer Some distribution tables of good neutrons characteristics are then built When a bad neutron comes to the Source_Optimizer it would then have few chances to reach Monitor_Optimizer it is changed into a better one That means that its position and velocity coordinates are translated to better values according to the good neutrons distribution tables The neutron energy v v2 v is kept as far as possible The Source_Optimizer works as follow 1 First of all the Source_Optimizer determines some limits min and maz for variables Y Ur Vy Vz 2 Then the component records the non optimized flux distributions in arrays with bins cells default is 10 cells This constitutes the Reference source 3 The Monitor_Optimizer records the good neutrons that reach it and communi cate an Optimized beam requirement to the Source_Optimizer However retains keep percent of the origin
79. ctions will have different values of F Q and hence of Q jj exp 2W and 6 The total attenuation through the sample due to scattering is given by p we j Hj where fi represents the incoherent scattering 8 3 4 Algorithm The algorithm of PowderN can be summarized as 92 Check if the neutron ray intersects the sample otherwise ignore the following Calculate the attenuation coefficients for scattering and absorption Perform Monte Carlo choices to determine the scattering position scattering type coherent incoherent and the outgoing direction Perform the necessary weight factor transformation 93 N o NaON AWU 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 8 4 Single crystal The single crystal component Input Parameters for component Single_crystal from samples lt Parameter value gt Unit Description lt mosaic_AB Mosaic_AB_Undefined gt arc minutes arc_minutes 1 1 1 1 1 1 In Plane mosaic rotation and plane vectors anisotropic mosaic_A mosaicB Ah Ak A 1 B h B k B l Puts the crystal in the in plane mosaic state Vectors A and B define plane in which the crystal roation is defined and mosaic_A mosaic_B denotes the resp mosaicities gaussian RMS with respect to the the two reflections chosen by A and B Miller indices lt reflections 0 gt string File name containin
80. ctor If any of the choices in the method fails 1 the two roots kt and ky are imaginary which means that conservation laws can not be satisfied and for instance the selected energy transfer is higher than the incoming neutron energy 2 the radius of the target circle is imaginary that is cos 0 gt 1 118 then a new q w set is drawn and the process is iterated until success or at last removal of the neutron event These latter absorptions are then reported at the end of the simulation as it never occurs in reality neutrons that scatter do find a suitable q w set The S q w data sets should be as wide a possible in q and w range else scattering con ditions will be limited by the reduced data set specially multiple scattering estimates On the other hand when q and w ranges are too large some Monte Carlo choices lead to scattering temptatives in non useful regions of S which reduces dramatically the algorithm efficiency The best settings are 1 to have the widest q and w range for S q w data sets 2 to either set wmax and qmazx to the maximum scatterable energy and wavevectors 3 or alternatively request the automatic range optimisation by setting parameter auto_qw 1 This is recommended but may sometimes miss a few neutrons if the q w beam range has been guessed too small Focusing the q and w range e g with auto qw 1 to the one being able to scatter the incoming beam when using the component does
81. d Fermi chopper lt diameter 0 071 gt m diameter of the shadowing cylinder lt Phase 0 0 gt deg dephasing angle at zero time lt wallwidth 0 0002 gt m thickness of walls separating the channels The component Vitess_ChopperFermi simulates a Fermi chopper with absorbing walls The shape of the channels can be straight curved with circular or curved with ideal i e close to a parabolic shape This is determined by the parameter GeomOp tion In the option straight Fermi chopper the very fast neutrons are transmitted with only a time modulation and lower speed neutrons are modulated both in time of flight and wavelength If the channels are curved the highest transmission occurs for a wavelength _ 3956 m s Aopt eras 6 7 with w 2rf 6 8 The optimal shape is calculated in an exact way and is close to parabolic in this case transmission is as high for the optimal wavelength as in the case of a straight Fermi 67 chopper for the limit A gt 0 In the more realistic case of circular shapes channels the transmission is slightly lower In general neutrons are transmitted through a curved Fermi chopper with a time AND wavelength modulation The rotation axis is vertical y axis i e the path length through the channels is given by the length l along the z axis The inital orientation is given by the phase of the chopper 0 means transmission orientation Geometry for straight and c
82. d by 2a L M A T The component Source_gen see section 3 4 works on the same principle but pro vides more options concerning wavelength energy range specifications shape etc Maxwellian parameters for some continuous sources are given in Table 4 1 As nobody knows exactly the characteristics of the sources it is not easy to measure spectrum there these figures should be used with caution 3 4 Source gen A general continuous source Input Parameters for component Source_gen from sources lt Parameter value gt Unit Description lt flux_file NULL gt str Name of a two columns lambda flux text file that contains the wavelength distribution of the flux in lt b gt either lt b gt 1 s cmx 2 st lt b gt or lt b gt 1 s cm 2 st AA see flux_file_perAA flag compatible with McStas PGPLOT wavelength monitor files When specified temperature and intensity values are ignored lt xdiv_file NULL gt str Name of the x horiz divergence distribution file given as a free format text matrix preceeded with a line lt ydiv_file NULL gt str Name of the y vert divergence distribution file given as a free format text matrix preceeded with a line lt radius 0 0 gt m Radius of circle in x y 0 plane where neutrons are generated You may also use yheight and xwidth for a square source lt dist 0 gt m Distance to target along z axis lt focus_xw 0 045 gt
83. define a density matrix operator 2 aa fla ab _ 1 a P XX des o _ zZ tP 0 A 18 where x is the neutron wave function Eq A 5 and Z is the unit matrix Using the density matrix the elastic cross section can be written as Lov84 Eq 10 31 d aos 5 z a Trpits Y ATA A NATO EAE Ey A 19 A r where V is the interaction potential and it is understood that the trace is to be taken with respect only to the neutron spin coordinates The outgoing polarization is given 151 as do P dQ Tr t Y py TAAVI 5 X AV 6 A 5 E Ey A 20 A r Inserting Eq in Eq and Eq results in the two master equations for polarized neutron scattering Tr t at 618 Bi a P a P B4 iP al x A 21 and Trpotoo Para BP a a amp P al P a P al amp ial x a i6t axP i Pxaty 3 A 22 Based on these two equations and the interaction potentials all the results presented in the following are derived in A 3 1 Example Nuclear scattering The nuclear scattering potential for a crystal is A 1 2 Vwv x ys exp ik Ria Ata Piao La A 23 1d so that a y exp ik d Ra Bola A 24 2 1d B gt exp ik Rig Ata A 25 1d where I is the nuclear spin operator and the constants A and B are related to the nuclear scattering lengths bt and b as A I 1 bt Ib 21 1 and B bt b 22 1 To calculate the polarization cross section
84. des e Transmission through filters and windows e Transmission through Soller blade collimators and velocity selectors in the ap proximation which does not take each blade into account e Reflection from monochromator and analyzer crystals with finite reflectivity and mosaicity e Reflection from guide walls e Passage of a continuous beam through a chopper e Scattering from all types of samples 2 2 1 Statistical errors of non integer counts In a typical simulation the result will consist of a count of neutrons histories rays with different weights The sum of these weights is an estimate of the mean number of neutrons hitting the monitor or detector per second in a real experiment One may write the counting result as 19 where N is the number of rays hitting the detector and the horizontal bar denotes averaging By performing the weight transformations the statistical mean value of I is unchanged However N will in general be enhanced and this will improve the accuracy of the simulation To give an estimate of the statistical error we proceed as follows Let us first for simplicity assume that all the counted neutron weights are almost equal p p and that we observe a large number of neutrons N gt 10 Then N almost follows a normal distribution with the uncertainty o N VN Hence the statistical uncertainty of the observed intensity becomes o 1 VNp I VN 2 4 as is used in rea
85. dimensional Gaussian in global coordinates is 1 1 T U y r DU y 7 8 21 G y O 8 21 The elastic coherent cross section is then given by Oo T 3 ESA No 2 G r F 8 22 8 4 2 The algorithm The overview of the algorithm used in the Single_crystal component is as follows 1 Check if the neutron intersects the crystal If not no action is taken 2 Search through a list of reciprocal lattice points of interest selecting those that are close enough to the Ewald sphere to have a non vanishing scattering proba bility From these compute the total coherent cross section Ccon see below the 2200 m s gt and the total cross section oto absorption cross section Cabs 02200 Ocoh Cinc Tabs 3 The transmission probability is exp Te L where is the length of the flight path through the crystal A Monte Carlo choice is performed to determine whether the neutron is transmitted Optionally the user may set a fixed Monte Carlo probability for the first scattering event for example to boost the statistics for a weak reflection 4 For non transmission the position at which the neutron will interact is selected from an exponential distribution A Monte Carlo choice is made of whether to scatter coherently or incoherently Absorption is treated by weight adjustment see below 98 Tangential plane Figure 8 5 The scattering triangle in the single crystal 5 For inc
86. dow As an alternative you may use the Exact_radial_coll contributed component For a rectangular shaped collimator instead of cylindrical radial you may use the Guide_channeled and the Guide_gravity components 49 5 Reflecting optical components mirrors and guides This section describes advanced neutron optical components such as supermirrors and guides as well as various rotating choppers A description of the reflectivity of a super mirror is found in section This section describes advanced neutron optical components such as supermirrors and guides A description of the reflectivity of a supermirror is found in section 5 1 5 1 Mirror The single mirror Name Mirror Author System Input parameters l h m Optional parameters Ro Qc W a reflect Notes validated no gravitation support The component Mirror models a single rectangular neutron mirror plate It can be used as a sample component or to e g assemble a complete neutron guide by putting multiple mirror components at appropriate locations and orientations in the instrument definition much like a real guide is build from individual mirrors In the local coordinate system the mirror lies in the first quadrant of the x y plane with one corner at 0 0 0 The input parameters of this component are the rectangular mirror dimensions l h and the values of Ro m Qe W and a for the mirror reflectivity As a special case if m 0 the
87. e contains useful neutrons This component uses the correlation between neutron energy initial direction and initial position The physical characteristics of the source are similar to those of Source_simple see section 3 1 The source is a thin rectangle in the x y plane with a flat energy spectrum in a user specified range The flux per area per steradian per Angstrom per second is specified by the user The initial neutron weight is given by Eq using A as the total wavelength range of the source A later version of this component will probably include a A dependence of the flux We use the input parameters dist cw and yh to set the focusing as for Source_simple section 3 1 The energy range will be from Eg dE to Ey dE filename is used to give the name of a file in which to output the final sampling destribution see below Neng 35 Npos and Naiv are used to set the number of bins in each dimensions Good general purpose values for the optimization parameters are a PB 0 25 The number of bins to choose will depend on the application More bins will allow better adaption of the sampling but will require more neutron histories to be simulated before a good adaption is obtained The output of the sampling distribution is only meant for debugging and the units on the axis are not necessarily meaningful Setting the filename to NULL disables the output of the sampling distribution 3 7 1 Optimization disclaimer A warn
88. e then all sampled individually The advantage is that we are then sure that each sub space 21 Figure 2 1 Illustration of the effect of direction focusing in McStas Weights of neutrons emitted into a certain solid angle are scaled down by the full unit sphere area is well represented in the final integrals This means that instead of shooting N events we define D partitions and shoot r N D events in each partition In conjunction with adaptive sampling we may define partitions so that they represent interesting distributions e g from events scattered on a monochromator or a sample The sum of partitions should equal the total space integrated by the Monte Carlo method and each partition must be sampled randomly In the case of McStas an ad hoc implementation of adaptive stratified is used when re peating events such as in the Virtual sources Virtual_input Vitess_input Virtual_menp input Virtual tripoli4 input and when using the SPLIT keyword in the TRACE section on instrument descriptions We emphasize here that the number of repetitions r should not exceed the dimensionality of the Monte Carlo integration space which is d 10 for neutron events and the dimensionality of the partition spaces i e the number of random generators following the stratified sampling location in the instrument 2 5 Accuracy of Monte Carlo simulations When running a Monte Carlo the meaningful quantities are obtained by integrating rand
89. e K Lefmann and K Nielsen Neutron News 10 3 20 1999 e P Willendrup E Farhi and K Lefmann Physica B 350 735 2004 11 1 About the component library This McStas Component Manual consists of the following major parts e An introduction to the use of Monte Carlo methods in McStas e A thorough description of system components with one chapter per major cate gory Sources optics monochromators samples monitors and other components e The McStas library functions and definitions that aid in the writing of simulations and components in Appendix B e An explanation of the McStas terminology in Appendix C Additionally you may refer to the list of example instruments from the library in the McStas User Manual 1 1 Authorship The component library is maintained by the McStas system group A number of basic components belongs the McStas system and are supported and tested by the McStas team Other components are contributed by specific authors who are listed in the code for each component they contribute as well as in this manual McStas users are encouraged to send their contributions to us for inclusion in future releases Some contributed components have later been taken over for further development by the McStas system group with permission from the original authors The original authors will still appear both in the component code and in the McStas manual 1 2 Symbols for neutron scattering and sim
90. e detector is pipt From k and kf we may compute the scattering parameters x ki ke and hw h 2my k k The vectors are given in the local coordinate system of the resolution sample component The wave vectors are in units of AS the energy transfer in meV The output parameters from Res monitor are the three count numbers Nsum psum and p2sum and the handle file of the output file 146 10 6 Progress bar Simulation progress and automatic saving Name Progress _bar Author System Input parameters percent flag_save profile Optional parameters Notes This component displays the simulation progress and status but does not affect the neutron parameters The display is updated in regular intervals of the full simulation the default step size is 10 but it may be changed using the percent parameter from 0 to 100 The estimated computation time is displayed at the begining and actual simulation time is shown at the end Additionally setting the flag_save to 1 results in a regular save of the data files during the simulation This means that is is possible to view the data before the end of the computation and have also a trace of it in case of computer crash The achieved percentage of the simulation is stored in these temporary data files Technically this save is equivalent to sending regularly a USR2 signal to the running simulation The optional profile parameter when set to a file na
91. e ene eee eee 167 C The McStas terminology 169 Preface and acknowledgements This document contains information on the neutron scattering components which are the building blocks for defining instruments in the Monte Carlo neutron ray tracing program McStas version 2 1 The initial release in October 1998 of version 1 0 was presented in Ref and further developed though version 2 0 as presented in Ref Wil 14 The reader of this document is not supposed to have specific knowledge of neutron scattering but some basic understanding of physics is helpful in understanding the theoretical background for the component functionality For details about setting up and running simulations we refer to the McStas system manual Wil 05 We assume familiarity with the use of the C programming language It is a pleasure to thank Dir Kurt N Clausen PSI for his continuous support to McStas and for having initiated the project Continuous support to McStas has also come from Prof Robert McGreevy ISIS Apart from the authors of this manual also Per Olof strand NTNU Trondheim has contributed to the development of the McStas system We have further benefited from discussions with many other people in the neutron scattering community too numerous to mention here The users who contributed components to this manual are acknowledged as authors of the individual components We encourage other users to contribute components with manual entries for inclusion i
92. e to unity for large r and q values respectively and they are representative of the atoms spatial distribution In a liquid limy 0 S q pkaT xr 112 where xr ae v r is the compressibility Ege67 FBS06 In perfect gases S q 1 for OP Y all q These quantities are obtained experimentally from diffractometers In principle Sinclq 1 in all materials but a q dependence is rather usual partly due to the Debye Waller factor e 7 4 Anyway Sinc q converges to unity at high q The static pair correlation function g r is the probability to find a neighbouring atom at a given distance unitless Since g 0 0 Eq provides a useful normalisation sum rule for coherent S q q S q 1 dq 27 p for coherent contribution 8 52 0 This means that the integrated oscillations around 1 of Seon q are directly related to the density of the material p In practice the function S q is often known on a restricted range q 0 max due to either limitations in the sample molecular dynamics simulation or the measurement itself In first approximation we consider that Eq can be applied in this range i e we neglect the large q contributions provided S q 1 converges faster than 1 q This is usually true after 2 3 oscillations of S q in liquids Then in isotropic liquid like materials Eq provides a normalisation sum rule for S 8 7 3 Theoretical side scattering in the sample The Eq controls the scattering
93. eam current Jtarget Which is currently of the order 1 2 mA lt flux_file_perAA 0 gt 1 When true 1 indicates that flux file data is already per Angstroem If false file data is per wavelength bin lt flux_file_log 0 gt 1 When true will transform the flux table in log scale to improve the sampling lt Lmin 0 gt AA Minimum wavelength of neutrons lt Lmax 0 gt AA Maximum wavelength of neutrons lt Emin 0 gt meV Minimum energy of neutrons lt Emax 0 gt meV Maximum energy of neutrons lt T2 0 gt K Second Maxwellian source Temperature 0 none lt I2 0 gt 1 cm 2 sr AA Second Maxwellian Source flux lt T3 0 gt K Third Maxwellian source Temperature O none lt I3 0 gt 1 cm 2 sr AA Third Maxwellian Source flux lt zdepth 0 gt m Source z zdepth not anymore flat lt target_index 1 gt 1 relative index of component to focus at e g next is 1 this is used to compute dist automatically This component is a continuous neutron source rectangular or circular which aims at a rectangular target centered at the beam The angular divergence is given by the dimensions of the target The shape may be rectangular dimension h and w or a disk of radius r The wavelength energy range to emit is specified either using center and half width or using minimum and maximum boundaries alternatively for energy and wavelength The flux spectrum is specified with the same Maxwellian pa
94. econd not in rotations per minute as in V_selector 72 o D00O0AaAQ0NA 7 Monochromators In this class of components we are concerned with elastic Bragg scattering from monochro mators Monochromator_flat models a flat thin mosaic crystal with a single scattering vector perpendicular to the surface The component Monochromator_curved is phys ically similar but models a singly or doubly bend monochromator crystal arrangement A much more general model of scattering from a single crystal is found in the compo nent Single crystal which is presented under Samples chapter 8 7 1 Monochromator flat An infinitely thin flat mosaic crystal with a single scattering vector Input Parameters for component Monochromator_flat from optics lt Parameter value gt Unit Description lt zmin 0 05 gt m Lower horizontal z bound of crystal lt zmax 0 05 gt m Upper horizontal z bound of crystal lt ymin 0 05 gt m Lower vertical y bound of crystal lt ymax 0 05 gt m Upper vertical y bound of crystal lt zwidth 0 gt m Width of crystal instead of zmin and zmax lt yheight 0 gt m Height of crystal instead of ymin and ymax lt mosaich 30 0 gt arc minutes Horizontal mosaic in z direction FWHM lt mosaicv 30 0 gt arc minutes Vertical mosaic in y direction FWHM lt r0 0 7 gt 1 Maximum reflectivity lt Q 1 8734 gt 1 angstrom Magnitude of scattering vector lt DM 0
95. ed neutrons along the path and we may in the following treat the event as a scattering event Additionally the type of interaction coherent or incoherent is chosen randomly with fractions 0 E and Cincel Ei The position of the neutron scattering event along the neutron trajectory length dei is determined by MPC77 In 1 1 e74 Eidezit 8 58 where is a random number in 0 1 This expression takes into account secondary extinction originating from the decrease of the beam intensity through the sample self shielding 115 Choosing the q and w transfer from S q w The choice of the q w wavevector energy transfer pair could be done randomly as in the first event of the second order scattering evaluation in DISCUS Johre but it is somewhat inefficient except for materials showing a broad quasi elastic signal As the scattering originates from structural peaks and excitations in the material S q w it is usual to adopt an importance sampling scheme by focusing the q w choice to areas where the intensity of S q w is high In practice this means that the neutron event should scatter preferably on e g Bragg peaks quasielastic contribution and phonons The main idea to implement the scattering from S q w is to cast two consecutive Monte Carlo choices using probability distribution built from the dynamic structure factor We define first the probability P w as the unweighted fraction of modes whose ene
96. ed to calculate the probability for scat tering along one certain direction Q from one phonon mode To do this we must integrate out the delta functions in the cross section 8 40 We here use that hw g h k ke 2myn k ki keky and the integration rule f 6 f x df dz 0 Now we reach do d o ke hen 1 1 E Nb K pa ins 8 41 5 7 man ki 2M di e I Fey n 2 5 Ban where the Jacobian reads mn 0 ea 42 A rough order of magnitude consideration gives Sa x1 Je 1 nk 5 3 1 ste jr Hence 26 xN Dbm and the phonon cross section becomes a fraction of the total scattering cross section 4r Nb as it must be The differential cross section per unit volume is found from 8 41 by replacing N with 1 Vo The total weight transformation now becomes ke j hr 14 ee ee ee ae 8 43 ki 2VoM dy k I kr n t3 3 343 2 Ti AlinlmaxNnsANQb where ns is the number of possible dispersion values in the chosen direction The Test_Phonon test example instrument exists in the distribution for this compo nent 108 00 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 8 7 Isotropic Sqw A general S q w coherent and incoherent scatterer Input Parameters for component Isotropic_Sqw from samples lt Parameter value gt Unit Description lt powder_format Undefined gt no quot
97. eed obtaining accurate and reliable results requires a substantial work when writing instrument descriptions This also means that users should read carefully both the documentation from the manuals and from the component itself using mcdoc comp before reporting errors Most anomalous results often originate from a wrong usage of some part of the package Anyway if you find that either the documentation is not clear or the behavior of the simulation is undoubtedly anomalous you should report this to us at mcstas risoe dk and refer to our special bug request reporting service Mcz 17 2 Monte Carlo Techniques and simulation strategy This chapter explains the simulation strategy and the Monte Carlo techniques used in McStas We first explain the concept of the neutron weight factor and discuss the statistical errors in dealing with sums of neutron weights Secondly we give an expression for how the weight factor transforms under a Monte Carlo choice and specialize this to the concept of direction focusing Finally we present a way of generating random numbers with arbitrary distributions More details are available in the Appendix concerning random numbers 2 1 Neutron spectrometer simulations 2 1 1 Monte Carlo ray tracing simulations The behavior of a neutron scattering instrument can in principle be described by a complex integral over all relevant parameters like initial neutron energy and divergence scattering vector and pos
98. ek only one value of n namely the one which makes nQo closest to the projection of 2k onto Qo see figure 7 1 Once n has been determined the Bragg angle 0 can be computed The angle a is the amount one would need to turn the nominal scattering vector Qo for the monochroma tor to be in Bragg scattering condition We now use a to compute the probability of reflection from the mosaic crystal Preflect Roe 4 27 7 2 The probability Prefect is used in a Monte Carlo choice to decide whether the neutron is transmitted or reflected In the case of reflection the neutron will be scattered into the Debye Scherrer cone with the probability of each point on the cone being determined by the mosaic The Debye Scherrer cone can be described by the equation kr k cos 20 sin 20 c cos y bsiny yp E lr 7 7 3 where b is a vector perpendicular to k and Qo c is perpendicular to k and b and both b and c have the same length as ki see figure 7 2 When choosing y and thereby kt 74 4 400 i 3Q0 2Q0 QO Figure 7 1 Selection of the Bragg order 2 in this case only a small part of the full 7 7 range will have appreciable scattering probability in non backscattering configurations The best statistics is thus obtained by sampling y only from a suitably narrow range The small deviation angle a of the nominal scattering vector nQo corresponds to a Aq of Aq a2k sin 7 4 The angle p corresponds to
99. ent Technical University of Denmark Kongens Lyngby Denmark Emmanuel Farhi lt farhi ill fr gt Institut Laue Langevin Grenoble France Erik Knudsen lt erkn fysik dtu dk gt Physics Department Technical University of Denmark Kongens Lyngby Denmark Kim Lefmann lt lefmann nbi dk gt Niels Bohr Institute University of Copenhagen Denmark as well as authors who left the project Peter Christiansen lt pchristiChep lu se gt Materials Research Department Riso National Laboratory Roskilde Den mark Present address University of Lund Lund Sweden Klaus Lieutenant lt klaus lieutenant helmholtz berlin de gt Institut Laue Langevin Grenoble France Present address Helmotlz Zentrum Berlin Germany Kristian Nielsen lt kristian nielsen mail tele dk gt Materials Research Department Ris National Laboratory Roskilde Den mark Presently associated with MySQL AB Sweden ISBN 978 87 550 3680 2 ISSN 0106 2840 Information Service Department Riso DTU 2015 Contents 10 12 LL Atithorshipliccio2 4 a5 6 dc a e ds o a a ke ee GB 12 Ec 12 ran God de E 13 1 4 About data files o e e 13 AI daw ek GP 13 De ede boa dee eee ee haa Pade BA Hagia 14 Ba HR bE Bes A ee Be od ee a a 16 Da af ee oe Ge ee eae ee 17 2 Monte Carlo Techniques and simulation strategy 18 ik Gee WS Be ee a ho ae e 18 ea 18 2 2 The neutron weight e o 19 di lease 19 2 3 Weight factor transformati
100. ent Divergence_monitor from monitors lt Parameter value gt Unit Description lt nh 20 gt 1 Number of pixel rows lt nv 20 gt 1 Number of pixel columns lt filename 0 gt text Name of file in which to store the detector image lt xmin 0 05 gt m Lower x bound of detector opening lt xmax 0 05 gt m Upper x bound of detector opening lt ymin 0 05 gt m Lower y bound of detector opening lt ymax 0 05 gt m Upper y bound of detector opening lt xwidth 0 gt m Width of detector Overrides xmin xmax lt yheight 0 gt m Height of detector Overrides ymin ymax lt maxdiv_h 2 gt degrees Maximal vertical divergence detected lt maxdiv_v 2 gt degrees Maximal vertical divergence detected lt restore_neutron 0 gt 1 If set the monitor does not influence the neutron state lt nx 0 gt 1 lt ny 0 gt 1 Vector definition of forward direction wrt divergence to be used e g when the monitor is rotated into the horizontal plane lt nz 1 gt 1 The component Divergence_monitor is a two dimensional monitor which resem bles PSD_Monitor As for this component the detector window is set by the x and y input coordinates Divergence_ monitor is sensitive to the neutron divergence defined by m tan7 v vz and ny tan t vy vz The neutron counts are being histogrammed into ny X ny pixels The divergence range accepted is in the vertical direction 7y max v ma
101. ent exists with a honeycomb geometry 5 5 Bender a bender model non polarizing Name Bender Author Philipp Bernhardt Input parameters r Win l w h Optional parameters k d Rojas ais Mja is QcJa i s Wia i s Notes partly validated no gravitation support 56 E OU0O0IDOdOadAauNR The Bender component is simulating an ideal curved neutron guide bender It is bent to the negative X axis and behaves like a parallel guide in the Y axis Opposite curvature may be achieved by a 0 0 180 rotation along Z axis Bender radius r entrance width w and height h are required parameters To define the length you may either enter the deviation angle W n or the length l Three different reflectivity profiles Ro Qe W m a can be given see section 5 1 for outer walls index a for inner walls index and for the top and bottom walls index s To get a better transmission coefficient it is possible to split the bender into k channels which are separated by partitions with the thickness of d The partitioning walls have the same coating as the exterior walls Because the angle of reflection doesn t change the routine calculates the reflection coefficent for the concave and if necessary for the convex wall only onces together with the number of reflections Nevertheless the exact position the time and the divergence is calculated at the end of the bender so there aren t any approximations The
102. ent will be neglected These are the ones that scatter off the side of the beam stop or penetrates the absorbing material Further the holder of the beamstop is not simulated Beamstop can be either circular or rectangular The input parameters of Beamstop are the four coordinates min max Ymin Ymax defining the opening of a rectangle or the radius r of a circle depending on which parameters are specified If the direct beam e g after a monochromator or sample should not be simulated it is possible to emulate an ideal beamstop so that only the scattered beam is left without the use of Beamstop This method is useful for instance in the case where only neutrons scattered from a sample are of interest The example below removes the direct beam and any background signal from other parts of the instrument COMPONENT MySample V _sample AT if SCATTERED ABSORB 4 4 Filter_gen A general filter using a transmission table Input Parameters for component Filter from optics 1 lt Parameter value gt Unit Description This component is an ideal flat filter that changes the neutron flux according to a 1D input table text file 45 File name Description Be trm Berylium filter for cold neutron spectrometers e g k lt 1 55 AN HOPG trm Highly oriented pyrolithic graphite for 2 filtering e g ther mal beam at k 1 64 2 662 and 4 1 T Sapphire trm Sapphire Al203 filter for f
103. er default is 0 i e save all recommended The component Virtual_output stores the neutron ray parameters at the end of the first part of a split simulation The idea is to let the next part of the split simulation be performed by another instrument file which reads the stored neutron ray parameters by the component Virtual_input All neutron ray parameters are saved to the output file which is by default of text type but can also assume the binary formats float or double The storing of neutron rays continues until the specified number of simulations have been performed buffer size may be used to limit the size of the output file but absolute intentities are then likely to be wrong Exept when using MPI we recommend to use the default value of zero saving all neutron rays The size of the file is then controlled indirectly with the general ncounts parameter 10 2 Virtual_input Starting the second part of a split simulation Input Parameters for component Virtual_input from sources lt Parameter value gt Unit Description lt filename 0 gt str Name of the neutron input file Empty string unactivates component lt verbose 0 gt 0 1 Display additional information about source recommended lt repeat_count 1 gt 1 Number of times the source must be generated repeated lt smooth 1 gt 0 1 Smooth sparsed event files for filename repetitions Use this option with MPI This will apply gaus
104. ered Use 0 for all This component simulates an array of infinitely thin single crystals with a single scattering vector perpendicular to the surface and a mosaic spread This component is used to simulate a singly or doubly curved monochromator or analyzer in reflecting geometry The component uses rectangular pieces of monochromator material as described in Monochromator_curved The scattering vector is named Q and as described in Monochromator_flat multiples of Q will be applied Other important parameters are the piece height and width y and zw respectively the horizontal and vertical mosaicities 7 and ny respectively If just one mosaicity 7 is specified this the same for both directions The number of pieces vertically and horizontally are called ny and np respectively 77 SGNIowrwnr and the vertical and horizontal radii of curvature are named r and rp respectively All single crystals are positioned in the same vertical plane but tilted accordingly to the curvature radius The constant monochromator reflectivity Ro can be replaced by a file of tabulated reflectivities reflect rfl in MCSTAS data In the same sense the transmission can be modeled by a tabulated file transmit for non reflected neutrons trm in MCSTAS data The most useful of these files for Monochromator_curved are HOPG r1f and HOPG trm As for Monochromator flat the crystal is assumed to be infinitely thin and the variation in lattice sp
105. es name or definition of column indexes in file lt Sqw _coh 0 gt str Name of the file containing the values of Q w and S Q w Coherent part Q in Angs 1 E in meV S q w in meV 1 Use 0 NULL or to disable lt Sqw inc 0 gt str Name of the file containing the values of Q w and S Q w Ve Incoherent self part Use 0 NULL or to scatter isotropically V like lt geometry 0 gt str Name of an Object File Format OFF or PLY file for complex geometry The OFF PLY file may be generated from XYZ coordinates using qhull powercrust lt radius 0 gt m Outer radius of sample in x z plane cylinder sphere lt thickness 0 gt m Thickness of hollow sample Negative value extends the hollow volume outside of the box cylinder lt xwidth 0 gt m width for a box sample shape lt yheight 0 gt m Height of sample in vertical direction for box cylinder shapes lt zdepth 0 gt m depth for a box sample shape lt threshold le 20 gt 1 Value under which S Q w is not accounted for to set according to the S Q w values i e not too low lt order 0 gt 1 Limit multiple scattering up to given order lt T 0 gt K Temperature of sample detailed balance Use T 0 to disable it and T 1 to automatically set it from non classical S q w lt verbose 1 gt 1 Verbosity level 0 silent l normal 2 verbose 3 debug A verbosity gt 1 also computes dispersions and S q w analysis lt
106. est instruments in McStas is given section A 5 We rely heavily on the books for the physics where the detailed calcu lations can be found The notation used here and in Wil88 is P scalar P vector P unit vector operator and amp vector of operators A 2 The Polarization Vector The spin of the neutron is represented by an operator for which only a single component can be measured at one time Each single measurement will give a value 1 2 but if we could make a large number of measurements on the same neutron state in each of the three axis directions and then make the average we get 8 The polarization vector P is then defined as P a A 1 so that 1 lt P lt 1 For a neutron beam which contains N neutrons each with a polarization P the beam polarization is defined as P 2a A 2 148 If we have one common quantization direction e g a magnetic field direction each neutron will either be spin up or spin down and the polarization can be expressed as n n Pai A 3 me ny where v nj is the number of neutrons with spin up down For a given neutron the probability of the neutron being spin up P is pie _m a n 2_1 P ny ny ne ny a and P Y 1 P t 1 P 2 The expectation value of the spin operator 6 which can be expressed by the Pauli matrices is the polarization vector P P 6 xlo x The most general form of
107. et Nrows Ncolumns does the same as Table_Read_Offset but also specifies the type of the file may be float or double the number Rrows of rows to read each of them having Neolumns Clements No text header should be present in the file e Table_Rebin 4 Table rebins all Table rows with increasing evenly spaced first column index 0 e g before using Table Value Linear interpolation is performed for all other columns The number of bins for the rebinned table is determined from the smallest first column step e Table_Info Table print information about the table Table e Table_Index Table m n reads the Table m n element e Table Value Table x n looks for the closest x value in the first column index 0 and extracts in this row the n th element starting from 0 The first column is thus the x axis for the data e Table Free 4T able free allocated memory blocks e Table Value2d Table X Y Uses 2D linear interpolation on a Table from X Y coordinates and returns the corresponding value Available functions to read an array of vectors matrices in a text file are e Table_Read_Array File amp n read and split file into as many blocks as neces sary and return a t_Table array Each block contains a single vector matrix This only works for text files The number of blocks is put into n e Table Free Array amp Table free the Table array e Table Info _Array T able display information about all data
108. eutrons which are similarly outside the monitor limits that may be other than geometrical The parallel option keyword is of common use in the case where the Monitor_nD is superposed with other components It ensures that neutrons are detected independently of other geometrical constrains This is generally the case when you need e g to place more than one monitor at the same place 132 0M OO 0NRA 9 8 2 The neutron parameters that can be monitored There are many different variables that can be monitored at the same time and position Some can have more than one name e g energy or omega kx ky kz k wavevector Angs 1 usually axis are vx vy vZ Vv m s x horz y vert z on axis x y Z m Distance Position kxy vxy xy radius m Radial wavevector velocity and position t time s Time of Flight energy omega meV lambda wavelength Angs p intensity flux n s or n cm 2 s ncounts 1 SX sy SZ 1 Spin vdiv ydiv dy deg vertical divergence y hdiv divergence xdiv deg horizontal divergence x angle deg divergence from direction theta longitude deg longitude x z for sphere and cylinder phi lattitude deg lattitude y z for sphere and cylinder as well as two other special variables user userl user2 user3 will monitor the Mon Name Vars UserVariable 1 2 to be assigned in an other component see below To tell the component what you want to monitor just add the variable names in the
109. finite thickness the beam is being attenuated by the attenuation coefficient HQ Fone Q V 8 16 For calibration it may be useful to consider the total intensity scattered into a detector of effective height h covering only one reflection ch 3 6 A cut though the Debye Scherrer cone perpendicular to its axis is a circle At the distance r from the sample the radius of this circle is rsin 20 Thus the detector in a small angle approximation counts a fraction h 27rsin 26 of the scattered neutrons giving a resulting count intensity I v hh T LO cone grp sin 20 where W is the flux at the sample position For clarity we repeat the meaning and unit of the symbols 8 17 begin tabular ccl Psi amp s 1 m 2 amp Incoming intensity of neutrons SIS amp s 1 amp Detected intensity of neutrons AN h amp m amp Height of detector r amp m amp Distance from sample to detector f amp 1 amp Packing factor of the powder j amp 1 amp Multiplicity of the reflection AN V_0 amp m 3 amp Volume of unit cell F bf Q 2 m 2 amp Structure factor AN exp 2W amp 1 amp Debye Waller factor AN mu_ rm Q m 1 Linear attenuation factor due to scattering from one powder line end tabular A powder sample will in general have several allowed reflections Q which will all contribute to the attenuation These refle
110. g the z axis completing a right handed coordinate system Most components position as specified in the instrument description with the AT keyword corresponds to their input side at the nominal beam position However a few components are radial and thus positioned in their centre Components are usually not designed to overlap This may lead to loss of neutron rays Warnings will be issued during simulation if sections of the instrument are not reached by any neutron rays or if neutrons are removed This is usually the sign of either overlapping components or a very low intensity 1 4 About data files Some components require external data files e g lattice crystallographic definitions for Laue and powder pattern diffraction S q w tables for inelastic scattering neutron events files for virtual sources transmission and reflectivity files etc Such files distributed with McStas are located in the data sub directory of the McStas library Components that make use of the McStas file system including the read table library see section may access all McStas data files without making local copies Of course you are welcome to define your own data files and eventually contribute to McStas if you find them useful File extensions are not compulsory but help in identifying relevant files per application We list powder and liquid data files from the McStas library in Tables 1 2 and 1 3 These files contain an extensive header describing phys
111. g structure factors of reflections Use empty or NULL for incoherent scattering only lt geometry 0 gt str Name of an Object File Format OFF or PLY file for complex geometry The OFF PLY file may be generated from XYZ coordinates using qhull powercrust lt xwidth 0 gt m Width of crystal lt yheight 0 gt m Height of crystal lt zdepth 0 gt m Depth of crystal no extinction simulated lt radius 0 gt m Outer radius of sample in x z plane lt delta_d_d le 4 gt 1 Lattice spacing variance gaussian RMS lt mosaic 1 gt arc minutes Crystal mosaic isotropic gaussian RMS Puts the crystal in the isotropic mosaic model state thus disregarding other mosaicity parameters lt mosaic_a 1 gt arc minutes Horizontal rotation around lattice vector a mosaic anisotropic gaussian RMS Put the crystal in the anisotropic crystal vector state I e model mosaicity through rotation around the crystal lattice vectors Has precedence over in plane mosaic model lt mosaic_b 1 gt arc minutes Vertical rotation around lattice vector b mosaic anisotropic gaussian RMS lt mosaic_c 1 gt arc minutes Out of plane Rotation around lattice vector c mosaic anisotropic gaussian RMS lt recip_cell 0 gt 1 Choice of direct reciprocal 0 1 unit cell definition lt barns 0 gt 1 Flag to indicate if F 2 from reflections is in barns or fm 2 barns 1 for laz and i
112. h 0 gt m Depth of box sample lt thickness 0 gt m Thickness of hollow sample Negative value extends the hollow volume outside of the box cylinder lt pack 1 gt 1 Packing factor lt Vc 0 gt AA 3 Volume of unit cell nb atoms per cell density of atoms lt sigma_abs 0 gt barns Absorption cross section per unit cell at 2200 m s Use a negative value to unactivate it lt sigma_inc 0 gt barns Incoherent cross section per unit cell Use a negative value to unactivate it lt delta_d_d 0 gt 0 1 Global relative delta_d_d d broadening when the w column is not available Use 0 if ideal lt p inc 0 1 gt 1 Fraction of incoherently scattered neutron rays lt p transmit 0 1 gt 1 Fraction of transmitted only attenuated neutron rays lt DW 0 gt 1 Global Debey Waller factor when the DW column is not available Use 1 if included in F2 lt nb_atoms 1 gt 1 Number of sub unit per unit cell that is ratio of sigma for chemical formula to sigma per unit cell lt d_phi 0 gt deg 0 180 Angle corresponding to the vertical angular range to focus to e g detector height 0 for no focusing lt p interact 0 gt 1 Fraction of events interacting with sample e g 1 p transmit p inc lt concentric 0 gt 1 Indicate that this component has a hollow geometry and may contain other components It should then be duplicated after the inside part only for box cylinder sphere lt density 0 gt
113. h is often the case in the course of the instrument simulation The memory requirements of the component are very low as no big n dimensional array is needed 3 9 2 Using the Source_Optimizer To use this component just install the Source Optimizer after a source but any location is possible afterwards in principle and use the Monitor_Optimizer at a location where you want to reach better statistics where to act on neutron beam COMPONENT optim_s Source_Optimizer options where to have better statistics COMPONENT optim_m Monitor_Optimizer xmin 0 05 xmax 0 05 ymin 0 05 ymax 0 05 optim_comp optim_s using more than one Monitor_Optimizer is possible The input parameter for Source_Optimizer is a single options string that can contain some specific optimizer configuration settings in clear language The formatting of the options parameter is free as long as it contains some specific keywords that can be sometimes followed by values The default configuration equivalent to options is 41 O0 DOANayE options continuous optimization auto setting keep 0 1 bins 0 1 smooth spikes SetX Y SetDivV SetDivS Parameters keep and step should be between 0 and 1 Additionally you may restrict the optimization to only some of the neutron parameters using the SetX Y SetV Sets SetDivV SetDivS keywords The keyword modifiers no or not revert the nex
114. hat scatter in 47 can not come back in the instrument description so that some of the multiple scat tering events are lost Namely in the previous example neutrons scattered by the outer wall of the cryostat s_out can not come back to the sample or to the other cryostat wall s_in As these neutrons have usually few chances to reach the rest of the simulation we expect that the approximation is fair 8 7 5 Validation For constant incoherent scattering mode V_sample PowderN Single crystal and Isotropic Sqw produce equivalent results eventhough the two later are more accurate geometry mul tiple scattering Execution times are equivalent Compared with the PowderN component the S q method is twice slower in compu tation time and intensity is usually lower by typically 20 depending on scattering 123 cross sections the difference arising from multiple scattering and secondary extinction not handled in PowderN The PowderN component is intrinsically more accurate in q as each Bragg peak is handled separately as an exact Dirac peak with optional Ag spreading In Isotropic_Sqw an approximated S q table is built from the F data and is coarser Still differences in the diffraction pattern are limited The Isotropic_ Sqw component has been benchmarked against real experiment for liq uid Rubidium Copley 1974 and liquid Cesium Bodensteiner and Dorner 1989 and the agreement is excellent The Test_Isotropic_Sqw test e
115. he zero_time 1 option A phase guess value may be set automatically using the zero_time 2 option The curvature of the slit channels is specified with the curvature parameter Positive sign indicates that the deviation bump due to curvature is in the 2 positive side and the center of curvature is in the 2 negative side The optimal radius of curvature R is related to frequency v and neutron velocity v with v 4r Rv The component was validated extensively by K Lieutenant As an alternative one may use the Vitess_ChopperFermi component eventhough slower and without super mirror support or the FermiChopper_ILL contributed component The Guide_gravity component has also a rotating mode using an approximation of a Fermi Chopper 6 2 2 Propagation in the Fermi chopper As can be seen in figure neutrons first propagate onto the cylinder surface of the chopper yellow curve Then the program checks the interaction with the entrance of the slit package orange line and calculates which slit is hit If the slit coating is reflecting m gt 0 multiple reflections are calculated green blue and maroon circles otherwise the neutrons are absorbed as soon as they interact with the blades Finally the remaining neutrons propagate to the exit of the chopper red curve The rotation of the chopper is characterized by the angle 6 between the rotating z and the static z axis 9 t is defined by ee d t Be w t to w t Do
116. hen transfer it into the UserMonitor all fitting in an EXTEND block This is performed in a 4 steps process 1 Declare that you intend to monitor user variables in a Monitor_nD instance defined in TRACE 1 DECLARE 2 a 3 include monitor_nd lib 4 MONNDDECLARE UserMonitor will monitor custom things in UserMonitor 51 i Initialize the label of the user variable optional INITIALIZE Zot MONND_USER_TITLE UserMonitor 1 Log time Zo The value 1 could be or 3 for the user2 user3 variable 3 Set the user variable value in a TRACE component EXTEND block 1 TRACE 2 ME 3 COMPONENT blah blah_comp 4 EXTEND 5 attach a value to useri in UserMonitor could be much more comlex here 6 MONND_USER VALUE UserMonitor 1 log t 71 8 M6 S Tell the Monitor_nD instance to record user variables TRACE ee COMPONENT UserMonitor Monitor_nD options auto userl Setting the user variable values may either make use of the neutron parameters x y z VX Vy VZ t Sx sy sz p access the internal variables of the component that sets the user variables in this example those from the blah instance access any component OUTPUT parameter using the MC_GETPAR C macro see chapter B or simply use a global instrument variable Instrument parameters can not be used directly 137 00 D0dNdRAQNE NONNNONNN
117. hollow geometry and may contain other components It should then be duplicated 83 Figure 8 2 The geometry of the hollow cylinder vanadium sample 28 after the inside part only for box cylinder sphere 29 lt order 0 gt Limit multiple scattering up to given order A sample with incoherent scattering e g vanadium is frequently used for calibration purposes as this gives an isotropic elastically scattered beam The component V_sample has only absorption and incoherent elastic scattering For the sample geometry we default use a hollow cylinder which has the solid cylinder as a limiting case The sample dimensions are Inner radius ri outer radius ro and height h see figure 8 2 Alternatively the sample geometry can be made rectangular by specifying the width Wg the height hy and the thickness tz The incoherent and absorption cross sections for V are default for the component For other choices the parameters Cinc Caps and the unit cell volume Vo should be specified For a loosely packed sample also the packing factor fpack can be specified default value of 1 8 1 1 Physics and algorithm The incoherent scattering gives a uniform angular distribution of the scattered neutrons from each nucleus y Q 1 47 For the focusing we choose to have a uniform distribu tion on a target sphere of radius foc at the position Utarget Ytarget Ztarget in the local coordinate system This gives an angula
118. ht edge lt ymin 0 gt m Lower edge lt ymax 0 gt m Upper edge lt xwidth 0 gt lt yheight 0 gt lt filename 0 gt string Optional filename for adaptive distribution output lt dist 0 gt m Distance to target rectangle along z axis lt focus_xw 0 05 gt m Width of target lt focus_yh 0 1 gt m Height of target lt E0 0 gt meV Mean energy of neutrons lt dE 0 gt meV Energy spread energy range is from E0 dE to E0 dE lt lambda0 0 gt AA Mean wavelength of neutrons if energy not specified lt dlambda 0 gt AA Wavelength spread half width lt flux 1e13 gt 1 cm 2 AAx xst Absolute source flux lt target_index 4 1 gt 1 relative index of component to focus at e g next is 1 this is used to compute dist automatically lt alpha 0 25 gt 1 Learning cut off factor 0 lt alpha lt 1 lt beta 0 25 gt 1 Aggressiveness of adaptive algorithm 0 lt beta lt 1 Source_adapt is a neutron source that uses adaptive importance sampling to im prove the efficiency of the simulations It works by changing on the fly the probability distributions from which the initial neutron state is sampled so that samples in regions that contribute much to the accuracy of the overall result are preferred over samples that contribute little The method can achieve improvements of a factor of ten or some times several hundred in simulations where only a small part of the initial phase spac
119. ic chopper Precision of the simulation increases with the number 68 Figure 6 7 geometry of a curved Fermi chopper of gates but also the computing time needed The use of four channels already gives exact transmission shapes for lower wavelengths A lt 6 A and good approximation for higher ones It is recommended to use larger number of channels only for a check The option zerotime may be used to reset the time at the chopper position The time is set to a value between Tp 2 and T 2 with Tp being the maximal pulse length depending on the phase of the chopper at the moment of passing the chopper centre The result is the generation of only 1 pulse instead of several this is useful for TOF instruments on continuous sources This component is about twice slower than the FermiChopper component The component must be placed after a component which sets a non zero flight path to the Fermi Chopper e g not an Arm 69 e Ne O OONO ho Velocity selector y m Figure 6 8 A velocity selector 6 4 V_selector A rotating velocity selector Input Parameters for component V_selector from optics lt Parameter value gt Unit Description lt xwidth 0 03 gt m Width of entry aperture lt yheight 0 05 gt m Height of entry aperture lt zdepth 0 30 gt m Distance between apertures for housing containing the rotor lt radius 0 12 gt m Height from aperture centre to rotation ax
120. ical properties with references and are specially suited for the PowderN see 8 3 and Isotropic_Sqw components see 8 7 McStas itself generates both simulation and monitor data files which structure is explained in the User Manual see end of chapter Running McStas 1 5 Component source code Source code for all components may be found in the MCSTAS library subdirectory of the McStas installation the default is usr local lib mcstas on Unix like systems 13 N E MCSTAS data Description lau Laue pattern file as issued from Crystallographica For use with Single crystal PowderN and Isotropic_Sqw Data h k 1 Mult d space 2Theta F squared laz Powder pattern file as obtained from Lazy ICSD For use with PowderN Isotropic_Sqw and possibly Single_crystal trm transmission file typically for monochromator crystals and filters Data k Angs 1 Transmission 0 1 rfl reflectivity file typically for mirrors and monochromator crys tals Data k Angs 1 Reflectivity 0 1 sqw S q w files for Isotropic Sqw component Data q fw S q w Table 1 1 Data files of the McStas library and C mcstas lib on Windows systems but it may be changed using the MCSTAS environment variable In case users only require to add new features preserving the existing features of a component using the EXTEND keyword in the instrument description file is recommended For larger modificatio
121. iles are given in LAZY format but may exist as well in Crystallographica lau format as well 15 MCSTAS data dok Cinc Tabs Tm c Note File name barns barns barns K m s Cs_liq_tot sqw 3 69 0 21 29 0 301 6 1090 Measured Ge_lig_coh sqw and Ge_liq_inc sqw 8 42 0 18 2 2 1211 4 5400 Ab initio MD He4_liq_coh sqw 1 34 O 0 00747 0 240 Measured Ne_liq_tot sqw 2 62 0 008 0 039 24 56 591 Measured Rb_liq coh sqw and Rb_liq_inc sqw 6 32 0 5 0 38 312 46 1300 Classical MD Rb_liq_tot sqw 6 32 0 5 0 38 312 46 1300 Measured Table 1 3 Liquids of the McStas library DLO0O3 Low c and high cabs materials are highlighted 1 7 Component validation Some components were checked for release 1 9 the Fermi choppers the velocity selectors 2 of the guide components and Source_gen The results are sumarized in a talk available online http www ill fr tas mcstas doc ValMcStas pdf Velocity selector and Fermi chopper were treated as black boxes and the resulting line shapes cross checked against analytical functions for some cases The component Selector showed no dependence on the distance between guide and selector axe This is corrected at the moment Apart from that the component yielded correct results That was different with the Fermi chopper components The component Chopper_Fermi which has been part of the McStas distribution for a long time gave wrong results and was removed from
122. in Ymax OF Vwidth Yheight 2 box A rectangular box with dimensions Zwidth Yheight depth 3 disk When choosing this geometry the detector is a flat disk in xy plane The radius is then radius max abs Emin Tmax Ymin Ymax Timath l 2s Yheight 2 9 2 4 sphere The detector is a sphere with the same radius as for the disk geometry 5 cylinder The detector is a cylinder with revolution axis along y vertical The radius in xz plane is radius max abs min Cmax Zwidth 2 9 3 and the height along y is height Ymax Ymax OlYheight 9 4 6 banana The same as the cylinder but without the top bottom caps and on a restricted angular range The angular range is specified using a theta variable limit specification in the options 7 previous The detector has the shape of the previous component This may be a surface or a volume In this case the neutron is detected on previous component and there is not neutron propagation By default the monitor is flat rectangular Of course you can choose the orientation of the Monitor_nD in the instrument description file with the usual ROTATED modifier For the box sphere and cylinder the outgoing neutrons are monitored by default but you can choose to monitor incoming neutron with the incoming option At last the slit or absorb option will ask the component to absorb the neutrons that do not intersect the monitor The exclusive option word removes n
123. include read table lib h j will only include the read_table lib h The library embedding is done only once for all components like the SHARE section For an example of implementation see Res monitor In this Appendix we present a short list of both each of the library contents and the run time features B 1 Run time calls and functions mcstas r Here we list a number of preprogrammed macros which may ease the task of writing component and instrument definitions B 1 1 Neutron propagation Propagation routines perform all necessary operations to transport neutron rays from one point to an other Except when using the special ALLOW_BACKPROP call prior to executing any PROP_ propagation the neutron rays which have negative propagation times are removed automatically e ABSORB This macro issues an order to the overall McStas simulator to interrupt the simulation of the current neutron history and to start a new one e PROP_ZO Propagates the neutron to the z 0 plane by adjusting x y z and t accordingly from knowledge of the neutron velocity v vy vz If the propaga tion time is negative the neutron ray is absorbed except if a ALLOW_BACKPROP preceeds it 159 For components that are centered along the z axis use the _intersect functions to determine intersection time s and then a PROP_DT call PROP_DT dt Propagates the neutron through the time interval dt adjusting x y z and t according
124. informations x Table_Index Table 2 5 read the 8rd row 6th column element of the table Indexes start at zero in C y Table_Value Table 1 45 1 look for value 1 45 in 1st column a axis and extract 2nd column value of that row Table_Free amp Table free allocated memory for table Additionally if the block number 3rd argument of Table_Read is 0 all blocks will be concatenated The Table_Value function assumes that the x axis is the first column index 0 Other functions are used the same way with a few additional parameters e g specifying an offset for reading files or reading binary data This other example for text files shows how to read many data blocks t_Table Table declare a t_Table structure array long n double y Table Table_Read_Array file dat amp n initialize and read the all numerical block n Table_Info_Array Table display informations for all blocks also returns n 166 y Table _Index Table 0 2 5 read in 1st block the 3rd row 6th column element ONLY use Table i with i lt n Table_Free_Array Table free allocated memory for Table You may look into for instance the source files for Monochromator_curved or Virtual_input for other implementation examples B 3 Monitor_nD Library This library gathers a few functions used by a set of monitors e g Monitor_nD Res_monitor Virtual_output etc It may monito
125. ing is in place here regarding potentially wrong results using optimization tech niques It is highly recommended in any case to benchmark optimized simulations against non optimized ones checking that obtained results are the same but hopefully with a much improved statistics 3 7 2 The adaption algorithm The adaptive importance sampling works by subdividing the initial neutron phase space into a number of equal sized bins The division is done on the three dimensions of energy horizontal position and horizontal divergence using Neng Npos and Naiv number of bins in each dimension respectively The total number of bins is therefore Nbin Neng N pos Naiv 3 5 Each bin 7 is assigned a sampling weight w the probability of emitting a neutron within bin is Wi N in Dji Wj In order to avoid false learning the sampling weight of a bin is kept larger than Wmin defined as P i 3 6 Npin Wj 0 lt PB lt 1 3 7 Win min Noin i j 1 This way a small fraction 8 of the neutrons are sampled uniformly from all bins while the fraction 1 8 are sampled in an adaptive way Compared to a uniform sampling of the phase space where the probability of each bin is 1 Npin the neutron weight must be adjusted as given by N in Pr IN _ ar V5 T i fmc P i Nin 3 8 where P is understood by the natural uniform sampling In order to set the criteria for adaption the Adapt_check component is u
126. ion routines so that numer ical spin propagation is done for analytical magnetic fields NB At the moment both components does not really check the bound aries of the field on the sides but merely assumes that the field starts at the entrance plane and stops at the exit plane Also some optimization remains for the numerical component and it would be nice to support tabulated magnetic field files However the framework developed for Pol_simpleBfield is very general and should easily facilitate these changes A 4 4 Samples e V_sample Modified the sample so that the scattered neutron has P 1 3P Note that this component does not handle multiple scattering so this approach is correct If the components handled multiple scattering the polarization should be set to P 1 3 P where n is the number of scatterings A 5 Tests With New Components All the test instruments can be found in the McStas examples folder go to Neutron site tests in mcgui There are basically two kind of tests The first kind of tests shows that the polarizing component can reproduce the same results as a similar non polarizing component e Test_Monochromators instr Intercomparison of Monochromator_flat and Monochro mator_pol e Test_Pol_Bender_Vs_Guide_Curved instr Intercomparison of Guide_curved and Pol_bender 157 The second type of test illustrates the polarizing capabilities of the component 158 Test_Magnetic_Consta
127. ircular channels The geometry of the chopper consists of a rectangular shaped object with a channel system In transmission position there are Neates Slits of width weit each along the x axis separated by absorbing walls of thickness Wwall see figure 6 6 The total width wot is given by Wtot NeatesWslit Ngates 1 Wwall 6 9 The rectangular channel system is surrounded by a so called shadowing cylinder it is a part of a cylinder with vertical symmetry axis and diameter d gt 1 0 wi 6 10 It serves to prevent transmission of neutrons which do not fly through the channels but it also reduces the transmission because the cylinder removes neutrons in front of the channel entrance or behind the channel exit see figure 6 6 E HA DA A A A O yO A _ rotation axis Figure 6 6 geometry of a staight Fermi chopper Geometry for parabolic channels In this case the Fermi chopper is supposed to be a full cylinder i e the central channels are longer than those on the edges The other features are the same as for the other options see figure 6 7 The algorithm works with a rotating chopper framework Neutrons hitting the channel walls are absorbed The channels are approximated by Neates gates If the trajectory takes a course through all the gates the neutron passes the Fermi chopper There are gates at the entrance and the exit of the channel The other gates are situated close to the centre of the Ferm
128. is lt alpha 48 298 gt deg Twist angle along the cylinder lt length 0 25 gt m Length of cylinder rotor less than zdepth lt d 0 0004 gt m Thickness of blades lt nu 300 gt Hz Cylinder rotation speed counter clockwise which is ideally 3956 alpha DEG2RAD 2 PI lambda length lt nslit 72 gt 1 Number of Soller blades The component V_selector models a rotating velocity selector constructed from N collimator blades arranged radially on an axis Two identical slits height x width at a 12 o clock position allow neutron passage at the position of the blades The blades are twisted on the axis so that a stationary velocity selector does not transmit neutrons the total twist angle is denoted in degrees Further input parameters for V_selector the distance between apertures Lo the 70 length of the collimator blades L1 the height from rotation axix to the slit centre ro the rotation speed w in rpm and the blade thickness t The local coordinate system has its Origo at the slit centre The component Selector produces equivalent results 6 4 1 Velocity selector transmission By rotating the selector you allow transmittance of neutrons rays with velocities around a nominal value given by Vo wL 6 6 11 which means that the selector has turned the twist angle during the typical neutron flight time L Vo The actual twist angle is Y wt wL V Neutrons having a velocity sligh
129. ith a flat energy wavelength spectrum Input Parameters for component Source_simple from sources lt Parameter value gt Unit Description lt radius 0 1 gt m Radius of circle in x y 0 plane where neutrons are generated lt yheight 0 gt m Height of rectangle in x y 0 plane where neutrons are generated lt xwidth 0 gt m Width of rectangle in x y 0 plane where neutrons are generated lt dist 0 gt m Distance to target along z axis lt focus_xw 045 gt m Width of target lt focus_yh 12 gt m Height of target lt E0 0 gt meV Mean energy of neutrons lt dE 0 gt meV Energy half spread of neutrons flat or gaussian sigma lt lambda0 0 gt AA Mean wavelength of neutrons lt dlambda 0 gt AA Wavelength half spread of neutrons lt flux 1 gt 1 s cm 2 st energy unit flux per energy unit Angs or meV if flux 0 the source emits 1 in 4 PI whole space lt gauss 0 gt 1 Gaussian 1 or Flat 0 energy wavelength distribution lt target_index 1 gt 1 relative index of component to focus at e g next is 1 this is used to compute dist automatically This component is a simple source with an energy distribution which is uniform in the range Ey dE alternatively a wavelength distribution in the range Ay dA This component is not used for detailed time of flight simulations so we put t 0 for all neutron rays The initial neutron ray position is ch
130. itial neutron velocity is selected within an inter val of either the corresponding energy or the corresponding wavelength Polarization is not relevant for sources and we initialize the neutron average spin to zero s 0 0 0 For time of flight sources the choice of the emission time t is being made on basis of detailed analytical expressions For other sources t is set to zero In the case one would like to use a steady state source with time of flight settings the emission time of each neutron ray should be determined using a Monte Carlo choice This may be achieved by the EXTEND keyword in the instrument description source as in the example below TRACE COMPONENT MySource Source_gen AT EXTEND Zot t le 3xrandpml set time to f 1 ms 3 0 1 Neutron flux The flux of the sources deserves special attention The total neutron intensity is defined as the sum of weights of all emitted neutron rays during one simulation the unit of total neutron weight is thus neutrons per second The flux 4 at an instrument is defined as intensity per area perpendicular to the beam direction The source flux is defined in different units the number of neutrons emitted per second from a 1 cm area on the source surface with direction within a 1 ster solid angle and with wavelength within a 1 interval The total intensity of real neutrons emitted towards a given diaphragm units n sec is therefore for con
131. ition in the sample etc However in most relevant cases these integrals are not solvable analytically and we hence turn to Monte Carlo methods The neutron ray tracing Monte Carlo method has been used widely for guide studies Sch 04 instrument optimization and design ZLa04 Lie05 Most of the time the conclusions and general behavior of such studies may be obtained using the classical analytic approaches but accurate estimates for the flux resolution and generally the optimum parameter set benefit considerably from MC methods Mathematically the Monte Carlo method is an application of the law of large numbers GRR92 Let f u be a finite continuous integrable function of parameter u for which an integral estimate is desirable The discrete statistical mean value of f computed as a series in the uniformly sampled interval a lt u lt b converges to the mathematical mean value of f over the same interval b lim 3 flu Fade 2 1 In the case were the u values are regularly sampled we come to the well known midpoint integration rule In the case were the u values are randomly but uniformly sampled this is the Monte Carlo integration technique As random generators are not perfect we rather talk about quasi Monte Carlo technique We encourage the reader to consult James for a detailed review on the Monte Carlo method 18 2 2 The neutron weight A totally realistic semi classical simulation will require that ea
132. itor component which is sensitive to both horizontal position x and horizontal divergence defined by m tan uz vz The detector window is set by the x and y input coordinates The neutron counts are being histogrammed into Nng X np pixels The horizontal divergence range accepted is M h max h max and the horizontal position range is the size of the detector The output from PSD_monitor is the integrated counts n I M2 as well as three two dimensional arrays of counts n x m I x m Ma x mm The arrays are written to a file and can be read e g by the tool mcplot see the system manual This component can be used for measuring acceptance diagrams Cus03 PSD_monitor can easily be changed into being sensitive to y and vertical divergence by a 90 degree rotation around the z axis 130 OCNoDWIrWNH NPP RP RP RP RPP Pree SCO ONOOBWNF OO 21 22 23 24 25 26 27 28 29 9 8 Monitor nD A general Monitor for 0D 1D 2D records Input Parameters for component Monitor_nD from monitors lt Parameter value gt Unit Description lt user1 FLTMMAX gt variable Variable assigned to Userl lt user2 FLT_MMAX gt variable Variable assigned to User2 lt user3 FLTMAX gt variable Variable assigned to User3 lt xwidth 0 gt m Width of detector lt yheight 0 gt m Height of detector lt zdepth 0 gt m Thickness of detector z lt xmin 0 gt m Lower x bound of openi
133. izontal and vertical mosaic perpendicular to a scattering vector The basis for the model is a three dimensional Gaussian distribution in Euler angles giving the orientation probability distribution for the micro crystals that is the mis orientation is given by small rotations around the X Y and Z axes with the rotation angles having in general different Gaussian probability distributions For given scat tering vector T a rotation of the micro crystals around an axis parallel to 7 has no effect on the direction of the scattering vector Suppose we form the intersection between the three dimensional Gaussian in Euler angles and a plane through the origin perpendicular to T This gives a two dimensional Gaussian say with axes defined by unit vectors g and gy and mosaic widths y and 7 We now let the mosaic for r be defined by rotations around g and g gt with angles having Gaussian distributions of widths and 72 Since g1 9 and T are perpendicular a small rotation of 7 around g will change 7 in the direction of g The two axes of 96 Ewald Sphere del d d mosaic kf Figure 8 4 Ewald sphere construction for a single neutron showing the Gaussian broad ening of reciprocal lattice points in their local coordinate system the Gaussian mosaic in reciprocal space that are perpendicular to 7 will thus be given by Tn29g1 and 79199 We now derive a quantitative expression for the scattering cross section
134. l density g cm 3 gt weight lt value of material molar weight g mol gt nb_atoms lt value of number of atoms per unit cell gt Further details on file formats are available in the mcdoc page of the component 89 oe wN Oona 8 3 2 Geometry physical properties concentricity The sample has the shape of a solid cylinder radius r and height h or a box shaped sample of size xwidth x yheight x zdepth At the users choice an inner hollow can be specified using the parameter thickness As the Isotropic Sqw component PowderN assumes concentric shape i e can contain other components inside the inner hollow To allow this two almost identical copies of the PowderN components must be set up around the internal component s for example COMPONENT Cryo PowderN reflections Al laz radius 0 01 thickness 0 001 concentric 1 AT 0 0 0 RELATIVE Somewhere COMPONENT Sample some_other_component with geometry FULLY enclosed in the hollow AT 0 0 0 RELATIVE Somewhere COMPONENT Cryo2 COPY Cryo concentric 0 AT 0 0 0 RELATIVE Somewhere As outlined the first instance of PowderN must have concentric 1 and the in stance must have concentric 0 Furthermore the component s inside the hollow must have a geometry which can be fully contained inside the hollow In addition to the coherent scattering specified in the reflections file absorption and incoherent cross sections can be given usi
135. l neutron experiments where p 1 For a better approximation we return to Eq 2 3 Allowing variations in both N and p we calculate the variance of the resulting intensity assuming that the two variables are statistically independent o I 0 N p N o P 2 5 Assuming as before that N follows a normal distribution we reach 0 N p Np Further assuming that the individual weights p follow a Gaussian distribution which in some cases is far from the truth we have N 0 p o pi No p and reach o I N P 0 p 2 6 The statistical variance of the p s is estimated by o pi Xz p Np N 1 The resulting variance then reads N Qe 2 _ 72 2 2 E P 2 7 2 For almost any positive value of N this is very well approximated by the simple expres sion o pz 2 8 As a consistency check we note that for all p equal this reduces to eq 2 4 In order to compute the intensities and uncertainties the monitor detector compo nents in McStas will keep track of N X p I X pl and Mo J p 2 3 Weight factor transformations during a Monte Carlo choice When a Monte Carlo choice must be performed e g when the initial energy and direction of the neutron ray is decided at the source it is important to adjust the neutron weight This is not correct in a situation where the detector counts a large fraction of the neutron rays in the simulation but we will neglect
136. lar area lt xwidth 0 gt m horiz dimension of sample as a width lt zdepth 0 gt m depth of sample lt target_index 0 gt 1 relative index of component to focus at e g next is 1 The component TOF_Res_sample scatters neutron rays isotropically in position within a specified angular range As for Res_sample this component is meant for computation of the resolution function but in this case for one time bin in a time of flight TOF instrument The component selects uniformly the neutron energy so that neutron arrival time at the TOF detector lies within one time bin specified by to and At For actual calculations of the resolution function TOF_Res_sample should be used together with Res_monitor described in section 10 5 The shape of TOF_Res_sample is either a hollow cylinder or a rectangular box The hollow cylinder shape is specified with the inner and outer radius rj and ro respectively and the height h If these parameters are unspecified the shape is instead a box of dimensions ry Yh and zt The component only propagates neutron rays that are scattered other rays are ab sorbed As for Res_sample the scattering probability is proportional to the neutron flight path length inside the sample The point of scattering in the sample is chosen uniformly along the neutron flight path inside the sample and the scattered direction is 144 N CON MD OB W 10 12 13 14 15 16 17 e UNa chosen in a
137. lastic scattering as found in a number of systems e g containing mobile hydrogen For the sample geometry we default use a hollow cylinder which has the solid cylinder as a limiting case The sample dimensions are Inner radius rj outer radius ro and height h This geometry is the same as the default for V_sample see figure 8 2 As for V_sample the sample geometry can be made rectangular by specifying the width wz the height hy and the thickness tz Also the focusing properties are the same as for V_sample For the focusing is performed as a uniform distribution on a target sphere of radius Tfoc at the position Ctargot Ytargets Ztarget in the local coordinate system The focusing can alternatively be performed on a rectangle with dimensions wyocus Afocus Or uniformly in angular space in a small angle approximation using Wroc angle Mfoc angle The focusing location can be picked to be a downstream component by specifying target_index The incoherent and absorption cross sections for V are default for the component For other choices the parameters Cinc Cabs and the unit cell volume Vo should be specified For a loosely packed sample also the packing factor fpack can be specified default value of 1 The inelastic scattering takes place as a quasielastic Lorentzian component which 86 is chosen with probability fap The broadening of the signal is given by r HWHM In addition a tunneling signal is present with a
138. le X X QE broad 1 Table 8 1 Processes implemented in sample components Absorption 1 single only 2 with secondary In analygo the energy transfer is given by 2 n 8 0 2 Weight transformation in samples focusing Within many samples the incident beam is attenuated by scattering and absorption so that the illumination varies considerably throughout the sample For single crystals this phenomenon is known as secondary extinction Bac75 but the effect is important for all samples In analytical treatments attenuation is difficult to deal with and is thus often ignored making a thin sample approximation In Monte Carlo simulations the beam attenuation is easily taken care of as will be shown below In the description we ignore multiple scattering which is however implemented in some sample components The sample has an absorption cross section per unit cell of o and a scattering cross section per unit cell of of The neutron path length in the sample before the scattering event is denoted by l and the path length within the sample after the scattering is denoted by lg see figure We then define the inverse penetration lengths as u o2 V and u 02 V where Ve is the volume of a unit cell Physically the attenuation along this path follows fate 1 exp Up u0 8 3 where the normalization fatt 0 1 The probability for a given neutron ray to be scattered from within the interval
139. lectivity lt Qc 0 0219 gt AA 1 Critical scattering vector lt alpha 6 07 gt AA Slope of reflectivity lt m 2 gt 1 m value of material Zero means completely absorbing glass SiO2 Si Ni Nid8 supermirror Be Diamond m 0 65 0 47 1 1 18 2 6 1 01 1 12 lt W 0 003 gt AA 1 Width of supermirror cut off o Noan WNHE PRR re PwWNYr Ow The component Guide models a guide tube consisting of four flat mirrors The guide is centered on the z axis with rectangular entrance and exit openings parallel to the x y plane The entrance has the dimensions w1 h1 and placed at z 0 The exit is of dimensions w2 h2 and is placed at z l where l is the guide length See figure 5 2 The reflecting properties are given by the values of Ro m Qc W and a as for Mirror or alternatively from the reflectivity file re flect Guide may produce wrong results with gravitation support Use Guide_gravity 52 hy Ww Figure 5 2 The geometry used for the guide component section 5 4 in this case or the Guide_channeled in section 5 3 5 2 1 Guide geometry and reflection For computations on the guide geometry we define the planes of the four guide sides by giving their normal vectors pointing into the guide and a point lying in the plane n 1 0 we w1 2 OY w1 2 0 0 n3 1 0 we wi 2 Of w1 2 0 0 n 0 1 ha h1 2 O 0 ha 2 0 ny 0 1 h2 h1 2 OF 0 h1 2 0
140. ly from knowledge of the neutron velocity This macro automatically calls PROP_GRAV_DT when the gravitation option has been set for the whole simulation PROP_GRAV_DT dt Ax Ay Az Like PROP_DT but it also includes grav ity using the acceleration Ax Ay Az In addition to adjusting x y z and t also vx vy vz is modified ALLOW_BACKPROP Indicates that the next propagation routine will not remove the neutron ray even if negative propagation times are found Subsequent propagations are not affected SCATTER This macro is used to denote a scattering event inside a component It should be used e g to indicate that a component has interacted with the neutron ray e g scattered or detected This does not affect the simulation see how ever Beamstop and it is mainly used by the MCDISPLAY section and the GROUP modifier See also the SCATTERED variable below B 1 2 Coordinate and component variable retrieval 160 MC_GETPAR comp outpar This may be used in e g the FINALLY section of an instrument definition to reference the output parameters of a component NAME_CURRENT_COMP gives the name of the current component as a string POS_A CURRENT_COMP gives the absolute position of the current compo nent A component of the vector is referred to as POS_A CURRENT_COMP where 7 is y or z ROT_A_CURRENT_COMP and ROT_R_CURRENT_COMP give the ori entation of the current component as rotation matrices absolute orientati
141. m Width of target lt focus yh 0 12 gt m Height of target lt focus_aw 0 gt deg maximal uniform horz width divergence lt focus_ah 0 gt deg maximal uniform vert height divergence lt E0 0 gt meV Mean energy of neutrons lt dE 0 gt meV Energy spread of neutrons half width lt lambda0 0 gt AA Mean wavelength of neutrons lt dlambda 0 gt AA Wavelength spread of neutrons half width lt I1 1 gt 1 cm 2 srxAA Source flux per solid angle area and Angstrom if 11 0 the source emits 1 in 4 PI whole space lt yheight 0 1 gt m Source y height then does not use radius parameter lt xwidth 0 1 gt m Source x width then does not use radius parameter lt verbose 0 gt 0 1 display info about the source 1 unactivate source lt T1 0 gt K Temperature of the Maxwellian source 0 none 28 Source Name T i T Ip T3 L3 factor PSI cold source 150 4 3 67e11 38 74 3 64e11 14 84 0 95e11 lrarger mA ILL VCS H1 216 8 1 24e13 33 9 1 02e13 16 7 3 042e12 ILL HCS H5 413 5 10 22e12 145 8 3 44e13 40 1 2 78e13 ILL Thermal H2 683 7 5 874e12 257 7 2 51e13 16 7 1 034e12 12 25 ILL Hot source 1695 1 74e13 708 3 9e12 Table 3 1 Flux parameters for present sources used in components Source_gen and Source_Maxwell_3 For some cases a correction factor to the intensity should be used to reach measured data for the PSI cold source this correction factor is the b
142. me will produce the number of statistical events reaching each component in the simulation This may be used to identify positions where events are lost 10 7 Beam_spy A beam analyzer Name Beam_spy Author System Input parameters Optional parameters Notes should overlap previous component This component is at the same time an Arm and a simple Monitor It analyzes all neutrons reaching it and computes statistics for the beam as well as the intensity This component does not affect the neutron beam and does not contain any propaga tion call Thus it gets neutrons from the previous component in the instrument descrip tion and should better be placed at the same position with AT 0 0 0 RELATIVE PREVIOUS 147 A Polarization in McStas P Christiansen Risg May 29 2015 A 1 Introduction In the current release of McStas there are components with polarization capabilities At the moment all such components should be understood as under development as the amount of testing and debugging of these components is small and there are known problems Here we shall report on what have been done so far We first describe the polarization vector and how it is related to the neutron wave function section A 2 and then the physics of simple components that we need in McStas is reviewed ae In the last two sections the actual McStas polarization com ponents are first described section A 4 and a list of t
143. mple the instance Mono_PST_on should itself be rotated to reflect according to a Bragg law 79 8 Samples This class of components models the sample of the experiment This is by far the most challenging part of a neutron scattering instrument to model However for purpose of simulating instrument performance details of the samples are rather unimportant allowing for simple approximations On the contrary for full virtual experiments it is of importance to have realistic and detailed sample descriptions McStas contains both simple and detailed samples We first consider incoherent scattering The simple component V sample performs both incoherent scattering and absorption An important component class is elastic Bragg scattering from an ideal powder The component PowderN models a powder scatterer with reflections given in an input file To scatter on a single Bragg peak the Powderl component may be used The component includes absorption incoherent scattering direct beam transmission and can assume concentric shape i e can be used for modelling sample enviroments Next type is Bragg scattering from single crystals The simplest single crystals are in fact the monochromator components like Monochromator_flat presented in section The monochromators are models of a thin mosaic crystal with a single scattering vec tor perpendicular to the surface Much more advanced the component Single_crystal is a general single crystal sample with
144. mple is either a hollow cylinder or a rectangular box The hollow cylinder shape is specified with the outer radius r and thickness respectively and the height h If these parameters are unspecified the shape is instead a box of dimensions Zw Yh and zg The component only propagates neutron rays that are scattered other rays are absorbed The scattering probability is proportional to the neutron flight path length inside the sample to make a true volume weighting of the sample The reason for this is that the resolution function of an instrument is independent of any sample properties such as scattering and absorbtion cross sections but will in general depend on sample size and shape The point of scattering inside the sample is chosen uniformly along the neutron flight path inside the sample and the scattered neutron ray is given a random energy and direction This energy is selected in the interval Ey AE Ey AE which hence must be chosen large enough to cover all interesting neutron energies Similarly the scattered direction is chosen in a user specified range either within a sphere of radius focus Within a rectangular target with measures 2focus Yfocus Or in the specified angular range This target is positioned at the Ztarget Ytarget Ztarget Point in space or using the target_index for which e g 1 is the further component 1 is the previous etc 143 oo DO dO0AaAQ0NAEA A special feature used when computing resol
145. mple of this component can be found inthe Neutron site tests Test_Phonon instrument from the mcgui 106 8 6 1 The phonon cross section The inelastic phonon cross section for a Bravais crystal of a pure element is given by Ref Squ78 ch 3 do oke Qn 1 lt IA 2 dOdE a ki V 2M P K q yA 1 1 i 2 ED Nap ta FS dwt w_p d Ktq T 8 38 where both annihilation and creation of one phonon is considered represented by the plus and minus sign in the dispersion delta functions respectively In the equation exp 2W is the Debye Waller factor DW and Vo is the volume of the unit cell The sum runs over the reciprocal lattice vectors 7 over the polarisation index p and the N allowed wave vectors q within the Brillouin zone where N is the number of unit cells in the crystal Further eg is the polarization unit vectors wy the phonon dispersion and the Bose factor is nq p hexp w p kBT 1 We have simplified this expression by assuming no polarization dependence of the dispersion giving Y py E qp 2 We assume that the inter atomic interaction is nearest neighbour only so that the phonon dispersion becomes di q c1 a z Sq 8 39 where z 12 is the number of nearest neighbours and sy nn cos q Inn where in turn rpn is the lattice positions of the nearest neighbours This dispersion relation may be modified with a small effort since it is given as a separate c f
146. mprove substantially the accuracy of the method but this discussion is beyond the scope of this paper Consequently limiting the q integration in Eq to the maximum momentum transfer for elastic processes 2k we write the total scattering cross section as N qoS q dq 8 55 Using Eq it is possible to define similar expressions for the coherent and incoherent terms Ccon Ei and 0inc E respectively These integrated cross sections are usually quite different from the tabulated values since the latter are bound scattering cross sections Except for a few materials with absorption resonances in the cold thermal energy range the absorption cross section for an incoming neutron of velocity v 2E m 114 l 2200 where m is the neutron mass is computed as Gabs Ei ibs ae M obtained from the literature DLO03 We now determine the total cross section accounting for both scattering and absorption 2200 where offs is Otot Ei Tapa Fi os Ei 8 56 The neutron trajectory intersection with the sample geometry provides the total path length in the sample degit to the exit Defining the linear attenuation u E poro E the probability that the neutron event is transmitted along path de is e7 Enterit If the neutron event is transmitted it leaves the sample In previous Monte Carlo codes such as DISCUSS Johrc MSC FMw72 and MSCAT Cop74 each neutron event is forced to scatter to the detector area i
147. mulation of Triple Axis Spectrometers the name of this package Pronunciation ranges from mez tas to mac stas and m c stas e Output parameter An output parameter for a component For example the counts in a monitor An output parameter may be accessed from the instrument in which the component is used using MC_GETPAR e Run time C code contained in the files mcstas r c and mcstas r h included in the McStas distribution that declare functions and variables used by the generated simulations e Setting parameter Similar to a definition parameter but with the restriction that the value of the parameter must be a number 169
148. multiple scattering that allows the input of an arbitrary unit cell and a list of structure factors read from a LAZY Crystallographica file This component also allows anisotropic mosaicity and Ad d lattice space variation Isotropic small angle scattering is simulated in Sans_Spheres which models scatter ing from a collection of hard spheres dilute colloids Inelastic scattering from a dispersion is exemplified by the component Phonon_simple which models scattering from a single acoustic phonon branch For a more general sample model the Isotropic_Sqw component is able to simulate all kinds of isotropic materials Liquids glasses polymers powders etc with S q w table specified by an input file Physical processes include coherent incoherent scatter ing both elastic and inelastic with absorption and multiple scattering Moreover this component may be used concentrically to model a sample environment Thus it may handle most samples except single crystals 8 0 1 Neutron scattering notation In sample components we use the notation common for neutron scattering where the wave vector transfer is denoted the scattering vector q ki ky 8 1 80 Sample Coherent Incoherent Process Elastic Inelastic Elastic Inelastic Absorption Multi Scatt Phonon_simple X 1 Isotropic Sqw X X X X 2 X Powder1 1 line X 1 PowderN N lines X 1 Sans_spheres colloid 1 Single_crystal X X 2 X V_sample X QE broad 1 Tunneling samp
149. mum MNEUTRON 1 67492 107 kg Neutron mass my HBAR 1 05459 107 Js Planck constant PI 3 14159265 T FLT_MAX 3 40282347E 38F a big float value 168 C The McStas terminology This is a short explanation of phrases and terms which have a specific meaning within McStas We have tried to keep the list as short as possible with the risk that the reader may occasionally miss an explanation In this case you are more than welcome to contact the McStas core team e Arm A generic McStas component which defines a frame of reference for other components e Component One unit e g optical element in a neutron spectrometer These are considered as Types of elements to be instantiated in an Instrument description e Component instance A named Component of a given Type inserted in an Instrument description e Definition parameter An input parameter for a component For example the radius of a sample component or the divergence of a collimator e Input parameter For a component either a definition parameter or a setting parameter These parameters are supplied by the user to define the characteris tics of the particular instance of the component definition For an instrument a parameter that can be changed at simulation run time e Instrument An assembly of McStas components defining a neutron spectrometer e Kernel The McStas meta language definition and the associated compiler mcstas e McStas Monte Carlo Si
150. n s oao a e 47 is A A A ees Pe eS ee Geese a 47 4 6 Collimator radial A radial Soller blade collimator 48 5 Reflecting optical components mirrors and guides 50 gE Rae APH He a a RSE SLA ah das i 50 5 1 1 Mirror reflectivity 2 0 0 00202 eee ee 50 A 51 oe Re A Bae ee Se ee 52 iii aon E Gee ee ee a ee 53 Pano Pads bah Wik Mle OMG ale Rae eee ba 54 5 3 Guide_channeled A guide section component with multiple channels 55 ike ke a ead ad Og a ee Gh Rae BS 55 ea ee ee ee ee Ge a we eee ee 55 5 4 Guide_gravity A guide with multiple channels and gravitation handling 56 5 5 Bender a bender model non polarizing 0 56 ye ba a Roa G a4 ee a aa 57 6 Moving optical components Choppers and velocity selectors 59 A E Ske 59 44 244g ia eee ee HO 62 IIA 63 ARTE A Sed Oe ae 63 verre 67 A Goa ek Hee OR a ae ae BS 70 A hed greed ere Be a Ge Gade a 71 odes OL 7 Monochromators 73 7 1 Monochromator_flat An infinitely thin flat mosaic crystal with a single A A RAN 73 eee eee ee 73 he no e AT DAD oe ee AN A 76 A RN RN ae 78 pe 78 8 Samples 80 8 0 1 Neutron scattering notation 0 02 ee 80 8 0 2 Weight transformation in samples focusing 81 Laa ou Pe Aa 83 o 83 eA Me ae ye ee a a Ae es whet eS 84 8 1 2 Remark on functionality o e e 85 puta Ta Lae a 86 yoke an eon Gece ae ag ot Gee as esse ae 88 8
151. n Section 8 7 3 previous multiple scattering estimation codes force the outgoing neutron event to come into the detector area and time window thus improving dramatically the code efficiency This choice sets the measurable energy and momentum transfers for the last scattering event in the sample so that the choice of the scattering excitation actually requires a more complex sampling mechanism for the dynamic structure factor As the present implementation makes no assumption on the simulated instrument part which is behind the sample we can not apply this method Consequently the efficiency of the sample scattering code is certainly lower than previous codes but on the other hand it does not depend on the type of instrument simulation In particular it may be used to model any material in the course of the neutron propagation along the instrument model filters mechanical parts samples shields radiation protections 117 Once the scattering probability and position the energy and momentum transfers and the neutron momentum after scattering have all been defined the whole process is iterated until the neutron is transmitted and exits the sample volume Extension to powder elastic scattering In principle the component can work in purely elastic mode if only the w 0 column is available in S Anyway in the diffractionists world people do not usually define scattering with S q Eq 8 48 but through the scattering vector 7 multipli
152. n double differential scattering cross section for both coherent and incoherent processes ds o kr IdE E NS q w 8 44 which describes the amount of neutrons scattered per unit solid angle dQ and per unit final energy dE In this equation N pV is the number of atoms in the scatter ing volume V with atomic number density p Ef Ei kf ki are the kinetic energy and wavevectors of final and initial states respectively is the bound atom scattering cross section 2 is the solid angle and q w are the wave vector and energy transfer at the sample In practice the double differential cross section is a linear combinaison of the coherent and incoherent parts as oS q w OcohScoh q w T CincSinclq w 8 45 where the subscripts coh and inc stand for the coherent and incoherent contributions respectively We define its norm on a selected q range IS f f Sandie 8 46 The norm limg 0 S q for large q values and can only be defined on a restricted q range Some easily measureable coherent quantities in a liquid are the static pair correlation function g r and the structure factor S q defined as N pl ODER A 8 47 i 1 5 sa f Ends 8 48 1 p 1 g 7 le dr 8 49 o 1 g r y 097 y 2 y in isotropic materials 8 50 0 gr The latter expression in isotropic materials may be Fourier transformed as 2 sin qr ar 1 5a fa Sta 24 8 51 Both g r and S q converg
153. n future versions of McStas In case of errors questions or suggestions do not hesitate to contact the authors at mcstas risoe dk or consult the McStas home page Mes A special bug request reporting service is available Mcz Important developments on the component side in McStas version 2 1 as compared to version 1 4 the last version of the component manual then a section of the system manual include e Validation of most components against analytical formula and benchmarking in simple cases e Newly added realistic source components ISIS_moderator ISIS source model based on MCNPX D Champion and S Ansell ISIS Virtual_tripoli4_input output Trioli4 similar to MCNP files reading writ ing G Campioni LLB SNS_source SNS source model based on MCNPX G Granroth SNS Source_gen ILL sources Maxwellian parameters E Farhi N Kernavanois H Bordallo ILL 10 ESS_moderator_short Calculated source model for the short pulse target station of the ESS project K Lefmann Ris ESS_moderator_long Calculated source model for the long pulse target sta tion of the ESS project K Lefmann Risg e Newly added optical components Radial_collimator Radial collimator with both approximated and exact options E Farhi ILL FermiChopper and Vitess_ChopperFermi Two Fermi Chopper components M Poehlmann G Zsigmond ILL and PSI Guide_tapering A rectangular tapered guide U Filges PSI
154. n of a component it is advised to make a copy of the component file into the working directory A component file in the local directory will in McStas take precedence over a library component of the same name 1 6 Documentation As a complement to this Component Manual we encourage users to use the mcdoc front end which enables to display both the catalog of the McStas library e g using mcdoc as well as the documentation of specific components e g with mcdoc text lt name gt mcdoc lt file comp gt The first line will search for all components matching the name and display their help section as text For instance mcdoc laz will list all available Lazy data files whereas mcdoc text Monitor will list most Monitors The second example will display the help corresponding to the file comp component using your BROWSER setting or as text if unset The help option will display the command help as usual An overview of the component library is also given at the McStas home page Mcs and in the User Manual Wil 05 14 MCSTAS data Ocoh Dine Cabs qn c Note File name barns barns barns K m s Ag laz 4 407 0 58 63 3 1234 9 2600 A1203_sapphire laz 15 683 0 0188 0 4625 2273 Al laz 1 495 0 0082 0 231 933 5 5100 lau Au laz 7 32 0 43 98 65 1337 4 1740 B4C laz 19 71 6 801 3068 2718 Ba laz 3 23 0 15 29 0 1000 1620 Be laz 7 63 0 0018 0 0076 1560 13000 BeO laz 11 85 0 003 0 008 2650 lau Bi la
155. n order to improve the sample scattering simulation statistics and reduce the computing time The corresponding instrument model is limited to a neutron event source a sample and a detector It is equaly possible in the current implementation to force neutron events to scatter by applying a correction factor mo 1 e MElddezit to the neutron statistical weight However the McStas instrument model is often build from a large sequence of components Eventhough the instrument description starts as well with a neutron event source more than one sample may be encountered in the course of the neutron propagation and multiple detectors may be positioned anywhere in space as well as other instrument components e g neutron optics This implies that neutron events scattered from a sample volume should not focus to a single area Indeed transmitted events may reach other scattering materials and it is not desirable to force all neutron events to scatter The correction factor Tp is then not applied and neutron events can be transmitted through the sample volume The simulation efficiency for the scattering then drops significantly but enables to model much more complex arrangements such as concentric sample environments magnets and monochromator mechanical parts and neutron filters If the neutron is not transmitted the neutron statistical weight is multiplied by a factor os E Tm 8 57 Cto Ei Coe to account for the fraction of absorb
156. n the reflectivity is zero for all Q i e the surface is completely absorbing This component may produce wrong results with gravitation 5 1 1 Mirror reflectivity To compute the reflectivity of the supermirrors we use an empirical formula derived from experimental data Cla 98 see Fig B 1 The reflectivity is given by Ro if Q lt Qe LRo 1 tanh Q mQ W 1 a Q Q gt Q OP Here Q is the length of the scattering vector in A defined by Mn Q k ke 5 vel 5 2 50 My being the neutron mass The number m in is a parameter determined by the mirror materials the bilayer sequence and the number of bilayers As can be seen R Ro for Q lt Qe where Qe is the critical scattering wave vector for a single layer of the mirror material At higher values of Q the reflectivity starts falling linearly with a slope a until a soft cut off at Q mQ The width of this cut off is denoted W See the example reflection curve in figure 5 1 It is important to notice that when m lt 1 the reflectivity remains constant at R Ro up to q Qe and not m Q This means that m lt 1 parameters behave like m 1 materials Alternatively the Mirror Guide and Guide_gravity components may use a reflectivity table reflect which 1st column is q A and 2nd column as the reflectivity R in 0 1 For this purpose we provide m 2 and m 8 reflectivity files from SwissNeutronics supermirror_m2 rf1 and s
157. nd propagates the neutrons onto this plane by the kernel call PROP_Z0 Neutrons within the slit opening are unaffected while all other neutrons are discarded by the kernel call ABSORB By using Slit some neutrons contributing to the background in a real experiment will be neglected These are the ones that scatter off the inner side of the slit penetrates the slit material or clear the outer edges of the slit 44 The input parameters of Slit are the four coordinates min Tmax Ymin Ymax defining the opening of the rectangle or the radius r of a circular opening depending on which parameters are specified The slit component can also be used to discard insignificant i e very low weight neu tron rays that in some simulations may be very abundant and therefore time consuming If the optional parameter Peut is set all neutron rays with p lt Peut are ABSORB ed This use is recommended in connection with Virtual_output 4 3 Beamstop A neutron absorbing area Input Parameters for component Beamstop from optics 1 lt Parameter value gt Unit Description ok WN HF The component Beamstop can be seen as the reverse of the Slit component It sets up an area at the z 0 plane and propagates the neutrons onto this plane by the kernel call PROP_Z0 Neutrons within this area are ABSORB ed while all other neutrons are unaffected By using this component some neutrons contributing to the background in a real experim
158. nd these directions To do this one uses 8 7 where the fraction y 0 g Q corrects for the focusing One must choose a proper distribution so that g Q gt 0 in every interesting direction If this is not the case the Monte Carlo simulation gives incorrect results All samples have been constructed with a focusing and a non focusing option 82 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 8 0 3 Future development of sample components There is still room for much more development of functionality in McStas samples A more general SANS sample is under development In addition a reflectometry sample will soon be developed In the mean time you may use the SiC contributed component In general all samples are assumed to be homogeneous There would also be potential in developing an inhomogeneous sample e g with spatially varying lattice constant relevant for stress strain scanners Inhomogeneously absorbing sample for tomography could also be possible Further no polarization effects are yet taken into account in any of the samples 8 1 Incoherent An incoherent scatterer the V sample Input Parameters for component Incoherent from samples lt Parameter value gt Unit Description lt geometry 0 gt str Name of an Object File Format OFF or PLY file for complex geometry The OFF PLY file may be generated from XYZ coordinates using qhull powercrust lt radius 0 gt m Outer
159. ng lt xmax 0 gt m Upper x bound of opening lt ymin 0 gt m Lower y bound of opening lt ymax 0 gt m Upper y bound of opening lt zmin 0 gt m Lower z bound of opening lt zmax 0 gt m Upper z bound of opening lt bins 0 gt 1 Number of bins to force for all variables Use bins keyword in options for heterogeneous bins lt min le40 gt u Minimum range value to force for all variables Use min or limits keyword in options for other limits lt max 1e40 gt u Maximum range value to force for all variables Use max or limits keyword in options for other limits lt restore_neutron 0 gt 0 1 If set the monitor does not influence the neutron state Equivalent to setting the parallel option lt radius 0 gt m Radius of sphere banana shape monitor lt options NULL gt str String that specifies the configuration of the monitor The general syntax is x options see lt b gt Descr lt b gt lt filename NULL gt str Output file name overrides file XX option lt geometry NULL gt str Name of an OFF file to specify a complex geometry detector lt usernamel NULL gt str Name assigned to Userl lt username2 NULL gt str Name assigned to User2 lt username3 NULL gt str Name assigned to User3 The component Monitor_nD is a general Monitor that may output any set of phy
160. ng coordinates min Tmax Ymin Ymaz and the name of the associated instance of Source_Optimizer used in the instrument description file one word without quotes As many Monitor_Optimizer instances as required may be used in an instrument for possibly more than one optimization location Multiple instances may all have an effect on the total intensity 42 3 11 Other sources components contributed pulsed sources virtual sources event files There are many other source definitions in McStas Detailed pulsed source components are available for new facilities in a number of contributed components e SNS contrib SNS_source e ISIS contrib ISIS_moderator see section 3 6 e ESS project ESS_moderator_long and ESS_moderator_short When no analytical model e g a Maxwellian distribution exits one may have ac cess to measurements estimated flux distributions event files and better to MCN P Triploli4 neutron event records The following components are then useful e misc Virtual_input can read a McStas event file in text or binary format often bringing an order of magnitude speed up See section e contrib Virtual tripoli4 input does the same but from event files text for mat obtained from the Tripoli4 reactor simulation program Such files are usually huge e contrib Virtual_mcnp input can read MCNP PTRAC event files text for mat obtained from the MCNP reactor simulation program Such files are usually h
161. ng the input parameters of and of The Bragg scattering from the powder d is calculated from the input file with the parameters Q F Q and j for the scattering vector structure factor and multiplicity respectively The volume of the unit cell is denoted Vc while the sample packing factor is f pack Focusing is performed by only scattering into one angular interval d of the Debye Scherrer circle The center of this interval is located at the point where the Debye Scherrer circle intersects the half plane defined by the initial velocity vi and a user specified vector f 8 3 3 Powder scattering An ideal powder sample consists of many small crystallites although each crystallite is sufficiently large not to cause measurable size broadening The orientation of the crystallites is evenly distributed and there is thus always a large number of crystallites oriented to fulfill the Bragg condition n 2d sin 0 8 10 where n is the order of the scattering an integer is the neutron wavelength d is the lattice spacing of the sample and 20 is the scattering angle see figure As all 90 2theta A Figure 8 3 The scattering geometry of a powder sample showing part of the Debye Scherrer cone solid lines and the Debye Scherrer circle grey crystal orientations are realised in a powder sample the neutrons are scattered within a Debye Scherrer cone of opening angle 40 Equation 8 10 may
162. nit Description lt thickness 0 gt m Thickness of cylindrical sample in x z plane lt radius 0 01 gt m Outer radius of sample in x z plane lt focus_r 0 gt m Radius of disk containing target Use 0 for full space lt p interact 1 gt 1 MC Probability for scattering the ray otherwise transmit lt f_QE 0 gt 1 Fraction of quasielastic scattering lt f_tun 0 gt 1 Fraction of tunneling scattering fQE f_tun lt 1 lt gamma 0 gt meV Lorentzian width of quasielastic broadening HWHM lt E_tun 0 gt meV Tunneling energy lt target_x 0 gt lt target_y 0 gt m position of target to focus at lt target_z 0 235 gt lt focus_xw 0 gt m horiz dimension of a rectangular area lt focus_yh 0 gt m vert dimension of a rectangular area lt focus_aw 0 gt deg horiz angular dimension of a rectangular area lt focus_ah 0 gt deg vert angular dimension of a rectangular area lt xwidth 0 gt m horiz dimension of sample as a width lt yheight 0 05 gt m vert dimension of sample as a height lt zdepth 0 gt m depth of sample lt sigma_abs 5 08 gt barns Absorbtion cross section pr unit cell lt sigma_inc 4 935 gt barns Total incoherent scattering cross section pr unit cell lt Vc 13 827 gt AA 3 Unit cell volume lt target_index 0 gt 1 relative index of component to focus at e g next is ail The component Tunneling sample displays incoherent ine
163. nitor Input Parameters for component E_monitor from monitors lt Parameter value gt Unit Description lt nlam 101 gt 1 Number of bins in wavelength lt nt 1001 gt 1 Number of bins in TOF lt filename gt string Defines filenames for the detector images Stored as lt br gt Peak_ 1t filename amp gt and Mean_ amp Ilt filename amp gt gt UOUN 5 lt t 0 0 gt us Minimum time 6 lt t_1 20000 gt us Maximum time 7 lt srcarea 1 gt cm 2 Source area 8 lt lambda_0 0 gt AA Minimum wavelength detected 9 lt lambda 1 20 gt AA Maximum wavelength detected 10 lt restore_neutron 0 gt 1 If set the monitor does not influence the neutron state 11 lt Freq gt Hz Source frequency Use freq 1 for reactor source 12 lt tofcuts 0 gt 1 Flag to generate TOF distributions as function of wavelength 13 lt toflambda 0 gt 1 Flag to generate TOF lambda distribution output 14 lt xwidth 0 01 gt m width of monitor 15 lt yheight 0 01 gt m height of monitor l6 lt source dist 1 gt m Distance from source Beware when transporting through neutron optics The component E_monitor resembles TOF_monitor to a very large extent Only this monitor is sensitive to the neutron energy which in binned in nchan bins between Emin and Emax in meV The output parameters from E_monitor are the total counts and a file with 1 dimensional data vs E similar to TOF monitor 127
164. nput Parameters for component Monochromator_curved from optics N e ow FOoOMOOAN Qos ho lt Parameter value gt Unit Description lt reflect NULL gt str reflectivity file name of text file as 2 columns k gt R lt transmit NULL gt str transmission file name of text file as 2 columns k T lt zwidth 0 01 gt m horizontal width of an individual slab lt yheight 0 01 gt m vertical height of an individual slab lt gap 0 0005 gt m typical gap between adjacent slabs lt NH 11 gt columns number of slabs horizontal lt NV 11 gt rows number of slabs vertical lt mosaich 30 0 gt arc minutes Horisontal mosaic FWHM lt mosaicv 30 0 gt arc minutes Vertical mosaic FWHM lt r0 0 7 gt 1 Maximum reflectivity O unactivates component 76 Monochromator curved 0 05 y m o OS AS Figure 7 3 A curved monochromator lt t0 1 0 gt 1 transmission efficiency lt Q 1 8734 gt AA 1 Scattering vector lt RV 0 gt m radius of vertical focussing flat for 0 lt RH 0 gt m radius of horizontal focussing flat for 0 lt DM 0 gt Angstrom monochromator d spacing instead of Q 2x pi DM lt mosaic 0 gt arc minutes sets mosaich mosaicv lt width 0 gt m total width of monochromator lt height 0 gt m total height of monochromator lt verbose 0 gt 0 1 verbosity level lt order 0 gt 1 specify the diffraction order 1 is usually pref
165. nt instr Constant magnetic field Test_Magnetic_Majorana instr Linearly decreasing field with small transverse component Test_Magnetic_Rotation instr Rotating magnetic field Test_Magnetic_Userdefined instr Example of how to make a user defined analytic magnetic field that can also depend on time Test_Pol_Bender instr Illustrates beam polarization with the Pol_bender Test_Pol_Set instr Tests Pol_set Test_Pol_Guide_Vmirror instr Illustrates beam polarization with the Pol_guide_vmirror Test_Pol_Mirror instr Illustrates beam polarization with the Pol_mirror Test_Pol_TripleAzis instr An example of a triple axis spectrometer with polariz ing monochromators a vanadium sample and a spin flipper B Libraries and constants The McStas Library contains a number of built in functions and conversion constants which are useful when constructing components These are stored in the share directory of the MCSTAS library Within these functions the Run time part is available for all component instrument descriptions The other parts are dynamic that is they are not pre loaded but only imported once when a component requests it using the 4include McStas keyword For instance within a component C code block usually SHARE or DECLARE 1 include read_table lib j will include the read_table lib h file and the read_table lib c unless the no runtime option is used with mcstas Similarly 1
166. of the crystal in the model For this we introduce a local coordinate system for each reciprocal lattice point T and use x for vectors written in local coordinates The origin is 7 the first axis is parallel to 7 and the other two axes are perpendicular to T In the local coordinate system the 3 dimensional Gaussian is given by 2 2 2 1 Ll oC G 11 2 3 ee 2 23 8 19 emata eo aos 8 19 The axes of the Gaussian are 0 TAd d and o2 03 nr Here we used the assumption that 7 is small so that tan y 7 with 7 given in radians By introducing the diagonal matrix o 0 0 D 0 0 0 0 o0 la equation 8 19 can be written as 1 1 G x e72 D 8 20 97 again with x z1 2 3 written in local coordinates To get an expression in the coordinates of the reciprocal lattice of the crystal we introduce a matrix U such that if y y ya y3 are the global coordinates of a point in the crystal reciprocal lattice then U y 7 are the coordinates in the local coordinate system for T The matrix U is given by UT 1 Us 3 where 1 s and z are the axes of the local coordinate system written in the global coordinates of the reciprocal lattice Thus t T T and s and z are unit vectors perpendicular to a and to each other The matrix U is unitarian that is U UT The translation between global and local coordinates is x U y y U x 5 The expression for the 3
167. oherent scattering the outgoing wave vector ky is selected with a random direction 6 For coherent scattering a reciprocal lattice vector is selected by a Monte Carlo choice and kg is found see below 7 Adjust the neutron weight as dictated by the Monte Carlo choices made 8 Repeat from 2 until the neutron is transmitted to simulate multiple scattering For point 2 the distance dist between a reciprocal lattice point and the Ewald sphere is considered small enough to allow scattering if it is less than five times the maximum axis of the Gaussian dist lt 5max 0 02 03 8 4 3 Choosing the outgoing wave vector The final wave vector kf must lie on the intersection between the Ewald sphere and the Gaussian ellipsoid Since 7 and Ad d are assumed small the intersection can be approximated with a plane tangential to the sphere see figure 8 5 The tangential point is taken to lie on the line between the center of the Ewald sphere k and the reciprocal lattice point T Since the radius of the Ewald sphere is kj this point is o ki p 1 p T where p ki T 99 The equation for the plane is P t 0 Bt t eR 8 23 Here B b b2 is a 3 x 2 matrix with the two generators for the plane b and b These are arbitrary unit vectors in the plane being perpendicular to each other and to the plane normal n p p Each t defines a potential final wave vector k t ki P t The value of the 3 dimensional Ga
168. om events into a single value e g flux or onto an histogram grid The theory shows that the accuracy of these estimates is a function of the space dimension d and the number of events N For large numbers N the central limit theorem provides an estimate of the relative error as 1 N However the exact expression depends on the random distributions 22 Records Accuracy 107 10 104 2 5 10 1 106 0 25 107 0 05 Table 2 1 Accuracy estimate as a function of the number of statistical events used to estimate an integral with McStas McStas uses a space with d 10 parameters to describe neutrons position velocity spin time We show in Table a rough estimate of the accuracy on integrals as a function of the number of records reaching the integration point This stands both for integrated flux as well as for histogram bins for which the number of events per bin should be used for N 23 ZXAO O04Aa0NRA 3 Source components McStas contains a number of different source components and any simulation will usu ally contain exactly one of these sources The main function of a source is to determine a set of initial parameters r v t for each neutron ray This is done by Monte Carlo choices from suitable distributions For example in most present sources the initial posi tion is found from a uniform distribution over the source surface which can be chosen to be either circular or rectangular The in
169. omatically lt tmax_multiplier 3 gt 1 Defined maximum emission time at moderator tmax tmax_multiplier ESS PULSE_ DURATION Only in combination with sourcedef 2013 2014 or 2015 lt yheight_c 0 12 gt m Height of the cold source lt yheight_t 0 12 gt m Height of the thermal source lt n pulses 1 gt 1 Number of pulses simulated 0 and 1 creates one pulse The integrated intensity is constant lt acc_power 5 gt MW Accelerator power in MW lt beamport_angle 1 gt deg Direction within the beamport sector 0 lt angle lt extraction_opening for 2014 extraction_opening 2 lt angle lt extraction_opening 2 for 2015 to direct neutrons For sourcedef 2015 the only allowed values are 5 15 55 degrees measured from the central point lt sourcedef 2014 gt string ESS source database values TDR 2001 2013 2014 20157 lt xwidth_c 0 1 gt m Width arc length opening of the cold source lt xwidth_t 0 18 gt m Edge of thermal source lt extraction_opening 120 gt deg Width of extraction area in degrees 60 or 120 degrees 120 deg only in combination with sourcedef 2014 and 2015 The simple time of flight source component Moderator resembles the source compo nent Source_simple described in 3 1 Moderator is circular with radius r and focuses on a rectangular target of area w x h in a distance 27 The initial
170. omponent Collimator_linear from optics lt Parameter value gt Unit Description lt xmin 0 02 gt m Lower x bound on slits lt xmax 0 02 gt m Upper x bound on slits lt ymin 0 05 gt m Lower y bound on slits lt ymax 0 05 gt m Upper y bound on slits lt xwidth 0 gt m Width of slits lt yheight 0 gt m Height of slits lt length 0 3 gt m Distance between input and output slits lt divergence 40 gt minutes of arc Divergence horizontal angle calculated as atan d length where d is the blade spacing lt transmission 1 gt 1 Transmission of Soller 0 lt t lt 1 lt divergenceV 0 gt minutes of arc Divergence vertical angle Collimator_linear models a standard linear Soller blade collimator The collimator has two identical rectangular openings defined by the x and y values Neutrons not clearing both openings are ABSORB ed The length of the collimator blades is denoted L while the distance between blades is called d The collimating effect is taken care of by employing an approximately triangular trans mission through the collimator of width FWHM 6 which is given in arc minutes i e 6 60 is one degree If 6 0 the collimating effect is disabled so that the component only consists of two rectangular apertures For a more detailed Soller collimator simulation taking every blade into account it is possible to use Channeled_guide with absorbing walls see section
171. on and the orientation relative to the previous component respectively A component of a rotation matrix is referred to as ROT _A CURRENT COMP m n where m and n are 0 1 or 2 standing for x y and z coordinates respectively POS_A COMP comp gives the absolute position of the component with the name comp Note that comp is not given as a string A component of the vector is referred to as POS A COMP comp i where i is x y or z ROT_A_COMP comp and ROT_R COMP comp give the orientation of the component comp as rotation matrices absolute orientation and the orientation relative to its previous component respectively Note that comp is not given as a string A component of a rotation matrice is referred to as ROT_A_COMP comp m n where m and n are 0 1 or 2 INDEX_CURRENT_COMP is the number index of the current component starting from 1 POS_A COMP INDEX index is the absolute position of component indez POS_A_ COMP INDEX INDEX_CURRENT_COMP is the same as POS_A _CURRENT_COMP You may use POSA COMP INDEX INDEX_CURRENT_COMP 1 to make for instance your component access the position of the next component this is usefull for automatic targeting A component of the vector is referred to as POS_A COMP INDEX indezx i where i is x y or z POS_R_COMP_INDEX works the same as above but with relative coordinates STORE_NEUTRON indez x y z uz vy vz t sv sy 8z p stores the current neutron state in the trace his
172. ons during a Monte Carlo choice 20 2 3 1 Direction focusing 2 0 ee 21 2 4 Adaptive and Stratified sampling 20004 21 2 5 Accuracy of Monte Carlo simulations 00 4 22 24 3 0 1 Neutron flux e 24 ere ee eee ee ee ee ee ee 26 te ye ae 26 3 3 Source_Maxwell_3 A continuous source with a Maxwellian spectrum 27 Deters ee at 28 3 5 Moderator A time of flight source pulsed o 30 APA a 31 3 6 1 Introduction o s e sos sa a woe lt lt 16 eRe a 31 e tare tenets a on gr Gh te aaa 32 3 6 3 Comparing TSl and TS o o e 33 da ee ee o Ad aa 33 3 7 Source_adapt A neutron source with adaptive importance sampling 35 3 7 1 Optimization disclaimer 2 20 a 36 3 7 2 The adaption algorithm o e e e 36 CARA A ea aha 38 ES 38 Pos Hons 40 3 9 1 The optimization algorithm 40 E ee ae Fae oe nan i 41 3 10 Monitor_Optimizer Optimization locations for the Source Optimizer lt esp so pepes d EEG ea ieo e Ea 42 3 11 Other sources components contributed pulsed sources virtual sources event files 3 o s aoee a a a ad AN a S 43 4 Beam optical components Arms slits collimators and filters 44 4 1 Arm The generic component aoao a a o 44 ba A ee de E 44 Lira a wb Boe ee Re 45 apa 45 ro hei Te paa 47 4 5 1 Collimator transmissio
173. osen randomly from within a circle of radius rs in the z 0 plane This geometry is a fair approximation of a cylindrical cold thermal source with the beam going out along the cylinder axis The initial neutron ray direction is focused onto a rectangular target of width w height h parallel to the xy plane placed at 0 0 2foc The initial weight of the created neutron ray po is set to the energy integrated flux Y times the source area rr times a solid angle factor which is basically the solid angle of the focusing rectangle See also the section on source flux This component replaces the obsolete components Source_flux_lambda Source_flat Source_flat_lambda and Source_flux 3 2 Source_div A continuous source with specified divergence Input Parameters for component Source_div from sources lt Parameter value gt Unit Description lt xwidth gt m Width of source lt yheight gt m Height of source 26 o DAANONA Rh aouw1 rwnrowo 17 18 19 lt focus_aw gt deg FWHM Gaussian or maximal uniform horz width divergence lt focus_ah gt deg FWHM Gaussian or maximal uniform vert height divergence lt E0 0 0 gt meV Mean energy of neutrons lt dE 0 0 gt meV Energy half spread of neutrons lt lambda0 0 0 gt Ang Mean wavelength of neutrons only relevant for E0 0 lt dlambda 0 0 gt Ang Wavelength half spread of neutrons lt gauss 0 gt 0 1 Criterion 0 unifo
174. probability of ftun and a tunneling energy of Etun The tunneling peaks are weighted by the usual factor k kj The total scattering cross section is given by d inc Sa o BE x 1 fae fina ho 69 i f r A Jinel kf EUA 2 fi hw Etun hw En The component takes care that for ftun lt 1 otherwise an error is returned The component accounts for absorption but not multiple scattering To obtain inten sities similar to real measured ones we therefore do not take attenuation from scattering into account for the outgoing neutron ray 87 N a oe Ww 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 8 3 PowderN A general powder sample Input Parameters for component PowderN from samples lt Parameter value gt Unit Description lt format Undefined gt no quotes Name of the format or list of column indexes see Description lt reflections NULL gt string Input file for reflections Use only incoherent scattering if NULL or lt geometry NULL gt str Name of an Object File Format OFF or PLY file for complex geometry The OFF PLY file may be generated from XYZ coordinates using qhull powercrust lt radius 0 gt m Outer radius of sample in x z plane lt yheight 0 gt m Height of sample y direction lt xwidth 0 gt m Horiz dimension of sample as a width lt zdept
175. r any kind of data create the data files and may dis play many geometries for mcdisplay Refer to these components for implementation examples and ask the authors for more details B 4 Adaptive importance sampling Library This library is currently only used by the components Source_adapt and Adapt_check It performs adaptive importance sampling of neutrons for simulation efficiency optimiza tion Refer to these components for implementation examples and ask the authors for more details B 5 Vitess import export Library This library is used by the components Vitess_input and Vitess_output as well as the mcstas2vitess utility Refer to these components for implementation examples and ask the authors for more details B 6 Constants for unit conversion etc The following predefined constants are useful for conversion between units 167 Name Value Conversion from Conversion to DEG2RAD 27 360 Degrees Radians RAD2DEG 360 27 Radians Degrees MIN2RAD 27 360 60 Minutes of arc Radians RAD2MIN 360 60 27 Radians Minutes of arc V2K 10 my h Velocity m s k vector A K2V 10710 h my k vector T Velocity m s VS2E mn 2e Velocity squared m s72 Neutron energy meV SE2V y 2e mn Square root of neutron Velocity m s energy meV FWHM2RMS 1 8log 2 Full width half maximum Root mean square standard deviation RMS2FWHM 8 log 2 Root mean square stan Full width half maxi dard deviation
176. r distribution in a small angle approximation of 1 r y Ze aa Ar rr 8 8 The focusing can alternatively be performed on a rectangle with dimensions Wfocus hfocus Or uniformly in angular space in a small angle approximation using wfoc angle hfoc angle The focusing location can be picked to be a downstream component by speci 84 fying target_index When calculating the neutron path length within the cylinder the kernel function cylinder_intersect is used twice once for the outer radius and once for the inner radius Multiple scattering is not included in this component To obtain intensities similar to real measured ones we therefore do not take attenuation from scattering into account for the outgoing neutron ray 8 1 2 Remark on functionality When simulating a realistic incoherent hollow cylinder sample one finds that the resulting direction dependence of the scattered intensity is not isotropic This is explained by the variation of attenuation with scattering angle One test result is shown in the instrument example chapter of the McStas User Manual The Samples_vanadium and Samples_incoherent test example instruments exist in the distribution for this component 85 oR WN RA COND 10 11 12 13 14 15 16 17 18 19 20 21 22 23 8 2 Tunneling_sample An incoherent inelastic scatterer Input Parameters for component Tunneling_sample from samples lt Parameter value gt U
177. rameters as in component Source_Maxwell_3 refer to section 3 3 Maxwellian parameters for some continuous sources are given in Table 3 1 As nobody knows exactly the characteristics of the sources it is not easy to measure spectrum there these figures should be used with caution 29 RO0Do00 Oo oe W ho 13 14 15 16 17 18 19 20 21 22 23 3 5 Moderator A time of flight source pulsed Name Moderator Author System Mark Hagen SNS Input parameters Ts Ep Er 27 w h To Ec Y Optional parameters Notes Input Parameters for component Moderator from sources lt Parameter value gt Unit Description lt isleft 0 9 gt 1 Fraction of thermal neutrons generated at the left moderator slab in case of 2013 or 2014 lt Lmin gt AA Lower edge of wavelength distribution lt Lmax gt AA Upper edge of wavelength distribution lt cold_frac 1 0 gt 1 Fraction of neutron statistics from cold source It is implicitely assumed that supermirror allows each beamline to choose the desired fraction of cold and thermal neutrons i e extreme idealization lt dist 0 gt m Distance from source to focusing rectangle at 0 0 dist lt focus_xw gt m Width of focusing rectangle lt focus yh gt m Height of focusing rectangle lt target_index 0 gt 1 relative index of component to focus at e g next is srl this is used to compute dist aut
178. re 6 4 The two vector components s t 2 x follow the equation faa o For a fixed chopper rotation speed the neutron trajectory tends to strech from a spiral curve for slow neutrons to a straight line for fast neutrons For real Fermi chopper settings v about 100 Hz on IN6 at the ILL neutron trajectories are found to be nearly straight for 1000 m s neutron velocities Bla83 The basis of the algorithm is to find the intersections of these spiral trajectories with the chopper outer cylinder and then the slit package in the rotating frame For this purpose the Ridders s root finding method was implemented in order to solve 1 dorz 6 d 6 3 64 i i i Z Component X Component A MN 1 I f 1 Jf 1 gt E N i N 2 1 x lt i 1 Time t X m Figure 6 4 The x and z component as a function of time in the rotating frame left A typical neutron trajectory in the rotating frame right This method provides faster and more accurate intersection determination than other common algorithms E g the secant method fails more often and may give wrong results outside chopper whereas the bisection method a k a Picard dichotomy is slightly slower Standard slit packages non super mirror The neutrons are first propagated to the outer chopper cylinder and their coordinates are transformed into the rotating frame using T Neutrons outside the slit channel chopper
179. re flat for 0 lt powder 0 gt 1 Flag to indicate powder mode for simulation of Debye Scherrer cones via random crystallite orientation lt PG 0 gt 1 Flag to indicate Pyrolytic Graphite mode only meaningful with choice of Graphite lau models PG crystal The Single_crystal component models a thick flat single crystal with multiple scat tering and absorption with elastic coherent scattering An elastic incoherent background may also be simulated It may be used to describe samples for diffraction but also for accurate monochromator descriptions The component is currently under further review The current documentation is outdated especially with respect to the model of crystal mosaicity The input parameters for the component are width yheight and zdepth to define the dimensions of the crystal in meters area is centered delta_d_d to give the value of Ad d no unit ax ay az bx by bz and cx cy cz to define the axes of the direct lattice of the crystal the sides of the unit cell in units of Angstrom and reflections a string giving the name of the file with the list of structure factors to consider The mosaic is specified either isotropically as mosaic or anisotropically as mosaic_h rotation around the Y axis mosaic_v rotation around the Z axis and mosaic_n rotation around the X axis in all cases in units of full width half maximum minutes of arc Optionally the absorption cross section a
180. rget_z 0 gt m position of target to focus at Straight ahead lt target_index 0 gt 1 relative index of component to focus at e g next is g lt focus_r 0 gt m Radius of sphere containing target lt focus_xw 0 gt m horiz dimension of a rectangular area m lt focus_yh 0 gt m vert dimension of a rectangular area lt focus_aw 0 gt deg horiz angular dimension of a rectangular area lt focus_ah 0 gt deg vert angular dimension of a rectangular area This component models a simple phonon signal from a single crystal of a pure element in an fcc crystal structure Only one isotropic acoustic phonon branch is modelled and the longitudinal and transverse dispersions are identical with the velocity of sound being c Other physical parameters are the atomic mass M the lattice parameter a the scattering length b the Debye Waller factor DW and the temperature T Incoherent scattering and absorption are taken into account by the cross sections Cabs and Cine The sample can have the form of a cylinder with height h and radius ro or a box with dimensions wy hy tz Phonons are emitted into a specific range of solid angles specified by the location xz Yt 24 and the focusing radius ro Alternatively the focusing is given by a rectangle Wiocus and Afocus and the focus point is given by the index of a down stream component target_index Multiple scattering is not included in this component A usage exa
181. rgy lies between w and w dw met aS q w dq P w dw 2 i5 8 59 where S ff S q w dgqdw is the norm of S q w in the available dynamical range q mins Umar and w E wmin Wmaz The probability P w is normalised to unity J P w dw 1 and is a probability distribution of mode energies in the material We then choose randomly an energy transfer w from this distribution Similarly in order to focus the wavevector transfer choice we define the probability distribution of wavevector P q w for the selected energy transfer lying between w and w dw qS q w Py q w Sa gt 8 60 from which we choose randomly a wavevector transfer q knowing the energy transfer w These two probability distributions extracted from S q w are shown in Fig for a model S q w function built from the L He elementary excitation Data from Donnelly Then a selection between energy gain and loss is performed with the detailed balance ratio e ksT In the case of Stokes processes the neutron can not loose more than its own energy to the sample dynamics so that hw lt Fi This condition breaks the symmetry between up scattering and down scattering Solving selection rules and choosing the scattered wave vector The next step is to check that the conservation laws h2 hw E Ep a hi k 8 61 q ky ky 8 62 can be satisfied These conditions are closely related to the method for selecting the outgoing wave vector direc
182. rm 1 Gaussian distributions lt flux 1 gt 1 s cm 2 st xenergy unit flux per energy unit Angs or meV Source_div is a rectangular source wx h which emits a beam of a specified divergence around the direction of the z axis The beam intensity is uniform over the whole of the source and the energy or wavelength distribution of the beam is uniform over the specified energy range Ey AF in meV or alternatively the wavelength range Ay A in A The source divergences are n and 6 FWHM in degrees If the gauss flag is set to 0 default the divergence distribution is uniform otherwise it is Gaussian This component may be used as a simple model of the beam profile at the end of a guide or at the sample position 3 3 Source_Maxwell_3 A continuous source with a Maxwellian spectrum Input Parameters for component Source_Maxwell_3 from sources lt Parameter value gt Unit Description lt size 0 gt m Edge of cube shaped source for backward compatibility lt yheight 0 gt m Height of rectangular source lt xwidth 0 gt m Width of rectangular source lt Lmin gt AA Lower edge of lambda distribution lt Lmax gt AA Upper edge of lambda distribution lt dist gt m Distance from source to focusing rectangle at 0 0 dist lt focus_xw gt m Width of focusing rectangle lt focus_yh gt m Height of focusing rectangle lt T1 gt K 1st temperature of
183. sed see sec tion 3 8 The source attemps to sample only from bins from which neutrons are not ab sorbed prior to the position in the instrument at which Adapt_check is placed Among 36 those bins the algorithm attemps to minimize the variance of the neutron weights at the Adapt_check position Thus bins that would give high weights at the Adapt_check position are sampled more often lowering the weights while those with low weights are sampled less often Let 7 Pac po denote the ratio between the neutron weight p at the Adapt_check position and the initial weight po just after the source For each bin the component keeps track of the sum gt of 7 s as well as of the total number of neutrons n from that bin The average weight at the Adapt_source position of bin i is thus 2 m We now distribute a total sampling weight of 6 uniformly among all the bins and a total weight of 1 8 among bins in proportion to their average weight 2 n at the Adapt_source position _ 6 Nbin bi ni Nbins paid 25 n After each neutron event originating from bin 7 the sampling weight w is updated This basic idea can be improved with a small modification The problem is that until the source has had the time to learn the right sampling weights neutrons may be emitted with high neutron weights but low probability These low probability neutrons may account for a large fraction of the total intensity in detectors causing large varian
184. sian distributions around initial events from the file lt display 1 gt 2 The component Virtual_input resumes a split simulation where the first part has been performed by another instrument and the neutron ray parameters have been stored by the component Virtual_output All neutron ray parameters are read from the input file which is by default of text type but can also assume the binary formats float and double The reading of neutron rays continues until the specified number of rays have been simulated or till the file has been exhausted If desirable the input file can be reused a number of times determined by the optional parameter repeat count This is only useful if the present simulation makes use of MC choices otherwise the same outcome will result for each repetition of the simulation see Appendix 2 141 Care should be taken when dealing with absolute intensities which will be correct only when the input file has been exhausted at least once The simulation ends with either the end of the repeated file counts or with the normal end with ncount McStas simulation events We recommend to control the simulation on repeat count by using a very larger ncount value 142 SCNIow1rwnr Be RP RRP RPP NOoRWNrF OO 10 3 Res sample A sample like component for resolution calculation Input Parameters for component Res_sample from misc lt Parameter value gt Unit Description lt
185. sical parameters regarding the passing neutrons The generated files are either a set of 1D signals Intensity vs Variable or a single 2D signal Intensity vs Variable 1 vs Variable 1 and possibly a simple long list of selected physical parameters for each neutron The input parameters for Monitor_nD are its dimensions min Tmax Ymin Ymax in meters and an options string describing what to detect and what to do with the signals in clear language The width Yneights Zdepth May also be used to enter dimensions Eventhough the possibilities of Monitor nD are numerous its usage remains as simple as possible specially in the options parameter which understands normal language The formatting of the options parameter is free as long as it contains some specific keywords that can be sometimes followed by values The no or not option modifier will revert next option The all option can also affect a set of monitor configuration 131 parameters see below As the usage of this component enables to monitor virtually anything and thus the combinations of options and parameters is infinite we shall only present the most ba sic configuration The reader should refer to the on line component help using e g mcdoc Monitor_nD comp 9 8 1 The Monitor_nD geometry The monitor shape can be selected among seven geometries 1 square The default geometry is flat rectangular in xy plane with dimensions Tmin Tmax Ym
186. sing the dy parameter By default neutrons hitting outside the physical extent of the disc are absorbed This behaviour can be overruled by setting parameter abs_out 0 A y Optional beamstop of width 6 Figure 6 1 Sketch of a disc chopper with geometry parameters When simulating the chopping of a continuous beam most of the neutrons could easily be lost To improve efficiency one can set the flag IsFirst which will allow every neutron ray to pass the DiskChopper but modify the time t to a random time at which it is possible to pass Of course there should be only one first chopper in any simulation To simulate frame overlap from a first chopper one can specify the number of frames to study by the parameter Npulse 60 0M D0dRAQNER For more advanced chopper geometries than those mentioned above it is possible to set up a GROUP of choppers COMPONENT Chop1 DiskChopper omega 2500 R 0 3 h 0 2 theta_0 20 n 1 AT 0 0 1 1 RELATIVE Source GROUP Choppers COMPONENT Chop2 DiskChopper omega 2500 R 0 3 h 0 2 theta_0 20 n 1 phi_0 40 AT 0 0 1 1 RELATIVE Source GROUP Choppers The result of such a DiskChopper GROUPing can be seen in figure 6 2 DiskChopper GROUP arangon PSD1 PSD1 sim oo X0 6 90216 dX 7 63337 YO 0 91963 dY Y position cm Figure 6 2 mcdisplay rendering and monitor output from a DiskChopper GROUP 61 CNS CON
187. sotropic constant elastic scattering reflections NULL pi barns 0 for lau type files lt ax 0 gt AA or AA 1 Coordinates of first direct recip unit cell vector lt ay 0 gt a on y axis lt az 0 gt a on z axis lt bx 0 gt AA or AA 1 Coordinates of second direct recip unit cell vector lt by 0 gt b on y axis lt bz 0 gt b on z axis lt cx 0 gt AA or AA 1 Coordinates of third direct recip unit cell vector lt cy 0 gt c on y axis 94 39 40 41 42 43 44 45 46 47 48 49 50 5l 52 53 54 55 56 lt cz 0 gt c on z axis lt p transmit 1 gt 1 Monte Carlo probability for neutrons to be transmitted without any scattering Used to improve statistics from weak reflections lt sigma abs 0 gt barns Absorption cross section per unit cell at 2200 m s lt sigma_inc 0 gt barns Incoherent scattering cross section per unit cell Use 1 to unactivate lt aa 0 gt deg Unit cell angles alpha beta and gamma Then uses norms of vectors a b and c as lattice parameters lt bb 0 gt deg Beta angle lt cc 0 gt Gamma angle deg lt order 0 gt 1 Limit multiple scattering up to given order 0 all 1 first 2 second lt RX 0 gt m Radius of horizontal along X lattice curvature flat for 0 lt RY 0 gt m Radius of vertical lattice curvature flat for 0 lt RZ 0 gt m Radius of horizontal along Z lattice curvatu
188. stant Lhota LPAAQAA 3 1 where A is the source area AQ is the solid angle of the diaphragm as seen from the source surface and AA is the width of the wavelength interval in which neutrons are emitted assuming a uniform wavelength spectrum 24 sources 0 1 0 05 Jud Oo 0 05 1 SB z m 0 0 05 0 0 050 1 x m Figure 3 1 A circular source component at z 0 emitting neutron events randomly either from a model or from a data file The simulations are performed so that detector intensities are independent of the number of neutron histories simulated although more neutron histories will give better statistics If Nsim denotes the number of neutron histories to simulate the initial neutron weight pg must be set to Mtotal P A Nsim Neim AQAA 3 2 where the source flux is now given a A dependence As a start we recommend new McStas users to use the Source_simple component Slightly more realistic sources are Source_Maxwell_3 for continuous sources or Mod erator for time of flight sources Optimizers can dramatically improve the statistics but may occasionally give wrong results due to misleaded optimization You should always check such simulations with shorter non optimized ones Other ways to speed up simulations are to read events from a file See section 3 11 for details 25 o DOAASNNA Rth CONDoKBWNrF OO Eh o bo 3 1 Source_simple A simple continuous source w
189. struments However EQ and El cannot be equal although they can be close By default these arguments select energy in meV if negative values are given selection will be in terms of Angstroms Variables dist zw and yh are the three component which will determine the directional acceptance window They define a rectangle with centre at 0 0 dist from the moderator position and with width zw meters and height yh meters The initial direction of all the neutrons are chosen randomly to originate from a point on the moderator surface and along a vector such that without obstruction and gravitational effects they would pass through the rectangle This should be used as a directional guide All the neutrons start from the surface of the moderator and will be diverted absorbed if they encountered other components The guide system can be turned off by setting dist to zero The CAngle variable is used to rotate the viewed direction of the moderator and reduces the effective solid angle of the moderator face Currently it is only for the horizontal plane This is redundant since there are beamline specific h face files The two variables modYsize and modXsize allow the moderators to be effectively reduced increased If these variables are given negative or zero values then they default to the actual visible surface size of the moderators The last variable SAC will correct for the different solid angle seen by two focussing windows which are at differen
190. t 2200 m s and the incoherent cross section may be given as absorption and incoherent in barns with default of zero and p_transmit may be assigned a fixed Monte Carlo probability for transmission through the crystal without any interaction The user must specify a list of reciprocal lattice vectors 7 to consider along with their structure factors F The user must also specify the coordinates in direct space of the unit cell axes a b and c from which the reciprocal lattice will be computed See section 8 4 5 for file format specifications In addition to coherent scattering Single_crystal also handles incoherent scattering and absorption The incoherent scattering cross section is supplied by the user as a constant Cinc The absorption cross section is supplied by the user at 2200 m s so the 2200 m s actual cross section for a neutron of velocity v is Tabs 02200 95 8 4 1 The physical model The textbook expression for the scattering cross section of a crystal is Squ 78 ch 3 Oo T 3 S No Dene F 8 18 Here F is the structure factor defined in section 8 3 N is the number of unit cells Vo is the volume of an individual unit cell and k ky is the scattering vector d x is a 3 dimensional delta function in reciprocal space so for given incoming wave vector k and lattice vector 7 only a single final wave vector ky is allowed In general this wavevector will not fulfill the conditions
191. t distances from the moderator surface The normal mea surement of flux is in neutrons second A cm str but in a detector it is measured in neutrons second Therefore if all other denominators in the flux are multiplied out then the flux at a point sized focus window should follow an inverse square law This solid angle correction is made if the SAC variable is set equal to 1 it will not be calculated 32 Variable Type Options Units Description Face char i Hydrogen Groove Nar String which designates the TS2 row Broad ii name of the face E1 E9 W1 W9 Face char i H2 CH4 Merlin Wa String which designates the TS1 ter ii Maps Crisp Gem name of the face EVS HET HRPD Iris Mari Polaris Prisma San dals Surf SXD Tosca EO float 0 lt E0 lt E1 meV Only neutrons above this en A ergy are sampled El float E0 lt E1 lt 1e10 meV Only neutrons below this en A ergy are sampled dist float 0 lt dist lt m Distance of focus window from face of moderator XW float 0 lt zw lt m x width of the focus window yh float 0 lt yh lt m y height of the focus window CAngle float 360 lt CAngle lt 360 P Horizontal angle from the nor mal to the moderator surface modXsize float 0 lt modX size lt co m Horizontal size of the modera tor defaults to actual size modYsize float 0 lt modY size lt 00 m Vertical size of the moderator defaults to actual size
192. t of 2000 events and in six 1D files e options signal energy x y is a PSD monitor recording the mean energy of the beam as a function of x and y 9 8 7 Monitoring user variables There are two ways to monitor any quantity with Monitor_nD This may be e g the number of neutron bounces in a guide or the wavevector and energy transfer at a sample The only requirement is to define the user1 and optionally user2 user3 variables of a given Monitor_nD instance Directly setting the user variables simple The first method uses directly the user1 and username1 component parameters to directly transfer the value and label such as in the following example COMPONENT UserMonitor Monitor_nD userl log t usernamel Log time options auto userl The values to assign to user2 and user3 must be global instrument variables or a component output variables as in user1 MC_GETPAR some_comp outpar Similarly the user2 user3 and username2 username3 parameters may be used to control the second and third user variable to produce eventually 2D 3D user variable correlation data and custom event lists 136 Indirectly setting the user variables only for professionals It is possible to control the user variables of a given Monitor _nD instance anywhere in the instrument description This method requires more coding but has the advantage that a variable may be defined to store the result of a computation locally and t
193. t option Other options not shown here are verbose displays optimization process debug purpose unactivate to unactivate the Optimizer file name Filename where to save optimized source distributions The file option will save the source distributions at the end of the optimization If no name is given the component name will be used and a src extension will be added By default no file is generated The file format is in a McStas 2D record style As an alternative you may use the Source_adapt component see section 3 7 which performs a 3D phase space optimization 3 10 Monitor_Optimizer Optimization locations for the Source_Optimizer Input Parameters for component Monitor_Optimizer from sources lt Parameter value gt Unit Description lt optim_comp gt no quotes name of the Source_Optimizer component in the instrument definition Do not use quotes lt xmin 0 1 gt m Lower x bound of monitor opening lt xmax 0 1 gt m Upper x bound of monitor opening lt ymin 0 1 gt m Lower y bound of monitor opening lt ymax 0 1 gt m Upper y bound of monitor opening lt xwidth 0 gt m Width of monitor Overrides xmin xmax lt yheight 0 gt m Height of monitor Overrides ymin ymax The Monitor_Optimizer component works with the Source_Optimizer compo nent See section 3 9 for usage The input parameters for Monitor_Optimizer are the rectangular shaped open i
194. t the thickness of the channel walls and Ro W Qer Qey Ax Ay My and My to set the supermirror parameters as described under Guide the names with z denote the vertical mirrors and those with y denote the horizontal ones 5 3 1 Algorithm The implementation is based on that of Guide 1 Calculate the channel which the neutron will enter 2 Shift the x coordinate so that the channel can be simulated as a single instance of the Guide component 3 do the same as in Guide 4 Restore the coordinates when the neutron exits the guide or is absorbed 5 3 2 Known problems e This component may produce wrong results with gravitation support Use Guide_gravity section 5 4 in this case e The focusing channeled geometry for k gt 1 and different values of w and wz is buggy wall slopes are not computed correctly and the component leaks neu trons 50 5 4 Guide gravity A guide with multiple channels and gravitation handling Name Guide_gravity Author System Input parameters w1 hi w2 ha L k m Optional parameters d Ro Qe W a wavy chamfers kp n G Notes validated with gravitation support rotating mode This component is a variation of Guide_channeled section 5 3 with the ability to handle gravitation effects and functional channeled focusing geometry Channels can be specified in two dimensions producing a 2D array k kp of smaller rectangular guide channels
195. t ymin 0 gt m Lower y bound of detector opening lt ymax 0 gt m Upper y bound of detector opening lt xwidth 0 gt m Width diameter of detector x Overrides xmin xmax lt yheight 0 gt m Height of detector y Overrides ymin ymax lt tmin 0 gt mu s Lower time bound lt tmax 0 gt mu s Upper time bound The component TOF monitor has a rectangular opening in the x y plane given by the x and y parameters like for Slit The neutron ray is propagated to the plane of the monitor by the kernel call PROP_Z0 A neutron ray is counted if it passes within the rectangular opening given by the x and y limits Special about TOF_monitor is that it is sensitive to the arrival time t of the neutron ray Like in a real time of flight detector the time dimension is binned into small time intervals Hence this monitor maintains a one dimensional histogram of counts The Nchan time intervals begin at tg and end at t alternatively the interval length is specified by At As usual in time of flight analysis all times are given in units of us The output parameters from TOF_monitor are the three count numbers NV J and Mp for the total counts in the monitor In addition a file filename is produced with a list of the same three data divided in different TOF bins This file can be read and plotted by the mcplot tool see the System Manual 9 2 TOF2E monitor A time of flight monitor with simple energy analysis Input P
196. ter 2 after a simulation of N rays the detected intensity in units of neutrons sec is Iy while the estimated errorbar is M5 Ne Many different monitor components have been developed for McStas but we have decided to support only the most important ones One example of the monitors we have omitted is the single monitor Monitor that measures just one number with errorbars per simulation This effect is mirrored by any of the 1 or 2 dimensional components we support e g the PSD_monitor In case additional functionality of monitors is required the few code lines of existing monitors can easily be modified However the ultimate solution is the use of the Swiss army knife of monitors Mon itor_nD that can face almost any simulation requirement but will prove challenging for users who like to perform own modifications 125 aow rwnr 10 11 12 13 14 COAMONDABRWNH 9 1 TOF_monitor The time of flight monitor Input Parameters for component TOF_monitor from monitors lt Parameter value gt Unit Description lt nx 90 gt 1 Number of pixel columns lt ny 90 gt 1 Number of pixel rows lt nt 10 gt 1 Number of TOF bins lt filename gt text Name of file in which to store the detector image lt restore_neutron 0 gt 1 If set the monitor does not influence the neutron state lt xmin 0 gt m Lower x bound of detector opening lt xmax 0 gt m Upper x bound of detector opening l
197. that for now 20 so that the combined effect of neutron weight change and Monte Carlo probability of making this particular choice equals the actual physical properties we like to model Let us follow up on the simple example of transmission The probability of trans mitting the real neutron is P but we make the Monte Carlo choice of transmitting the neutron ray each time fmc 1 This must be reflected on the choice of weight mul tiplier 7 P Of course one could simulate without weight factor transformation in our notation written as fmc P 7 1 To generalize weight factor transformations are given by the master equation umcr P 2 9 This probability rule is general and holds also if e g it is decided to transmit only half of the rays fmc 0 5 An important different example is elastic scattering from a powder sample where the Monte Carlo choices are the particular powder line to scatter from the scattering position within the sample and the final neutron direction within the Debye Scherrer cone This weight transformation is much more complex than described above but still boils down to obeying the master transformation rule 2 9 2 3 1 Direction focusing An important application of weight transformation is direction focusing Assume that the sample scatters the neutron rays in many directions In general only neutron rays in some of these directions will stand any chance of being detected These directions we
198. the package The new Vitess_ChopperFermi transferred from the VITESS package showed mainly correct behaviour Little bugs were corrected after the first tests At the moment there is only the problem left that it underestimates the influence of a shadowing cylinder With the contributed FermiChopper component there were also minor problems which are all corrected in the meantime For the guides several trajectories through different kinds of guides straight con vergent divergent were calculated analytically and positions directions and losses of reflections compared to the values calculated in the components This was done for Guide and Guide_gravity in the latter case calculations were performed with and without gravity Additionally a cross check against the VITESS guide module was per formed Waviness chamfers and channels were not checked After correction of a bug in Guide_gravity both components worked perfectly within the conditions tested Source_gen was cross checked against the VITESS source module for the case of 3 Maxwellians describing the moderator characteristic and typical sizes the guide and its distance to the moderator It showed the same line shape as a functions of wavelength and divergence and the same absolute values 16 1 8 Disclaimer bugs We would like to emphasize that the usage of both the McStas software as well as its components are the responsability of the users Ind
199. thermal distribution lt T2 300 gt K 2nd temperature of thermal distribution lt T3 300 gt K 3nd temperature of lt I1l gt in flux units see above 1 cm 2 st AA flux 1 lt I2 0 gt in flux units see above 1 cm 2 st AA flux 2 lt I3 0 gt 1 cm 2 st AA flux 3 lt target_index 1 gt 1 relative index of component to focus at e g next is 1 this is used to compute dist automatically lt lambda0 0 gt AA Mean wavelength of neutrons lt dlambda 0 gt AA Wavelength spread of neutrons This component is a source with a Maxwellian energy wavelength distribution sampled in the range Ajow to Anigh The initial neutron ray position is chosen randomly from 27 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 within a rectangle of area h x w in the z 0 plane The initial neutron ray direction is focused within a solid angle defined by a rectangular target of width cw height yh parallel to the xy plane placed at 0 0 dto The energy distribution used is a sum of 1 2 or 3 Maxwellians with temperatures T to 73 and integrated intensities J4 to I3 For one single Maxwellian the intensity in a small wavelength interval A A dA is I M A T dA where M A T1 2a exp a A A is the normalized Maxwell distribu tion a 949 0 K A T The initial weight of the created neutron ray po is calculated according to Eq bA with W A replace
200. tion 116 g 0 5 q 0 g qo Energy transfer meV Energy transfer meV a 0s 115 35 4 1 08 06 04 02 o 05 E 2 25 3 Momentum transfer A 1 15 2 25 Momentum transfer Figure 8 7 Centre Model of dynamic structure factor S q w for 1 He left prob ability distribution g horizontal axis of energy transfers vertical axis density of states right probability distribution gy w vertical axis of momentum transfers horizontal axis for a given energy transfer hw 1 1 meV When the final wave vector has to be computed the quantities ki hw and q q are known We solve the energy conservation law Eq and we select randomly ky as one of the two roots The scattering angle 0 from the initial k direction is determined from the momentum conservation law cos 0 k ke q 2kik which defines a scattering cone We then choose randomly a direction on the cone If the selection rules can not be verified namely cos 0 gt 1 a new q w random choice is performed see Section 8 7 3 It might appear inefficient to select the energy and momentum tranfers first and check the selection rules afterwards However in practice the number of iterations to actually scatter on a high probability process and satisfy these rules is limited usually below 10 Moreover as these two steps are simple the whole process requires a limited number of computer operations As mentioned i
201. tly different from Vo will either be transmitted or absorbed depending on the exact position of the rotator blades when the neutron enters the selector Assuming this position to be unknown and integrating over all possible positions assuming zero thickness of blades we arrive at a transmission factor T 1 N 2 16 L V if N 27 16 wL V lt 1 6 12 0 otherwise where N is the number of collimator blades A horisontal divergence changes the above formula because of the angular difference between the entry and exit points of the neutron The resulting transmittance resembles the one above only with V replaced by V and replaced by 6 4 where y is the angular difference due to the divergence An additional vertical divergence does not change this formula but it may contribute to Y We have here ignored the very small non linearity of 4 along the neutron path in case of both vertical and horisontal divergence Adding the effect of a finite blade thickness t reduces the transmission by the overall factor Nt e E 6 13 x where r is the distance from the rotation axis We ignore the variation of r along the neutron path and use just the average value 6 5 Selector another approach to describe a rotating velocity selector Input Parameters for component Selector from optics l lt Parameter value gt Unit Description 71 The component Selector describes the same kind of rotating velocity selec
202. tor as V_selector compare description there but it uses different parameters and a different algorithm The position of the apertures relative to the z axis usually the beam centre is defined by the four parameters min max ymin ymax Entry and exit apertures are always identical and situated directly before and behind the rotor There are num blades of thickness width twisted by the angle a in degrees on a length len The selector rotates with a speed feq in rotation per second its axle is in a distance radius below the Z axis First the neutron is propagated to the entrance window The loss of neutrons hitting the thin side of the blades is taken into account by multiplying the neutron weight by a factor p r 0 r 0 6 14 0 360 num 6 15 6 is the opening between two blades for the distance r between the neutron position at the entrance and the selector axle The difference between 0 and 0 is determined by the blade thickness The neutron is now propagated to the exit window If it is outside the regarded channel between the two actual blades it is lost otherwise it remains in the exit plane WARNING Differences between Selector and V_selector e Selector has a different coordinate system than V_selector in Selector the origin lies in the entrance plane of the selector e The blades are twisted to the other side i e to the left above the axle in Selector e Speed of rotation is given in rotation per s
203. tory table in local coordinate system index is usu ally INDEX_CURRENT_COMP This is automatically done when entering each component of an instrument RESTORE_NEUTRON indez y Z UL vy vz t S sy SZ p restores the neu tron state to the one at the input of the component index To ignore a component effect use RESTORE_NEUTRON INDEX_CURRENT_COMP L Y Z UL vy VZ t S SY SZ p at the end of its TRACE section or in its EXTEND section These neutron states are in the local component coordinate systems SCATTERED is a variable set to 0 when entering a component which is incre mented each time a SCATTER event occurs This may be used in the EXTEND sections to determine whether the component interacted with the current neutron ray extend_list n amp arr amp len elemsize Given an array arr with len elements each of size elemsize make sure that the array is big enough to hold at least n elements by extending arr and len if necessary Typically used when reading a list of numbers from a data file when the length of the file is not known in advance mcset_ncount n Sets the number of neutron histories to simulate to n mcget_ncount Returns the number of neutron histories to simulate usually set by option n mcget_run_num Returns the number of neutron histories that have been sim ulated until now 161 B 1 3 Coordinate transformations coords set x y z returns a Coord structure like POS_A CURRE
204. traight still frame We use parabolic curvature for slits 66 aow kwnr 10 11 12 13 14 Then instead of solving a t d Ay z where Ag z Rett 1 1 2 Retit 6 5 with A being the gap between the straight tangent line at the slit center and the real slit shape we perform the additional transformation x gt a A 2 6 6 The additional transformation counter balances the real curvature so that the rest of the algorithm is written as if slits were straight This applies to all computations in the rotating frame and thus as well to reflections on super mirror coatings 6 3 Vitess_ChopperFermi The Fermi Chopper from Vitess Input Parameters for component Vitess_ChopperFermi from optics lt Parameter value gt Unit Description lt sGeomFileName 0 gt str name of output file for geometry information lt GeomOption 0 gt 1 option O straight 1 parabolic 2 circular lt zerotime 0 gt 1 option 1 set time to zero 0 do not lt Nchannels 20 gt 1 number of channels of the Fermi chopper lt Ngates 4 gt 1 number of gates defining the channel 4 default 6 or 8 for long wavelengths lt freq 300 0 gt Hz number of rotations per second lt height 0 05 gt m height of the Fermi chopper lt width 0 04 gt m total width of the Fermi chopper lt depth 0 03 gt m channel length of the Fermi chopper lt r_curv 0 5 gt m radius of curvature of the curve
205. troduced by approximating the Ewald sphere with a plane 100 8 4 4 Computing the total coherent cross section To determine the total coherent scattering cross section the differential cross section must be integrated over the Ewald sphere do Ocoh do ss coh el For small mosaic we may approximate the sphere with the tangential plane and we thus get from 8 22 and 8 25 ee I NE alr n Ep Pan 8 29 la caen an det L aver pe f 7299 dg 8 31 arde N OO e 8 32 O yoo FP 8 33 Ocoh S ye 8 34 As before we let g L 1 t to so that dt det L dg Neutron weight factor adjustment We now calculate the correct neutron weight ad justment for the Monte Carlo choices made In three cases is a Monte Carlo choice made with a probability different from the probability of the corresponding physical event When deciding whether to transmit the neutron or not when simulating absorption and when selecting the reciprocal lattice vector 7 to scatter from If the user has choosen a fixed transmission probability f transmit Ptransmit the neutron weight must be adjusted by P transmit transmit f transmit where P transmit exp G2 is the physical transmission probability Likewise for non transmission the adjustment is 1 P transmit 1 f transmit tr no transmission Absorption is never explicitly simulated so the Monte Carlo probability of
206. tron state The component Res_monitor is used for calculating the resolution function of a particular instrument with detector of the given shape size and position The shape of Res_monitor is by default rectangular but can be a box a sphere a disk or a cylinder depending on the parameter options The component works like a normal monitor but also records all scattering events and stores them to a file that can later be read by the McStas frontend tool mcresplot For time of flight TOF instruments Res_monitor should be understood as giving the resolution of one time bin of the TOF detector only the bin properties being specified in the preceding TOF_Res_sample As described in section 10 3 the Res monitor should be used in connection with one of the components Res_sample or TOF_Res sample the name of which should be passed as an input parameter to Res_monitor For example COMPONENT mysample Res_sample COMPONENT det Res_monitor res_sample_comp mysample 145 The output file is in ASCII format one line per scattering event with the following columns e ki the three components of the initial wave vector e ke the three components of the final wave vector r the three components of the position of the scattering event in the sample Pi the neutron weight just after the scattering event pr the relative neutron weight adjustment from sample to detector so the total weight in th
207. uge e misc Vitess_input can read Vitess neutron event binary files e optics Filter_gen reads a 1D distribution from a file and may either modify or set the flux according to it See section 4 4 43 4 Beam optical components Arms slits collimators and filters This chapter contains a number of optical components that is used to modify the neutron beam in various ways as well as the generic component Arm 4 1 Arm The generic component Name Arm Author System Input parameters none Optional parameters none Notes The component Arm is empty is resembles an optical bench and has no effect on the neutron ray The purpose of this component is only to provide a standard means of defining a local coordinate system within the instrument definition Other components may then be positioned relative to the Arm component using the McStas meta language The use of Arm components in the instrument definitions is not required but is recom mended for clarity Arm has no input parameters The first Arm instance in an instrument definition may be changed into a Progress_bar component in order to display on the fly the simulation progress and possibly save in termediate results 4 2 Slit A beam defining diaphragm Input Parameters for component Slit from optics l lt Parameter value gt Unit Description The component Slit is a very simple construction It sets up an opening at z 0 a
208. ugh the total scattering cross sections Ocoh Cinc Tabs and the S q w data files If you are lucky enough to have access to separated coherent and incoherent contri butions e g from material simulation simply set Sqw_coh and Sqw_inc parameter to the files names If on the other hand you have access to a global data set containing incoherent scattering as well e g the result of a previous experiment use Sqw_coh parameter set the 0 parameter to the sum of both contributions Ceoh Cinc and set Cine 1 This way we only use one of the two implemented scattering channels Such global data sets may originate from previous experiments as far as you have applied all known corrections multiple scattering geometry In any case the accuracy of the S q w data limits the q and w resolution of the simulation eventhough a bilinear interpolation is performed in order to smooth binning The sampling of data files should then be as thin as possible If the Sqw_inc parameter is left unset but the Gine is not zero an isotropic incoherent elastic scattering is used just like the V_sample component see section 8 1 Anyway as explained below it is also possible to simulate the elastic scattering from a powder file see below File formats S q w inelastic scattering The format of the data files is free text consisting of three numerical blocks separated by empty lines or comments in the following order 1 A vector of length
209. ulation In the description of the theory behind the component functionality we will use the usual symbols r for the position x y z of the particle unit m and v for the particle velocity vz Vy Uz unit m s Another essential quantity is the neutron wave vector k mp v h where my is the neutron mass k is usually given in A while neutron energies are given in meV The neutron wavelength is the reciprocal wave vector A 27 k In general vectors are denoted by boldface symbols Subscripts i and f denotes initial and final respectively and are used in connection with the neutron state before and after an interaction with the component in question 12 The spin of the neutron is given a special treatment Despite the fact that each physical neutron has a well defined spin value the McStas spin vector s can have any length between zero unpolarized beam and unity totally polarized beam Further all three cartesian components of the spin vector are present simultaneously although this is physically not permitted by quantum mechanics For further details about polarization handling you may refer to the Appendix A 1 3 Component coordinate system All mentioning of component geometry refer to the local coordinate system of the in dividual component The axis convention is so that the z axis is along the neutron propagation axis the y axis is vertical up and the x axis points left when looking alon
210. unction attatched to the component To calculate da dQ we need to transform the q sum into an integral over the Brillouin zone by Doe gt NV 27 dez d q The k sum can now be removed by expanding the q integral to infinity All in all the partial differential cross section reads 2 1 2 1 1 sam hw Nb f TV n 7 5 Sw wyJ k q d g ao m oe I SI 8 40 2 2 8 6 2 The algorithm All neutrons which hit the sample volume are scattered into a particular range of solid angle AQ like many other components One of the difficult things in scattering from a dispersion is to take care to fulfill the dispersion criteria and to find the correct weight transformation In Phonon simple the following steps are taken 1 If the sample is hit calculate the total path length inside the sample otherwise leave the neutron ray unchanged 107 2 Choose a scattering point inside the sample 3 Choose a direction for the final wave vector kp within AQ 4 Calculate possible values of kf so that the dispersion relation is fulfilled for the corresponding value of kr There is always at least one possible kg value 5 Choose one of the calculated kf values 6 Propagate the neutron to the scattering point and adjust the neutron velocity according to kf 7 Calculate and apply the correct weight factor correction see below 8 6 3 The weight transformation Before making the weight transformation we ne
211. upermirror_m3 rfl in MCSTAS 1ib data 5 1 2 Algorithm The function of the component can be described as 1 Propagate the neutron ray to the plane of the mirror 2 If the neutron trajectory intersects the mirror plate it is reflected otherwise it is left untouched 3 Reflection of the incident velocity vi Uy Uy vz gives the final velocity vf z Uy vz 4 Calculate Q 2m uz h 5 The neutron weight is adjusted with the amount m R Q 6 To avoid spending large amounts of computation time on very low weight neutrons neutrons for which the reflectivity is lower than about 1071 are ABSORB ed 51 Supermirror reflectivity m 4 1 4 T y T o EJ Reflectivity p o EJ 0 4 0 2 0 L L L L L L L L L 0 0 01 0 02 0 03 0 04 0 05 0 06 0 07 0 08 0 09 0 1 Momentum transfer Q 71 Figure 5 1 A typical reflectivity curve for a supermirror Eq 5 2 The used values are m 4 Ro 1 Qe 0 02 7 a 6 49 A W 1 300 7 5 2 Guide The guide section Input Parameters for component Guide from optics lt Parameter value gt Unit Description lt reflect 0 gt str Reflectivity file name Format q Angs 1 R 0 1 lt wl gt m Width at the guide entry lt h1 gt m Height at the guide entry lt w2 0 gt m Width at the guide exit lt h2 0 gt m Height at the guide exit lt l gt m length of guide lt RO 0 99 gt 1 Low angle ref
212. user specified range either within a sphere of radius rfoc within a rectangu lar target with measures focus Yfocus Or in the specified angular range This target is positioned at the Zrarget Ytarget Ztarget point in space or using target_index This component stores complete information about the scattering event in the output parameter res_struct see Res_Sample 10 5 Res_monitor The monitor for resolution calculation Input Parameters for component Res_monitor from misc lt Parameter value gt Unit Description lt res_sample_comp gt no quotes Name of Res_sample component in the instrument definition lt filename 0 gt string Name of output file If unset use automatic name lt options 0 gt str String that specifies the geometry of the monitor lt xwidth 1 gt m Width diameter of detector lt yheight 1 gt m Height of detector lt zdepth 0 gt m Thichness of detector lt radius 0 gt m Radius of sphere cylinder monitor lt xmin 0 gt m Lower x bound of detector opening lt xmax 0 gt m Upper bound of detector opening lt ymin 0 gt m Lower bound of detector opening lt ymax 0 gt m Upper bound of detector opening lt zmin 0 gt m Lower bound of detector opening lt zmax 0 gt m Upper bound of detector opening NNK lt bufsize 0 gt 1 Number of events to store Use 0 to store all lt restore_neutron 0 gt 1 If set the monitor does not influence the neu
213. ussian for this kg is 1 1 T t gt alt Dalt l G a t cantan 8 24 where a t T ki kg t is given in local coordinates for T It can be shown that equation 8 24 can be re written as 1 1 T t a_ t to M t to G a t ny Ea si e 8 25 where M BYDB is a 2 x 2 symmetric and positive definite matrix ty M B Do is a 2 vector and a tiM to o Do is a real number Note that this is a two dimensional Gaussian not necessarily normalized in t with center to and axis defined by M To choose kf we sample t from the 2 dimensional Gaussian distribution 8 25 To do this we first construct the Cholesky decomposition of the matrix 4M 21 This gives a 2x 2 matrix L such that LLT 3M l and is possible since M is symmetric and positive definite It is given by JV 0 L 2 where M7 vu ni2 12 12 Vio V22 V VU11 22 V11 Now let g g1 92 be two random numbers drawn form a Gaussian distribution with mean 0 and standard deviation 1 and let t Lg to The probability of a particular t is then 1 P t dt qe 29 9dg 8 26 1 1 1 7 1 Trp 1 p3 L t to L t to ae dt 8 27 1 1 T t to M t to qt 2 On det L 1540 where we used that g L t to so that dg st This is just the normalized form of 8 25 Finally we set ky ki P t and k ki k p keg to normalize the length of kt to correct for the small error in
214. ution functions is that the compo nent stores complete information about the scattering event in the output parameter res_struct The information includes initial and final wave vectors the coordinates of the scattering point and the neutron weight after the scattering event From this infor mation the scattering parameters Q w can be recorded for every scattering event and used to compute the resolution function For an example of using the information in the output parameter see the description of the Res_monitor component in section 10 5 10 4 TOF_Res_sample A sample like component for TOF resolution calculation Input Parameters for component TOFRes_sample from misc lt Parameter value gt Unit Description lt thickness 0 gt Thickness of hollow cylinder in x z plane lt radius 0 01 gt m Outer radius of hollow cylinder lt yheight 0 05 gt m vert dimension of sample as a height lt focus_r 0 05 gt m Radius of sphere containing target lt time_bin 20000 gt us position of time bin lt time_width 10 gt us width of time bin lt target_x 0 gt lt target_y 0 gt m position of target to focus at lt target_z 5 gt lt focus_xw 0 gt m horiz dimension of a rectangular area lt focus_yh 0 gt m vert dimension of a rectangular area lt focus_aw 0 gt deg horiz angular dimension of a rectangular area lt focus_ah 0 gt deg vert angular dimension of a rectangu
215. velocity is chosen with a linear distribution within an interval defined by the minimum and maximum energies Eo and Ej respectively The initial time of the neutron is determined on basis of a simple heuristical model 30 for the time dependence of the neutron intensity from a time of flight source For all neutron energies the flux decay is assumed to be exponential v E t exp t T E 3 3 where the decay constant is given by TO sE lt Ee re allp E aP E gt E 3 4 The decay parameters are T in us Ee and y both in meV Other pulsed source models are available from contributed components See section 3 11 3 6 ISIS_moderator ISIS pulsed moderators Input Parameters for component ISIS_moderator from sources l lt Parameter value gt Unit Description j 3 6 1 Introduction The following document describes the functions obtained for models of TS2 as described in Table target 3 4cm diameter tantalum clad tungsten reflector Be D20 80 20 at 300K Composite Moderator H2 CH4 Coupled Groove 3x8 3 cm 26K solid CH4 Hydrogen 12x11cm 22K liquid H2 Poisoned Moderator solid CH4 26K Decoupled Narrow Gd poison at 2 4 cm 8 vanes Broad 3 3 cm not fully decoupled PreModerators 0 85 cm and 0 75 cm H20 Table 3 2 Description of Models TS1 model is from the tungsten target as currently installed and positioned The model also includes the MERLIN moder
216. was monitored such as MyMonitor x You can also set the filename in options with the file keyword followed by the file name that you want The extension will then be added if the name does not contain a dot Finally the filename parameter may also be used The output files format are standard 1D or 2D McStas detector files The no file option will unactivate monitor and make it a single OD monitor detecting integrated flux and counts The verbose option will display the nature of the monitor and the names of the generated files The 2D output When you ask the Monitor_nD to monitor only two variables e g options x y a single 2D file of intensity versus these two correlated variables will be created The 1D output The Monitor_nD can produce a set of 1D files one for each monitored variable when using 1 or more than 2 variables or when specifying the multiple keyword option The List output The Monitor_nD can additionally produce a list of variable values for neutrons that pass into the monitor This feature is additive to the 1D or 2D output By default only 1000 events will be recorded in the file but you can specify for instance list 3000 neutrons or list all neutrons This last option might require a lot of memory and generate huge files 9 8 5 Monitor equivalences In the following table 9 1 we show how the Monitor_nD may substitute any other McStas monitor 9 8 6 Usage examples e 1
217. x and similar for the horizontal direction The output from PSD_monitor is the integrated counts n I M2 as well as three two dimensional arrays of counts n Ny m nv m Mo mv Mm The arrays are written to a file filename and can be read e g by the tool MC_plot see the system manual 9 7 DivPos_monitor A divergence and position sensitive monitor Input Parameters for component DivPos_monitor from monitors lt Parameter value gt Unit Description lt nh 20 gt 1 Number of bins in position lt ndiv 20 gt 1 Number of bins in divergence lt filename 0 gt string Name of file in which to store the detector image lt xmin 0 05 gt m Lower x bound of detector opening lt xmax 0 05 gt m Upper x bound of detector opening 129 o 10 12 13 14 15 lt ymin 0 05 gt m Lower y bound of detector opening lt ymax 0 05 gt m Upper y bound of detector opening lt xwidth 0 gt m Width of detector Overrides xmin xmax lt yheight 0 gt m Height of detector Overrides ymin ymax lt maxdiv h 2 gt degrees Maximal horizontal divergence detected lt restore_neutron 0 gt 1 If set the monitor does not influence the neutron state lt nx 0 gt 1 lt ny 0 gt 1 Vector definition of forward direction wrt divergence to be used e g when the monitor is rotated into the horizontal plane lt nz 1 gt 1 DivPos_monitor is a two dimensional mon
218. xample instrument exists in the distribution for this component 124 9 Monitors and detectors In real neutron experiments detectors and monitors play quite different roles One wants the detectors to be as efficient as possible counting all neutrons absorbing them in the process while the monitors measure the intensity of the incoming beam and must as such be almost transparent interacting only with roughly 0 1 1 of the neutrons passing by In computer simulations it is of course possible to detect every neutron ray without absorbing it or disturbing any of its parameters Hence the two components have very similar functions in the simulations and we do not distinguish between them For simplicity they are from here on just called monitors Another important difference between computer simulations and real experiments is that one may allow the monitor to be sensitive to any neutron property as e g direction energy and divergence in addition to what is found in real world detectors space and time One may in fact let the monitor record correlations between these properties as seen for example in the divergence position sensitive monitor in section 9 7 When a monitor detects a neutron ray a number counting variable is incremented ny n 1 1 In addition the neutron weight p is added to the weight counting variable I L 1 pi and the second moment of the weight is updated Mo M2i 1 p As also discussed chap
219. y of tau_data is computed with one element for each reciprocal lattice point close to the Ewald sphere Except for the search for possible 7 vectors all computations are done in local coordinates using the matrix U to do the necessary transformations The list of reciprocal lattice points is specified in an ASCII data file Each line contains seven numbers separated by white space The first three numbers are the h k l indices of the reciprocal lattice point and the last number is the value of the structure factor F in barns The middle three numbers are not used and may be omitted they are nevertheless recommended since this makes the file format compatible with the output from the Crystallographica program Cry Any line beginning with any character of is considered to be a comment and lines which can not be read as vectors matrices are ignored The column signification may also explicitely be set in the data file header using any of the lines column_h lt index of the Bragg Qh column gt column_k lt index of the Bragg Qk column gt column lt index of the Bragg Ql column gt column_F2 lt index of the squared str factor F 2 column b gt column_F lt index of the structure factor norm F column gt Other component parameters may as well be specified in the data file header with lines e g 102 O00ZJDOAAANA sigma_abs lt value sigma _inc lt value Delta_d d lt value l
220. y profile of width similar to but not equal the intrinsic mosaicity In this component and in real life the mosaicity given is that of the reflectivity signal As a further simplification the crystal is assumed to be infinitely thin This means that multiple scattering effects are not simulated It also means that the total reflectivity ro is used as a parameter for the model rather than the atomic scattering cross section implying that the scattering efficiency does not vary with neutron wavelength The variance of the lattice spacing Ad d is assumed to be zero so this component is not suitable for simulating backscattering instruments use the component Single_crystal in section 8 4 for that When a neutron trajectory intersects the crystal the first step in the computation is to determine the probability of scattering This probability is then used in a Monte Carlo choice deciding whether to scatter or transmit the neutron The physical scattering probability is the sum of the probabilities of first second and higher order scattering up to the highest order possible for the given neutron wavelength However in most cases at most one order will have a significant scattering probability and the computation thus considers only the order that best matches the neutron wavelength The scattering of neutrons from a crystal is governed by Bragg s law nQo 2k sin 9 7 1 The scattering order is specified by the integer n We se
221. z 9 148 0 0084 0 0338 544 5 1790 C60 lau 5 551 0 001 0 0035 C_diamond laz 5 551 0 001 0 0035 4400 18350 lau C_graphite laz 5 551 0 001 0 0035 3800 18350 lau Cd laz 3 04 3 46 2520 594 2 2310 Cr laz 1 660 1 83 3 05 2180 5940 Cs laz 3 69 0 21 29 0 301 6 1090 cin liquid Cu laz 7 485 0 55 3 78 1357 8 3570 Fe laz 11 22 0 4 2 56 1811 4910 Ga laz 6 675 0 16 2 75 302 91 2740 Gd laz 29 3 151 49700 1585 2680 Ge laz 8 42 0 18 2 2 1211 4 5400 H20_ice_th laz 7 75 160 52 0 6652 273 Hg laz 20 24 6 6 372 3 234 32 1407 12 laz 7 0 0 62 12 3 386 85 In laz 2 08 0 54 193 8 429 75 1215 K laz 69 0 27 2 1 336 53 2000 LiF laz 4 46 0 921 70 51 1140 Li laz 0 454 0 92 70 5 453 69 6000 Nb laz 8 57 0 0024 1 15 2750 3480 Ni laz 13 3 5 2 4 49 1728 4970 Pb laz 11 115 0 003 0 171 600 61 1260 Pd laz 4 39 0 093 6 9 1828 05 3070 Pt laz 11 58 0 13 10 3 2041 4 2680 Rb laz 6 32 0 5 0 38 312 46 1300 Se_alpha laz 7 98 0 32 11 7 494 3350 Se_beta laz 7 98 0 32 11 7 494 3350 Si laz 2 163 0 004 0 171 1687 2200 Si02_quartza laz 10 625 0 0056 0 1714 846 lau SiO2_quartzb laz 10 625 0 0056 0 1714 1140 lau Sn_alpha laz 4 871 0 022 0 626 505 08 Sn_beta laz 4 871 0 022 0 626 505 08 2500 Ti laz 1 485 2 87 6 09 1941 4140 Tllaz 9 678 0 21 3 43 577 818 V laz 0184 4 935 5 08 2183 4560 Zn laz 4 054 0 077 1 11 692 68 3700 Zr laz 6 44 0 02 0 185 2128 3800 Table 1 2 Powders of the McStas library DLO3 Low c and high Cabs materials are highlighted F
Download Pdf Manuals
Related Search
Related Contents
Stoves 900GDO Tecumseh AVB5558EXN Performance Data Sheet CBE WP 300 ECO SDAST meeting #41 Copenhagen Nov Le Guide de l`Applicateur Source INRS Form #3132 flumioxazin GBC 64 x 99 mm, 2 x 125 micron, Key Card, 100 pack Gigabyte GA-Q35M-S2 S775, Q35, MATX FICHA DATOS TÉCNICOS HAND PLUS Copyright © All rights reserved.
Failed to retrieve file