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:
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.
5cmRunning Minuit in Fortran-callable mode.
The following Minuit subroutines are provided in order to allow
the user to communicate with Minuit and perform all Minuit
functions (define parameters, execute commands, etc.) directly
from Fortran through subroutine calls.
In the following list of subroutines, output arguments are indicated
by appending a star *
to its name.
It should also be noted that for the Double Precision version of
Minuit (recommended for all 32-bit machines such as IBM, Vax,
Unix workstations, etc.), all the REAL
arguments given below must be
declared DOUBLE PRECISION
.
4cmInitialize Minuit
4cmSpecify a title for a problem
4cmDefine a parameter, assigning values from variables
CALL MNPARM (NUM,CHNAM,STVAL,STEP,BND1,BND2,IERFLG*)
0
if no error, >0
if request failed.
If BND1=BND2=0.
, then the parameter is considered unbounded, which
is recommended unless limits are needed to make things behave well.
4cmDefine a parameter, assigning values from character string Subroutine MNPARS defines a new (or redefines an old) parameter specifying values for its number, name, starting value, step size, and limits if any. All these values are given in one character string as if it was being read from the input stream. It can therefore be used in place of MNPARM if the character string format is more convenient than the calling sequence of MNPARM.
Calling sequence:
Example:
CALL MNPARS(' 15 ''Lambda Mass'' 1.2, 0.1' , ICONDN)
4cmExecute a Minuit command
CALL MNEXCM (FCN,CHCOM,ARGLIS,NARG,IERFLG*,FUTIL)
EXTERNAL
)
MAXARG
, containing the numeric arguments
to the command (if any),
NARG
MAXARG),
=0
if not used).
If used this function must be declared EXTERNAL
.
0
if the command was executed normally,
>0
otherwise.
Executing a command by calling MNEXCM has exactly the same effect as reading the same command in data-driven mode, except that a few commands would make no sense and are not available in Fortran-callable mode (e.g. [SET INPut]SET INPUT). The other difference is that control always returns to the calling routine from MNEXCM, even after commands END, EXIT, and STOP.
4cmExecute a Minuit command specified as a character string Subroutine MNCOMD causes the execution of the Minuit command specified as the second argument. It therefore works like MNEXCM, except that it accepts the entire command with arguments as one character string. This is more convenient in many cases and avoids problems of word length matching (DOUBLE PRECISION constants).
CALL MNCOMD (FCN,CHSTR,ICONDN*,FUTIL)
EXTERNAL
)
=0
if not used).
If used this function must be declared EXTERNAL
.
0
if the command was executed normally,
>0
otherwise.
4cmGet the current value of a parameter
This routine is the inverse of MNPARM and can for instance be used after a fit.
CALL MNPOUT (NUM,CHNAM*,VAL*,ERROR*,BND1*,BND2*,IVARBL*)
4cmGet the current status of minimization
CALL MNSTAT (FMIN*,FEDM*,ERRDEF*,NPARI*,NPARX*,ISTAT*)
UP
defining parameter uncertainties
4cmGet the current value of the covariance matrix
EMAT
to store the matrix elements.
NDIM
should be at least as large as the number of parameters
variable at the time of the call, otherwise the user will get
only part of the full matrix.
DIMENSION EMAT(NDIM,NDIM)
which
is to be filled with the (external) covariance matrix.
4cmAccess current parameter errors
CALL MNERRS (NUM,EPLUS*,EMINUS*,EPARAB*,GLOBCC*)
NUM>0
, this is taken to be an external parameter number;
if NUM<0
, it is the negative of an internal parameter number.
NUM
.
NUM
.
This is a number between zero and one which gives the correlation
between parameter NUM
and that linear combination of all other
parameters which is most strongly correlated with NUM
.
Note that this call does not cause the errors to be calculated, it merely returns the current existing values. If any of the requested values has not been calculated, or has been destroyed (for example, by a redefinition of parameter values) MNERRS returns a value of zero for that argument. Thus the call to MNERRS will normally follow the execution of commands [MIGrad]MIGRAD, [HESse]HESSE, MNContour, and/or [MINOs]MINOS.
4cmFind a function contour with the MNContour method
CALL MNCONT (FCN,NUM1,NUM2,NPT,XPT*,YPT*,NFOUND*,FUTIL)
EXTERNAL
)
>4
).
EXTERNAL
.
NUM1
.
It must be declared with a DIMENSION XPT(NPT)
.
NUM2
.
It must be declared with a DIMENSION YPT(NPT)
.
NPT
, but it can be
negative (if the input arguments are not valid), or zero if
less than four points have been found, or less than NPT
if the
program could not find NPT
points.
Note that alternatively MNContour can be calculated
by calling MNEXCM to issue the MNContour command,
but then the user does not have Fortran access to the actual
point coordinates XPT
and YPT
.
4cmSwitch to command-reading mode
This facility can be useful when one wants to continue interactively.
EXTERNAL
)
=0
if not used).
If used this function must be declared EXTERNAL
.
The call to MNINTR will cause Minuit to read commands from
the unit IRD
(originally specified by the user in his call to MNINIT,
IRD
is usually 5 by default,
which in turn is usually the terminal by default).
Minuit then reads and executes commands until it encounters
a command END, EXIT, RETurn, or STOP,
or an end-of-file on input
(or an unrecoverable error condition while reading
or trying to execute a command), in which case control returns
to the program which called MNINTR.
4cmSet logical unit number for input
Sets logical unit number of input unit from which Minuit will read the next command.