| 243 |
|
|
| 244 |
if(.not.flag_shower)then |
if(.not.flag_shower)then |
| 245 |
call savecluster(iv) |
call savecluster(iv) |
| 246 |
c$$$ if(debug.eq.1)print*,' view ',iv,' #clusters ', nclstr_view |
if(debug.eq.1)print*,'view ',iv,' #clusters ', nclstr_view |
| 247 |
else |
else |
| 248 |
fshower(iv) = 1 |
fshower(iv) = 1 |
| 249 |
c GOOD1(DSPnumber(iv)) = 11 !AHAHAHAHA ORRORE!! |
c GOOD1(DSPnumber(iv)) = 11 !AHAHAHAHA ORRORE!! |
| 266 |
C come here if GOOD1=0 |
C come here if GOOD1=0 |
| 267 |
C or the event has too many clusters |
C or the event has too many clusters |
| 268 |
C--------------------------------------------- |
C--------------------------------------------- |
| 269 |
200 continue |
c 200 continue |
| 270 |
|
|
| 271 |
ngood = 0 |
ngood = 0 |
| 272 |
do iv = 1,nviews |
do iv = 1,nviews |
| 323 |
do id=1,maxlength !??? |
do id=1,maxlength !??? |
| 324 |
clsignal(id) = 0. |
clsignal(id) = 0. |
| 325 |
clsigma(id) = 0. |
clsigma(id) = 0. |
| 326 |
cladc(id) = 0. |
cladc(id) = 0 ! EM GCC4.7 is integer |
| 327 |
clbad(id) = 0. |
clbad(id) = 0 ! EM GCC4.7 is integer |
| 328 |
enddo |
enddo |
| 329 |
do iv=1,nviews |
do iv=1,nviews |
| 330 |
c crc1(iv)=0 |
c crc1(iv)=0 |
| 393 |
c----------------------------------------- |
c----------------------------------------- |
| 394 |
c possible SEED... |
c possible SEED... |
| 395 |
c----------------------------------------- |
c----------------------------------------- |
|
c$$$ if(debug.eq.1)print*,'|||| ',value(is),' @',is |
|
|
c$$$ $ ,' cut ',clseedcut(is) |
|
|
|
|
| 396 |
itemp = is |
itemp = is |
| 397 |
fsat = 0 ! first saturated strip |
fsat = 0 ! first saturated strip |
| 398 |
lsat = 0 ! last saturated strip |
lsat = 0 ! last saturated strip |
| 404 |
$ value(itemp).le.value(itemp+1) |
$ value(itemp).le.value(itemp+1) |
| 405 |
$ .and.value(itemp+1).gt.clseedcut(itemp+1)) |
$ .and.value(itemp+1).gt.clseedcut(itemp+1)) |
| 406 |
itemp = itemp+1 |
itemp = itemp+1 |
|
c$$$ if(debug.eq.1)print*,'|||| ',value(itemp),' @',is |
|
|
c$$$ $ ,' cut ',clseedcut(itemp) |
|
| 407 |
if(itemp.eq.last) goto 230 !stops if reaches last strip |
if(itemp.eq.last) goto 230 !stops if reaches last strip |
| 408 |
if(sat(itemp).eq.1) goto 230 !stop if reaches a saturated strip |
if(sat(itemp).eq.1) goto 230 !stop if reaches a saturated strip |
| 409 |
enddo ! of the ladder |
enddo ! of the ladder |
| 415 |
fsat = itemp |
fsat = itemp |
| 416 |
lsat = itemp |
lsat = itemp |
| 417 |
if(itemp.eq.last) goto 231 !estremo... |
if(itemp.eq.last) goto 231 !estremo... |
| 418 |
do while( |
do while( sat(itemp+1).eq.1 ) |
|
$ sat(itemp+1).eq.1 .and. |
|
|
$ value(itemp+1).gt.clseedcut(itemp+1) .and. |
|
|
$ .true.) |
|
| 419 |
itemp = itemp+1 |
itemp = itemp+1 |
| 420 |
lsat = itemp |
lsat = itemp |
| 421 |
if(itemp.eq.last) goto 231 !stops if reaches last strip |
if(itemp.eq.last) goto 231 !stops if reaches last strip |
| 430 |
iseed = itemp ! <<< SEED |
iseed = itemp ! <<< SEED |
| 431 |
else |
else |
| 432 |
iseed = int((lsat+fsat)/2) ! <<< SEED |
iseed = int((lsat+fsat)/2) ! <<< SEED |
| 433 |
if(debug.eq.1) |
c$$$ print*,'saturated strips ',fsat,lsat,iseed |
|
$ print*,'saturated strips (first,last) ',fsat,lsat |
|
| 434 |
c$$$ print*,'--> ',(value(ii),ii=fsat,lsat) |
c$$$ print*,'--> ',(value(ii),ii=fsat,lsat) |
| 435 |
endif |
endif |
| 436 |
c--------------------------------------------------------------- |
c--------------------------------------------------------------- |
| 437 |
c after finding a cluster seed, checks also adjacent strips, |
c after finding a cluster seed, checks also adjacent strips, |
| 438 |
C and tags the ones exceeding clinclcut |
C and tags the ones exceeding clinclcut |
| 439 |
c--------------------------------------------------------------- |
c--------------------------------------------------------------- |
|
|
|
|
if(debug.eq.1)print*,'SEED ',value(iseed),' @',iseed |
|
|
$ ,' cut ',clseedcut(iseed) |
|
|
|
|
| 440 |
ir=iseed !indici destro |
ir=iseed !indici destro |
| 441 |
il=iseed ! e sinistro |
il=iseed ! e sinistro |
| 442 |
|
|
| 558 |
$ mult_view(nclstr_view) = mult_view(nclstr_view)+1 |
$ mult_view(nclstr_view) = mult_view(nclstr_view)+1 |
| 559 |
enddo |
enddo |
| 560 |
|
|
|
c$$$ print*,(value(ii),ii=lmax,rmax) |
|
|
c$$$ print*,(clinclcut(ii),ii=lmax,rmax) |
|
|
c$$$ print*,(clseedcut(ii),ii=lmax,rmax) |
|
| 561 |
|
|
| 562 |
c$$$ if(rmax-lmax+1.gt.25) |
c$$$ if(rmax-lmax+1.gt.25) |
| 563 |
c$$$ $ print*,'view ',iv |
c$$$ $ print*,'view ',iv |
| 583 |
$ delta.gt.cut .and. |
$ delta.gt.cut .and. |
| 584 |
$ value(iss).gt.clseedcut(iss).and. |
$ value(iss).gt.clseedcut(iss).and. |
| 585 |
$ .true.)then |
$ .true.)then |
| 586 |
if( value(iss).gt.vmax )then |
if( value(iss).gt.vmax )then |
| 587 |
imax = iss |
imax = iss |
| 588 |
vmax = value(iss) |
vmax = value(iss) |
| 589 |
else |
else |
| 658 |
ist=nst(j) |
ist=nst(j) |
| 659 |
|
|
| 660 |
clsigma(ind) = sigma(iv,ivk,ist) |
clsigma(ind) = sigma(iv,ivk,ist) |
| 661 |
cladc(ind) = adc(iv,ivk,ist) |
cladc(ind) = int(adc(iv,ivk,ist)) ! EM GCC4.7 is integer |
| 662 |
clbad(ind) = bad(iv,ivk,ist) |
clbad(ind) = bad(iv,ivk,ist) |
| 663 |
c clped(ind) = pedestal(iv,ivk,ist) |
c clped(ind) = pedestal(iv,ivk,ist) |
| 664 |
|
|
| 668 |
$ sgnl(nclstr1) = sgnl(nclstr1) + value(j) !cluster charge |
$ sgnl(nclstr1) = sgnl(nclstr1) + value(j) !cluster charge |
| 669 |
enddo |
enddo |
| 670 |
|
|
| 671 |
if(debug.eq.1)then |
c$$$ print*,'view ',iv,' -- savecluster -- nclstr1: ' |
| 672 |
print*,'view ',iv,' -- ' |
c$$$ $ ,nclstr1,maxs(nclstr1),mult(nclstr1),sgnl(nclstr1) |
| 673 |
$ ,' n.cl: ',nclstr1 |
c$$$ print*,'----------------------' |
| 674 |
$ ,' maxs: ',maxs(nclstr1) |
|
|
$ ,' mult: ',mult(nclstr1) |
|
|
$ ,' sign: ',sgnl(nclstr1) |
|
|
print*,'----------------------' |
|
|
endif |
|
| 675 |
enddo |
enddo |
| 676 |
|
|
| 677 |
return |
return |
| 740 |
c print*,iv,nvk(is),nst(is),adc(iv,nvk(is),nst(is)) |
c print*,iv,nvk(is),nst(is),adc(iv,nvk(is),nst(is)) |
| 741 |
c $ ,cn(iv,nvk(is)) |
c $ ,cn(iv,nvk(is)) |
| 742 |
c $ ,pedestal(iv,nvk(is),nst(is)) |
c $ ,pedestal(iv,nvk(is),nst(is)) |
| 743 |
value(is)= -(DBLE(adc(iv,nvk(is),nst(is))) |
value(is)= -(REAL(adc(iv,nvk(is),nst(is))) ! EM GCC4.7 value(nstrips_view) is real not double |
| 744 |
$ -cn(iv,nvk(is))-pedestal(iv,nvk(is),nst(is))) |
$ -cn(iv,nvk(is))-pedestal(iv,nvk(is),nst(is))) |
| 745 |
$ *mask(iv,nvk(is),nst(is)) |
$ *mask(iv,nvk(is),nst(is)) |
| 746 |
clseedcut(is)=clcuty*sigma(iv,nvk(is),nst(is)) |
clseedcut(is)=clcuty*sigma(iv,nvk(is),nst(is)) |
| 748 |
clinclcut(is)=incuty*sigma(iv,nvk(is),nst(is)) |
clinclcut(is)=incuty*sigma(iv,nvk(is),nst(is)) |
| 749 |
$ *mask(iv,nvk(is),nst(is)) |
$ *mask(iv,nvk(is),nst(is)) |
| 750 |
sat(is)=0 |
sat(is)=0 |
| 751 |
if( adc(iv,nvk(is),nst(is)).lt.adc_saty ) |
if( adc(iv,nvk(is),nst(is)).lt.adc_saty )sat(is)=1 |
|
$ sat(is)=mask(iv,nvk(is),nst(is)) |
|
| 752 |
else |
else |
| 753 |
C=== > X view |
C=== > X view |
| 754 |
value(is)= (DBLE(adc(iv,nvk(is),nst(is))) |
value(is)= (REAL(adc(iv,nvk(is),nst(is))) |
| 755 |
$ -cn(iv,nvk(is))-pedestal(iv,nvk(is),nst(is))) |
$ -cn(iv,nvk(is))-pedestal(iv,nvk(is),nst(is))) |
| 756 |
$ *mask(iv,nvk(is),nst(is)) |
$ *mask(iv,nvk(is),nst(is)) |
| 757 |
clseedcut(is)=clcutx*sigma(iv,nvk(is),nst(is)) |
clseedcut(is)=clcutx*sigma(iv,nvk(is),nst(is)) |
| 759 |
clinclcut(is)=incutx*sigma(iv,nvk(is),nst(is)) |
clinclcut(is)=incutx*sigma(iv,nvk(is),nst(is)) |
| 760 |
$ *mask(iv,nvk(is),nst(is)) |
$ *mask(iv,nvk(is),nst(is)) |
| 761 |
sat(is)=0 |
sat(is)=0 |
| 762 |
if( adc(iv,nvk(is),nst(is)).gt.adc_satx ) |
if( adc(iv,nvk(is),nst(is)).gt.adc_satx )sat(is)=1 |
|
$ sat(is)=mask(iv,nvk(is),nst(is)) |
|
| 763 |
endif |
endif |
| 764 |
enddo !end loop on strips (1) |
enddo !end loop on strips (1) |
| 765 |
|
|