105 |
* ---------------------------------------------------------- |
* ---------------------------------------------------------- |
106 |
* changed in order to evaluate energy-dependent |
* changed in order to evaluate energy-dependent |
107 |
* tolerances on all 5 parameters |
* tolerances on all 5 parameters |
108 |
FACT=100. !scale factor to define tolerance on alfa |
cPP FACT=1.0e10 !scale factor to define tolerance on alfa |
109 |
c deflection error (see PDG) |
c deflection error (see PDG) |
110 |
DELETA1 = 0.01/0.3/0.4/0.4451**2*SQRT(720./(6.+4.)) |
DELETA1 = 0.01/0.3/0.4/0.4451**2*SQRT(720./(6.+4.)) |
111 |
DELETA2 = 0.016/0.3/0.4/0.4451*SQRT(0.4451/9.36) |
DELETA2 = 0.016/0.3/0.4/0.4451*SQRT(0.4451/9.36) |
267 |
ALTOL(3) = DSQRT(ALTOL(1)**2+ALTOL(2)**2)/44.51 |
ALTOL(3) = DSQRT(ALTOL(1)**2+ALTOL(2)**2)/44.51 |
268 |
ALTOL(4) = ALTOL(3) |
ALTOL(4) = ALTOL(3) |
269 |
|
|
270 |
|
c$$$ print*,' -- ',(DAL(I),ALTOL(I),' - ',i=1,5) !>>>> new step! |
271 |
|
|
272 |
*---- check tolerances: |
*---- check tolerances: |
273 |
c$$$ DO I=1,5 |
c$$$ DO I=1,5 |
274 |
c$$$ if(TRKVERBOSE)print*,i,' -- ',DAL(I),ALTOL(I) !>>>> new step! |
c$$$ if(TRKVERBOSE)print*,i,' -- ',DAL(I),ALTOL(I) !>>>> new step! |
275 |
c$$$ ENDDO |
c$$$ ENDDO |
276 |
c$$$ print*,'chi2 -- ',DCHI2 |
c$$$ print*,'chi2 -- ',DCHI2 |
277 |
|
|
278 |
IF(ISTEP.LT.3) GOTO 10 ! ***PP*** |
IF(ISTEP.LT.ISTEPMIN) GOTO 10 ! ***PP*** |
279 |
DO I=1,5 |
DO I=1,5 |
280 |
IF(ABS(DAL(I)).GT.ALTOL(I))GOTO 10 !>>>> new step! |
IF(ABS(DAL(I)).GT.ALTOL(I))GOTO 10 !>>>> new step! |
281 |
ENDDO |
ENDDO |
366 |
$ print*,'*** WARNING *** in mini n.dof = 0 (set to 1)' |
$ print*,'*** WARNING *** in mini n.dof = 0 (set to 1)' |
367 |
endif |
endif |
368 |
|
|
|
if(TRKDEBUG) print*,'mini2: -ok- ',istep,chi2,1./AL(5) |
|
|
|
|
369 |
* ------------------------------------ |
* ------------------------------------ |
370 |
* Reduced chi^2 |
* Reduced chi^2 |
371 |
CHI2 = CHI2/dble(ndof) |
CHI2 = CHI2/dble(ndof) |
374 |
|
|
375 |
11 CONTINUE |
11 CONTINUE |
376 |
|
|
377 |
|
if(TRKDEBUG) print*,'mini2: -ok- ',istep,chi2,1./AL(5) |
378 |
|
|
379 |
NSTEP=ISTEP ! ***PP*** |
NSTEP=ISTEP ! ***PP*** |
380 |
|
|
381 |
|
c$$$ print*,'>>>>> NSTEP = ',NSTEP |
382 |
|
|
383 |
RETURN |
RETURN |
384 |
END |
END |
385 |
|
|
445 |
* measured position of the cluster. |
* measured position of the cluster. |
446 |
* --------------------------------------------------------- |
* --------------------------------------------------------- |
447 |
CHI2=0. |
CHI2=0. |
448 |
DO I=1,nplanes |
DO I=1,nplanes |
449 |
IF(XGOOD(I).EQ.1.AND.YGOOD(I).EQ.0)THEN !X-cl |
IF(XGOOD(I).EQ.1.AND.YGOOD(I).EQ.0)THEN !X-cl |
450 |
BETA = (XM_B(I)-XM_A(I))/(YM_B(I)-YM_A(I)) |
BETA = (XM_B(I)-XM_A(I))/(YM_B(I)-YM_A(I)) |
451 |
ALFA = XM_A(I) - BETA * YM_A(I) |
ALFA = XM_A(I) - BETA * YM_A(I) |
640 |
c |
c |
641 |
DIMENSION AL_P(5) |
DIMENSION AL_P(5) |
642 |
* |
* |
643 |
DO I=1,nplanes |
cpp DO I=1,nplanes |
644 |
ZV(I)=ZM(I) ! |
cpp ZV(I)=ZM(I) ! |
645 |
ENDDO |
cpp ENDDO |
646 |
* |
* |
647 |
* set parameters for GRKUTA |
* set parameters for GRKUTA |
648 |
* |
* |
660 |
c$$$ print*,'POSXY (prima) ',vout |
c$$$ print*,'POSXY (prima) ',vout |
661 |
|
|
662 |
DO I=1,nplanes |
DO I=1,nplanes |
663 |
step=vout(3)-zv(i) |
cpp step=vout(3)-zv(i) |
664 |
|
step=vout(3)-zm(i) |
665 |
10 DO J=1,7 |
10 DO J=1,7 |
666 |
VECT(J)=VOUT(J) |
VECT(J)=VOUT(J) |
667 |
VECTINI(J)=VOUT(J) |
VECTINI(J)=VOUT(J) |
703 |
AYV(I)=DATAN(VOUT(5)/VOUT(6))*180./ACOS(-1.) |
AYV(I)=DATAN(VOUT(5)/VOUT(6))*180./ACOS(-1.) |
704 |
* ----------------------------------------------- |
* ----------------------------------------------- |
705 |
|
|
706 |
|
IF(TRACKMODE.EQ.1) THEN |
707 |
|
* ----------------------------------------------- |
708 |
|
* change of energy by bremsstrahlung for electrons |
709 |
|
VOUT(7) = VOUT(7) * 0.997 !0.9968 |
710 |
|
* ----------------------------------------------- |
711 |
|
ENDIF |
712 |
|
|
713 |
ENDDO |
ENDDO |
714 |
|
|
715 |
c$$$ print*,'POSXY (dopo) ',vout |
c$$$ print*,'POSXY (dopo) ',vout |
755 |
RESY(IP) = 1000. !12.d-4 |
RESY(IP) = 1000. !12.d-4 |
756 |
XGOOD(IP) = 0 |
XGOOD(IP) = 0 |
757 |
YGOOD(IP) = 0 |
YGOOD(IP) = 0 |
758 |
|
DEDXTRK_X(IP) = 0 |
759 |
|
DEDXTRK_Y(IP) = 0 |
760 |
|
AXV(IP) = 0 |
761 |
|
AYV(IP) = 0 |
762 |
|
XV(IP) = -100 |
763 |
|
YV(IP) = -100 |
764 |
enddo |
enddo |
765 |
|
|
766 |
return |
return |
833 |
ENDDO |
ENDDO |
834 |
IFLAG=0 !no debug mode |
IFLAG=0 !no debug mode |
835 |
CALL TRICIRCLE(NP,XP,ZP,AP,RP,CHI,XC,ZC,RADIUS,IFLAG) |
CALL TRICIRCLE(NP,XP,ZP,AP,RP,CHI,XC,ZC,RADIUS,IFLAG) |
836 |
c print*,' circle: ',XC,ZC,RADIUS,' --- ',CHI,IFLAG |
|
837 |
|
c$$$ print*,' circle: ',XC,ZC,RADIUS,' --- ',CHI,IFLAG |
838 |
|
c$$$ print*,' XP ',(xp(i),i=1,np) |
839 |
|
c$$$ print*,' ZP ',(zp(i),i=1,np) |
840 |
|
c$$$ print*,' AP ',(ap(i),i=1,np) |
841 |
|
c$$$ print*,' XP ',(rp(i),i=1,np) |
842 |
|
|
843 |
IF(IFLAG.NE.0)GOTO 10 !straigth fit |
IF(IFLAG.NE.0)GOTO 10 !straigth fit |
844 |
if(CHI.gt.100)GOTO 10 !straigth fit |
c if(CHI.gt.100)GOTO 10 !straigth fit |
845 |
ARG = RADIUS**2-(ZINI-ZC)**2 |
ARG = RADIUS**2-(ZINI-ZC)**2 |
846 |
IF(ARG.LT.0)GOTO 10 !straigth fit |
IF(ARG.LT.0)GOTO 10 !straigth fit |
847 |
DC = SQRT(ARG) |
DC = SQRT(ARG) |
851 |
DEF=100./(RADIUS*0.3*0.43) |
DEF=100./(RADIUS*0.3*0.43) |
852 |
IF(XC.GT.0)DEF=-DEF |
IF(XC.GT.0)DEF=-DEF |
853 |
|
|
854 |
|
|
855 |
|
|
856 |
IF(ABS(X0).GT.30)THEN |
IF(ABS(X0).GT.30)THEN |
857 |
c$$$ PRINT*,'STRANGE GUESS: XC,ZC,R ',XC,ZC,RADIUS |
c$$$ PRINT*,'STRANGE GUESS: XC,ZC,R ',XC,ZC,RADIUS |
858 |
c$$$ $ ,' - CHI ',CHI,' - X0,AX,DEF ',X0,AX,DEF |
c$$$ $ ,' - CHI ',CHI,' - X0,AX,DEF ',X0,AX,DEF |