51 |
|
|
52 |
do k=1,nstrips_va1 |
do k=1,nstrips_va1 |
53 |
nstr = nstr + strange(i,j,k) !uses only |
nstr = nstr + strange(i,j,k) !uses only |
54 |
if(mod(i,2).eq.1) then !odd strip ---> Y view |
if(mod(i,2).eq.1) then ! ---> Y view |
55 |
signal(k) = - (DBLE(adc(i,j,k)) - pedestal(i,j,k)) !negative signal |
signal(k) = - (DBLE(adc(i,j,k)) - pedestal(i,j,k)) !negative signal |
56 |
else !even strip ---> X view |
else ! ---> X view |
57 |
signal(k) = DBLE(adc(i,j,k)) - pedestal(i,j,k) !positive signal |
signal(k) = DBLE(adc(i,j,k)) - pedestal(i,j,k) !positive signal |
58 |
endif |
endif |
59 |
smean = smean + signal(k)*strange(i,j,k) |
smean = smean + signal(k)*strange(i,j,k) |
60 |
ssigma = ssigma + (signal(k)**2)*strange(i,j,k) |
ssigma = ssigma + (signal(k)**2)*strange(i,j,k) |
61 |
enddo |
enddo |
62 |
|
|
63 |
smean=smean/nstr !strips value distribution mean |
smean=smean/nstr !strips value distribution mean |
|
|
|
64 |
ssigma=SQRT((ssigma/nstr)-smean**2) !strips value distribution sigma |
ssigma=SQRT((ssigma/nstr)-smean**2) !strips value distribution sigma |
65 |
|
|
66 |
cut=scut*ssigma !exclusion cut |
cut=scut*ssigma !exclusion cut |
156 |
|
|
157 |
ncn=0 !number of strips in cn computation |
ncn=0 !number of strips in cn computation |
158 |
cn(i,j)=0 !initializes cn variable |
cn(i,j)=0 !initializes cn variable |
159 |
|
cnrms(i,j)=0 !initializes cn rms |
160 |
cnn(i,j)=0 !initialize cn flag |
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 |
|
cnrms(i,j) = cnrms(i,j) |
167 |
|
$ + (DBLE(adc(i,j,k)) - pedestal(i,j,k)) |
168 |
|
$ *(DBLE(adc(i,j,k)) - pedestal(i,j,k))*iok |
169 |
ncn = ncn + iok !counts number of strips in cn computation |
ncn = ncn + iok !counts number of strips in cn computation |
170 |
enddo |
enddo |
171 |
|
|
184 |
cnn(i,j) = 0 |
cnn(i,j) = 0 |
185 |
else |
else |
186 |
cn(i,j)=cn(i,j)/DBLE(ncn) !<<<< computes common noise |
cn(i,j)=cn(i,j)/DBLE(ncn) !<<<< computes common noise |
187 |
|
cnrms(i,j)= SQRT( cnrms(i,j)/DBLE(ncn) - cn(i,j)**2 ) |
188 |
cnn(i,j) = ncn |
cnn(i,j) = ncn |
189 |
gulp=0 |
gulp=0 |
190 |
if(debug.and.ABS(cn(i,j)).gt.1000) |
if(debug.and.ABS(cn(i,j)).gt.1000) |