--- DarthVader/TrackerLevel2/src/F77/cncomp.f 2006/05/30 16:30:37 1.2 +++ DarthVader/TrackerLevel2/src/F77/cncomp.f 2006/08/04 08:18:06 1.3 @@ -65,12 +65,25 @@ cut=scut*ssigma !exclusion cut + nco=0 + nbo=0 do k=1,nstrips_va1 if(ABS(signal(k)-smean).gt.cut) then strange(i,j,k)=0 !marks strips exceeding cut +c print*,i,j,k,signal(k),smean endif + nco=nco+strange(i,j,k) + nbo=nbo+bad(i,j,k) enddo ! in order not to use them in CN computation +c$$$ if(i.eq.12.and.(j.eq.2.or.j.eq.3))then +c$$$ print*,'view ',i,' vk ',j +c$$$ print*,'ADC (1-51-128) = ',adc(i,j,1),adc(i,j,52),adc(i,j,128) +c$$$ print*,' = ',smean +c$$$ print*,'s = ',ssigma +c$$$ print*,'nstrange = ',128-nco +c$$$ print*,'nbad = ',128-nbo +c$$$ endif countme = countme + 1 !??? if (countme.le.3) goto 666 !??? @@ -141,29 +154,37 @@ ncn=0 !number of strips in cn computation cn(i,j)=0 !initializes cn variable + cnflag(i,j)=0 !initialize cn flag OK do k=1,nstrips_va1 !loops on strips * tags strange, bad or signal-affected strips - iok=strange(i,j,k)*bad(i,j,k)*clstr(i,j,k) - cn(i,j)=cn(i,j) + (DBLE(adc(i,j,k)) - pedestal(i,j,k))*iok + iok = strange(i,j,k)*bad(i,j,k)*clstr(i,j,k) + cn(i,j) = cn(i,j) + (DBLE(adc(i,j,k)) - pedestal(i,j,k))*iok ncn = ncn + iok !counts number of strips in cn computation enddo - NSTRIPMAX=10 - if(ncn.lt.NSTRIPMAX) then !no signal free strips on this VA1... + if(ncn.lt.NSTRIPMIN) then !no signal free strips on this VA1... if(ncn.eq.0)then if(debug)print*,' WARNING - cnoise: ', $ 'no strips for CN computation on VA1 ',j, - $ ', VIEW ',i + $ ', VIEW ',i,' >>> FAILED ' else if(debug)print*,' WARNING - cnoise: ', - $ 'less than ',NSTRIPMAX - $ ,'strips for CN computation on VA1 ',j, - $ ', VIEW ',i + $ 'less than ',NSTRIPMIN + $ ,' strips for CN computation on VA1 ',j, + $ ', VIEW ',i,' >>> FAILED ' endif gulp=1 + cnflag(i,j) = -1 else cn(i,j)=cn(i,j)/DBLE(ncn) !<<<< computes common noise + if(ncn.lt.NSTRIPWARNING) then + if(debug)print*,' WARNING - cnoise: ', + $ 'less than ',NSTRIPWARNING + $ ,' strips for CN computation on VA1 ',j, + $ ', VIEW ',i + cnflag(i,j) = 1 + endif gulp=0 endif