| 271 |
*------------------------------------------------------------------------------- |
*------------------------------------------------------------------------------- |
| 272 |
ccc ntrk=0 !counter of identified physical tracks |
ccc ntrk=0 !counter of identified physical tracks |
| 273 |
|
|
| 274 |
11111 continue !<<<<<<< come here when performing a new search |
c11111 continue !<<<<<<< come here when performing a new search |
| 275 |
|
continue !<<<<<<< come here when performing a new search |
| 276 |
|
|
| 277 |
if(nclouds_xz.eq.0)goto 880 !go to next event |
if(nclouds_xz.eq.0)goto 880 !go to next event |
| 278 |
if(nclouds_yz.eq.0)goto 880 !go to next event |
if(nclouds_yz.eq.0)goto 880 !go to next event |
| 303 |
* 1st) decreasing n.points |
* 1st) decreasing n.points |
| 304 |
* 2nd) increasing chi**2 |
* 2nd) increasing chi**2 |
| 305 |
* ------------------------------------------------------- |
* ------------------------------------------------------- |
| 306 |
rchi2best=1000000000. |
rchi2best=1000000000. |
| 307 |
ndofbest=0 |
ndofbest=0 |
| 308 |
do i=1,ntracks |
do i=1,ntracks |
| 309 |
ndof=0 |
ndof=0 |
| 377 |
if(VERBOSE.EQ.1)iprint=1 |
if(VERBOSE.EQ.1)iprint=1 |
| 378 |
if(DEBUG.EQ.1)iprint=2 |
if(DEBUG.EQ.1)iprint=2 |
| 379 |
call mini2(jstep,ifail,iprint) |
call mini2(jstep,ifail,iprint) |
| 380 |
if(ifail.ne.0) then |
cc if(ifail.ne.0) then |
| 381 |
|
if(ifail.ne.0.or.CHI2.ne.CHI2) then !new |
| 382 |
|
if(CHI2.ne.CHI2)CHI2=-9999. !new |
| 383 |
if(VERBOSE.EQ.1)then |
if(VERBOSE.EQ.1)then |
| 384 |
print *, |
print *, |
| 385 |
$ '*** MINIMIZATION FAILURE *** (after refinement) ' |
$ '*** MINIMIZATION FAILURE *** (after refinement) ' |
| 386 |
$ ,iev |
$ ,iev |
|
|
|
| 387 |
endif |
endif |
| 388 |
endif |
endif |
| 389 |
|
|
| 706 |
stripx = stripx + corr |
stripx = stripx + corr |
| 707 |
resxPAM = res |
resxPAM = res |
| 708 |
|
|
| 709 |
10 endif |
10 continue |
| 710 |
|
endif |
| 711 |
|
|
| 712 |
* ----------------- |
* ----------------- |
| 713 |
* CLUSTER Y |
* CLUSTER Y |
| 753 |
stripy = stripy + corr |
stripy = stripy + corr |
| 754 |
resyPAM = res |
resyPAM = res |
| 755 |
|
|
| 756 |
20 endif |
20 continue |
| 757 |
|
endif |
| 758 |
|
|
| 759 |
|
|
| 760 |
c=========================================================== |
c=========================================================== |
| 1584 |
integer iflag |
integer iflag |
| 1585 |
|
|
| 1586 |
integer badseed,badclx,badcly |
integer badseed,badclx,badcly |
| 1587 |
|
|
| 1588 |
|
iflag = iflag |
| 1589 |
if(DEBUG.EQ.1)print*,'cl_to_couples:' |
if(DEBUG.EQ.1)print*,'cl_to_couples:' |
| 1590 |
|
|
| 1591 |
cc if(RECOVER_SINGLETS.and..not.SECOND_SEARCH)goto 80 |
cc if(RECOVER_SINGLETS.and..not.SECOND_SEARCH)goto 80 |
| 1771 |
$ ,'( ',ncouplemax,' ) --> masked!' |
$ ,'( ',ncouplemax,' ) --> masked!' |
| 1772 |
c mask_view(nviewx(nplx)) = 2 |
c mask_view(nviewx(nplx)) = 2 |
| 1773 |
c mask_view(nviewy(nply)) = 2 |
c mask_view(nviewy(nply)) = 2 |
| 1774 |
mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 |
mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 |
| 1775 |
mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 |
mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 |
| 1776 |
goto 10 |
goto 10 |
| 1777 |
endif |
endif |
| 1778 |
|
|
| 1800 |
endif |
endif |
| 1801 |
enddo |
enddo |
| 1802 |
|
|
| 1803 |
80 continue |
c 80 continue |
| 1804 |
|
continue |
| 1805 |
|
|
| 1806 |
|
|
| 1807 |
if(DEBUG.EQ.1)then |
if(DEBUG.EQ.1)then |
| 2129 |
SZX=SZX+ZP(I)*XX |
SZX=SZX+ZP(I)*XX |
| 2130 |
SSX=SSX+XX |
SSX=SSX+XX |
| 2131 |
SZ=SZ+ZP(I) |
SZ=SZ+ZP(I) |
| 2132 |
S1=S1+1. |
S1=S1+1. |
| 2133 |
ENDDO |
ENDDO |
| 2134 |
DET=SZZ*S1-SZ*SZ |
DET=SZZ*S1-SZ*SZ |
| 2135 |
AX=(SZX*S1-SZ*SSX)/DET |
AX=(SZX*S1-SZ*SSX)/DET |
| 2215 |
enddo !end loop on planes - COPPIA 3 |
enddo !end loop on planes - COPPIA 3 |
| 2216 |
|
|
| 2217 |
31 continue |
31 continue |
| 2218 |
1 enddo !end loop on COPPIA 2 |
c 1 enddo !end loop on COPPIA 2 |
| 2219 |
|
enddo !end loop on COPPIA 2 |
| 2220 |
enddo !end loop on sensors - COPPIA 2 |
enddo !end loop on sensors - COPPIA 2 |
| 2221 |
20 continue |
20 continue |
| 2222 |
enddo !end loop on planes - COPPIA 2 |
enddo !end loop on planes - COPPIA 2 |
| 2223 |
|
|
| 2224 |
11 continue |
c 11 continue |
| 2225 |
|
continue |
| 2226 |
enddo !end loop on COPPIA1 |
enddo !end loop on COPPIA1 |
| 2227 |
enddo !end loop on sensors - COPPIA 1 |
enddo !end loop on sensors - COPPIA 1 |
| 2228 |
10 continue |
10 continue |
| 2329 |
* doublet distance in parameter space |
* doublet distance in parameter space |
| 2330 |
distance= |
distance= |
| 2331 |
$ ((alfayz1(idbref)-alfayz1(idb2))/Dalfayz1)**2 |
$ ((alfayz1(idbref)-alfayz1(idb2))/Dalfayz1)**2 |
| 2332 |
$ +((alfayz2(idbref)-alfayz2(idb2))/Dalfayz2)**2 |
$ +((alfayz2(idbref)-alfayz2(idb2))/Dalfayz2)**2 |
| 2333 |
distance = sqrt(distance) |
distance = sqrt(distance) |
| 2334 |
|
|
| 2335 |
if(distance.lt.cutdistyz)then |
if(distance.lt.cutdistyz)then |
| 2354 |
1118 continue |
1118 continue |
| 2355 |
enddo !end loop (2) on DOUBLETS |
enddo !end loop (2) on DOUBLETS |
| 2356 |
|
|
| 2357 |
1188 continue |
c 1188 continue |
| 2358 |
|
continue |
| 2359 |
enddo !end loop on... bo? |
enddo !end loop on... bo? |
| 2360 |
|
|
| 2361 |
nptloop=npv |
nptloop=npv |
| 2543 |
* solo i due parametri spaziali per il momemnto |
* solo i due parametri spaziali per il momemnto |
| 2544 |
distance= |
distance= |
| 2545 |
$ ((alfaxz1(itrref)-alfaxz1(itr2))/Dalfaxz1)**2 |
$ ((alfaxz1(itrref)-alfaxz1(itr2))/Dalfaxz1)**2 |
| 2546 |
$ +((alfaxz2(itrref)-alfaxz2(itr2))/Dalfaxz2)**2 |
$ +((alfaxz2(itrref)-alfaxz2(itr2))/Dalfaxz2)**2 |
| 2547 |
distance = sqrt(distance) |
distance = sqrt(distance) |
| 2548 |
|
|
| 2549 |
|
|
| 2582 |
11188 continue |
11188 continue |
| 2583 |
enddo !end loop (2) on TRIPLETS |
enddo !end loop (2) on TRIPLETS |
| 2584 |
|
|
| 2585 |
11888 continue |
c11888 continue |
| 2586 |
|
continue |
| 2587 |
enddo !end loop on... bo? |
enddo !end loop on... bo? |
| 2588 |
|
|
| 2589 |
nptloop=npv |
nptloop=npv |
| 2648 |
npt_tot=npt_tot+npt |
npt_tot=npt_tot+npt |
| 2649 |
|
|
| 2650 |
if(DEBUG.EQ.1)then |
if(DEBUG.EQ.1)then |
| 2651 |
print*,'>>>> cloud ',nclouds_xz,' --- ',npt,' points' |
print*,'>>>> cloud ',nclouds_xz,' --- ',npt,' points' |
| 2652 |
print*,'- alfaxz1 ',alfaxz1_av(nclouds_xz) |
print*,'- alfaxz1 ',alfaxz1_av(nclouds_xz) |
| 2653 |
print*,'- alfaxz2 ',alfaxz2_av(nclouds_xz) |
print*,'- alfaxz2 ',alfaxz2_av(nclouds_xz) |
| 2654 |
print*,'- alfaxz3 ',alfaxz3_av(nclouds_xz) |
print*,'- alfaxz3 ',alfaxz3_av(nclouds_xz) |
| 2951 |
xm(nplanes-ip+1)=xPAM |
xm(nplanes-ip+1)=xPAM |
| 2952 |
ym(nplanes-ip+1)=yPAM |
ym(nplanes-ip+1)=yPAM |
| 2953 |
zm(nplanes-ip+1)=zPAM |
zm(nplanes-ip+1)=zPAM |
| 2954 |
resx(nplanes-ip+1)=resxPAM |
resx(nplanes-ip+1)=resxPAM |
| 2955 |
resy(nplanes-ip+1)=resyPAM |
resy(nplanes-ip+1)=resyPAM |
| 2956 |
if(DEBUG.EQ.1)print*,'(X,Y)' |
if(DEBUG.EQ.1)print*,'(X,Y)' |
| 2957 |
$ ,nplanes-ip+1,xPAM,yPAM |
$ ,nplanes-ip+1,xPAM,yPAM |
| 2962 |
ym_B(nplanes-ip+1) = yPAM_B |
ym_B(nplanes-ip+1) = yPAM_B |
| 2963 |
zm(nplanes-ip+1) |
zm(nplanes-ip+1) |
| 2964 |
$ = (zPAM_A+zPAM_B)/2. |
$ = (zPAM_A+zPAM_B)/2. |
| 2965 |
resx(nplanes-ip+1) = resxPAM |
resx(nplanes-ip+1) = resxPAM |
| 2966 |
resy(nplanes-ip+1) = resyPAM |
resy(nplanes-ip+1) = resyPAM |
| 2967 |
if(icx.eq.0.and.icy.gt.0)then |
if(icx.eq.0.and.icy.gt.0)then |
| 2968 |
xgood(nplanes-ip+1)=0. |
xgood(nplanes-ip+1)=0. |
| 3021 |
* ********************************************************** |
* ********************************************************** |
| 3022 |
|
|
| 3023 |
if(chi2.le.0.)goto 666 |
if(chi2.le.0.)goto 666 |
| 3024 |
|
if(chi2.ge.1.e08)goto 666 !OPTIMIZATION |
| 3025 |
|
if(chi2.ne.chi2)goto 666 !OPTIMIZATION |
| 3026 |
|
|
| 3027 |
* -------------------------- |
* -------------------------- |
| 3028 |
* STORE candidate TRACK INFO |
* STORE candidate TRACK INFO |
| 3049 |
|
|
| 3050 |
XV_STORE(ip,ntracks)=sngl(xv(ip)) |
XV_STORE(ip,ntracks)=sngl(xv(ip)) |
| 3051 |
YV_STORE(ip,ntracks)=sngl(yv(ip)) |
YV_STORE(ip,ntracks)=sngl(yv(ip)) |
| 3052 |
ZV_STORE(ip,ntracks)=sngl(zv(ip)) |
ZV_STORE(ip,ntracks)=sngl(zv(ip)) |
| 3053 |
XM_STORE(ip,ntracks)=sngl(xm(ip)) |
XM_STORE(ip,ntracks)=sngl(xm(ip)) |
| 3054 |
YM_STORE(ip,ntracks)=sngl(ym(ip)) |
YM_STORE(ip,ntracks)=sngl(ym(ip)) |
| 3055 |
ZM_STORE(ip,ntracks)=sngl(zm(ip)) |
ZM_STORE(ip,ntracks)=sngl(zm(ip)) |
| 3893 |
|
|
| 3894 |
cl_used(cltrx(ip,ntr)) = 1 !tag used clusters |
cl_used(cltrx(ip,ntr)) = 1 !tag used clusters |
| 3895 |
|
|
| 3896 |
xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) |
xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) |
| 3897 |
|
|
| 3898 |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) |
| 3899 |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
$ dedx_x(ip,ntr)=-dedx_x(ip,ntr) |
| 4114 |
alfayz2_av_nt(iyz)=alfayz2_av(iyz) |
alfayz2_av_nt(iyz)=alfayz2_av(iyz) |
| 4115 |
nnn=nnn+ptcloud_yz(iyz) |
nnn=nnn+ptcloud_yz(iyz) |
| 4116 |
enddo |
enddo |
| 4117 |
do ipt=1,nnn |
do ipt=1,min(ndblt_max_nt,nnn) |
| 4118 |
db_cloud_nt(ipt)=db_cloud(ipt) |
db_cloud_nt(ipt)=db_cloud(ipt) |
| 4119 |
enddo |
enddo |
| 4120 |
endif |
endif |
| 4127 |
alfaxz3_av_nt(ixz)=alfaxz3_av(ixz) |
alfaxz3_av_nt(ixz)=alfaxz3_av(ixz) |
| 4128 |
nnn=nnn+ptcloud_xz(ixz) |
nnn=nnn+ptcloud_xz(ixz) |
| 4129 |
enddo |
enddo |
| 4130 |
do ipt=1,nnn |
do ipt=1,min(ntrpt_max_nt,nnn) |
| 4131 |
tr_cloud_nt(ipt)=tr_cloud(ipt) |
tr_cloud_nt(ipt)=tr_cloud(ipt) |
| 4132 |
enddo |
enddo |
| 4133 |
endif |
endif |