17 |
*************************************************************************** |
*************************************************************************** |
18 |
|
|
19 |
#include "gpstripspe.inc" |
#include "gpstripspe.inc" |
20 |
|
c |
21 |
|
c eventually to be removed in future version containing the BADVA1 filling |
22 |
|
c |
23 |
|
DATA BADVA1/ntotva1*1/ |
24 |
|
c |
25 |
|
c new strip capacitance simulation 19/02/09 S. Bottai |
26 |
|
c |
27 |
|
c |
28 |
dimension stripqxtanti(nstripx) |
dimension stripqxtanti(nstripx) |
29 |
dimension stripqytanti(nstripy) |
dimension stripqytanti(nstripy) |
30 |
|
|
80 |
|
|
81 |
c=cistrx/cdec |
c=cistrx/cdec |
82 |
c2=cistrx2/cdec |
c2=cistrx2/cdec |
|
|
|
|
|
|
83 |
|
|
84 |
|
|
85 |
do j=8,nstripx-6,2 ! only even strips on X side |
do j=8,nstripx-6,2 ! only even strips on X side |
86 |
jm2=1 |
CV jm2=1 |
87 |
IF(j-2.lt.8) jm2=0 |
CV IF(j-2.lt.8) jm2=0 |
88 |
jp2=1 |
CV jp2=1 |
89 |
IF(j+2.gt.(nstripx-6)) jp2=0 |
CV IF(j+2.gt.(nstripx-6)) jp2=0 |
90 |
jm4=1 |
CV jm4=1 |
91 |
IF(j-4.lt.8) jm4=0 |
CV IF(j-4.lt.8) jm4=0 |
92 |
jp4=1 |
CV jp4=1 |
93 |
IF(j+4.gt.(nstripx-6)) jp4=0 |
CV IF(j+4.gt.(nstripx-6)) jp4=0 |
94 |
|
|
95 |
stripqxtanti(j)=proxtanti(np,nt,j)*(1.-2.*(c+c2))+ |
|
96 |
+ c*(1.-2.*c)*(jm2*proxtanti(np,nt,j-2) |
stripqxtanti(j)=proxtanti(np,nt,j) |
97 |
+ +jp2*proxtanti(np,nt,j+2))+ |
SUMF=0. |
98 |
+ (c**2)*(jm4*proxtanti(np,nt,j-4)*(1.+c2/(c**2))+ |
DO KK=1,15 |
99 |
+ 2.*proxtanti(np,nt,j)+jp4*proxtanti(np,nt,j+4)*(1.+c2/(c**2))) |
KF=KK*2 |
100 |
|
IF(KK.EQ.1) FN=F1 |
101 |
|
IF(KK.EQ.2) FN=F2 |
102 |
|
IF(KK.EQ.3) FN=F3 |
103 |
|
IF(KK.EQ.4) FN=F4 |
104 |
|
IF(KK.GE.5) FN=F1/KK |
105 |
|
IF((J-KF).GE.8) THEN |
106 |
|
stripqxtanti(j)=stripqxtanti(j)+FN*proxtanti(np,nt,j-KF) |
107 |
|
SUMF=SUMF+FN |
108 |
|
ENDIF |
109 |
|
IF((J+KF).LE.(nstripx-6)) THEN |
110 |
|
stripqxtanti(j)=stripqxtanti(j)+FN*proxtanti(np,nt,j+KF) |
111 |
|
SUMF=SUMF+FN |
112 |
|
ENDIF |
113 |
|
ENDDO |
114 |
|
|
115 |
|
stripqxtanti(j)=stripqxtanti(j)-SUMF*proxtanti(np,nt,j) |
116 |
|
|
117 |
|
cv stripqxtanti(j)=proxtanti(np,nt,j)*(1.-2.*(c+c2))+ |
118 |
|
cv + c*(1.-2.*c)*(jm2*proxtanti(np,nt,j-2) |
119 |
|
cv + +jp2*proxtanti(np,nt,j+2))+ |
120 |
|
cv + (c**2)*(jm4*proxtanti(np,nt,j-4)*(1.+c2/(c**2))+ |
121 |
|
cv + 2.*proxtanti(np,nt,j)+jp4*proxtanti(np,nt,j+4)*(1.+c2/(c**2))) |
122 |
|
|
123 |
|
|
124 |
if(stripqxtanti(j).gt.1.e-8) then |
if(stripqxtanti(j).gt.1.e-8) then |
125 |
NSTRPX=NSTRPX+1 |
|
126 |
floatadcx=stripqxtanti(j)*xcalib |
IVA1=INT((J/2-1)/128)+1 |
127 |
IF(NSTRPX.GT.MAXSTR) THEN |
IF(badva1(NP*2,LADD,IVA1).EQ.1) THEN |
128 |
WRITE(6,*) 'ERROR - NSTRPX > MAXSTR, NSTRPX=',NSTRPX |
NSTRPX=NSTRPX+1 |
129 |
NSTRPX=MAXSTR |
floatadcx=stripqxtanti(j)*xcalib |
130 |
ENDIF |
IF(NSTRPX.GT.MAXSTR) THEN |
131 |
NPSTRIPX(NSTRPX)=NP |
WRITE(6,*) 'ERROR - NSTRPX > MAXSTR' |
132 |
NTSTRIPX(NSTRPX)=NT |
NSTRPX=MAXSTR |
133 |
ISTRIPX(NSTRPX)=(J/2)+(LADD-1)*1024 |
ENDIF |
134 |
QSTRIPX(NSTRPX)=floatadcx |
NPSTRIPX(NSTRPX)=NP |
135 |
XSTRIPX(NSTRPX)=GLOBSTRIPX(NP,NT,J) |
NTSTRIPX(NSTRPX)=NT |
136 |
c PRINT*,'1NPSTRIPX ',NP, ' NTSTRX ', NT,' ISTRIPX ', ISTRIPX(NSTRPX) |
ISTRIPX(NSTRPX)=(J/2)+(LADD-1)*1024 |
137 |
|
QSTRIPX(NSTRPX)=floatadcx |
138 |
|
XSTRIPX(NSTRPX)=GLOBSTRIPX(NP,NT,J) |
139 |
|
c PRINT*,'1NPSTRIPX ',NP, ' NTSTRX ', NT,' ISTRIPX ', ISTRIPX(NSTRPX) |
140 |
c PRINT*,'2Q ',QSTRIPX(NSTRPX),' XS ', XSTRIPX(NSTRPX) |
c PRINT*,'2Q ',QSTRIPX(NSTRPX),' XS ', XSTRIPX(NSTRPX) |
141 |
c PRINT*,' ' |
c PRINT*,' ' |
142 |
|
|
143 |
|
ENDIF |
144 |
|
|
145 |
endif |
endif |
146 |
enddo |
enddo |
147 |
|
|
148 |
c PRINT*, 'NSTRPX', NSTRPX |
c PRINT*, 'NSTRPX', NSTRPX |
149 |
|
|
150 |
******************** Y side ************************* |
******************** Y side ************************* |
151 |
|
|
152 |
c=cistry/cdec |
c=cistry/cdec |
189 |
+ jp2*proytanti(np,nt,jpiu2)) |
+ jp2*proytanti(np,nt,jpiu2)) |
190 |
|
|
191 |
if(stripqytanti(j).gt.1.e-8) then |
if(stripqytanti(j).gt.1.e-8) then |
192 |
NSTRPY=NSTRPY+1 |
|
193 |
IF(NSTRPY.GT.MAXSTR) THEN |
|
194 |
WRITE(6,*) 'ERROR - NSTRPY > MAXSTR, NSTRPY=',NSTRPY |
IVA1=INT((J-1)/128)+1 |
195 |
NSTRPY=MAXSTR |
IF(badva1(NP*2-1,LADD,IVA1).EQ.1) THEN |
196 |
ENDIF |
|
197 |
floatadcy=stripqytanti(j)*ycalib |
NSTRPY=NSTRPY+1 |
198 |
NPSTRIPY(NSTRPY)=NP |
IF(NSTRPY.GT.MAXSTR) THEN |
199 |
NTSTRIPY(NSTRPY)=NT |
WRITE(6,*) 'ERROR - NSTRPY > MAXSTR' |
200 |
ISTRIPY(NSTRPY)=J+(LADD-1)*1024 |
NSTRPY=MAXSTR |
201 |
QSTRIPY(NSTRPY)=FLOATADCY |
ENDIF |
202 |
YSTRIPY(NSTRPY)=GLOBSTRIPY(NP,NT,J) |
floatadcy=stripqytanti(j)*ycalib |
203 |
c PRINT*,'1NPSTRIPY ',NP, ' NTSTRY ', NT,' ISTRIPY ', ISTRIPY(NSTRPY) |
NPSTRIPY(NSTRPY)=NP |
204 |
|
NTSTRIPY(NSTRPY)=NT |
205 |
|
ISTRIPY(NSTRPY)=J+(LADD-1)*1024 |
206 |
|
QSTRIPY(NSTRPY)=FLOATADCY |
207 |
|
YSTRIPY(NSTRPY)=GLOBSTRIPY(NP,NT,J) |
208 |
|
c PRINT*,'1NPSTRIPY ',NP, ' NTSTRY ', NT,' ISTRIPY ', ISTRIPY(NSTRPY) |
209 |
c PRINT*,'2Q ',QSTRIPY(NSTRPY),' YS ', YSTRIPY(NSTRPY) |
c PRINT*,'2Q ',QSTRIPY(NSTRPY),' YS ', YSTRIPY(NSTRPY) |
210 |
|
|
211 |
|
ENDIF |
212 |
|
|
213 |
endif |
endif |
214 |
|
|
215 |
enddo |
enddo |
216 |
|
|
217 |
c PRINT*, 'NSTRPY', NSTRPY |
c PRINT*, 'NSTRPY', NSTRPY |
218 |
END |
END |
219 |
|
|