41 |
* !the tracking procedure |
* !the tracking procedure |
42 |
DATA STEPMAX/100./ !maximum number of steps in the trackin gprocess |
DATA STEPMAX/100./ !maximum number of steps in the trackin gprocess |
43 |
|
|
44 |
DATA ALMAX/dinf,dinf,1.,dinf,dinf/ !limits on alpha vector components |
DATA ALMAX/dinf,dinf,dinf,dinf,dinf/ !limits on alpha vector components |
45 |
DATA ALMIN/-dinf,-dinf,-1.,-dinf,-dinf/ !" |
DATA ALMIN/-dinf,-dinf,-dinf,-dinf,-dinf/ !" |
46 |
|
|
47 |
DIMENSION DAL(5) !increment of vector alfa |
DIMENSION DAL(5) !increment of vector alfa |
48 |
DIMENSION CHI2DD_R(4,4),CHI2D_R(4) !hessiano e gradiente di chi2 |
DIMENSION CHI2DD_R(4,4),CHI2D_R(4) !hessiano e gradiente di chi2 |
138 |
RETURN |
RETURN |
139 |
ENDIF |
ENDIF |
140 |
|
|
141 |
COST=1e-7 |
COST=1e-9 |
142 |
|
costfac=1.1 |
143 |
|
flagstep=0 |
144 |
|
|
145 |
|
7 continue |
146 |
|
|
147 |
|
IF(costfac.le.1.) THEN |
148 |
|
IFAIL=1 |
149 |
|
PRINT *,'=== WARNING ===> no matrix inversion ' |
150 |
|
RETURN |
151 |
|
ENDIF |
152 |
|
|
153 |
DO I=1,5 |
DO I=1,5 |
154 |
DO J=1,5 |
DO J=1,5 |
155 |
CHI2DD(I,J)=CHI2DD(I,J)*COST |
CHI2DD(I,J)=CHI2DD(I,J)*COST |
163 |
* track fitting with FREE deflection |
* track fitting with FREE deflection |
164 |
*------------------------------------------------------------* |
*------------------------------------------------------------* |
165 |
CALL DSFACT(5,CHI2DD,5,IFA,DET,JFA) !CHI2DD matrix determinant |
CALL DSFACT(5,CHI2DD,5,IFA,DET,JFA) !CHI2DD matrix determinant |
166 |
IF(IFA.NE.0) THEN !not positive-defined |
IF(IFA.NE.0.or.jfa.ne.0) THEN !not positive-defined |
167 |
if(TRKVERBOSE)then |
if(ifa.eq.-1)then |
168 |
|
if(TRKVERBOSE)then |
169 |
PRINT *, |
PRINT *, |
170 |
$ '*** ERROR in mini ***'// |
$ '*** ERROR in mini ***'// |
171 |
$ 'on matrix inversion (not pos-def)' |
$ 'on matrix inversion (not pos-def)' |
172 |
$ ,DET |
$ ,DET |
173 |
endif |
endif |
174 |
IF(CHI2.EQ.0) CHI2=-9999. |
IF(CHI2.EQ.0) CHI2=-9999. |
175 |
IF(CHI2.GT.0) CHI2=-CHI2 |
IF(CHI2.GT.0) CHI2=-CHI2 |
176 |
IFAIL=1 |
IFAIL=1 |
177 |
RETURN |
RETURN |
178 |
|
endif |
179 |
|
if(jfa.eq.-1)then |
180 |
|
if(flagstep.eq.-1.) costfac=(costfac-1)/2+1 |
181 |
|
cost=cost*costfact |
182 |
|
flagstep=1. |
183 |
|
goto 7 |
184 |
|
elseif(jfa.eq.1)then |
185 |
|
if(flagstep.eq.1.) costfac=(costfac-1)/2+1 |
186 |
|
cost=cost/costfac |
187 |
|
flagstep=-1. |
188 |
|
goto 7 |
189 |
|
endif |
190 |
ENDIF |
ENDIF |
191 |
CALL DSFINV(5,CHI2DD,5) !CHI2DD matrix inversion |
CALL DSFINV(5,CHI2DD,5) !CHI2DD matrix inversion |
192 |
* ******************************************* |
* ******************************************* |