next up previous contents index
Next: Fitting one or Up: Fitting Previous: One and two-dimensional

Fitting one-dimensional histograms with special functions

CALL HFITHN (ID,CHFUN,CHOPT,NP,*PAR*,STEP,PMIN,PMAX,SIGPAR*,CHI2*)

Action: Fits the given special function to the contents of a one-dimensional histogram, and optionally superimposes it to the histogram when editing.

Input parameters:
ID
Histogram identifier.
CHFUN
Character variable specifying the desired parametric function. Possible keywords are:
G
to fit gaussian PAR(1)*exp(-0.5*((x-PAR(2))/PAR(3))**2).
The first parameter PAR(1) corresponds to the normalization, the second parameter PAR(2) corresponds to the mean value, while the third parameter PAR(3) corresponds to the half width of the gaussian.    
E
to fit exponential exp(PAR(1)+PAR(2)*x)    
Pn
to fit polynomyal PAR(1)+PAR(2)*x+PAR(3)*x**2......+PAR(n+1)*x**n    
Any combination of these keywords with the 2 operators + or * is allowed, e.g. 'p4+g', a combination of a 4th degree polynomial and a gaussian, which needs eight parameters or p2*g+g, a second degree polynomyal and 2 gaussians, needing 9 parameters. The order of the parameters in PAR must correspond to the order of the basic functions. For example, in the first case above, PAR(1:5) apply to the polynomial of degree 4 and PAR(6:8) to the gaussian while in the second case PAR(1:3) apply to the polynomial of degree 2, PAR(4:6) to the first gaussian and PAR(7:9) to the second gaussian. Blanks are not allowed in the expression.
CHOPT
'B'
Some or all parameters are bounded. The arrays STEP, PMIN and PMAX must be specified. By default all parameters vary freely.
'D'
The user is assumed to compute derivatives analytically using the routine HDERIV. By default, derivatives are computed numerically.
'E'
Perform a detailed error analysis using the MINUIT routines HESSE and MINOS
'F'
Force storing of the result of the fit bin by bin with the histogram.
'L'
Use the logaritmic Likelihood fitting method. By default the chisquared method is used.
'M'
Invoke interactive MINUIT.
'N'
The results of the fit are not stored bin by bin with the histogram. By default the function is calculated at the centre of each bin in the specified range.
'Q'
Quiet mode. No printing.
'R'
Fit a Restricted area of the 1-D histogram. IFTLOW = IQUEST(11) specifies the lower limit of the minimization domain,
IFTUP = IQUEST(12) specifies the upper limit of the minimization domain.  
'V'
Verbose mode. Results are printed after each iteration. By default only final results are printed.
'W'
Set event weights to one. By default weights are taken according to statistical errors.
NP
Number of parameters.
PAR
Array of dimension NP with initial values for the parameters.
STEP
Array of dimension NP with initial step sizes for the parameters ('B' option only).
PMIN
Array of dimension NP with the lower bounds for the parameters ('B' option only).
PMAX
Array of dimension NP with the upper bounds for the parameters ('B' option only).

Output parameters:
PAR
Array of dimension NP with the final fitted values of the parameters.
SIGPAR
Array of dimension NP with the standard deviations on the final fitted values of the parameters.
CHI2
Chisquared of the fit.

next up previous contents index
Next: Fitting one or Up: Fitting Previous: One and two-dimensional

Last update: Tue May 16 09:09:27 METDST 1995