-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmnwerr.F
60 lines (60 loc) · 1.77 KB
/
mnwerr.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
*
* $Id: mnwerr.F,v 1.1.1.1 2000/06/08 11:19:20 andras Exp $
*
* $Log: mnwerr.F,v $
* Revision 1.1.1.1 2000/06/08 11:19:20 andras
* import of MINUIT from CERNlib 2000
*
* Revision 1.1.1.1 1996/03/07 14:31:32 mclareni
* Minuit
*
*
#include "minuit/pilot.h"
SUBROUTINE MNWERR
#include "minuit/d506dp.inc"
CC Calculates the WERR, external parameter errors,
CC and the global correlation coefficients, to be called
CC whenever a new covariance matrix is available.
CC
#include "minuit/d506cm.inc"
C calculate external error if v exists
IF (ISW(2) .GE. 1) THEN
DO 100 L= 1, NPAR
NDEX = L*(L+1)/2
DX = SQRT(ABS(VHMAT(NDEX)*UP))
I = NEXOFI(L)
IF (NVARL(I) .GT. 1) THEN
AL = ALIM(I)
BA = BLIM(I) - AL
DU1 = AL + 0.5 *(SIN(X(L)+DX) +1.0) * BA - U(I)
DU2 = AL + 0.5 *(SIN(X(L)-DX) +1.0) * BA - U(I)
IF (DX .GT. 1.0) DU1 = BA
DX = 0.5 * (ABS(DU1) + ABS(DU2))
ENDIF
WERR(L) = DX
100 CONTINUE
ENDIF
C global correlation coefficients
IF (ISW(2) .GE. 1) THEN
DO 130 I= 1, NPAR
GLOBCC(I) = 0.
K1 = I*(I-1)/2
DO 130 J= 1, I
K = K1 + J
P(I,J) = VHMAT(K)
130 P(J,I) = P(I,J)
CALL MNVERT(P,MAXINT,MAXINT,NPAR,IERR)
IF (IERR .EQ. 0) THEN
DO 150 IIN= 1, NPAR
NDIAG = IIN*(IIN+1)/2
DENOM = P(IIN,IIN)*VHMAT(NDIAG)
IF (DENOM.LE.ONE .AND. DENOM.GE.ZERO) THEN
GLOBCC(IIN) = 0.
ELSE
GLOBCC(IIN) = SQRT(1.0-1.0/DENOM)
ENDIF
150 CONTINUE
ENDIF
ENDIF
RETURN
END