--- DarthVader/TrackerLevel2/src/F77/analysissubroutines.f 2006/09/29 08:13:04 1.5 +++ DarthVader/TrackerLevel2/src/F77/analysissubroutines.f 2006/10/02 13:12:48 1.6 @@ -1675,7 +1675,7 @@ * -------------- integer iflag - integer badseed,badcl + integer badseed,badclx,badcly * init variables ncp_tot=0 @@ -1717,7 +1717,7 @@ else ilast=TOTCLLENGTH endif - badcl=badseed + badclx=badseed do igood=-ngoodstr,ngoodstr ibad=1 if((INDMAX(icx)+igood).gt.ifirst.and. @@ -1727,7 +1727,7 @@ $ nvk(MAXS(icx)+igood), $ nst(MAXS(icx)+igood)) endif - badcl=badcl*ibad + badclx=badclx*ibad enddo * ---------------------------------------------------- * >>> eliminato il taglio sulle BAD <<< @@ -1762,7 +1762,7 @@ else ilast=TOTCLLENGTH endif - badcl=badseed + badcly=badseed do igood=-ngoodstr,ngoodstr ibad=1 if((INDMAX(icy)+igood).gt.ifirst.and. @@ -1771,7 +1771,7 @@ $ ibad=BAD(VIEW(icy), $ nvk(MAXS(icy)+igood), $ nst(MAXS(icy)+igood)) - badcl=badcl*ibad + badcly=badcly*ibad enddo * ---------------------------------------------------- * >>> eliminato il taglio sulle BAD <<< @@ -1797,13 +1797,29 @@ * ------------------------------------------------------------- * >>> eliminata (TEMPORANEAMENTE) la correlazione di carica <<< * ------------------------------------------------------------- -c$$$ if(dedx(icy).lt.chsaty.or.dedx(icx).lt.chsatx)then -c$$$ ddd=(dedx(icy) -c$$$ $ -kch(nplx,nldx)*dedx(icx)-cch(nplx,nldx)) -c$$$ ddd=ddd/sqrt(kch(nplx,nldx)**2+1) -c$$$ cut=chcut*sch(nplx,nldx) -c$$$ if(abs(ddd).gt.cut)goto 20 !charge not consistent -c$$$ endif + if( .not.(dedx(icy).gt.chsaty.and.dedx(icx).gt.chsatx) + $ .and. + $ .not.(dedx(icy).lt.chmipy.and.dedx(icx).lt.chmipx) + $ .and. + $ (badclx.eq.1.and.badcly.eq.1) + $ .and. + $ .true.)then + + ddd=(dedx(icy) + $ -kch(nplx,nldx)*dedx(icx)-cch(nplx,nldx)) + ddd=ddd/sqrt(kch(nplx,nldx)**2+1) + +c cut = chcut * sch(nplx,nldx) + + sss=(kch(nplx,nldx)*dedx(icy)+dedx(icx) + $ -kch(nplx,nldx)*cch(nplx,nldx)) + sss=sss/sqrt(kch(nplx,nldx)**2+1) + cut = chcut * (16 + sss/50.) + + if(abs(ddd).gt.cut)then + goto 20 !charge not consistent + endif + endif * ------------------> COUPLE <------------------ * check to do not overflow vector dimentions @@ -2101,215 +2117,6 @@ return end -c$$$ subroutine cl_to_couples_2(iflag) -c$$$ -c$$$ include 'commontracker.f' -c$$$ include 'common_momanhough.f' -c$$$ include 'momanhough_init.f' -c$$$ include 'calib.f' -c$$$ include 'level1.f' -c$$$ -c$$$ logical DEBUG -c$$$ common/dbg/DEBUG -c$$$ -c$$$* output flag -c$$$* -------------- -c$$$* 0 = good event -c$$$* 1 = bad event -c$$$* -------------- -c$$$ integer iflag -c$$$ -c$$$ integer badseed,badcl -c$$$ -c$$$* init variables -c$$$ ncp_tot=0 -c$$$ do ip=1,nplanes -c$$$ do ico=1,ncouplemax -c$$$ clx(ip,ico)=0 -c$$$ cly(ip,ico)=0 -c$$$ enddo -c$$$ ncp_plane(ip)=0 -c$$$ do icl=1,nclstrmax_level2 -c$$$ cls(ip,icl)=1 -c$$$ enddo -c$$$ ncls(ip)=0 -c$$$ enddo -c$$$ do icl=1,nclstrmax_level2 -c$$$ cl_single(icl)=1 -c$$$ cl_good(icl)=0 -c$$$ enddo -c$$$ -c$$$* start association -c$$$ ncouples=0 -c$$$ do icx=1,nclstr1 !loop on cluster (X) -c$$$ if(mod(VIEW(icx),2).eq.1)goto 10 -c$$$ -c$$$* ---------------------------------------------------- -c$$$* cut on charge (X VIEW) -c$$$ if(dedx(icx).lt.dedx_x_min)then -c$$$ cl_single(icx)=0 -c$$$ goto 10 -c$$$ endif -c$$$* cut BAD (X VIEW) -c$$$ badseed=BAD(VIEW(icx),nvk(MAXS(icx)),nst(MAXS(icx))) -c$$$ ifirst=INDSTART(icx) -c$$$ if(icx.ne.nclstr1) then -c$$$ ilast=INDSTART(icx+1)-1 -c$$$ else -c$$$ ilast=TOTCLLENGTH -c$$$ endif -c$$$ badcl=badseed -c$$$ do igood=-ngoodstr,ngoodstr -c$$$ ibad=1 -c$$$ if((INDMAX(icx)+igood).gt.ifirst.and. -c$$$ $ (INDMAX(icx)+igood).lt.ilast.and. -c$$$ $ .true.)then -c$$$ ibad=BAD(VIEW(icx), -c$$$ $ nvk(MAXS(icx)+igood), -c$$$ $ nst(MAXS(icx)+igood)) -c$$$ endif -c$$$ badcl=badcl*ibad -c$$$ enddo -c$$$* print*,'icx ',icx,badcl -c$$$ if(badcl.eq.0)then -c$$$ cl_single(icx)=0 -c$$$ goto 10 -c$$$ endif -c$$$* ---------------------------------------------------- -c$$$ -c$$$ cl_good(icx)=1 -c$$$ nplx=npl(VIEW(icx)) -c$$$ nldx=nld(MAXS(icx),VIEW(icx)) -c$$$ -c$$$ do icy=1,nclstr1 !loop on cluster (Y) -c$$$ if(mod(VIEW(icy),2).eq.0)goto 20 -c$$$ -c$$$* ---------------------------------------------------- -c$$$* cut on charge (Y VIEW) -c$$$ if(dedx(icy).lt.dedx_y_min)then -c$$$ cl_single(icy)=0 -c$$$ goto 20 -c$$$ endif -c$$$* cut BAD (Y VIEW) -c$$$ badseed=BAD(VIEW(icy),nvk(MAXS(icy)),nst(MAXS(icy))) -c$$$ ifirst=INDSTART(icy) -c$$$ if(icy.ne.nclstr1) then -c$$$ ilast=INDSTART(icy+1)-1 -c$$$ else -c$$$ ilast=TOTCLLENGTH -c$$$ endif -c$$$ badcl=badseed -c$$$ do igood=-ngoodstr,ngoodstr -c$$$ ibad=1 -c$$$ if((INDMAX(icy)+igood).gt.ifirst.and. -c$$$ $ (INDMAX(icy)+igood).lt.ilast.and. -c$$$ $ .true.) -c$$$ $ ibad=BAD(VIEW(icy), -c$$$ $ nvk(MAXS(icy)+igood), -c$$$ $ nst(MAXS(icy)+igood)) -c$$$ badcl=badcl*ibad -c$$$ enddo -c$$$* print*,'icy ',icy,badcl -c$$$ if(badcl.eq.0)then -c$$$ cl_single(icy)=0 -c$$$ goto 20 -c$$$ endif -c$$$* ---------------------------------------------------- -c$$$ -c$$$ -c$$$ cl_good(icy)=1 -c$$$ nply=npl(VIEW(icy)) -c$$$ nldy=nld(MAXS(icy),VIEW(icy)) -c$$$ -c$$$* ---------------------------------------------- -c$$$* CONDITION TO FORM A COUPLE -c$$$* ---------------------------------------------- -c$$$* geometrical consistency (same plane and ladder) -c$$$ if(nply.eq.nplx.and.nldy.eq.nldx)then -c$$$ -c$$$c$$$* charge correlation -c$$$c$$$ ddd=(dedx(icy) -c$$$c$$$ $ -kch(nplx,nldx)*dedx(icx)-cch(nplx,nldx)) -c$$$c$$$ ddd=ddd/sqrt(kch(nplx,nldx)**2+1) -c$$$c$$$ cut=chcut*sch(nplx,nldx) -c$$$c$$$ if(abs(ddd).gt.cut)goto 20 !charge not consistent -c$$$ -c$$$* ------------------> COUPLE <------------------ -c$$$* check to do not overflow vector dimentions -c$$$ if(ncp_plane(nplx).gt.ncouplemax)then -c$$$ if(DEBUG)print*, -c$$$ $ ' ** warning ** number of identified'// -c$$$ $ ' couples on plane ',nplx, -c$$$ $ ' exceeds vector dimention'// -c$$$ $ ' ( ',ncouplemax,' )' -c$$$c good2=.false. -c$$$c goto 880 !fill ntp and go to next event -c$$$ iflag=1 -c$$$ return -c$$$ endif -c$$$ -c$$$ if(ncp_plane(nplx).eq.ncouplemax)then -c$$$ if(DEBUG)print*, -c$$$ $ '** warning ** number of identified '// -c$$$ $ 'couples on plane ',nplx, -c$$$ $ 'exceeds vector dimention ' -c$$$ $ ,'( ',ncouplemax,' )' -c$$$c good2=.false. -c$$$c goto 880 !fill ntp and go to next event -c$$$ iflag=1 -c$$$ return -c$$$ endif -c$$$ -c$$$ ncp_plane(nplx) = ncp_plane(nplx) + 1 -c$$$ clx(nplx,ncp_plane(nplx))=icx -c$$$ cly(nply,ncp_plane(nplx))=icy -c$$$ cl_single(icx)=0 -c$$$ cl_single(icy)=0 -c$$$c print*,'couple ',nplx,ncp_plane(nplx),' --- ',icx,icy -c$$$ endif -c$$$* ---------------------------------------------- -c$$$ -c$$$ 20 continue -c$$$ enddo !end loop on clusters(Y) -c$$$ -c$$$ 10 continue -c$$$ enddo !end loop on clusters(X) -c$$$ -c$$$ -c$$$ do icl=1,nclstr1 -c$$$ if(cl_single(icl).eq.1)then -c$$$ ip=npl(VIEW(icl)) -c$$$ ncls(ip)=ncls(ip)+1 -c$$$ cls(ip,ncls(ip))=icl -c$$$ endif -c$$$ enddo -c$$$ -c$$$ -c$$$ if(DEBUG)then -c$$$ print*,'clusters ',nclstr1 -c$$$ print*,'good ',(cl_good(i),i=1,nclstr1) -c$$$ print*,'singles ',(cl_single(i),i=1,nclstr1) -c$$$ print*,'couples per plane: ',(ncp_plane(ip),ip=1,nplanes) -c$$$ endif -c$$$ -c$$$ do ip=1,6 -c$$$ ncp_tot=ncp_tot+ncp_plane(ip) -c$$$ enddo -c$$$c if(ncp_tot.gt.ncp_max)goto 100!next event (TEMPORANEO!!!) -c$$$ -c$$$ if(ncp_tot.gt.ncp_max)then -c$$$ if(DEBUG)print*, -c$$$ $ '** warning ** number of identified '// -c$$$ $ 'couples exceeds upper limit for Hough tr. ' -c$$$ $ ,'( ',ncp_max,' )' -c$$$c good2=.false. -c$$$c goto 880 !fill ntp and go to next event -c$$$ iflag=1 -c$$$ return -c$$$ endif -c$$$ -c$$$ return -c$$$ end *************************************************** * *