[ Identification | Description | Input parameters | Output parameters | Links ]

# The `Source_multi_surfaces` Component

Rectangular neutron source with subareas - using wavelength spectra reading from files

## Identification

- Author: Ludovic Giller, Uwe Filges
- Origin: PSI/Villigen
- Date: 31.10.06
- Version: 1.1
- Modification history:

## Description

    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
    parameter "names".
    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

    Usage example:
      Source_multi_surfaces(h=0.16,w=0.09,dist=1.18,xw=0.08,yh=0.15,xdim=4,ydim=4,
                            Lmin=0.01,Lmax=10.0,names="files_name.dat")

WARNING: This is a contributed Component.

## Input parameters

Parameters in boldface are required; the others are optional.

Name | Unit | Description | Default
--- | --- | --- | ---
names | str | Name of the file containing a list of the spectra file names 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) |
h | m | Source y-height |
w | m | Source x-width |
dist | m | Distance to target along z axis |
xw | m | Width(x) of target |
yh | m | Height(y) of target |
xdim | int | Number of subareas in the x direction |
ydim | int | Number of subareas in the y direction |
Emin | eV | Minimum energy of neutrons | 0.0
Emax | eV | Maximum energy of neutrons | 0.0
Lmin | AA | Minimum wavelength of neutrons | 0.0
Lmax | AA | Maximum wavelength of neutrons | 0.0

## Output parameters

Name | Unit | Description | Default
--- | --- | --- | ---
p_in |  |  |

## Links

- Source code for `Source_multi_surfaces.comp`.

[ Identification | Description | Input parameters | Output parameters | Links ]