36 |
c DATA XGOOD,YGOOD/nplanes*1.,nplanes*1./ !planes to be used in the tracking |
c DATA XGOOD,YGOOD/nplanes*1.,nplanes*1./ !planes to be used in the tracking |
37 |
|
|
38 |
DATA STEPAL/5*1.d-7/ !alpha vector step |
DATA STEPAL/5*1.d-7/ !alpha vector step |
39 |
DATA ISTEPMAX/120/ !maximum number of steps in the chi^2 minimization |
DATA ISTEPMAX/100/ !maximum number of steps in the chi^2 minimization |
40 |
DATA TOLL/1.d-8/ !tolerance in reaching the next plane during |
DATA TOLL/1.d-8/ !tolerance in reaching the next plane during |
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,dinf,dinf,dinf/ !limits on alpha vector components |
DATA ALMAX/dinf,dinf,1.,dinf,dinf/ !limits on alpha vector components |
45 |
DATA ALMIN/-dinf,-dinf,-dinf,-dinf,-dinf/ !" |
DATA ALMIN/-dinf,-dinf,-1.,-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-9 |
COST=1e-7 |
|
costfac=1.1 |
|
|
flagstep=0 |
|
|
|
|
|
7 continue |
|
|
|
|
|
IF(costfac.le.1.) THEN |
|
|
IFAIL=1 |
|
|
PRINT *,'=== WARNING ===> no matrix inversion ' |
|
|
RETURN |
|
|
ENDIF |
|
|
|
|
142 |
DO I=1,5 |
DO I=1,5 |
143 |
DO J=1,5 |
DO J=1,5 |
144 |
CHI2DD(I,J)=CHI2DD(I,J)*COST |
CHI2DD(I,J)=CHI2DD(I,J)*COST |
152 |
* track fitting with FREE deflection |
* track fitting with FREE deflection |
153 |
*------------------------------------------------------------* |
*------------------------------------------------------------* |
154 |
CALL DSFACT(5,CHI2DD,5,IFA,DET,JFA) !CHI2DD matrix determinant |
CALL DSFACT(5,CHI2DD,5,IFA,DET,JFA) !CHI2DD matrix determinant |
155 |
IF(IFA.NE.0.or.jfa.ne.0) THEN !not positive-defined |
IF(IFA.NE.0) THEN !not positive-defined |
156 |
if(ifa.eq.-1)then |
if(TRKVERBOSE)then |
|
if(TRKVERBOSE)then |
|
157 |
PRINT *, |
PRINT *, |
158 |
$ '*** ERROR in mini ***'// |
$ '*** ERROR in mini ***'// |
159 |
$ 'on matrix inversion (not pos-def)' |
$ 'on matrix inversion (not pos-def)' |
160 |
$ ,DET |
$ ,DET |
161 |
endif |
endif |
162 |
IF(CHI2.EQ.0) CHI2=-9999. |
IF(CHI2.EQ.0) CHI2=-9999. |
163 |
IF(CHI2.GT.0) CHI2=-CHI2 |
IF(CHI2.GT.0) CHI2=-CHI2 |
164 |
IFAIL=1 |
IFAIL=1 |
165 |
RETURN |
RETURN |
|
endif |
|
|
if(jfa.eq.-1)then |
|
|
if(flagstep.eq.-1.) costfac=(costfac-1)/2+1 |
|
|
cost=cost*costfact |
|
|
flagstep=1. |
|
|
goto 7 |
|
|
elseif(jfa.eq.1)then |
|
|
if(flagstep.eq.1.) costfac=(costfac-1)/2+1 |
|
|
cost=cost/costfac |
|
|
flagstep=-1. |
|
|
goto 7 |
|
|
endif |
|
166 |
ENDIF |
ENDIF |
167 |
CALL DSFINV(5,CHI2DD,5) !CHI2DD matrix inversion |
CALL DSFINV(5,CHI2DD,5) !CHI2DD matrix inversion |
168 |
* ******************************************* |
* ******************************************* |
245 |
* check number of steps: |
* check number of steps: |
246 |
*------------------------------------------------------------* |
*------------------------------------------------------------* |
247 |
IF(ISTEP.ge.ISTEPMAX) then |
IF(ISTEP.ge.ISTEPMAX) then |
248 |
IFAIL=1 |
c$$$ IFAIL=1 |
249 |
if(TRKVERBOSE) |
c$$$ if(TRKVERBOSE) |
250 |
$ PRINT *,'*** WARNING in mini *** ISTEP.GT.ISTEPMAX=', |
c$$$ $ PRINT *,'*** WARNING in mini *** ISTEP.GT.ISTEPMAX=', |
251 |
$ ISTEPMAX |
c$$$ $ ISTEPMAX |
252 |
goto 11 |
goto 11 |
253 |
endif |
endif |
254 |
*------------------------------------------------------------* |
*------------------------------------------------------------* |