72 |
|
|
73 |
DIMENSION AL0(5) |
DIMENSION AL0(5) |
74 |
LOGICAL SUCCESS_NEW,SUCCESS_OLD |
LOGICAL SUCCESS_NEW,SUCCESS_OLD |
75 |
|
|
76 |
|
c$$$ PRINT*,'==========' ! TEST |
77 |
|
c$$$ PRINT*,'START MINI' ! TEST |
78 |
|
c$$$ PRINT*,'==========' ! TEST |
79 |
|
|
80 |
* |
* |
81 |
* define kind of minimization (0x=chi2+gaussian or 1x=likelihood+student) |
* define kind of minimization (0x=chi2+gaussian or 1x=likelihood+student) |
82 |
* |
* |
101 |
* ---------------------------------------------------------- |
* ---------------------------------------------------------- |
102 |
AVRESX = RESXAV |
AVRESX = RESXAV |
103 |
AVRESY = RESYAV |
AVRESY = RESYAV |
104 |
|
NX = 0.0 |
105 |
|
NY = 0.0 |
106 |
DO IP=1,6 |
DO IP=1,6 |
107 |
IF( XGOOD(IP).EQ.1 )THEN |
IF( XGOOD(IP).EQ.1 )THEN |
108 |
NX=NX+1 |
NX=NX+1.0 |
109 |
AVRESX=AVRESX+RESX(IP) |
AVRESX=AVRESX+RESX(IP) |
110 |
ENDIF |
ENDIF |
|
IF(NX.NE.0)AVRESX=AVRESX/NX |
|
111 |
IF( YGOOD(IP).EQ.1 )THEN |
IF( YGOOD(IP).EQ.1 )THEN |
112 |
NY=NY+1 |
NY=NY+1.0 |
113 |
AVRESY=AVRESY+RESY(IP) |
AVRESY=AVRESY+RESY(IP) |
114 |
ENDIF |
ENDIF |
|
IF(NX.NE.0)AVRESY=AVRESY/NY |
|
115 |
ENDDO |
ENDDO |
116 |
|
IF(NX.NE.0.0)AVRESX=AVRESX/NX |
117 |
|
IF(NY.NE.0.0)AVRESY=AVRESY/NY |
118 |
|
|
119 |
* ---------------------------------------------------------- |
* ---------------------------------------------------------- |
120 |
* define ALTOL(5) ---> tolerances on state vector |
* define ALTOL(5) ---> tolerances on state vector |
1000 |
c$$$ print*,'POSXY (prima) ',vout |
c$$$ print*,'POSXY (prima) ',vout |
1001 |
|
|
1002 |
DO I=1,nplanes |
DO I=1,nplanes |
1003 |
cpp step=vout(3)-zv(i) |
c$$$ ipass = 0 ! TEST |
1004 |
step=vout(3)-zm(i) |
c$$$ PRINT *,'TRACKING -> START PLANE: ',I ! TEST |
1005 |
|
cPPP step=vout(3)-zm(i) |
1006 |
|
cPP step=(zm(i)-vout(3))/VOUT(6) |
1007 |
10 DO J=1,7 |
10 DO J=1,7 |
1008 |
VECT(J)=VOUT(J) |
VECT(J)=VOUT(J) |
1009 |
VECTINI(J)=VOUT(J) |
VECTINI(J)=VOUT(J) |
1010 |
ENDDO |
ENDDO |
1011 |
|
cPPP step=vect(3)-zm(i) |
1012 |
|
IF(VOUT(6).GE.0.) THEN |
1013 |
|
IFAIL=1 |
1014 |
|
if(TRKVERBOSE) |
1015 |
|
$ PRINT *,'posxy (grkuta): WARNING ===> backward track!!' |
1016 |
|
RETURN |
1017 |
|
ENDIF |
1018 |
|
step=(zm(i)-vect(3))/VOUT(6) |
1019 |
11 continue |
11 continue |
1020 |
CALL GRKUTA(CHARGE,STEP,VECT,VOUT) |
CALL GRKUTA(CHARGE,STEP,VECT,VOUT) |
1021 |
|
c$$$ ipass = ipass + 1 ! TEST |
1022 |
|
c$$$ PRINT *,'TRACKING -> STEP: ',ipass,' LENGHT: ', STEP ! TEST |
1023 |
IF(VOUT(3).GT.VECT(3)) THEN |
IF(VOUT(3).GT.VECT(3)) THEN |
1024 |
IFAIL=1 |
IFAIL=1 |
1025 |
if(TRKVERBOSE) |
if(TRKVERBOSE) |
1061 |
VOUT(7) = VOUT(7) * 0.997 !0.9968 |
VOUT(7) = VOUT(7) * 0.997 !0.9968 |
1062 |
* ----------------------------------------------- |
* ----------------------------------------------- |
1063 |
ENDIF |
ENDIF |
1064 |
|
c$$$ PRINT *,'TRACKING -> END' ! TEST |
1065 |
|
|
1066 |
ENDDO |
ENDDO |
1067 |
|
|
1100 |
YM(IP) = -100. !0. |
YM(IP) = -100. !0. |
1101 |
XM_A(IP) = -100. !0. |
XM_A(IP) = -100. !0. |
1102 |
YM_A(IP) = -100. !0. |
YM_A(IP) = -100. !0. |
1103 |
c ZM_A(IP) = 0 |
ZM_A(IP) = fitz(nplanes-ip+1) !init to mech. position |
1104 |
XM_B(IP) = -100. !0. |
XM_B(IP) = -100. !0. |
1105 |
YM_B(IP) = -100. !0. |
YM_B(IP) = -100. !0. |
1106 |
c ZM_B(IP) = 0 |
ZM_B(IP) = fitz(nplanes-ip+1) !init to mech. position |
1107 |
RESX(IP) = 1000. !3.d-4 |
RESX(IP) = 1000. !3.d-4 |
1108 |
RESY(IP) = 1000. !12.d-4 |
RESY(IP) = 1000. !12.d-4 |
1109 |
XGOOD(IP) = 0 |
XGOOD(IP) = 0 |
1252 |
AL(2) = Y0 |
AL(2) = Y0 |
1253 |
tath = sqrt(AY**2+AX**2) |
tath = sqrt(AY**2+AX**2) |
1254 |
AL(3) = tath/sqrt(1+tath**2) |
AL(3) = tath/sqrt(1+tath**2) |
|
c$$$ IF(AX.NE.0)THEN |
|
|
c$$$ AL(4)= atan(AY/AX) |
|
|
c$$$ ELSE |
|
|
c$$$ AL(4) = acos(-1.)/2 |
|
|
c$$$ IF(AY.LT.0)AL(4) = AL(4)+acos(-1.) |
|
|
c$$$ ENDIF |
|
|
c$$$ IF(AX.LT.0)AL(4)= acos(-1.)+ AL(4) |
|
|
c$$$ AL(4) = -acos(-1.) + AL(4) !from incidence direction to tracking ref.sys. |
|
|
|
|
|
c$$$ AL(4) = 0. |
|
|
c$$$ IF(AX.NE.0.AND.AY.NE.0)THEN |
|
|
c$$$ AL(4)= atan(AY/AX) |
|
|
c$$$ ELSEIF(AY.EQ.0)THEN |
|
|
c$$$ AL(4) = 0. |
|
|
c$$$ IF(AX.LT.0)AL(4) = AL(4)+acos(-1.) |
|
|
c$$$ ELSEIF(AX.EQ.0)THEN |
|
|
c$$$ AL(4) = acos(-1.)/2 |
|
|
c$$$ IF(AY.LT.0)AL(4) = AL(4)+acos(-1.) |
|
|
c$$$ ENDIF |
|
|
c$$$ IF(AX.LT.0)AL(4)= acos(-1.)+ AL(4) |
|
|
c$$$ AL(4) = -acos(-1.) + AL(4) !from incidence direction to tracking ref.sys. |
|
|
|
|
|
c$$$ AL(4)=0. |
|
|
c$$$ IF( AX.NE.0.OR.AY.NE.0. ) THEN |
|
|
c$$$ AL(4) = ASIN(AY/SQRT(AX**2+AY**2)) |
|
|
c$$$ IF(AX.LT.0.) AL(4) = ACOS(-1.0)-AL(4) |
|
|
c$$$ ENDIF |
|
1255 |
|
|
1256 |
AL(4)=0. |
AL(4)=0. |
1257 |
IF( AX.NE.0.OR.AY.NE.0. ) THEN |
IF( AX.NE.0.OR.AY.NE.0. ) THEN |