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 |
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 |
* Y view |
* Y view |
1155 |
S1=0. |
S1=0. |
1156 |
DO I=1,nplanes |
DO I=1,nplanes |
1157 |
IF(YGOOD(I).EQ.1)THEN |
IF(YGOOD(I).EQ.1)THEN |
1158 |
YY = YM(I) |
YY = REAL(YM(I))!EM GCC4.7 |
1159 |
IF(XGOOD(I).EQ.0)THEN |
IF(XGOOD(I).EQ.0)THEN |
1160 |
YY = (YM_A(I) + YM_B(I))/2 |
YY = REAL((YM_A(I) + YM_B(I))/2.)!EM GCC4.7 |
1161 |
ENDIF |
ENDIF |
1162 |
SZZ=SZZ+ZM(I)*ZM(I) |
SZZ=SZZ+REAL(ZM(I)*ZM(I))!EM GCC4.7 |
1163 |
SZY=SZY+ZM(I)*YY |
SZY=SZY+REAL(ZM(I)*YY)!EM GCC4.7 |
1164 |
SSY=SSY+YY |
SSY=SSY+YY |
1165 |
SZ=SZ+ZM(I) |
SZ=SZ+REAL(ZM(I))!EM GCC4.7 |
1166 |
S1=S1+1. |
S1=S1+1. |
1167 |
ENDIF |
ENDIF |
1168 |
ENDDO |
ENDDO |
1169 |
DET=SZZ*S1-SZ*SZ |
DET=SZZ*S1-SZ*SZ |
1170 |
AY=(SZY*S1-SZ*SSY)/DET |
AY=(SZY*S1-SZ*SSY)/DET |
1171 |
BY=(SZZ*SSY-SZY*SZ)/DET |
BY=(SZZ*SSY-SZY*SZ)/DET |
1172 |
Y0 = AY*ZINI+BY |
Y0 = REAL(AY*ZINI+BY)!EM GCC4.7 |
1173 |
* ---------------------------------------- |
* ---------------------------------------- |
1174 |
* X view |
* X view |
1175 |
* ---------------------------------------- |
* ---------------------------------------- |
1179 |
NP=0 |
NP=0 |
1180 |
DO I=1,nplanes |
DO I=1,nplanes |
1181 |
IF(XGOOD(I).EQ.1)THEN |
IF(XGOOD(I).EQ.1)THEN |
1182 |
XX = XM(I) |
XX = REAL(XM(I))!EM GCC4.7 |
1183 |
IF(YGOOD(I).EQ.0)THEN |
IF(YGOOD(I).EQ.0)THEN |
1184 |
XX = (XM_A(I) + XM_B(I))/2 |
XX = REAL((XM_A(I) + XM_B(I))/2.)!EM GCC4.7 |
1185 |
ENDIF |
ENDIF |
1186 |
NP=NP+1 |
NP=NP+1 |
1187 |
XP(NP)=XX |
XP(NP)=XX |
1188 |
ZP(NP)=ZM(I) |
ZP(NP)=REAL(ZM(I))!EM GCC4.7 |
1189 |
ENDIF |
ENDIF |
1190 |
ENDDO |
ENDDO |
1191 |
IFLAG=0 !no debug mode |
IFLAG=0 !no debug mode |
1199 |
|
|
1200 |
IF(IFLAG.NE.0)GOTO 10 !straigth fit |
IF(IFLAG.NE.0)GOTO 10 !straigth fit |
1201 |
c if(CHI.gt.100)GOTO 10 !straigth fit |
c if(CHI.gt.100)GOTO 10 !straigth fit |
1202 |
ARG = RADIUS**2-(ZINI-ZC)**2 |
ARG = REAL(RADIUS**2-(ZINI-ZC)**2)!EM GCC4.7 |
1203 |
IF(ARG.LT.0)GOTO 10 !straigth fit |
IF(ARG.LT.0)GOTO 10 !straigth fit |
1204 |
DC = SQRT(ARG) |
DC = SQRT(ARG) |
1205 |
IF(XC.GT.0)DC=-DC |
IF(XC.GT.0)DC=-DC |
1206 |
X0=XC+DC |
X0=XC+DC |
1207 |
AX = -(ZINI-ZC)/DC |
AX = REAL(-(ZINI-ZC)/DC)!EM GCC4.7 |
1208 |
DEF=100./(RADIUS*0.3*0.43) |
DEF=100./(RADIUS*0.3*0.43) |
1209 |
IF(XC.GT.0)DEF=-DEF |
IF(XC.GT.0)DEF=-DEF |
1210 |
|
|
1230 |
S1=0. |
S1=0. |
1231 |
DO I=1,nplanes |
DO I=1,nplanes |
1232 |
IF(XGOOD(I).EQ.1)THEN |
IF(XGOOD(I).EQ.1)THEN |
1233 |
XX = XM(I) |
XX = REAL(XM(I))!EM GCC4.7 |
1234 |
IF(YGOOD(I).EQ.0)THEN |
IF(YGOOD(I).EQ.0)THEN |
1235 |
XX = (XM_A(I) + XM_B(I))/2 |
XX = REAL((XM_A(I) + XM_B(I))/2.)!EM GCC4.7 |
1236 |
ENDIF |
ENDIF |
1237 |
SZZ=SZZ+ZM(I)*ZM(I) |
SZZ=SZZ+REAL(ZM(I)*ZM(I))!EM GCC4.7 |
1238 |
SZX=SZX+ZM(I)*XX |
SZX=SZX+REAL(ZM(I)*XX)!EM GCC4.7 |
1239 |
SSX=SSX+XX |
SSX=SSX+XX |
1240 |
SZ=SZ+ZM(I) |
SZ=SZ+REAL(ZM(I))!EM GCC4.7 |
1241 |
S1=S1+1. |
S1=S1+1. |
1242 |
ENDIF |
ENDIF |
1243 |
ENDDO |
ENDDO |
1245 |
AX=(SZX*S1-SZ*SSX)/DET |
AX=(SZX*S1-SZ*SSX)/DET |
1246 |
BX=(SZZ*SSX-SZX*SZ)/DET |
BX=(SZZ*SSX-SZX*SZ)/DET |
1247 |
DEF = 0 |
DEF = 0 |
1248 |
X0 = AX*ZINI+BX |
X0 = REAL(AX*ZINI+BX)!EM GCC4.7 |
1249 |
|
|
1250 |
20 CONTINUE |
20 CONTINUE |
1251 |
* ---------------------------------------- |
* ---------------------------------------- |