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+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 |
|
ISTRIPX(NSTRPX)=(J/2)+(LADD-1)*1024 |
137 |
|
QSTRIPX(NSTRPX)=floatadcx |
138 |
|
XSTRIPX(NSTRPX)=GLOBSTRIPX(NP,NT,J) |
139 |
|
ENDIF |
140 |
|
|
141 |
endif |
endif |
142 |
enddo |
enddo |
143 |
|
|
184 |
+ jp2*proytanti(np,nt,jpiu2)) |
+ jp2*proytanti(np,nt,jpiu2)) |
185 |
|
|
186 |
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) |
|
187 |
|
|
188 |
|
|
189 |
|
IVA1=INT((J-1)/128)+1 |
190 |
|
IF(badva1(NP*2-1,LADD,IVA1).EQ.1) THEN |
191 |
|
|
192 |
|
NSTRPY=NSTRPY+1 |
193 |
|
IF(NSTRPY.GT.MAXSTR) THEN |
194 |
|
WRITE(6,*) 'ERROR - NSTRPY > MAXSTR' |
195 |
|
NSTRPY=MAXSTR |
196 |
|
ENDIF |
197 |
|
floatadcy=stripqytanti(j)*ycalib |
198 |
|
NPSTRIPY(NSTRPY)=NP |
199 |
|
NTSTRIPY(NSTRPY)=NT |
200 |
|
ISTRIPY(NSTRPY)=J+(LADD-1)*1024 |
201 |
|
QSTRIPY(NSTRPY)=FLOATADCY |
202 |
|
YSTRIPY(NSTRPY)=GLOBSTRIPY(NP,NT,J) |
203 |
|
|
204 |
|
ENDIF |
205 |
|
|
206 |
endif |
endif |
207 |
|
|
208 |
enddo |
enddo |