Next: Running Minuit in Fortran-callable
Up: How to Use Minuit
Previous: The Function FCN.
  Index
Subsections
Minuit can be run in two different modes:
Data-driven mode
means that the user drives Minuit with data, either typed
interactively from a terminal or from a data file in batch; and
Fortran-callable mode
means that Minuit is driven directly from Fortran subroutine
calls, without data.
To some extent, the two modes may also be mixed.
This section describes the first mode, and is valid for both
interactive and batch running.
The differences between interactive and batch are described in
a separate subsection below.
In data-driven mode, the user must supply,
in addition to the subroutine FCN, a
main program which includes the following
statements (the statements in upper case are required, those
given in lower case are optional):
Example of main program when using Minuit in data
driven mode
EXTERNAL FCN
external futil
call mintio(ird,iwr,isav)
CALL MINUIT(FCN,futil)
The name of FCN may be chosen freely, and is communicated
to Minuit as its first argument.
FUTIL is the generic name of a function or subroutine which the
user may optionally call from FCN, and if he does call such
a routine, he must declare it external and communicate its
name to Minuit as well. If FUTIL is not used, then the second
argument may be put equal to 0,
and need not be declared EXTERNAL; if FUTIL is
declared EXTERNAL, it must be supplied in the loading process.
CALL MINTIO (IREAD,IWRITE,ISAVE)
Action:
The purpose of MINTIO is to communicate to Minuit the I/O units.
- Input parameters
-
- IREAD
- Fortran unit number for reading (default 5).
- IWRITE
- Fortran unit number for writing (default 6).
- Isave
- Fortran unit number for saving (default 7).
If the default values are acceptable, then it is not necessary to
call MINTIO.
It is the user's responsibility that the I/O units are properly
opened for the appropriate operations.
In data-driven mode, that is with CALL MINUIT, you should
not call MNINIT, since Minuit takes care of all
initialization.
To change unit numbers, call MINTIO
before calling MINUIT.
In order that control returns to the user program after
CALL MINUIT, the last command in the corresponding Data Block
should be RETURN.
If the last command is EXIT or STOP,
then Minuit will execute a Fortran STOP, and if the last
command is END, Minuit will read a new Data Block from the current
input unit.
In data-driven mode, either interactively or in batch,
Minuit reads the following data provided by the user:
- Title: (a string of 50 characters or less)
which can be chosen freely by the user, to help identify the job.
- Parameter definitions: for each parameter one record giving:
- 1.
- The parameter number.
This is the index in the array XVAL by which the
user function FCN will access the value of the parameter.
- 2.
- The parameter name.
A string of ten characters to help the user in
reading the Minuit output.
- 3.
- The starting value of the parameter.
- 4.
- The starting step size,
or expected uncertainty in this parameter,
if it is to be a variable parameter. Otherwise blank or zero if the
value is to be constant.
- Optional
- The lower bound
(limit) below which the parameter value must not vary.
- Optional
- The upper bound
(limit) above which the parameter value must not vary.
Normally the user should not specify limits on the parameters, that is
both should be left blank. If one limit is specified, then BOTH must
be specified. The properties of limits are explained elsewhere
in this document.
The format of the parameter definitions may be either
fixed-field (each item in a field of width ten columns),
or in free-field format.
In the free-field format, items are separated by blanks or one comma,
and the parameter name must be given between single quotes.
The program assumes free-field format if it finds two single
quotes in the line.
Parameter names will be blank-padded or truncated to be
ten characters long.
- A blank record: indicates the end of parameter definitions.
- If the user FCN reads input data from the same input stream as the
Minuit data (the default stream is UNIT 5),
then the FCN data should appear here.
- Minuit commands: these specify actions which should be performed by Minuit.
Commands must not contain leading or embedded blanks, but may be
truncated to three characters, and may be given in upper or lower case.
Some commands have numerical arguments, and these may be given in
free-field format, separated by blank(s) or one comma.
The list of recognized commands is given and explained below.
The command HELP causes Minuit to write to the output stream a list
of currently recognized commands.
The command HELP SHOw lists the available SET
and SHOw commands.
Any or all of the above data read by Minuit
can reside on one or more different files,
and Minuit can be instructed
to switch to reading a different file with the SET INPUT command.
Optionally, the title record may be preceeded by a record
beginning with the characters SET TITLE, and the
parameter definitions may be preceeded by a record
beginning with the characters PARAMETERS.
It is in fact recommended always to include these optional
records when preparing a data file, since the file can then be
read at any time (not just at the beginning of a Minuit run)
and will always be interpreted correctly by Minuit.
Example of a typical Minuit data set
SET TITLE
Fit to time distribution of K decays, Expt NA94
PARAMETERS
1 'Real(X)' 0. .1
2 'Imag(X)' 0. .1
5 'Delta M' .535 .01
10 'K Short LT' .892
11 'K Long LT' 518.3
fix 5
migrad
set print 0
minos
restore
migrad
minos
fix 5
set param 5 0.535
mncontour 1 2
stop
In its initialization phase, Minuit attempts to determine whether
or not it is running interactively, by calling the logical function
INTRAC, a routine in the CERN Program Library which can
be provided for all commonly used computers.
For our purposes, we define ``running interactively'' as meaning that
input is coming from a terminal under the control of an intelligent
being, able to make decisions based on the output he receives at
the terminal. It is not always easy for INTRAC to know whether this
is the case, so, depending on your operating system, Minuit can be
fooled in certain cases. When this happens, the user can always override
the beliefs of INTRAC with the commands SET BATch and
SET INTeractive.
The command SHOw INTeractive informs the user of the current mode.
According to whether or not it believes it is running interactively,
Minuit behaves differently in the following ways:
- If interactive, the user is prompted before each data record is read.
- If interactive, Minuit recovers from many error conditions
and prompts the user to enter correct data or to specify
additional required input.
If the same error conditions occur in batch mode, the program either
exits (if no corrective action seems possible) or ignores the incorrect
data (for example, a command it cannot interpret) and continues.
- The default page size for output is a typical terminal dimension
(80 by 24) if interactive, and a typical printed page size (120 by 56)
if batch, but these can be overridden with the commands
SET WIDth and SET LINes.
When an interactive user requests Minuit to read
further input from an external file (the SET INPut command),
then further input is considered to be temporarily
in batch mode, until input reverts to the primary input stream.
Next: Running Minuit in Fortran-callable
Up: How to Use Minuit
Previous: The Function FCN.
  Index
Back to
CERN
| IT
| ASD
| CERN Program Library Home
MG
(last mod. 1998-08-19)