24 |
|
|
25 |
parameter (dinf=1.d15) !just a huge number... |
parameter (dinf=1.d15) !just a huge number... |
26 |
parameter (dinfneg=-dinf) ! just a huge negative number... |
parameter (dinfneg=-dinf) ! just a huge negative number... |
|
|
|
|
double precision NX, NY ! EM GCC4.7 |
|
27 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
28 |
c variables used in the tracking procedure (mini and its subroutines) |
c variables used in the tracking procedure (mini and its subroutines) |
29 |
c |
c |
102 |
* ---------------------------------------------------------- |
* ---------------------------------------------------------- |
103 |
AVRESX = RESXAV |
AVRESX = RESXAV |
104 |
AVRESY = RESYAV |
AVRESY = RESYAV |
105 |
NX = 0.0 |
NX = 0 !EM GCC4.7 |
106 |
NY = 0.0 |
NY = 0 !EM GCC4.7 |
107 |
DO IP=1,6 |
DO IP=1,6 |
108 |
IF( XGOOD(IP).EQ.1 )THEN |
IF( XGOOD(IP).EQ.1 )THEN |
109 |
NX=NX+1.0 |
NX=NX+1!EM GCC4.7 |
110 |
AVRESX=AVRESX+RESX(IP) |
AVRESX=AVRESX+RESX(IP) |
111 |
ENDIF |
ENDIF |
112 |
IF( YGOOD(IP).EQ.1 )THEN |
IF( YGOOD(IP).EQ.1 )THEN |
113 |
NY=NY+1.0 |
NY=NY+1!EM GCC4.7 |
114 |
AVRESY=AVRESY+RESY(IP) |
AVRESY=AVRESY+RESY(IP) |
115 |
ENDIF |
ENDIF |
116 |
ENDDO |
ENDDO |
141 |
JFAIL=0 !error flag |
JFAIL=0 !error flag |
142 |
CHI2=0 |
CHI2=0 |
143 |
|
|
144 |
if(TRKDEBUG) print*,'guess: ',al |
if(TRKDEBUG) print*,'mini : guess ',al |
145 |
if(TRKDEBUG) print*,'mini2: step ',istep,chi2,AL(5) |
if(TRKDEBUG) print*,'mini : step ',istep,chi2,AL(5) |
146 |
|
|
147 |
* |
* |
148 |
* ----------------------- |
* ----------------------- |
252 |
ENDDO |
ENDDO |
253 |
ENDIF |
ENDIF |
254 |
|
|
255 |
if(TRKDEBUG) print*,'mini2: step ',istep,chi2,AL(5) |
if(TRKDEBUG) print*,'mini : step ',istep,chi2,AL(5) |
256 |
|
|
257 |
c$$$ PRINT*,'DAL ',(DAL(K),K=1,5) |
c$$$ PRINT*,'DAL ',(DAL(K),K=1,5) |
258 |
c$$$ PRINT*,'CHI2DOLD ',(CHI2DOLD(K),K=1,5) |
c$$$ PRINT*,'CHI2DOLD ',(CHI2DOLD(K),K=1,5) |
563 |
|
|
564 |
11 CONTINUE |
11 CONTINUE |
565 |
|
|
566 |
if(TRKDEBUG) print*,'mini2: -ok- ',istep,chi2,AL(5) |
if(TRKDEBUG) print*,'mini : -ok- ',istep,chi2,AL(5) |
567 |
|
|
568 |
NSTEP=ISTEP ! ***PP*** |
NSTEP=ISTEP ! ***PP*** |
569 |
|
|
1135 |
|
|
1136 |
subroutine guess() |
subroutine guess() |
1137 |
|
|
1138 |
IMPLICIT DOUBLE PRECISION (A-H,O-Z) ! EM GCC4.7 |
c IMPLICIT DOUBLE PRECISION (A-H,O-Z) |
1139 |
|
|
1140 |
include 'commontracker.f' !tracker general common |
include 'commontracker.f' !tracker general common |
1141 |
include 'common_mini_2.f' !common for the tracking procedure |
include 'common_mini_2.f' !common for the tracking procedure |
1142 |
|
|
1143 |
REAL*8 XP(NPLANES),ZP(NPLANES),AP(NPLANES),RP(NPLANES) ! EM GCC4.7 |
REAL*4 XP(NPLANES),ZP(NPLANES),AP(NPLANES),RP(NPLANES) |
1144 |
REAL*4 CHI,XC,ZC,RADIUS |
REAL*4 CHI,XC,ZC,RADIUS |
1145 |
|
|
1146 |
|
c$$$ DO I=1,nplanes |
1147 |
|
c$$$ print *,i,' - ',XGOOD(I),YGOOD(I) |
1148 |
|
c$$$ print *,i,' - ',xm(i),ym(i),zm(i) |
1149 |
|
c$$$ print *,i,' A ',xm_a(i),ym_a(i),zm_a(i) |
1150 |
|
c$$$ print *,i,' B ',xm_b(i),ym_b(i),zm_b(i) |
1151 |
|
c$$$ enddo |
1152 |
|
|
1153 |
|
|
1154 |
* ---------------------------------------- |
* ---------------------------------------- |
1155 |
* Y view |
* Y view |
1156 |
* ---------------------------------------- |
* ---------------------------------------- |
1164 |
S1=0. |
S1=0. |
1165 |
DO I=1,nplanes |
DO I=1,nplanes |
1166 |
IF(YGOOD(I).EQ.1)THEN |
IF(YGOOD(I).EQ.1)THEN |
1167 |
YY = YM(I) |
YY = REAL(YM(I))!EM GCC4.7 |
1168 |
IF(XGOOD(I).EQ.0)THEN |
IF(XGOOD(I).EQ.0)THEN |
1169 |
YY = (YM_A(I) + YM_B(I))/2 |
YY = REAL((YM_A(I) + YM_B(I))/2.)!EM GCC4.7 |
1170 |
ENDIF |
ENDIF |
1171 |
SZZ=SZZ+ZM(I)*ZM(I) |
SZZ=SZZ+REAL(ZM(I)*ZM(I))!EM GCC4.7 |
1172 |
SZY=SZY+ZM(I)*YY |
SZY=SZY+REAL(ZM(I)*YY)!EM GCC4.7 |
1173 |
SSY=SSY+YY |
SSY=SSY+YY |
1174 |
SZ=SZ+ZM(I) |
SZ=SZ+REAL(ZM(I))!EM GCC4.7 |
1175 |
S1=S1+1. |
S1=S1+1. |
1176 |
ENDIF |
ENDIF |
1177 |
ENDDO |
ENDDO |
1178 |
DET=SZZ*S1-SZ*SZ |
DET=SZZ*S1-SZ*SZ |
1179 |
AY=(SZY*S1-SZ*SSY)/DET |
AY=(SZY*S1-SZ*SSY)/DET |
1180 |
BY=(SZZ*SSY-SZY*SZ)/DET |
BY=(SZZ*SSY-SZY*SZ)/DET |
1181 |
Y0 = AY*ZINI+BY |
Y0 = REAL(AY*ZINI+BY)!EM GCC4.7 |
1182 |
* ---------------------------------------- |
* ---------------------------------------- |
1183 |
* X view |
* X view |
1184 |
* ---------------------------------------- |
* ---------------------------------------- |
1188 |
NP=0 |
NP=0 |
1189 |
DO I=1,nplanes |
DO I=1,nplanes |
1190 |
IF(XGOOD(I).EQ.1)THEN |
IF(XGOOD(I).EQ.1)THEN |
1191 |
XX = XM(I) |
XX = REAL(XM(I))!EM GCC4.7 |
1192 |
IF(YGOOD(I).EQ.0)THEN |
IF(YGOOD(I).EQ.0)THEN |
1193 |
XX = (XM_A(I) + XM_B(I))/2 |
XX = REAL((XM_A(I) + XM_B(I))/2.)!EM GCC4.7 |
1194 |
ENDIF |
ENDIF |
1195 |
NP=NP+1 |
NP=NP+1 |
1196 |
XP(NP)=XX |
XP(NP)=XX |
1197 |
ZP(NP)=ZM(I) |
ZP(NP)=REAL(ZM(I))!EM GCC4.7 |
1198 |
ENDIF |
ENDIF |
1199 |
ENDDO |
ENDDO |
1200 |
IFLAG=0 !no debug mode |
IFLAG=0 !no debug mode |
1208 |
|
|
1209 |
IF(IFLAG.NE.0)GOTO 10 !straigth fit |
IF(IFLAG.NE.0)GOTO 10 !straigth fit |
1210 |
c if(CHI.gt.100)GOTO 10 !straigth fit |
c if(CHI.gt.100)GOTO 10 !straigth fit |
1211 |
ARG = RADIUS**2-(ZINI-ZC)**2 |
ARG = REAL(RADIUS**2-(ZINI-ZC)**2)!EM GCC4.7 |
1212 |
IF(ARG.LT.0)GOTO 10 !straigth fit |
IF(ARG.LT.0)GOTO 10 !straigth fit |
1213 |
DC = SQRT(ARG) |
DC = SQRT(ARG) |
1214 |
IF(XC.GT.0)DC=-DC |
IF(XC.GT.0)DC=-DC |
1215 |
X0=XC+DC |
X0=XC+DC |
1216 |
AX = -(ZINI-ZC)/DC |
AX = REAL(-(ZINI-ZC)/DC)!EM GCC4.7 |
1217 |
DEF=100./(RADIUS*0.3*0.43) |
DEF=100./(RADIUS*0.3*0.43) |
1218 |
IF(XC.GT.0)DEF=-DEF |
IF(XC.GT.0)DEF=-DEF |
1219 |
|
|
1239 |
S1=0. |
S1=0. |
1240 |
DO I=1,nplanes |
DO I=1,nplanes |
1241 |
IF(XGOOD(I).EQ.1)THEN |
IF(XGOOD(I).EQ.1)THEN |
1242 |
XX = XM(I) |
XX = REAL(XM(I))!EM GCC4.7 |
1243 |
IF(YGOOD(I).EQ.0)THEN |
IF(YGOOD(I).EQ.0)THEN |
1244 |
XX = (XM_A(I) + XM_B(I))/2 |
XX = REAL((XM_A(I) + XM_B(I))/2.)!EM GCC4.7 |
1245 |
ENDIF |
ENDIF |
1246 |
SZZ=SZZ+ZM(I)*ZM(I) |
SZZ=SZZ+REAL(ZM(I)*ZM(I))!EM GCC4.7 |
1247 |
SZX=SZX+ZM(I)*XX |
SZX=SZX+REAL(ZM(I)*XX)!EM GCC4.7 |
1248 |
SSX=SSX+XX |
SSX=SSX+XX |
1249 |
SZ=SZ+ZM(I) |
SZ=SZ+REAL(ZM(I))!EM GCC4.7 |
1250 |
S1=S1+1. |
S1=S1+1. |
1251 |
ENDIF |
ENDIF |
1252 |
ENDDO |
ENDDO |
1254 |
AX=(SZX*S1-SZ*SSX)/DET |
AX=(SZX*S1-SZ*SSX)/DET |
1255 |
BX=(SZZ*SSX-SZX*SZ)/DET |
BX=(SZZ*SSX-SZX*SZ)/DET |
1256 |
DEF = 0 |
DEF = 0 |
1257 |
X0 = AX*ZINI+BX |
X0 = REAL(AX*ZINI+BX)!EM GCC4.7 |
1258 |
|
|
1259 |
20 CONTINUE |
20 CONTINUE |
1260 |
* ---------------------------------------- |
* ---------------------------------------- |