EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lmrazz.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file lmrazz.F
1 
2 C **********************************************************************
3 
4  SUBROUTINE lmrazz(YNEW,PNEW)
5 
6  IMPLICIT NONE
7 
8 C...This is the MINUIT routine RAZZIA.
9 CC CALLED ONLY BY SIMPLEX (AND IMPROV) TO ADD A NEW POINT
10 CC AND REMOVE AN OLD ONE FROM THE CURRENT SIMPLEX, AND GET THE
11 CC ESTIMATED DISTANCE TO MINIMUM.
12 CC
13  COMMON
14  1/lmmine/ erp(30) ,ern(30)
15  2/lmpari/ x(15) ,xt(15) ,dirin(15) ,maxint ,npar
16  3/lmpare/ u(30) ,werr(30) ,maxext ,nu
17  4/lmlimi/ alim(30) ,blim(30) ,lcode(30) ,lcorsp(30) ,limset
18  5/lmvari/ v(15,15)
19  7/lmfix / ipfix(15),xs(15) ,xts(15) ,dirins(15) ,npfix
20  7/lmfix2/ grds(15) ,g2s(15) ,gsteps(15),aberfs(15)
21  c/lmcasc/ y(16) ,jh ,jl
22  f/lmderi/ gin(30) ,grd(15) ,g2(15) ,gstep(15) ,aberf(15)
23  g/lmsimv/ p(15,16) ,pstar(15),pstst(15) ,pbar(15) ,prho(15)
24  j/lmvart/ vt(15,15)
25  COMMON
26  6/lmunit/ isysrd ,isyswr ,isyspu
27  8/lmtitl/ title(13),date(2) ,isw(7) ,nblock
28  9/lmconv/ epsi ,apsi ,vtest ,nstepq ,nfcn ,nfcnmx
29  a/lmcard/ cword ,cword2 ,cword3 ,word7(7)
30  b/lmmini/ amin ,up ,newmin ,itaur ,sigma,epsmac
31 
32  REAL erp,ern
33  INTEGER maxint,npar
34  REAL x,xt,dirin
35  INTEGER maxext ,nu
36  REAL u,werr
37  INTEGER lcode,lcorsp,limset
38  REAL alim,blim
39  REAL v
40  INTEGER ipfix,npfix
41  REAL xs,xts,dirins
42  REAL grds,g2s,gsteps,aberfs
43  REAL y
44  INTEGER jh,jl
45  REAL gin,grd,g2,gstep,aberf
46  REAL p,pstar,pstst,pbar,prho
47  REAL vt
48 ***** COMMON
49  INTEGER isysrd ,isyswr ,isyspu
50  REAL title,date
51  INTEGER isw,nblock
52  REAL epsi ,apsi ,vtest
53  INTEGER nstepq ,nfcn ,nfcnmx
54  REAL cword ,cword2 ,cword3 ,word7
55  REAL amin ,up ,sigma,epsmac
56  INTEGER newmin ,itaur
57 
58  COMMON /lpflag/ lst3
59  INTEGER lst3
60  SAVE /lpflag/
61 
62 
63  INTEGER i,j,nparp1
64  REAL ynew,pnew,us,pbig,plit
65 
66  dimension pnew(15)
67  DO 10 i=1,npar
68 10 p(i,jh)=pnew(i)
69  y(jh)=ynew
70  IF(ynew.GE.amin) go to 18
71  DO 15 i=1,npar
72 15 x(i)=pnew(i)
73  CALL lminto(x)
74  amin=ynew
75  jl=jh
76 18 CONTINUE
77  jh=1
78  nparp1=npar+1
79 20 DO 25 j=2,nparp1
80  IF (y(j) .GT. y(jh)) jh = j
81 25 CONTINUE
82  sigma = y(jh) - y(jl)
83  IF (sigma .LE. 0.) go to 45
84  us = 1.0/sigma
85  DO 35 i= 1, npar
86  pbig = p(i,1)
87  plit = pbig
88  DO 30 j= 2, nparp1
89  IF (p(i,j) .GT. pbig) pbig = p(i,j)
90  IF (p(i,j) .LT. plit) plit = p(i,j)
91  30 CONTINUE
92  dirin(i) = pbig - plit
93  IF (itaur .LT. 1 ) v(i,i) = 0.5*(v(i,i) +us*dirin(i)**2)
94  35 CONTINUE
95  40 RETURN
96 CMM changed
97 C 45 IF(LST3.GE.1) WRITE (ISYSWR, 1000) NPAR
98  45 IF(lst3.GE.6) WRITE (isyswr, 1000) npar
99 
100  go to 40
101  1000 FORMAT('0***** FUNCTION VALUE DOES NOT SEEM TO DEPEND ON ANY ',
102  +'OF THE',i3,' VARIABLE PARAMETERS',/15x ,'VERIFY THAT STEP SIZES',
103  +' ARE BIG ENOUGH AND CHECK FCN LOGIC.',/1x,81(1h*)/1x,81(1h*)//)
104  END