43 |
|
|
44 |
c DATA ALMAX/dinf,dinf,1.,dinf,dinf/ !limits on alpha vector components |
c DATA ALMAX/dinf,dinf,1.,dinf,dinf/ !limits on alpha vector components |
45 |
c DATA ALMIN/-dinf,-dinf,-1.,-dinf,-dinf/ !" |
c DATA ALMIN/-dinf,-dinf,-1.,-dinf,-dinf/ !" |
46 |
DATA ALMAX/dinf,dinf,dinf,dinf,dinf/ !limits on alpha vector components |
DATA ALMAX/dinf,dinf,1.,dinf,dinf/ !limits on alpha vector components |
47 |
DATA ALMIN/-dinf,-dinf,-dinf,-dinf,-dinf/ !" |
DATA ALMIN/-dinf,-dinf,-1.,-dinf,-dinf/ !" |
48 |
|
|
49 |
DIMENSION DAL(5) !increment of vector alfa |
DIMENSION DAL(5) !increment of vector alfa |
50 |
DIMENSION CHI2DD_R(4,4),CHI2D_R(4) !hessiano e gradiente di chi2 |
DIMENSION CHI2DD_R(4,4),CHI2D_R(4) !hessiano e gradiente di chi2 |
140 |
RETURN |
RETURN |
141 |
ENDIF |
ENDIF |
142 |
|
|
143 |
COST=1e-7 |
COST=1e-5 |
144 |
DO I=1,5 |
DO I=1,5 |
145 |
DO J=1,5 |
DO J=1,5 |
146 |
CHI2DD(I,J)=CHI2DD(I,J)*COST |
CHI2DD(I,J)=CHI2DD(I,J)*COST |
272 |
c$$$ ENDDO |
c$$$ ENDDO |
273 |
c$$$ print*,'chi2 -- ',DCHI2 |
c$$$ print*,'chi2 -- ',DCHI2 |
274 |
|
|
275 |
|
IF(ISTEP.LT.3) GOTO 10 ! ***PP*** |
276 |
DO I=1,5 |
DO I=1,5 |
277 |
IF(ABS(DAL(I)).GT.ALTOL(I))GOTO 10 !>>>> new step! |
IF(ABS(DAL(I)).GT.ALTOL(I))GOTO 10 !>>>> new step! |
278 |
ENDDO |
ENDDO |
467 |
+ *( XGOOD(I)*(1-YGOOD(I)) ) |
+ *( XGOOD(I)*(1-YGOOD(I)) ) |
468 |
+ +((XV(I)-XM(I))**2+(YV(I)-YM(I))**2)/RESY(i)**2 |
+ +((XV(I)-XM(I))**2+(YV(I)-YM(I))**2)/RESY(i)**2 |
469 |
+ *( (1-XGOOD(I))*YGOOD(I) ) |
+ *( (1-XGOOD(I))*YGOOD(I) ) |
470 |
|
c$$$ print*,(XV(I)-XM(I))**2/RESX(i)**2 *( XGOOD(I)*YGOOD(I) ) |
471 |
|
c$$$ print*,(YV(I)-YM(I))**2/RESY(i)**2 *( YGOOD(I)*XGOOD(I) ) |
472 |
|
c$$$ print*,((XV(I)-XM(I))**2+(YV(I)-YM(I))**2)/RESX(i)**2 |
473 |
|
c$$$ + *( XGOOD(I)*(1-YGOOD(I)) ) |
474 |
|
c$$$ print*,((XV(I)-XM(I))**2+(YV(I)-YM(I))**2)/RESY(i)**2 |
475 |
|
c$$$ + *( (1-XGOOD(I))*YGOOD(I) ) |
476 |
|
c$$$ print*,XV(I),XM(I),XGOOD(I) |
477 |
|
c$$$ print*,YV(I),YM(I),YGOOD(I) |
478 |
ENDDO |
ENDDO |
479 |
c print*,'CHISQ ',chi2 |
c$$$ print*,'CHISQ ',chi2 |
480 |
* ------------------------------------------------ |
* ------------------------------------------------ |
481 |
* |
* |
482 |
* calculation of derivatives (dX/dAL_fa and dY/dAL_fa) |
* calculation of derivatives (dX/dAL_fa and dY/dAL_fa) |
652 |
IF(AL_P(5).NE.0.) VOUT(7)=DABS(1./AL_P(5)) |
IF(AL_P(5).NE.0.) VOUT(7)=DABS(1./AL_P(5)) |
653 |
IF(AL_P(5).EQ.0.) VOUT(7)=1.E8 |
IF(AL_P(5).EQ.0.) VOUT(7)=1.E8 |
654 |
|
|
655 |
c$$$ print*,'POSXY ',vout |
c$$$ print*,'POSXY (prima) ',vout |
656 |
|
|
657 |
DO I=1,nplanes |
DO I=1,nplanes |
658 |
step=vout(3)-zv(i) |
step=vout(3)-zv(i) |
687 |
GOTO 11 |
GOTO 11 |
688 |
ENDIF |
ENDIF |
689 |
|
|
690 |
|
|
691 |
* ----------------------------------------------- |
* ----------------------------------------------- |
692 |
* evaluate track coordinates |
* evaluate track coordinates |
693 |
100 XV(I)=VOUT(1) |
100 XV(I)=VOUT(1) |
699 |
|
|
700 |
ENDDO |
ENDDO |
701 |
|
|
702 |
|
c$$$ print*,'POSXY (dopo) ',vout |
703 |
|
|
704 |
|
|
705 |
RETURN |
RETURN |
706 |
END |
END |
707 |
|
|
827 |
IF(XC.GT.0)DEF=-DEF |
IF(XC.GT.0)DEF=-DEF |
828 |
|
|
829 |
IF(ABS(X0).GT.30)THEN |
IF(ABS(X0).GT.30)THEN |
830 |
PRINT*,'STRANGE GUESS: XC,ZC,R ',XC,ZC,RADIUS |
c$$$ PRINT*,'STRANGE GUESS: XC,ZC,R ',XC,ZC,RADIUS |
831 |
$ ,' - CHI ',CHI,' - X0,AX,DEF ',X0,AX,DEF |
c$$$ $ ,' - CHI ',CHI,' - X0,AX,DEF ',X0,AX,DEF |
832 |
GOTO 10 !straigth fit |
GOTO 10 !straigth fit |
833 |
ENDIF |
ENDIF |
834 |
GOTO 20 !guess is ok |
GOTO 20 !guess is ok |
872 |
AL(2) = Y0 |
AL(2) = Y0 |
873 |
tath = sqrt(AY**2+AX**2) |
tath = sqrt(AY**2+AX**2) |
874 |
AL(3) = tath/sqrt(1+tath**2) |
AL(3) = tath/sqrt(1+tath**2) |
875 |
IF(AX.NE.0)THEN |
c$$$ IF(AX.NE.0)THEN |
876 |
AL(4)= atan(AY/AX) |
c$$$ AL(4)= atan(AY/AX) |
877 |
ELSE |
c$$$ ELSE |
878 |
AL(4) = acos(-1.)/2 |
c$$$ AL(4) = acos(-1.)/2 |
879 |
IF(AY.LT.0)AL(4) = AL(4)+acos(-1.) |
c$$$ IF(AY.LT.0)AL(4) = AL(4)+acos(-1.) |
880 |
|
c$$$ ENDIF |
881 |
|
c$$$ IF(AX.LT.0)AL(4)= acos(-1.)+ AL(4) |
882 |
|
c$$$ AL(4) = -acos(-1.) + AL(4) !from incidence direction to tracking ref.sys. |
883 |
|
|
884 |
|
c$$$ AL(4) = 0. |
885 |
|
c$$$ IF(AX.NE.0.AND.AY.NE.0)THEN |
886 |
|
c$$$ AL(4)= atan(AY/AX) |
887 |
|
c$$$ ELSEIF(AY.EQ.0)THEN |
888 |
|
c$$$ AL(4) = 0. |
889 |
|
c$$$ IF(AX.LT.0)AL(4) = AL(4)+acos(-1.) |
890 |
|
c$$$ ELSEIF(AX.EQ.0)THEN |
891 |
|
c$$$ AL(4) = acos(-1.)/2 |
892 |
|
c$$$ IF(AY.LT.0)AL(4) = AL(4)+acos(-1.) |
893 |
|
c$$$ ENDIF |
894 |
|
c$$$ IF(AX.LT.0)AL(4)= acos(-1.)+ AL(4) |
895 |
|
c$$$ AL(4) = -acos(-1.) + AL(4) !from incidence direction to tracking ref.sys. |
896 |
|
|
897 |
|
c$$$ AL(4)=0. |
898 |
|
c$$$ IF( AX.NE.0.OR.AY.NE.0. ) THEN |
899 |
|
c$$$ AL(4) = ASIN(AY/SQRT(AX**2+AY**2)) |
900 |
|
c$$$ IF(AX.LT.0.) AL(4) = ACOS(-1.0)-AL(4) |
901 |
|
c$$$ ENDIF |
902 |
|
|
903 |
|
AL(4)=0. |
904 |
|
IF( AX.NE.0.OR.AY.NE.0. ) THEN |
905 |
|
AL(4) = ASIN(AY/SQRT(AX**2+AY**2)) |
906 |
|
IF(AX.LT.0.AND.AY.GE.0) AL(4) = ACOS(-1.0)-AL(4) |
907 |
|
IF(AX.LT.0.AND.AY.LT.0) AL(4) = -ACOS(-1.0)-AL(4) |
908 |
ENDIF |
ENDIF |
909 |
IF(AX.LT.0)AL(4)= acos(-1.)+ AL(4) |
IF(AY.GT.0.) AL(4) = AL(4)-ACOS(-1.0) |
910 |
AL(4) = -acos(-1.) + AL(4) !from incidence direction to tracking rs |
IF(AY.LE.0.) AL(4) = AL(4)+ACOS(-1.0) |
911 |
|
|
912 |
AL(5) = DEF |
AL(5) = DEF |
913 |
|
|
914 |
c print*,' guess: ',(al(i),i=1,5) |
c print*,' guess: ',(al(i),i=1,5) |