--- DarthVader/TrackerLevel2/src/F77/analysissubroutines.f 2008/12/23 11:28:36 1.38 +++ DarthVader/TrackerLevel2/src/F77/analysissubroutines.f 2009/12/14 10:51:40 1.43 @@ -271,7 +271,8 @@ *------------------------------------------------------------------------------- ccc ntrk=0 !counter of identified physical tracks -11111 continue !<<<<<<< come here when performing a new search +c11111 continue !<<<<<<< come here when performing a new search + continue !<<<<<<< come here when performing a new search if(nclouds_xz.eq.0)goto 880 !go to next event if(nclouds_yz.eq.0)goto 880 !go to next event @@ -302,7 +303,7 @@ * 1st) decreasing n.points * 2nd) increasing chi**2 * ------------------------------------------------------- - rchi2best=1000000000. + rchi2best=1000000000. ndofbest=0 do i=1,ntracks ndof=0 @@ -527,14 +528,6 @@ * --- and store the results -------------------------------- - ntrk = ntrk + 1 !counter of found tracks - if(.not.FIMAGE - $ .and.iimage.eq.0) image(ntrk)= 0 - if(.not.FIMAGE - $ .and.iimage.ne.0)image(ntrk)=ntrk+1 !this is the image of the next - if(FIMAGE) image(ntrk)=ntrk-1 !this is the image of the previous - call fill_level2_tracks(ntrk) !==> good2=.true. - if(ntrk.eq.NTRKMAX)then if(verbose.eq.1) $ print*, @@ -544,6 +537,24 @@ cc good2=.false. goto 880 !fill ntp and go to next event endif + + ntrk = ntrk + 1 !counter of found tracks + if(.not.FIMAGE + $ .and.iimage.eq.0) image(ntrk)= 0 + if(.not.FIMAGE + $ .and.iimage.ne.0)image(ntrk)=ntrk+1 !this is the image of the next + if(FIMAGE) image(ntrk)=ntrk-1 !this is the image of the previous + call fill_level2_tracks(ntrk) !==> good2=.true. + +c$$$ if(ntrk.eq.NTRKMAX)then +c$$$ if(verbose.eq.1) +c$$$ $ print*, +c$$$ $ '** warning ** number of identified '// +c$$$ $ 'tracks exceeds vector dimension ' +c$$$ $ ,'( ',NTRKMAX,' )' +c$$$cc good2=.false. +c$$$ goto 880 !fill ntp and go to next event +c$$$ endif if(iimage.ne.0)then FIMAGE=.true. ! goto 1212 !>>> fit image-track @@ -705,7 +716,8 @@ stripx = stripx + corr resxPAM = res - 10 endif + 10 continue + endif * ----------------- * CLUSTER Y @@ -751,7 +763,8 @@ stripy = stripy + corr resyPAM = res - 20 endif + 20 continue + endif c=========================================================== @@ -1581,7 +1594,8 @@ integer iflag integer badseed,badclx,badcly - + + iflag = iflag if(DEBUG.EQ.1)print*,'cl_to_couples:' cc if(RECOVER_SINGLETS.and..not.SECOND_SEARCH)goto 80 @@ -1767,8 +1781,8 @@ $ ,'( ',ncouplemax,' ) --> masked!' c mask_view(nviewx(nplx)) = 2 c mask_view(nviewy(nply)) = 2 - mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 - mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 + mask_view(nviewx(nplx))= mask_view(nviewx(nplx))+ 2**1 + mask_view(nviewy(nply))= mask_view(nviewy(nply))+ 2**1 goto 10 endif @@ -1796,7 +1810,8 @@ endif enddo - 80 continue +c 80 continue + continue if(DEBUG.EQ.1)then @@ -2124,7 +2139,7 @@ SZX=SZX+ZP(I)*XX SSX=SSX+XX SZ=SZ+ZP(I) - S1=S1+1. + S1=S1+1. ENDDO DET=SZZ*S1-SZ*SZ AX=(SZX*S1-SZ*SSX)/DET @@ -2210,12 +2225,14 @@ enddo !end loop on planes - COPPIA 3 31 continue - 1 enddo !end loop on COPPIA 2 +c 1 enddo !end loop on COPPIA 2 + enddo !end loop on COPPIA 2 enddo !end loop on sensors - COPPIA 2 20 continue enddo !end loop on planes - COPPIA 2 - 11 continue +c 11 continue + continue enddo !end loop on COPPIA1 enddo !end loop on sensors - COPPIA 1 10 continue @@ -2322,7 +2339,7 @@ * doublet distance in parameter space distance= $ ((alfayz1(idbref)-alfayz1(idb2))/Dalfayz1)**2 - $ +((alfayz2(idbref)-alfayz2(idb2))/Dalfayz2)**2 + $ +((alfayz2(idbref)-alfayz2(idb2))/Dalfayz2)**2 distance = sqrt(distance) if(distance.lt.cutdistyz)then @@ -2347,7 +2364,8 @@ 1118 continue enddo !end loop (2) on DOUBLETS - 1188 continue +c 1188 continue + continue enddo !end loop on... bo? nptloop=npv @@ -2535,7 +2553,7 @@ * solo i due parametri spaziali per il momemnto distance= $ ((alfaxz1(itrref)-alfaxz1(itr2))/Dalfaxz1)**2 - $ +((alfaxz2(itrref)-alfaxz2(itr2))/Dalfaxz2)**2 + $ +((alfaxz2(itrref)-alfaxz2(itr2))/Dalfaxz2)**2 distance = sqrt(distance) @@ -2574,7 +2592,8 @@ 11188 continue enddo !end loop (2) on TRIPLETS -11888 continue +c11888 continue + continue enddo !end loop on... bo? nptloop=npv @@ -2639,7 +2658,7 @@ npt_tot=npt_tot+npt if(DEBUG.EQ.1)then - print*,'>>>> cloud ',nclouds_xz,' --- ',npt,' points' + print*,'>>>> cloud ',nclouds_xz,' --- ',npt,' points' print*,'- alfaxz1 ',alfaxz1_av(nclouds_xz) print*,'- alfaxz2 ',alfaxz2_av(nclouds_xz) print*,'- alfaxz3 ',alfaxz3_av(nclouds_xz) @@ -2942,7 +2961,7 @@ xm(nplanes-ip+1)=xPAM ym(nplanes-ip+1)=yPAM zm(nplanes-ip+1)=zPAM - resx(nplanes-ip+1)=resxPAM + resx(nplanes-ip+1)=resxPAM resy(nplanes-ip+1)=resyPAM if(DEBUG.EQ.1)print*,'(X,Y)' $ ,nplanes-ip+1,xPAM,yPAM @@ -2953,7 +2972,7 @@ ym_B(nplanes-ip+1) = yPAM_B zm(nplanes-ip+1) $ = (zPAM_A+zPAM_B)/2. - resx(nplanes-ip+1) = resxPAM + resx(nplanes-ip+1) = resxPAM resy(nplanes-ip+1) = resyPAM if(icx.eq.0.and.icy.gt.0)then xgood(nplanes-ip+1)=0. @@ -3040,7 +3059,7 @@ XV_STORE(ip,ntracks)=sngl(xv(ip)) YV_STORE(ip,ntracks)=sngl(yv(ip)) - ZV_STORE(ip,ntracks)=sngl(zv(ip)) + ZV_STORE(ip,ntracks)=sngl(zv(ip)) XM_STORE(ip,ntracks)=sngl(xm(ip)) YM_STORE(ip,ntracks)=sngl(ym(ip)) ZM_STORE(ip,ntracks)=sngl(zm(ip)) @@ -3875,7 +3894,20 @@ if(ip.eq.6.and.ssensor.ne.0)ssensor = 3 - ssensor !notazione paolo x align LS(IP,ntr) = ssensor+10*sladder - if(id.ne.0)then +c if(id.ne.0)then +CCCCCC(10 novembre 2009) PATCH X NUCLEI +C non ho capito perche', ma durante il ritracciamento dei nuclei +C (quando una traccia viene trovata ma non e' buona) c'e' qualche variabile +C che non viene reinizializzata correttamente e i cluster esclusi +C dal fit risultano ancora inclusi... +C + cltrx(ip,ntr) = 0 + cltry(ip,ntr) = 0 + if( + $ xgood_nt(ip,ntr).eq.1.and.ygood_nt(ip,ntr).eq.1 + $ .and. + $ id.ne.0)then + c >>> is a couple cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) @@ -3884,7 +3916,7 @@ cl_used(cltrx(ip,ntr)) = 1 !tag used clusters - xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) + xbad(ip,ntr)= nbadstrips(4,clx(nplanes-ip+1,icp_cp(id))) if(nsatstrips(clx(nplanes-ip+1,icp_cp(id))).gt.0) $ dedx_x(ip,ntr)=-dedx_x(ip,ntr) @@ -4105,7 +4137,7 @@ alfayz2_av_nt(iyz)=alfayz2_av(iyz) nnn=nnn+ptcloud_yz(iyz) enddo - do ipt=1,nnn + do ipt=1,min(ndblt_max_nt,nnn) db_cloud_nt(ipt)=db_cloud(ipt) enddo endif @@ -4118,7 +4150,7 @@ alfaxz3_av_nt(ixz)=alfaxz3_av(ixz) nnn=nnn+ptcloud_xz(ixz) enddo - do ipt=1,nnn + do ipt=1,min(ntrpt_max_nt,nnn) tr_cloud_nt(ipt)=tr_cloud(ipt) enddo endif