--- PamVMC/trk/src/f77/gpucollection.F 2009/02/19 17:46:26 1.1 +++ PamVMC/trk/src/f77/gpucollection.F 2009/06/12 18:39:59 1.5 @@ -17,7 +17,14 @@ *************************************************************************** #include "gpstripspe.inc" - +c +c eventually to be removed in future version containing the BADVA1 filling +c + DATA BADVA1/ntotva1*1/ +c +c new strip capacitance simulation 19/02/09 S. Bottai +c +c dimension stripqxtanti(nstripx) dimension stripqytanti(nstripy) @@ -73,45 +80,73 @@ c=cistrx/cdec c2=cistrx2/cdec - - do j=8,nstripx-6,2 ! only even strips on X side - jm2=1 - IF(j-2.lt.8) jm2=0 - jp2=1 - IF(j+2.gt.(nstripx-6)) jp2=0 - jm4=1 - IF(j-4.lt.8) jm4=0 - jp4=1 - IF(j+4.gt.(nstripx-6)) jp4=0 - - stripqxtanti(j)=proxtanti(np,nt,j)*(1.-2.*(c+c2))+ - + c*(1.-2.*c)*(jm2*proxtanti(np,nt,j-2) - + +jp2*proxtanti(np,nt,j+2))+ - + (c**2)*(jm4*proxtanti(np,nt,j-4)*(1.+c2/(c**2))+ - + 2.*proxtanti(np,nt,j)+jp4*proxtanti(np,nt,j+4)*(1.+c2/(c**2))) +CV jm2=1 +CV IF(j-2.lt.8) jm2=0 +CV jp2=1 +CV IF(j+2.gt.(nstripx-6)) jp2=0 +CV jm4=1 +CV IF(j-4.lt.8) jm4=0 +CV jp4=1 +CV IF(j+4.gt.(nstripx-6)) jp4=0 + + + stripqxtanti(j)=proxtanti(np,nt,j) + SUMF=0. + DO KK=1,15 + KF=KK*2 + IF(KK.EQ.1) FN=F1 + IF(KK.EQ.2) FN=F2 + IF(KK.EQ.3) FN=F3 + IF(KK.EQ.4) FN=F4 + IF(KK.GE.5) FN=F1/KK + IF((J-KF).GE.8) THEN + stripqxtanti(j)=stripqxtanti(j)+FN*proxtanti(np,nt,j-KF) + SUMF=SUMF+FN + ENDIF + IF((J+KF).LE.(nstripx-6)) THEN + stripqxtanti(j)=stripqxtanti(j)+FN*proxtanti(np,nt,j+KF) + SUMF=SUMF+FN + ENDIF + ENDDO + + stripqxtanti(j)=stripqxtanti(j)-SUMF*proxtanti(np,nt,j) + +cv stripqxtanti(j)=proxtanti(np,nt,j)*(1.-2.*(c+c2))+ +cv + c*(1.-2.*c)*(jm2*proxtanti(np,nt,j-2) +cv + +jp2*proxtanti(np,nt,j+2))+ +cv + (c**2)*(jm4*proxtanti(np,nt,j-4)*(1.+c2/(c**2))+ +cv + 2.*proxtanti(np,nt,j)+jp4*proxtanti(np,nt,j+4)*(1.+c2/(c**2))) + + if(stripqxtanti(j).gt.1.e-8) then - NSTRPX=NSTRPX+1 - floatadcx=stripqxtanti(j)*xcalib - IF(NSTRPX.GT.MAXSTR) THEN - WRITE(6,*) 'ERROR - NSTRPX > MAXSTR, NSTRPX=',NSTRPX - NSTRPX=MAXSTR - ENDIF - NPSTRIPX(NSTRPX)=NP - NTSTRIPX(NSTRPX)=NT - ISTRIPX(NSTRPX)=(J/2)+(LADD-1)*1024 - QSTRIPX(NSTRPX)=floatadcx - XSTRIPX(NSTRPX)=GLOBSTRIPX(NP,NT,J) -c PRINT*,'1NPSTRIPX ',NP, ' NTSTRX ', NT,' ISTRIPX ', ISTRIPX(NSTRPX) + + IVA1=INT((J/2-1)/128)+1 + IF(badva1(NP*2,LADD,IVA1).EQ.1) THEN + NSTRPX=NSTRPX+1 + floatadcx=stripqxtanti(j)*xcalib + IF(NSTRPX.GT.MAXSTR) THEN + WRITE(6,*) 'ERROR - NSTRPX > MAXSTR' + NSTRPX=MAXSTR + ENDIF + NPSTRIPX(NSTRPX)=NP + NTSTRIPX(NSTRPX)=NT + ISTRIPX(NSTRPX)=(J/2)+(LADD-1)*1024 + QSTRIPX(NSTRPX)=floatadcx + XSTRIPX(NSTRPX)=GLOBSTRIPX(NP,NT,J) +c PRINT*,'1NPSTRIPX ',NP, ' NTSTRX ', NT,' ISTRIPX ', ISTRIPX(NSTRPX) c PRINT*,'2Q ',QSTRIPX(NSTRPX),' XS ', XSTRIPX(NSTRPX) -c PRINT*,' ' +c PRINT*,' ' + + ENDIF + endif enddo - + c PRINT*, 'NSTRPX', NSTRPX - + ******************** Y side ************************* c=cistry/cdec @@ -154,23 +189,31 @@ + jp2*proytanti(np,nt,jpiu2)) if(stripqytanti(j).gt.1.e-8) then - NSTRPY=NSTRPY+1 - IF(NSTRPY.GT.MAXSTR) THEN - WRITE(6,*) 'ERROR - NSTRPY > MAXSTR, NSTRPY=',NSTRPY - NSTRPY=MAXSTR - ENDIF - floatadcy=stripqytanti(j)*ycalib - NPSTRIPY(NSTRPY)=NP - NTSTRIPY(NSTRPY)=NT - ISTRIPY(NSTRPY)=J+(LADD-1)*1024 - QSTRIPY(NSTRPY)=FLOATADCY - YSTRIPY(NSTRPY)=GLOBSTRIPY(NP,NT,J) -c PRINT*,'1NPSTRIPY ',NP, ' NTSTRY ', NT,' ISTRIPY ', ISTRIPY(NSTRPY) + + + IVA1=INT((J-1)/128)+1 + IF(badva1(NP*2-1,LADD,IVA1).EQ.1) THEN + + NSTRPY=NSTRPY+1 + IF(NSTRPY.GT.MAXSTR) THEN + WRITE(6,*) 'ERROR - NSTRPY > MAXSTR' + NSTRPY=MAXSTR + ENDIF + floatadcy=stripqytanti(j)*ycalib + NPSTRIPY(NSTRPY)=NP + NTSTRIPY(NSTRPY)=NT + ISTRIPY(NSTRPY)=J+(LADD-1)*1024 + QSTRIPY(NSTRPY)=FLOATADCY + YSTRIPY(NSTRPY)=GLOBSTRIPY(NP,NT,J) +c PRINT*,'1NPSTRIPY ',NP, ' NTSTRY ', NT,' ISTRIPY ', ISTRIPY(NSTRPY) c PRINT*,'2Q ',QSTRIPY(NSTRPY),' YS ', YSTRIPY(NSTRPY) + + ENDIF + endif enddo -c PRINT*, 'NSTRPY', NSTRPY +c PRINT*, 'NSTRPY', NSTRPY END