(See also: McStas on the ESS cluster)

Prerequisites:

The following guide assumes the use of either

  1. McStas 2.3 (Apr. 06, 2016) plus
    1. - Component library: McStas-2.3, built Sep. 15, 2016 (which includes MCPL v. 0.6)
    2. The instrument file ESS_butterfly_MCPL from the McStas GitHub repository
    3. The updated MCPL_input component from the McStas GitHub repository
    4. If you need to WRITE MCPL files, also download the updated MCPL_output component from the McStas GitHub repository

  2. McStas 2.4 (May. 17, 2017) (which includes MCPL v. 1.1)
    1. If you need to WRITE MCPL files, also also download the updated MCPL_output component from the McStas GitHub repository
    2. The instrument file ESS_butterfly_MCPL from the McStas GitHub repository

  3. McStas 2.4.1. and later includes the right versions of all of the above!

Input datasets:

You will also need an MCPL input file for the beamline in question. The files are available in easy-to-use limited-statististics files here, named <Sector><Beamline>.mcpl.gz  (e.g. W8.mcpl.gz). The key numbers and properties of these files are:


Figure 1: Visualisation of events in the file W8.mcpl.gz within the ESS_butterfly_MCPL instrument. The coordinate system of choice is the TARGET coordinate system. 


  1. For use on your own computer, download the relevant file from http://public.esss.dk/users/willend/MCPL/ - REMEMBER THEY ARE BIG!
  2. If you need any special type of MCPL datafile (bigger, smaller, filtered one way or another...) please write Esben Klinkby [X] an email, putting Peter Willendrup cc


The ESS_butterfly_MCPL instrument file

We now turn our attention to the supplied ESS_butterfly_MCPL instrument file. The below text is a summary only, PLEASE STUDY IT YOURSELF!

The most important properties of the file is

Varying statistics

To ensure conservation of the original simulated intensity, the full content of the MCPL file must used. Therefore the normal user-controlled McStas -n (ncount) is effectively disabled. To allow varying statistics anyway, the instrument parameter 'repeat' (corresponding to the component parameter repeat_count of the MCPL_input component) may be used to repeat the content of the file an integer number of times. See next paragraph wrt. the possibility of slightly varying energy, position and direction when repeating.

MCPL and parallel simulations using MPI

As the MCPL parallelisation in McStas is handled by very simple means, running on multiple processors / cores means repeating the contents of the MCPL file. To do this without wasting time, every repetition of an event will result in a small Monte-Carlo choice being done inside a "sphere of confusion" around the initial event, dimensioned by the parameters E_smear (Gaussian MC choice within E_smear*E around initial particle energy E), pos_smear (m) (flat MC choice of position within radius pos_smear around initial particle position), dir_smear (degrees) (Gaussian MC choice of direction within dir_smear around initial particle direction).

Output data

Instrument geometry

Using the above-mentioned W8.mcpl.gz MCPL file and choosing parameters sector=W and beamline=8, you will get the below instrument geometry, showed as different types of mcdisplay output:

  1. mcdisplay-webgl (McStas 2.4 only)
  2. mcdisplay.pl/mcdisplay (McStas 2.4/McStas 2.3)
  3. mcdisplay-pyqtgraph (McStas 2.4 only)
  4. mcdisplay-pyqtgraph, zoomed (McStas 2.4 only)

Figure(s) 2: Various types of mcdisplay geometry output

Monitor data

Running the instrument file with sector=W and beamline=8 will produce this type of graphics:

Figure(s) 3: ESS_butterfly_MCPL.instr - overview plot and "end of curved guide" PSD for the W8 beamline

Output data from similar, analytic model

Based on the analytical ESS_butterfly.comp, a similar set of simulations can be run. The relevant instrument file is ESS_butterfly_Guide_curved_test.instr from the McStas GitHub page

Monitor data

Running the instrument file with sector=W and beamline=8 will produce this type of graphics:

Figure(s) 4: ESS_butterfly_Guide_curved_test.instr - overview plot and "end of curved guide" PSD for the W8 beamline