The vitess module read_in can be found under the trajectories option in the module menubar.
The module read_in can read the data of the output file or data sets written by the VITESS writeout module or a corresponding module in another simulation program. read_in is supposed to be used as the first module in a simulations thereby replacing a source module .
It can read data from 5 different formats: VITESS, McStas, MCPL, MCNP and MCNPX, both as ASCII and binary data.
In any case it expects complete data sets, i.e. data sets with a reduced number of paramters as enabled in writeout for the VITESS format cannot be read.
Up to 3 files can be read. If more than 1 file is used, their weights have to be set accordingly.
The weight should be proportional to the (started) number of trajectories and their sum should give 1.
The input file(s) can be also be read N times to start a longer simulation. Note that this gives a faked improvement of the resolution.
In this case the weights of the trajectories are divided by N to give the same total beam intensity.
For MCNP data, a normalization is foreseen to get correct absolute intensities.
In contrast to writeout, there is only one filter realized - by color (of the neutrons/trajectories), which only works for VITESS.
As it will often be the first module in the simulation of the second (or third) part on an instrument,
there is the option to give the file 'instrument.inf' of the first (two) part(s) of the instrument, so that a complete and correct 'instrument.inf' file for the whole simulation can be obtained.
Note that the name must be different from 'instrument.inf' to prevent overwriting.
read_in and writeout will replace input file and output file from VITESS 4.0 on.
To read and write data in MCPL format, the utiliy mcpl by Thomas Kittelmann is used (see MCPL-Homepage) which stores the trajectories in binary format. The interface does not allow options like using several input files, ASCII format, etc.
The following information is written for each trajectory (or neutron) in VITESS format:column 1 ID of the trajectory. (e.g. AA000123456) 2 tracing information (T: tracing, N: no tracing) 3 'color' of the trajectory (reserved for the user's demands) 4 time of flight [ms] 5 neutron wavelength [Å] 6 intensity (or weight) [n/s] (represented by the trajectory) 7 - 9 x-,y-,z-coordinate of the position [cm] (with respect to the coordinate system provided by the module preceding writeout) 10 -12 x-,y-,z-coordinate of the flight dir. (direction cosinus) 13 -15 x-,y-,z-coordinate of the spin
column 1 intensity (or weight) [n/s] (represented by the trajectory) 2 - 4 x-,y-,z-coordinate of the position [m] (with respect to the coordinate system provided by the module preceding writeout) 5 - 7 x-,y-,z-coordinate of the speed [m/s] 8 time of flight [s] 9 -11 x-,y-,z-coordinate of the polarization
column 1 - 3 x-,y-,z-coordinate of the position [cm] (with respect to the coordinate system provided by the module preceding writeout) 4 - 6 x-,y-,z-coordinate of the flight dir. (direction cosinus) 7 neutron energy [MeV] 8 weight [n/s] (represented by the trajectory) 9 time of flight [shakes=1e-8s]
column 1 history [-] not used, 0 written 2 ID [-] not used, 0 written 3 weight [n/s] (represented by the trajectory) 4 neutron energy [MeV] 5 time of flight [shakes=1e-8s] 6 - 8 x-,y-,z-coordinate of the position [cm] (with respect to the coordinate system provided by the module preceding writeout) 9 -11 x-,y-,z-coordinate of the flight dir. (direction cosinus) 12 unused [-] not used, 0 written
The same information is expected by read_in - except for the weight in MCNP format, where neutron counts are assumed. This can be normalised to [n/s] by the corresponding input parameter (see the following tables).
From VITESS 3.6 onward it is possible to randomly sample a subset of particles from the input file. This can be done by setting the Random sample option to 'yes' together with setting the max events option to the desired number of particles. This can be useful to perform reflectivity curves, or when wanting to perform repetitions of virtual experiments with statistical uncertainty taken into account. Note that it is possible to over sample and set max events to a value larger that the initial particle list, allowing it for random repetitions.
Parameter Unit |
Description |
Range or Values |
Command Option |
data format | Format in which the input file to be read is written | "VITESS" "McStas" "MCPL" "MCNP" "MCNPX" |
-f |
storage format |
Format in which trajectories were written into the input file: in scientific/exponential form (e.g. 5.4321E03) or usual float format (5432.1) or binary form |
"exp" "float" "binary" |
-F | ASCII input file 1, 2, 3 |
Names of the input files containing the neutron trajectories for MCPL format only input file 1 is handled |
- | -A -B -D |
Weight of the trajectories in file 1, 2, 3 |
If there is only one input file, then this should get the weight 1.0. If 2 input files resulting from simulation with 1 Mio. and 3 Mio. trajectories are combined, then 0.25 for the 1st and 0.75 for the 2nd would be the proper choice to get the correct flux |
0.0 - 1.0 | -a -b -c |
repetition |
(optional) The trajectories will be written 'repetition' times to yield 'repetition' times as many neutrons for the simulations. The weight of each trajectory will be reduced by the same factor. |
>= 1 (int) default: 1 |
-R |
max events | (optional) It is possible to sample a subset of particles from the input file. The number set will be the amount of events to sample from the input file. | (int) default: all | -M |
Random sample | This option is to be used together with max events. If set to 'yes' the input particle list will be read in a random manner. If set to 'no', particles will be read in the row order presented in the file. | (int) default: all | -J |
Intensity factor for MCNPX [n/s] |
The weight of each neutron trajectory from the MCNPX simulation will be multiplied by this factor to yield correct absolute source flux values. This factor F = Isrc/ NMCNPX-Events can be calculated as the ratio of proton current to the number of protons simulated. |
>0 typical 1.0e8 default: 1.0 |
-I |
read in color | (optional) Only trajectories of the given color are read. Color -1 means: all trajectories are read |
>= -1 (int) default: -1 |
-C |
instrument input file | Specifies the instrument file of the previous part of the simulation. | any | --I |
raytracing file | File containing IDs of the trajectories to ray-traced. The output of a writeout module can be used for example. | any | -r |
kind of raytracing | defines if raytracing takes places and in which way - see help file called 'Raytracing'. | 'no' 'write trace files' 'only trace trajectories' |
-k |