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 |
153 |
* **** Chi2+gaussian minimization |
* **** Chi2+gaussian minimization |
154 |
* ------------------------------- |
* ------------------------------- |
155 |
|
|
156 |
IF(.NOT.STUDENT.OR.FIRSTSTEPS) THEN |
IF((.NOT.STUDENT).OR.FIRSTSTEPS) THEN |
157 |
|
|
158 |
IF(ISTEP.GE.3) FIRSTSTEPS = .false. |
IF(ISTEP.GE.3) FIRSTSTEPS = .false. |
159 |
|
|
303 |
FC = CHI2 |
FC = CHI2 |
304 |
EC = 0. |
EC = 0. |
305 |
|
|
306 |
|
ICOUNT = 0 |
307 |
100 CONTINUE |
100 CONTINUE |
308 |
|
ICOUNT = ICOUNT+1 |
309 |
|
|
310 |
DO I=1,5 |
DO I=1,5 |
311 |
AL0(I)=AL(I) |
AL0(I)=AL(I) |
312 |
ENDDO |
ENDDO |
350 |
ENDIF |
ENDIF |
351 |
c$$$ E = BETA*E |
c$$$ E = BETA*E |
352 |
ENDIF |
ENDIF |
353 |
|
IF(ICOUNT.GT.20) GOTO 101 |
354 |
GOTO 100 |
GOTO 100 |
355 |
|
|
356 |
101 CONTINUE |
101 CONTINUE |
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 |