Rectangular neutron source with subareas - using wavelength spectra reading
Author: Ludovic Giller, Uwe Filges
This routine is a rectangular neutron source, which aims at a square target
centered at the beam (in order to improve MC-acceptance rate).
The angular divergence is then given by the dimensions of the target.
The source surface can be divided in subareas (maximum 7 in one dimension).
For each subarea a discret spectrum must be loaded given by its corresponding
file. The name of the files are saved in one file and will be called with the
In fact the routine first reads the spectrum from files (up to 49) and it
selects randomly a subarea. Secondly it generates a neutron with an random
energy, selected from the spectrum corresponding to the subsurface chosen, and
with a random direction of propagation within the target.
ATTENTION 1: the files must be located in the working directory where also
the instrument file is located
ATTENTION 2: the wavelenght distribution (or binning) must be uniform
The file giving the name of sub-sources is matrix like,
eg. for a 3x2 (x,y) division :
spec1_1.dat spec1_2.dat spec1_3.dat
spec2_1.dat spec2_2.dat spec2_3.dat(RETURN-key)
ATTENTION : The line break after the last line is important.
Otherwise the files can not be read in !!!
and for example spec1_2.dat must be like, always from big to
small lambda :
#comments must be preceded by "#"
#lambda [AA] intensity [a.u.]
[a.u.] means that your chosen unit for the intensity influences
the outcoming unit. What you put in you will get out !
i.e. whatever is the unit for the input intensity you
will have the same unit for the the output.
Generally McStas works in neutrons per second [n/s].
WARNING: This is a contributed Component.
Parameters in boldface are required;
the others are optional.
Name of the file containing a list of the spectra file names