18 |
|
|
19 |
#include "gpstripspe.inc" |
#include "gpstripspe.inc" |
20 |
|
|
21 |
|
c |
22 |
|
c new strip capacitance simulation 19/02/09 S. Bottai |
23 |
|
c |
24 |
|
c |
25 |
dimension stripqxtanti(nstripx) |
dimension stripqxtanti(nstripx) |
26 |
dimension stripqytanti(nstripy) |
dimension stripqytanti(nstripy) |
27 |
|
|
77 |
|
|
78 |
c=cistrx/cdec |
c=cistrx/cdec |
79 |
c2=cistrx2/cdec |
c2=cistrx2/cdec |
|
|
|
|
|
|
80 |
|
|
81 |
|
|
82 |
do j=8,nstripx-6,2 ! only even strips on X side |
do j=8,nstripx-6,2 ! only even strips on X side |
83 |
jm2=1 |
CV jm2=1 |
84 |
IF(j-2.lt.8) jm2=0 |
CV IF(j-2.lt.8) jm2=0 |
85 |
jp2=1 |
CV jp2=1 |
86 |
IF(j+2.gt.(nstripx-6)) jp2=0 |
CV IF(j+2.gt.(nstripx-6)) jp2=0 |
87 |
jm4=1 |
CV jm4=1 |
88 |
IF(j-4.lt.8) jm4=0 |
CV IF(j-4.lt.8) jm4=0 |
89 |
jp4=1 |
CV jp4=1 |
90 |
IF(j+4.gt.(nstripx-6)) jp4=0 |
CV IF(j+4.gt.(nstripx-6)) jp4=0 |
91 |
|
|
92 |
stripqxtanti(j)=proxtanti(np,nt,j)*(1.-2.*(c+c2))+ |
|
93 |
+ c*(1.-2.*c)*(jm2*proxtanti(np,nt,j-2) |
stripqxtanti(j)=proxtanti(np,nt,j) |
94 |
+ +jp2*proxtanti(np,nt,j+2))+ |
SUMF=0. |
95 |
+ (c**2)*(jm4*proxtanti(np,nt,j-4)*(1.+c2/(c**2))+ |
ccc DO KK=1,15 |
96 |
+ 2.*proxtanti(np,nt,j)+jp4*proxtanti(np,nt,j+4)*(1.+c2/(c**2))) |
DO KK=1,4 |
97 |
|
KF=KK*2 |
98 |
|
IF(KK.EQ.1) FN=F1 |
99 |
|
IF(KK.EQ.2) FN=F2 |
100 |
|
IF(KK.EQ.3) FN=F3 |
101 |
|
IF(KK.EQ.4) FN=F4 |
102 |
|
IF(KK.GE.5) FN=F1/KK |
103 |
|
IF((J-KF).GE.8) THEN |
104 |
|
stripqxtanti(j)=stripqxtanti(j)+FN*proxtanti(np,nt,j-KF) |
105 |
|
SUMF=SUMF+FN |
106 |
|
ENDIF |
107 |
|
IF((J+KF).LE.(nstripx-6)) THEN |
108 |
|
stripqxtanti(j)=stripqxtanti(j)+FN*proxtanti(np,nt,j+KF) |
109 |
|
SUMF=SUMF+FN |
110 |
|
ENDIF |
111 |
|
ENDDO |
112 |
|
|
113 |
|
stripqxtanti(j)=stripqxtanti(j)-SUMF*proxtanti(np,nt,j) |
114 |
|
|
115 |
|
cv stripqxtanti(j)=proxtanti(np,nt,j)*(1.-2.*(c+c2))+ |
116 |
|
cv + c*(1.-2.*c)*(jm2*proxtanti(np,nt,j-2) |
117 |
|
cv + +jp2*proxtanti(np,nt,j+2))+ |
118 |
|
cv + (c**2)*(jm4*proxtanti(np,nt,j-4)*(1.+c2/(c**2))+ |
119 |
|
cv + 2.*proxtanti(np,nt,j)+jp4*proxtanti(np,nt,j+4)*(1.+c2/(c**2))) |
120 |
|
|
121 |
|
|
122 |
if(stripqxtanti(j).gt.1.e-8) then |
if(stripqxtanti(j).gt.1.e-8) then |
123 |
NSTRPX=NSTRPX+1 |
|
124 |
floatadcx=stripqxtanti(j)*xcalib |
IVA1=INT((J/2-1)/128)+1 |
125 |
IF(NSTRPX.GT.MAXSTR) THEN |
IF(badva1(NP*2,LADD,IVA1).EQ.1) THEN |
126 |
WRITE(6,*) 'ERROR - NSTRPX > MAXSTR' |
NSTRPX=NSTRPX+1 |
127 |
NSTRPX=MAXSTR |
floatadcx=stripqxtanti(j)*xcalib |
128 |
ENDIF |
IF(NSTRPX.GT.MAXSTR) THEN |
129 |
NPSTRIPX(NSTRPX)=NP |
WRITE(6,*) 'ERROR - NSTRPX > MAXSTR' |
130 |
NTSTRIPX(NSTRPX)=NT |
NSTRPX=MAXSTR |
131 |
ISTRIPX(NSTRPX)=(J/2)+(LADD-1)*1024 |
ENDIF |
132 |
QSTRIPX(NSTRPX)=floatadcx |
NPSTRIPX(NSTRPX)=NP |
133 |
XSTRIPX(NSTRPX)=GLOBSTRIPX(NP,NT,J) |
NTSTRIPX(NSTRPX)=NT |
134 |
|
ISTRIPX(NSTRPX)=(J/2)+(LADD-1)*1024 |
135 |
|
QSTRIPX(NSTRPX)=floatadcx |
136 |
|
XSTRIPX(NSTRPX)=GLOBSTRIPX(NP,NT,J) |
137 |
|
ENDIF |
138 |
|
|
139 |
endif |
endif |
140 |
enddo |
enddo |
141 |
|
|
182 |
+ jp2*proytanti(np,nt,jpiu2)) |
+ jp2*proytanti(np,nt,jpiu2)) |
183 |
|
|
184 |
if(stripqytanti(j).gt.1.e-8) then |
if(stripqytanti(j).gt.1.e-8) 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) |
|
185 |
|
|
186 |
|
|
187 |
|
IVA1=INT((J-1)/128)+1 |
188 |
|
IF(badva1(NP*2-1,LADD,IVA1).EQ.1) THEN |
189 |
|
|
190 |
|
NSTRPY=NSTRPY+1 |
191 |
|
IF(NSTRPY.GT.MAXSTR) THEN |
192 |
|
WRITE(6,*) 'ERROR - NSTRPY > MAXSTR' |
193 |
|
NSTRPY=MAXSTR |
194 |
|
ENDIF |
195 |
|
floatadcy=stripqytanti(j)*ycalib |
196 |
|
NPSTRIPY(NSTRPY)=NP |
197 |
|
NTSTRIPY(NSTRPY)=NT |
198 |
|
ISTRIPY(NSTRPY)=J+(LADD-1)*1024 |
199 |
|
QSTRIPY(NSTRPY)=FLOATADCY |
200 |
|
YSTRIPY(NSTRPY)=GLOBSTRIPY(NP,NT,J) |
201 |
|
|
202 |
|
ENDIF |
203 |
|
|
204 |
endif |
endif |
205 |
|
|
206 |
enddo |
enddo |