65 |
|
|
66 |
cut=scut*ssigma !exclusion cut |
cut=scut*ssigma !exclusion cut |
67 |
|
|
68 |
|
nco=0 |
69 |
|
nbo=0 |
70 |
do k=1,nstrips_va1 |
do k=1,nstrips_va1 |
71 |
if(ABS(signal(k)-smean).gt.cut) then |
if(ABS(signal(k)-smean).gt.cut) then |
72 |
strange(i,j,k)=0 !marks strips exceeding cut |
strange(i,j,k)=0 !marks strips exceeding cut |
73 |
|
c print*,i,j,k,signal(k),smean |
74 |
endif |
endif |
75 |
|
nco=nco+strange(i,j,k) |
76 |
|
nbo=nbo+bad(i,j,k) |
77 |
enddo ! in order not to use them in CN computation |
enddo ! in order not to use them in CN computation |
78 |
|
|
79 |
|
c$$$ if(i.eq.12.and.(j.eq.2.or.j.eq.3))then |
80 |
|
c$$$ print*,'view ',i,' vk ',j |
81 |
|
c$$$ print*,'ADC (1-51-128) = ',adc(i,j,1),adc(i,j,52),adc(i,j,128) |
82 |
|
c$$$ print*,'<ADC-PED> = ',smean |
83 |
|
c$$$ print*,'s = ',ssigma |
84 |
|
c$$$ print*,'nstrange = ',128-nco |
85 |
|
c$$$ print*,'nbad = ',128-nbo |
86 |
|
c$$$ endif |
87 |
|
|
88 |
countme = countme + 1 !??? |
countme = countme + 1 !??? |
89 |
if (countme.le.3) goto 666 !??? |
if (countme.le.3) goto 666 !??? |
154 |
|
|
155 |
ncn=0 !number of strips in cn computation |
ncn=0 !number of strips in cn computation |
156 |
cn(i,j)=0 !initializes cn variable |
cn(i,j)=0 !initializes cn variable |
157 |
|
cnflag(i,j)=0 !initialize cn flag OK |
158 |
|
|
159 |
do k=1,nstrips_va1 !loops on strips |
do k=1,nstrips_va1 !loops on strips |
160 |
* tags strange, bad or signal-affected strips |
* tags strange, bad or signal-affected strips |
161 |
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) |
162 |
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 |
163 |
ncn = ncn + iok !counts number of strips in cn computation |
ncn = ncn + iok !counts number of strips in cn computation |
164 |
enddo |
enddo |
165 |
|
|
166 |
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... |
|
167 |
if(ncn.eq.0)then |
if(ncn.eq.0)then |
168 |
if(debug)print*,' WARNING - cnoise: ', |
if(debug)print*,' WARNING - cnoise: ', |
169 |
$ 'no strips for CN computation on VA1 ',j, |
$ 'no strips for CN computation on VA1 ',j, |
170 |
$ ', VIEW ',i |
$ ', VIEW ',i,' >>> FAILED ' |
171 |
else |
else |
172 |
if(debug)print*,' WARNING - cnoise: ', |
if(debug)print*,' WARNING - cnoise: ', |
173 |
$ 'less than ',NSTRIPMAX |
$ 'less than ',NSTRIPMIN |
174 |
$ ,'strips for CN computation on VA1 ',j, |
$ ,' strips for CN computation on VA1 ',j, |
175 |
$ ', VIEW ',i |
$ ', VIEW ',i,' >>> FAILED ' |
176 |
endif |
endif |
177 |
gulp=1 |
gulp=1 |
178 |
|
cnflag(i,j) = -1 |
179 |
else |
else |
180 |
cn(i,j)=cn(i,j)/DBLE(ncn) !<<<< computes common noise |
cn(i,j)=cn(i,j)/DBLE(ncn) !<<<< computes common noise |
181 |
|
if(ncn.lt.NSTRIPWARNING) then |
182 |
|
if(debug)print*,' WARNING - cnoise: ', |
183 |
|
$ 'less than ',NSTRIPWARNING |
184 |
|
$ ,' strips for CN computation on VA1 ',j, |
185 |
|
$ ', VIEW ',i |
186 |
|
cnflag(i,j) = 1 |
187 |
|
endif |
188 |
gulp=0 |
gulp=0 |
189 |
endif |
endif |
190 |
|
|