141 |
CHI2=0 |
CHI2=0 |
142 |
|
|
143 |
if(TRKDEBUG) print*,'guess: ',al |
if(TRKDEBUG) print*,'guess: ',al |
144 |
if(TRKDEBUG) print*,'mini2: step ',istep,chi2,1./AL(5) |
if(TRKDEBUG) print*,'mini2: step ',istep,chi2,AL(5) |
145 |
|
|
146 |
* |
* |
147 |
* ----------------------- |
* ----------------------- |
251 |
ENDDO |
ENDDO |
252 |
ENDIF |
ENDIF |
253 |
|
|
254 |
if(TRKDEBUG) print*,'mini2: step ',istep,chi2,1./AL(5) |
if(TRKDEBUG) print*,'mini2: step ',istep,chi2,AL(5) |
255 |
|
|
256 |
c$$$ PRINT*,'DAL ',(DAL(K),K=1,5) |
c$$$ PRINT*,'DAL ',(DAL(K),K=1,5) |
257 |
c$$$ PRINT*,'CHI2DOLD ',(CHI2DOLD(K),K=1,5) |
c$$$ PRINT*,'CHI2DOLD ',(CHI2DOLD(K),K=1,5) |
418 |
* --------------------------------------------- |
* --------------------------------------------- |
419 |
*------------------------------------------------------------* |
*------------------------------------------------------------* |
420 |
c$$$ ALTOL(5) = DSQRT(DELETA1**2+DELETA2**2*AL(5)**2)/FACT |
c$$$ ALTOL(5) = DSQRT(DELETA1**2+DELETA2**2*AL(5)**2)/FACT |
421 |
|
IF(FACT.EQ.0)THEN |
422 |
|
IFAIL=1 |
423 |
|
RETURN |
424 |
|
ENDIF |
425 |
ALTOL(5) = DSQRT((DELETA1*AVRESX)**2+DELETA2**2*AL(5)**2)/FACT |
ALTOL(5) = DSQRT((DELETA1*AVRESX)**2+DELETA2**2*AL(5)**2)/FACT |
426 |
ALTOL(1) = ALTOL(5)/DELETA1 |
ALTOL(1) = ALTOL(5)/DELETA1 |
427 |
ALTOL(2) = ALTOL(1) |
ALTOL(2) = ALTOL(1) |
558 |
* ------------------------------------ |
* ------------------------------------ |
559 |
* Reduced chi^2 |
* Reduced chi^2 |
560 |
CHI2 = CHI2/dble(ndof) |
CHI2 = CHI2/dble(ndof) |
|
|
|
561 |
c print*,'mini2: chi2 ',chi2 |
c print*,'mini2: chi2 ',chi2 |
562 |
|
|
563 |
11 CONTINUE |
11 CONTINUE |
564 |
|
|
565 |
if(TRKDEBUG) print*,'mini2: -ok- ',istep,chi2,1./AL(5) |
if(TRKDEBUG) print*,'mini2: -ok- ',istep,chi2,AL(5) |
566 |
|
|
567 |
NSTEP=ISTEP ! ***PP*** |
NSTEP=ISTEP ! ***PP*** |
568 |
|
|
1103 |
YM(IP) = -100. !0. |
YM(IP) = -100. !0. |
1104 |
XM_A(IP) = -100. !0. |
XM_A(IP) = -100. !0. |
1105 |
YM_A(IP) = -100. !0. |
YM_A(IP) = -100. !0. |
1106 |
c ZM_A(IP) = 0 |
ZM_A(IP) = fitz(nplanes-ip+1) !init to mech. position |
1107 |
XM_B(IP) = -100. !0. |
XM_B(IP) = -100. !0. |
1108 |
YM_B(IP) = -100. !0. |
YM_B(IP) = -100. !0. |
1109 |
c ZM_B(IP) = 0 |
ZM_B(IP) = fitz(nplanes-ip+1) !init to mech. position |
1110 |
RESX(IP) = 1000. !3.d-4 |
RESX(IP) = 1000. !3.d-4 |
1111 |
RESY(IP) = 1000. !12.d-4 |
RESY(IP) = 1000. !12.d-4 |
1112 |
XGOOD(IP) = 0 |
XGOOD(IP) = 0 |
1255 |
AL(2) = Y0 |
AL(2) = Y0 |
1256 |
tath = sqrt(AY**2+AX**2) |
tath = sqrt(AY**2+AX**2) |
1257 |
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 |
|
1258 |
|
|
1259 |
AL(4)=0. |
AL(4)=0. |
1260 |
IF( AX.NE.0.OR.AY.NE.0. ) THEN |
IF( AX.NE.0.OR.AY.NE.0. ) THEN |