*

      SUBROUTINE GPDSPE
*************************************************************************
*                                                                       *
* To perform SPE digitization                                           *
*                                                                       *
* Called by: GUDIGI                                                     *
* Author: Francesco Cafagna, 23/02/96 12.50.38                          *
*                                                                       *
*************************************************************************
      PARAMETER (RADDEG=57.295779)

*#include "gppdigi.inc"
c +SEQ,GPDSPE.
*#include "gpsed.inc"
*et. 04/11/2005
#include "gpstripspe.inc"
*end et.
*
*      INTEGER IS,ID,NV,NVM,GPNHIT,NTHIT,NHFRST
*      CHARACTER*4 CSET
*      LOGICAL CONT,HF
*
* Data block for digitalization
*
*      INTEGER NTRA,IDIG,LTRA,NPLANE,LKDN,NTDIGI,JJ
*      REAL XI,YI,XO,YO,PATH,DE,GPGAUS
*      REAL VPOS(3),BMAGNET(3),ANGLEX,ANGLEY,XMULT,YMULT,DXPOS,DYPOS
*
*      DATA NTRA,LTRA/1,1/

*et. 04/11/2005
*
*
* Vector zeroed
*
      CALL VZERO(ISTRIPX,MAXSTR)            
      CALL VZERO(NPSTRIPX,MAXSTR)            
      CALL VZERO(NTSTRIPX,MAXSTR)
      CALL VZERO(QSTRIPX,MAXSTR)
      CALL VZERO(XSTRIPX,MAXSTR)
      CALL VZERO(ISTRIPY,MAXSTR)            
      CALL VZERO(NPSTRIPY,MAXSTR)            
      CALL VZERO(NTSTRIPY,MAXSTR)
      CALL VZERO(QSTRIPY,MAXSTR)
      CALL VZERO(YSTRIPY,MAXSTR)
      NSTRPX=0
      NSTRPY=0
      
* 
      do ip=1,nplanes
	 do iip=1,nsensors
	     isignyesx=0
	     isignyesy=0
	     do iiip=1,nstripx
		if(proxtanti(ip,iip,iiip).gt.0) then
		    isignyesx=1
		    GO TO 456
    		endif
	     enddo
	     do iiip=1,nstripy
	         if(proytanti(ip,iip,iiip).gt.0) then
		      isignyesy=1
		      GO TO 456
	         endif
	     enddo
456          if(isignyesx.eq.1.or.isignyesy.eq.1) then
		 call gpucollection(ip,iip)
	     endif
         enddo
      enddo


*      PRINT*,'NSTRPX', NSTRPX, 'NSTRPY', NSTRPY
c      do i=1, nstrpx
c         PRINT*,i,' NPX ',NPSTRIPX(i), ' NTX ', NTSTRIPX(i)
c         PRINT*,i,' ISX ', ISTRIPX(i)
c         PRINT*,i,' QX ',QSTRIPX(i),' XSX ', XSTRIPX(i)
c      enddo
c      do i=1, nstrpy
c         PRINT*,i,' NPY ',NPSTRIPY(i), ' NTY ', NTSTRIPY(i)
c         PRINT*,i,' ISY ', ISTRIPY(i)
c         PRINT*,i,' QY ',QSTRIPY(i),' YSY ', YSTRIPY(i) 
c      enddo


   20 RETURN
      END
