311 |
c $ ,iimage,fimage,ntrk,image(ntrk) |
c $ ,iimage,fimage,ntrk,image(ntrk) |
312 |
|
|
313 |
if(ntrk.eq.NTRKMAX)then |
if(ntrk.eq.NTRKMAX)then |
314 |
if(DEBUG) |
if(verbose) |
315 |
$ print*, |
$ print*, |
316 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
317 |
$ 'tracks exceeds vector dimension ' |
$ 'tracks exceeds vector dimension ' |
702 |
endif |
endif |
703 |
|
|
704 |
endif |
endif |
705 |
|
c if(icy.eq.0.and.icx.ne.0) |
706 |
|
c $ print*,PFAx,icx,angx,stripx,resxPAM,'***' |
707 |
|
|
708 |
* ----------------- |
* ----------------- |
709 |
* CLUSTER Y |
* CLUSTER Y |
775 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
776 |
c (xi,yi,zi) = mechanical coordinates in the silicon sensor frame |
c (xi,yi,zi) = mechanical coordinates in the silicon sensor frame |
777 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
778 |
|
if(((mod(int(stripx+0.5)-1,1024)+1).le.3) |
779 |
|
$ .or.((mod(int(stripx+0.5)-1,1024)+1).ge.1022)) then !X has 1018 strips... |
780 |
|
print*,'xyz_PAM (couple):', |
781 |
|
$ ' WARNING: false X strip: strip ',stripx |
782 |
|
endif |
783 |
xi = acoordsi(stripx,viewx) |
xi = acoordsi(stripx,viewx) |
784 |
yi = acoordsi(stripy,viewy) |
yi = acoordsi(stripy,viewy) |
785 |
zi = 0. |
zi = 0. |
866 |
nldy = nldx |
nldy = nldx |
867 |
viewy = viewx - 1 |
viewy = viewx - 1 |
868 |
|
|
869 |
|
c print*,'X-singlet ',icx,nplx,nldx,viewx,stripx |
870 |
|
c if((stripx.le.3).or.(stripx.ge.1022)) then !X has 1018 strips... |
871 |
|
if(((mod(int(stripx+0.5)-1,1024)+1).le.3) |
872 |
|
$ .or.((mod(int(stripx+0.5)-1,1024)+1).ge.1022)) then !X has 1018 strips... |
873 |
|
print*,'xyz_PAM (X-singlet):', |
874 |
|
$ ' WARNING: false X strip: strip ',stripx |
875 |
|
endif |
876 |
xi = acoordsi(stripx,viewx) |
xi = acoordsi(stripx,viewx) |
877 |
|
|
878 |
xi_A = xi |
xi_A = xi |
1151 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
1152 |
c (xi,yi,zi) = mechanical coordinates in the silicon sensor frame |
c (xi,yi,zi) = mechanical coordinates in the silicon sensor frame |
1153 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
1154 |
|
if(((mod(int(stripx+0.5)-1,1024)+1).le.3) |
1155 |
|
$ .or.((mod(int(stripx+0.5)-1,1024)+1).ge.1022)) then !X has 1018 strips... |
1156 |
|
c if((stripx.le.3).or.(stripx.ge.1022)) then !X has 1018 strips... |
1157 |
|
print*,'whichsensor: ', |
1158 |
|
$ ' WARNING: false X strip: strip ',stripx |
1159 |
|
endif |
1160 |
xi = acoordsi(stripx,viewx) |
xi = acoordsi(stripx,viewx) |
1161 |
yi = acoordsi(stripy,viewy) |
yi = acoordsi(stripy,viewy) |
1162 |
zi = 0. |
zi = 0. |
1702 |
|
|
1703 |
* ---------------------------------------------------- |
* ---------------------------------------------------- |
1704 |
* cut on charge (X VIEW) |
* cut on charge (X VIEW) |
1705 |
|
* ---------------------------------------------------- |
1706 |
if(dedx(icx).lt.dedx_x_min)then |
if(dedx(icx).lt.dedx_x_min)then |
1707 |
cl_single(icx)=0 |
cl_single(icx)=0 |
1708 |
goto 10 |
goto 10 |
1709 |
endif |
endif |
1710 |
|
* ---------------------------------------------------- |
1711 |
* cut BAD (X VIEW) |
* cut BAD (X VIEW) |
1712 |
|
* ---------------------------------------------------- |
1713 |
badseed=BAD(VIEW(icx),nvk(MAXS(icx)),nst(MAXS(icx))) |
badseed=BAD(VIEW(icx),nvk(MAXS(icx)),nst(MAXS(icx))) |
1714 |
ifirst=INDSTART(icx) |
ifirst=INDSTART(icx) |
1715 |
if(icx.ne.nclstr1) then |
if(icx.ne.nclstr1) then |
1729 |
endif |
endif |
1730 |
badcl=badcl*ibad |
badcl=badcl*ibad |
1731 |
enddo |
enddo |
1732 |
|
* ---------------------------------------------------- |
1733 |
|
* >>> eliminato il taglio sulle BAD <<< |
1734 |
|
* ---------------------------------------------------- |
1735 |
c if(badcl.eq.0)then |
c if(badcl.eq.0)then |
1736 |
c cl_single(icx)=0 |
c cl_single(icx)=0 |
1737 |
c goto 10 |
c goto 10 |
1747 |
|
|
1748 |
* ---------------------------------------------------- |
* ---------------------------------------------------- |
1749 |
* cut on charge (Y VIEW) |
* cut on charge (Y VIEW) |
1750 |
|
* ---------------------------------------------------- |
1751 |
if(dedx(icy).lt.dedx_y_min)then |
if(dedx(icy).lt.dedx_y_min)then |
1752 |
cl_single(icy)=0 |
cl_single(icy)=0 |
1753 |
goto 20 |
goto 20 |
1754 |
endif |
endif |
1755 |
|
* ---------------------------------------------------- |
1756 |
* cut BAD (Y VIEW) |
* cut BAD (Y VIEW) |
1757 |
|
* ---------------------------------------------------- |
1758 |
badseed=BAD(VIEW(icy),nvk(MAXS(icy)),nst(MAXS(icy))) |
badseed=BAD(VIEW(icy),nvk(MAXS(icy)),nst(MAXS(icy))) |
1759 |
ifirst=INDSTART(icy) |
ifirst=INDSTART(icy) |
1760 |
if(icy.ne.nclstr1) then |
if(icy.ne.nclstr1) then |
1773 |
$ nst(MAXS(icy)+igood)) |
$ nst(MAXS(icy)+igood)) |
1774 |
badcl=badcl*ibad |
badcl=badcl*ibad |
1775 |
enddo |
enddo |
1776 |
|
* ---------------------------------------------------- |
1777 |
|
* >>> eliminato il taglio sulle BAD <<< |
1778 |
|
* ---------------------------------------------------- |
1779 |
c if(badcl.eq.0)then |
c if(badcl.eq.0)then |
1780 |
c cl_single(icy)=0 |
c cl_single(icy)=0 |
1781 |
c goto 20 |
c goto 20 |
1782 |
c endif |
c endif |
1783 |
* ---------------------------------------------------- |
* ---------------------------------------------------- |
1784 |
|
|
|
|
|
1785 |
cl_good(icy)=1 |
cl_good(icy)=1 |
1786 |
nply=npl(VIEW(icy)) |
nply=npl(VIEW(icy)) |
1787 |
nldy=nld(MAXS(icy),VIEW(icy)) |
nldy=nld(MAXS(icy),VIEW(icy)) |
1792 |
* geometrical consistency (same plane and ladder) |
* geometrical consistency (same plane and ladder) |
1793 |
if(nply.eq.nplx.and.nldy.eq.nldx)then |
if(nply.eq.nplx.and.nldy.eq.nldx)then |
1794 |
* charge correlation |
* charge correlation |
1795 |
ddd=(dedx(icy) |
* (modified to be applied only below saturation... obviously) |
1796 |
$ -kch(nplx,nldx)*dedx(icx)-cch(nplx,nldx)) |
|
1797 |
ddd=ddd/sqrt(kch(nplx,nldx)**2+1) |
* ------------------------------------------------------------- |
1798 |
cut=chcut*sch(nplx,nldx) |
* >>> eliminata (TEMPORANEAMENTE) la correlazione di carica <<< |
1799 |
if(abs(ddd).gt.cut)goto 20 !charge not consistent |
* ------------------------------------------------------------- |
1800 |
|
c$$$ if(dedx(icy).lt.chsaty.or.dedx(icx).lt.chsatx)then |
1801 |
|
c$$$ ddd=(dedx(icy) |
1802 |
|
c$$$ $ -kch(nplx,nldx)*dedx(icx)-cch(nplx,nldx)) |
1803 |
|
c$$$ ddd=ddd/sqrt(kch(nplx,nldx)**2+1) |
1804 |
|
c$$$ cut=chcut*sch(nplx,nldx) |
1805 |
|
c$$$ if(abs(ddd).gt.cut)goto 20 !charge not consistent |
1806 |
|
c$$$ endif |
1807 |
|
|
1808 |
* ------------------> COUPLE <------------------ |
* ------------------> COUPLE <------------------ |
1809 |
* check to do not overflow vector dimentions |
* check to do not overflow vector dimentions |
1810 |
if(ncp_plane(nplx).gt.ncouplemax)then |
c$$$ if(ncp_plane(nplx).gt.ncouplemax)then |
1811 |
if(DEBUG)print*, |
c$$$ if(DEBUG)print*, |
1812 |
$ ' ** warning ** number of identified'// |
c$$$ $ ' ** warning ** number of identified'// |
1813 |
$ ' couples on plane ',nplx, |
c$$$ $ ' couples on plane ',nplx, |
1814 |
$ ' exceeds vector dimention'// |
c$$$ $ ' exceeds vector dimention'// |
1815 |
$ ' ( ',ncouplemax,' )' |
c$$$ $ ' ( ',ncouplemax,' )' |
1816 |
c good2=.false. |
c$$$c good2=.false. |
1817 |
c goto 880 !fill ntp and go to next event |
c$$$c goto 880 !fill ntp and go to next event |
1818 |
iflag=1 |
c$$$ iflag=1 |
1819 |
return |
c$$$ return |
1820 |
endif |
c$$$ endif |
1821 |
|
|
1822 |
if(ncp_plane(nplx).eq.ncouplemax)then |
if(ncp_plane(nplx).eq.ncouplemax)then |
1823 |
if(DEBUG)print*, |
if(verbose)print*, |
1824 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
1825 |
$ 'couples on plane ',nplx, |
$ 'couples on plane ',nplx, |
1826 |
$ 'exceeds vector dimention ' |
$ 'exceeds vector dimention ' |
1868 |
c if(ncp_tot.gt.ncp_max)goto 100!next event (TEMPORANEO!!!) |
c if(ncp_tot.gt.ncp_max)goto 100!next event (TEMPORANEO!!!) |
1869 |
|
|
1870 |
if(ncp_tot.gt.ncp_max)then |
if(ncp_tot.gt.ncp_max)then |
1871 |
if(DEBUG)print*, |
if(verbose)print*, |
1872 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
1873 |
$ 'couples exceeds upper limit for Hough tr. ' |
$ 'couples exceeds upper limit for Hough tr. ' |
1874 |
$ ,'( ',ncp_max,' )' |
$ ,'( ',ncp_max,' )' |
2027 |
|
|
2028 |
* ------------------> COUPLE <------------------ |
* ------------------> COUPLE <------------------ |
2029 |
* check to do not overflow vector dimentions |
* check to do not overflow vector dimentions |
2030 |
if(ncp_plane(nplx).gt.ncouplemax)then |
c$$$ if(ncp_plane(nplx).gt.ncouplemax)then |
2031 |
if(DEBUG)print*, |
c$$$ if(DEBUG)print*, |
2032 |
$ ' ** warning ** number of identified'// |
c$$$ $ ' ** warning ** number of identified'// |
2033 |
$ ' couples on plane ',nplx, |
c$$$ $ ' couples on plane ',nplx, |
2034 |
$ ' exceeds vector dimention'// |
c$$$ $ ' exceeds vector dimention'// |
2035 |
$ ' ( ',ncouplemax,' )' |
c$$$ $ ' ( ',ncouplemax,' )' |
2036 |
c good2=.false. |
c$$$c good2=.false. |
2037 |
c goto 880 !fill ntp and go to next event |
c$$$c goto 880 !fill ntp and go to next event |
2038 |
iflag=1 |
c$$$ iflag=1 |
2039 |
return |
c$$$ return |
2040 |
endif |
c$$$ endif |
2041 |
|
|
2042 |
if(ncp_plane(nplx).eq.ncouplemax)then |
if(ncp_plane(nplx).eq.ncouplemax)then |
2043 |
if(DEBUG)print*, |
if(verbose)print*, |
2044 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
2045 |
$ 'couples on plane ',nplx, |
$ 'couples on plane ',nplx, |
2046 |
$ 'exceeds vector dimention ' |
$ 'exceeds vector dimention ' |
2088 |
c if(ncp_tot.gt.ncp_max)goto 100!next event (TEMPORANEO!!!) |
c if(ncp_tot.gt.ncp_max)goto 100!next event (TEMPORANEO!!!) |
2089 |
|
|
2090 |
if(ncp_tot.gt.ncp_max)then |
if(ncp_tot.gt.ncp_max)then |
2091 |
if(DEBUG)print*, |
if(verbose)print*, |
2092 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
2093 |
$ 'couples exceeds upper limit for Hough tr. ' |
$ 'couples exceeds upper limit for Hough tr. ' |
2094 |
$ ,'( ',ncp_max,' )' |
$ ,'( ',ncp_max,' )' |
2402 |
* (2 couples needed) |
* (2 couples needed) |
2403 |
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
2404 |
if(ndblt.eq.ndblt_max)then |
if(ndblt.eq.ndblt_max)then |
2405 |
if(DEBUG)print*, |
if(verbose)print*, |
2406 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
2407 |
$ 'doublets exceeds vector dimention ' |
$ 'doublets exceeds vector dimention ' |
2408 |
$ ,'( ',ndblt_max,' )' |
$ ,'( ',ndblt_max,' )' |
2472 |
* (3 couples needed) |
* (3 couples needed) |
2473 |
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
2474 |
if(ntrpt.eq.ntrpt_max)then |
if(ntrpt.eq.ntrpt_max)then |
2475 |
if(DEBUG)print*, |
if(verbose)print*, |
2476 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
2477 |
$ 'triplets exceeds vector dimention ' |
$ 'triplets exceeds vector dimention ' |
2478 |
$ ,'( ',ntrpt_max,' )' |
$ ,'( ',ntrpt_max,' )' |
2699 |
* >>> NEW CLOUD <<< |
* >>> NEW CLOUD <<< |
2700 |
|
|
2701 |
if(nclouds_yz.ge.ncloyz_max)then |
if(nclouds_yz.ge.ncloyz_max)then |
2702 |
if(DEBUG)print*, |
if(verbose)print*, |
2703 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
2704 |
$ 'YZ clouds exceeds vector dimention ' |
$ 'YZ clouds exceeds vector dimention ' |
2705 |
$ ,'( ',ncloyz_max,' )' |
$ ,'( ',ncloyz_max,' )' |
2911 |
* ~~~~~~~~~~~~~~~~~ |
* ~~~~~~~~~~~~~~~~~ |
2912 |
* >>> NEW CLOUD <<< |
* >>> NEW CLOUD <<< |
2913 |
if(nclouds_xz.ge.ncloxz_max)then |
if(nclouds_xz.ge.ncloxz_max)then |
2914 |
if(DEBUG)print*, |
if(verbose)print*, |
2915 |
$ '** warning ** number of identified '// |
$ '** warning ** number of identified '// |
2916 |
$ 'XZ clouds exceeds vector dimention ' |
$ 'XZ clouds exceeds vector dimention ' |
2917 |
$ ,'( ',ncloxz_max,' )' |
$ ,'( ',ncloxz_max,' )' |
3211 |
* -------------------------- |
* -------------------------- |
3212 |
if(ntracks.eq.NTRACKSMAX)then |
if(ntracks.eq.NTRACKSMAX)then |
3213 |
|
|
3214 |
if(DEBUG)print*, |
if(verbose)print*, |
3215 |
$ '** warning ** number of candidate tracks '// |
$ '** warning ** number of candidate tracks '// |
3216 |
$ ' exceeds vector dimension ' |
$ ' exceeds vector dimension ' |
3217 |
$ ,'( ',NTRACKSMAX,' )' |
$ ,'( ',NTRACKSMAX,' )' |
3837 |
include 'level2.f' |
include 'level2.f' |
3838 |
include 'level1.f' |
include 'level1.f' |
3839 |
|
|
3840 |
|
do i=1,nviews |
3841 |
|
good2(i)=good1(i) |
3842 |
|
enddo |
3843 |
|
|
3844 |
|
c good2 = 0!.false. |
|
good2 = 0!.false. |
|
3845 |
c$$$ nev2 = nev1 |
c$$$ nev2 = nev1 |
3846 |
|
|
3847 |
c$$$# ifndef TEST2003 |
c$$$# ifndef TEST2003 |
3943 |
real sinth,phi,pig !(4) |
real sinth,phi,pig !(4) |
3944 |
pig=acos(-1.) |
pig=acos(-1.) |
3945 |
|
|
3946 |
good2=1!.true. |
c good2=1!.true. |
3947 |
chi2_nt(ntr) = sngl(chi2) |
chi2_nt(ntr) = sngl(chi2) |
3948 |
|
nstep_nt(ntr) = 0!nstep |
3949 |
|
|
3950 |
phi = al(4) !(4) |
phi = al(4) !(4) |
3951 |
sinth = al(3) !(4) |
sinth = al(3) !(4) |
4029 |
include 'common_xyzPAM.f' |
include 'common_xyzPAM.f' |
4030 |
|
|
4031 |
* count #cluster per plane not associated to any track |
* count #cluster per plane not associated to any track |
4032 |
good2=1!.true. |
c good2=1!.true. |
4033 |
nclsx = 0 |
nclsx = 0 |
4034 |
nclsy = 0 |
nclsy = 0 |
4035 |
|
|