314 |
do i=1,5 |
do i=1,5 |
315 |
AL_GUESS(i)=AL(i) |
AL_GUESS(i)=AL(i) |
316 |
enddo |
enddo |
317 |
|
c print*,'## guess: ',al |
318 |
|
|
319 |
do i=1,5 |
do i=1,5 |
320 |
AL(i)=dble(AL_STORE(i,icand)) |
AL(i)=dble(AL_STORE(i,icand)) |
327 |
iprint=0 |
iprint=0 |
328 |
c if(DEBUG)iprint=1 |
c if(DEBUG)iprint=1 |
329 |
if(VERBOSE)iprint=1 |
if(VERBOSE)iprint=1 |
330 |
|
if(DEBUG)iprint=2 |
331 |
call mini2(jstep,ifail,iprint) |
call mini2(jstep,ifail,iprint) |
332 |
if(ifail.ne.0) then |
if(ifail.ne.0) then |
333 |
if(.true.)then |
if(VERBOSE)then |
334 |
print *, |
print *, |
335 |
$ '*** MINIMIZATION FAILURE *** (after refinement) ' |
$ '*** MINIMIZATION FAILURE *** (after refinement) ' |
336 |
$ ,iev |
$ ,iev |
568 |
xPAM_B = 0. |
xPAM_B = 0. |
569 |
yPAM_B = 0. |
yPAM_B = 0. |
570 |
zPAM_B = 0. |
zPAM_B = 0. |
571 |
|
c print*,'## xyz_PAM: ',icx,icy,sensor,PFAx,PFAy,angx,angy |
572 |
* ----------------- |
* ----------------- |
573 |
* CLUSTER X |
* CLUSTER X |
574 |
* ----------------- |
* ----------------- |
687 |
|
|
688 |
endif |
endif |
689 |
|
|
690 |
|
c print*,'## stripx,stripy ',stripx,stripy |
691 |
|
|
692 |
c=========================================================== |
c=========================================================== |
693 |
C COUPLE |
C COUPLE |
694 |
C=========================================================== |
C=========================================================== |
890 |
|
|
891 |
endif |
endif |
892 |
|
|
893 |
|
|
894 |
|
c print*,'## xPAM,yPAM,zPAM ',xPAM,yPAM,zPAM |
895 |
|
c print*,'## xPAM_A,yPAM_A,zPAM_A ',xPAM_A,yPAM_A,zPAM_A |
896 |
|
c print*,'## xPAM_B,yPAM_B,zPAM_B ',xPAM_B,yPAM_B,zPAM_B |
897 |
|
|
898 |
100 continue |
100 continue |
899 |
end |
end |
900 |
|
|
2495 |
jstep=0 !number of minimization steps |
jstep=0 !number of minimization steps |
2496 |
iprint=0 |
iprint=0 |
2497 |
c if(DEBUG)iprint=1 |
c if(DEBUG)iprint=1 |
2498 |
if(DEBUG)iprint=1 |
if(DEBUG)iprint=2 |
2499 |
call mini2(jstep,ifail,iprint) |
call mini2(jstep,ifail,iprint) |
2500 |
if(ifail.ne.0) then |
if(ifail.ne.0) then |
2501 |
if(DEBUG)then |
if(DEBUG)then |
2872 |
endif |
endif |
2873 |
11882 continue |
11882 continue |
2874 |
enddo !end loop on cluster inside couples |
enddo !end loop on cluster inside couples |
2875 |
*----- single clusters ----------------------------------------------- |
*----- single clusters ----------------------------------------------- |
2876 |
|
c print*,'## ncls(',ip,') ',ncls(ip) |
2877 |
do ic=1,ncls(ip) !loop on single clusters |
do ic=1,ncls(ip) !loop on single clusters |
2878 |
icl=cls(ip,ic) |
icl=cls(ip,ic) |
2879 |
|
c print*,'## ic ',ic,' ist ',ist |
2880 |
c if(cl_used(icl).eq.1.or. !if the cluster is already used |
c if(cl_used(icl).eq.1.or. !if the cluster is already used |
2881 |
if(cl_used(icl).ne.0.or. !if the cluster is already used !(3) |
if(cl_used(icl).ne.0.or. !if the cluster is already used !(3) |
2882 |
$ LADDER(icl).ne.nldt.or. !or the ladder number does not match |
$ LADDER(icl).ne.nldt.or. !or the ladder number does not match |
2896 |
distance = distance_to(XP,YP) |
distance = distance_to(XP,YP) |
2897 |
distance = distance / RCHI2_STORE(ibest)!<<< MS |
distance = distance / RCHI2_STORE(ibest)!<<< MS |
2898 |
if(DEBUG)print*,'( cl-s ',icl |
if(DEBUG)print*,'( cl-s ',icl |
2899 |
$ ,' ) normalized distance ',distance |
$ ,' ) normalized distance ',distance,'<',distmin,' ?' |
2900 |
if(distance.lt.distmin)then |
if(distance.lt.distmin)then |
2901 |
|
if(DEBUG)print*,'YES' |
2902 |
xmm_A = xPAM_A |
xmm_A = xPAM_A |
2903 |
ymm_A = yPAM_A |
ymm_A = yPAM_A |
2904 |
zmm_A = zPAM_A |
zmm_A = zPAM_A |
2920 |
endif |
endif |
2921 |
18882 continue |
18882 continue |
2922 |
enddo !end loop on single clusters |
enddo !end loop on single clusters |
2923 |
|
c print*,'## distmin ', distmin,' clinc ',clinc |
2924 |
if(distmin.le.clinc)then |
if(distmin.le.clinc)then |
2925 |
|
|
2926 |
CLS_STORE(nplanes-ip+1,ibest)=iclm !<<<< |
CLS_STORE(nplanes-ip+1,ibest)=iclm !<<<< |