/[PAMELA software]/DarthVader/TrackerLevel2/src/F77/cncomp.f
ViewVC logotype

Diff of /DarthVader/TrackerLevel2/src/F77/cncomp.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pam-fi, Tue May 30 16:30:37 2006 UTC revision 1.5 by pam-fi, Fri Sep 29 08:13:04 2006 UTC
# Line 10  Line 10 
10        subroutine cncomp(i,j,errflag)    !(view, VA1)        subroutine cncomp(i,j,errflag)    !(view, VA1)
11    
12        include 'commontracker.f'        include 'commontracker.f'
13          include 'level1.f'
14        include 'common_reduction.f'        include 'common_reduction.f'
15        include 'calib.f'        include 'calib.f'
16    
# Line 65  c--------------------------------------- Line 66  c---------------------------------------
66                
67        cut=scut*ssigma           !exclusion cut        cut=scut*ssigma           !exclusion cut
68                
69          nco=0
70          nbo=0
71        do k=1,nstrips_va1        do k=1,nstrips_va1
72           if(ABS(signal(k)-smean).gt.cut) then           if(ABS(signal(k)-smean).gt.cut) then
73              strange(i,j,k)=0    !marks strips exceeding cut              strange(i,j,k)=0    !marks strips exceeding cut
74    c            print*,i,j,k,signal(k),smean
75           endif           endif
76             nco=nco+strange(i,j,k)
77             nbo=nbo+bad(i,j,k)
78        enddo                     ! in order not to use them in CN computation        enddo                     ! in order not to use them in CN computation
79    
80    c$$$      if(i.eq.12.and.(j.eq.2.or.j.eq.3))then
81    c$$$         print*,'view ',i,' vk ',j
82    c$$$         print*,'ADC (1-51-128) = ',adc(i,j,1),adc(i,j,52),adc(i,j,128)
83    c$$$         print*,'<ADC-PED> = ',smean
84    c$$$         print*,'s         = ',ssigma
85    c$$$         print*,'nstrange  = ',128-nco
86    c$$$         print*,'nbad      = ',128-nbo
87    c$$$      endif
88    
89        countme = countme + 1         !???        countme = countme + 1         !???
90        if (countme.le.3) goto 666 !???        if (countme.le.3) goto 666 !???
# Line 133  c--------------------------------------- Line 147  c---------------------------------------
147        subroutine cnoise(i,j,gulp) !(view, VA1)        subroutine cnoise(i,j,gulp) !(view, VA1)
148    
149        include 'commontracker.f'        include 'commontracker.f'
150          include 'level0.f'
151          include 'level1.f'
152        include 'common_reduction.f'        include 'common_reduction.f'
153        include 'calib.f'        include 'calib.f'
154                
# Line 141  c--------------------------------------- Line 157  c---------------------------------------
157                
158        ncn=0                     !number of strips in cn computation        ncn=0                     !number of strips in cn computation
159        cn(i,j)=0                 !initializes cn variable        cn(i,j)=0                 !initializes cn variable
160          cnn(i,j)=0                !initialize cn flag
161    
162        do k=1,nstrips_va1        !loops on strips        do k=1,nstrips_va1        !loops on strips
163  *        tags strange, bad or signal-affected strips  *        tags strange, bad or signal-affected strips
164           iok=strange(i,j,k)*bad(i,j,k)*clstr(i,j,k)           iok = strange(i,j,k)*bad(i,j,k)*clstr(i,j,k)
165           cn(i,j)=cn(i,j) + (DBLE(adc(i,j,k)) - pedestal(i,j,k))*iok           cn(i,j) = cn(i,j) + (DBLE(adc(i,j,k)) - pedestal(i,j,k))*iok
166           ncn = ncn + iok            !counts number of strips in cn computation           ncn = ncn + iok            !counts number of strips in cn computation
167        enddo        enddo
168                
169        NSTRIPMAX=10        if(ncn.lt.NSTRIPMIN) then         !no signal free strips on this VA1...
       if(ncn.lt.NSTRIPMAX) then         !no signal free strips on this VA1...  
170           if(ncn.eq.0)then           if(ncn.eq.0)then
171              if(debug)print*,' WARNING - cnoise: ',              if(debug)print*,' WARNING - cnoise: ',
172       $        'no strips for CN computation on VA1 ',j,       $        'no strips for CN computation on VA1 ',j,
173       $        ', VIEW ',i       $        ', VIEW ',i,'  >>> FAILED '
174           else           else
175              if(debug)print*,' WARNING - cnoise: ',              if(debug)print*,' WARNING - cnoise: ',
176       $        'less than ',NSTRIPMAX       $        'less than ',NSTRIPMIN
177       $           ,'strips for CN computation on VA1 ',j,       $           ,' strips for CN computation on VA1 ',j,
178       $        ', VIEW ',i       $        ', VIEW ',i,'  >>> FAILED '
179           endif           endif
180           gulp=1           gulp=1
181             cnn(i,j) = 0
182        else        else
183           cn(i,j)=cn(i,j)/DBLE(ncn) !<<<< computes common noise           cn(i,j)=cn(i,j)/DBLE(ncn) !<<<< computes common noise
184             cnn(i,j) = ncn
185           gulp=0                           gulp=0                
186             if(debug.and.ABS(cn(i,j)).gt.1000)
187         $        print*,'Event ',eventn(1)
188         $        ,': cn(',i,',',j,')= ',cn(i,j),' ncn ',ncn
189        endif        endif
190    
191        return        return
# Line 191  c--------------------------------------- Line 212  c---------------------------------------
212        subroutine cutcn(i,j)     !(view, VA1)        subroutine cutcn(i,j)     !(view, VA1)
213    
214        include 'commontracker.f'        include 'commontracker.f'
215          include 'level1.f'
216        include 'common_reduction.f'        include 'common_reduction.f'
217        include 'calib.f'        include 'calib.f'
218    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.23