- DMC McStas simulation working
SKIPPED: psi/amorstat.c psi/nxamor.c psi/pimotor.c psi/polterwrite.c
This commit is contained in:
@ -47,21 +47,24 @@ in a certain way:
|
||||
Alternatively SICS can write the data to be passed to McStas into a file. But then this
|
||||
file must be read in the INITIALIZE section of the instrument definition and values must
|
||||
be assigned to the appropriate McStas variables.
|
||||
<li>McStas must dump its data into a single file: use the <b>-f filename</b> option.
|
||||
The format must be <b> --format=XML</b>.
|
||||
<li> In order to count on monitor, a modified PSD_monitor component MUST be used in the
|
||||
<li>In order for the NeXus-XML based reading to work McStas must dump its data into a single file:
|
||||
use the <b>-f filename</b> option. The format must be <b> --format=XML</b>.
|
||||
<li> In order to count on monitor, a modified monitor component, MKMonitor MUST be used in the
|
||||
simulation. This component writes the collected total counts into a file. This file is
|
||||
the read by SICS in order to determine the control monitor. Evaluating the McStas XML dump \
|
||||
the read by SICS in order to determine the control monitor. Evaluating the McStas dump \
|
||||
file each time proved to be to inaccurate. The name of the file containing the monitor
|
||||
must be configured through: mccontrol configure mcmonfile name-of-file.
|
||||
<li>The mcstas simulation executable must be declared with allowexec in order to be able
|
||||
to start with the Tcl exec command.
|
||||
<li>Though McStas can be made to dump its data by sending it a USR2 signal, it is
|
||||
much cleaner and simpler to have McStas dump its data regularly through the use of the
|
||||
Progress_bar component.
|
||||
</ul>
|
||||
</p>
|
||||
<h2>The McStas Reader</h2>
|
||||
<p>
|
||||
In order to enable trasnfer from McStas result files into SICS objects a reader object is
|
||||
needed. This module supports only XML formatted McStas files, with the output dumped into
|
||||
In order to enable transfer from McStas result files into SICS objects a reader object is
|
||||
needed. This module supports XML formatted McStas files, with the output dumped into
|
||||
one file. The McStas options to achieve this are: <b>-f filename --format="XML"</b>
|
||||
This module supports the following commands:
|
||||
<dl>
|
||||
@ -69,7 +72,7 @@ This module supports the following commands:
|
||||
<dd>Opens a McStas simulation file for reading.
|
||||
<dt>mcreader close
|
||||
<dd>Closes a McStas file after use.
|
||||
<dt>mcreader insertmon path object monitornumber
|
||||
<dt>mcreader insertmon path object monitornumber scale
|
||||
<dd>This transfers a monitor value from a previously opened McStas file into a SICS
|
||||
monitor field. The McStas field read is the values tag belonging to the component. The
|
||||
parameters:
|
||||
@ -83,12 +86,28 @@ groups, the name attribute is used a path component.
|
||||
this McStas interface only counters can store monitors.
|
||||
<dt>monitornumber
|
||||
<dd>Monitornumber is the monitor channel into which the value is to be stored.
|
||||
<dt>scale
|
||||
<dd>Scale is an optional scale factor for the monitor. Real monitors have a
|
||||
sensitivity of E-6, McStas monitors have an efficiency of 1.0. This factor allows to
|
||||
correct for this.
|
||||
</dl>
|
||||
<dt>mcreader inserthm path hmobject
|
||||
<dt>mcreader inserthm path hmobject scale
|
||||
<dd>Inserts array data stored under path in the histogram memory array of hmobject which
|
||||
must be a valid SICS histogram memory object. The path is the same as given for insertmon,
|
||||
but of course the data part of the detector must be addressed.
|
||||
but of course the data part of the detector must be addressed. Scale is again an optional
|
||||
scale factor which allows to scale the McStas counts to real counts.
|
||||
</dl>
|
||||
The mccreader module also supports reading data from any ASCII file into SICS. Mcreader
|
||||
close and open are not required then. For reading histogram memory data, the appropriate
|
||||
data has to be parsed into a <a href="sicsdata.htm">SICSdata</a> object first. Then
|
||||
data can be trasnferred using the following commands:
|
||||
<dl>
|
||||
<dt>mcreader insertmondirect counter num value
|
||||
<dd>Assigns value to the monitor num at the counter object counter. Monitor 0 is the
|
||||
actual counts data.
|
||||
</dl>
|
||||
<dt>mcreader inserthmfromdata hm data
|
||||
<dd>Inserts the data in the SICSData object data into the histogram memory hm.
|
||||
</p>
|
||||
<H2>The McStas Controller</h2>
|
||||
<p>
|
||||
@ -123,6 +142,11 @@ line and finally starts the simulation. This script is expected to return either
|
||||
<dd>This configures the minimum time between McStas dumps in seconds. The idea is that
|
||||
SICS buffers values during a simulation run and does not interrupt the McStas process to
|
||||
often.
|
||||
<dt>mccontrol configure update monitorscale
|
||||
<dd>Configures the scaling factor to use on the monitor in monfile. Normal monitors have
|
||||
a efficeincy of 1E-6, the McStas monitor counts every neutron. This can be compensated
|
||||
for by this scaling factor. Note that this scaling factor may be dependent on the
|
||||
wavelength used.
|
||||
<dt>mccontrol configure mcmonfile filename
|
||||
<dd>This configures the file which mccontrol is going to read in order to watch the
|
||||
simulation control monitor.
|
||||
@ -131,6 +155,10 @@ line and finally starts the simulation. This script is expected to return either
|
||||
<dt>mccontrol run scriptkey
|
||||
<dd>Invokes one of the scripts configure for testing purposes. scripkey can be one of:
|
||||
mcstart, mcisrunning, mcdump, mckill and mccopydata.
|
||||
<dt>mccontrol finish
|
||||
<dd>This calls waitpid on the PID of the McStas process. This should be done in
|
||||
the mckill script. Otherwise it may occur that the McStas simulation turns into
|
||||
a Zombie process.
|
||||
</dl>
|
||||
Standard scripts for many of the script routines required are provided for the unix
|
||||
environment in the file mcsupport.tcl. Please note, that all system executables called
|
||||
|
Reference in New Issue
Block a user