8 integer i1,i2,i3,i4,i5,i6
9 integer i_event,n_event,n_point
10 integer i_pad_x,i_pad_y
11 integer hit(0:350,0:350,0:150)
12 integer z_store(0:10000),z_tmp(10000),f_tmp(10000),n_tmp
13 integer i_int,n_int,inter_layer,inter_layer_new
19 real x_store(0:10000),y_store(0:10000)
20 real x_tmp(10000),y_tmp(10000),dist_cut,e_cut
21 real x_int,y_int,radius_max
22 real q_int,q_tot,sigma1,sigma2,ratio
23 real q_integral1,q_integral2,q_integral,q_check
24 real q_pad(0:600,0:600,0:600)
25 real x_deposit,y_deposit
26 real x_crack(2),x_scaler,y_crack(4),y_scaler
37 data par /0.00001,2.167,0.0008/
44 data y_crack /0.005,32.525,65.065,97.595/
55 data file2 /
'.atuple'/
60 data file0 /
'../mc1/Posi.'/
64 data file4 /
'/HEPdata/ILC/repond/Muon.'/
69 if(dist_cut.gt.e_cut)
then
70 write(6,*)
'Problem with distance cut values'
79 write(6,*)
'Type run number'
82 open(unit=61,status=
'OLD',file=file4//file1//file3)
83 open(unit=62,status=
'UNKNOWN',file=file4//file1//file2)
85 read(61,*) z_store(0),x_store(0),y_store(0)
86 inter_layer=x_store(0)
98 if(n_event.ge.100)
then
102 if(i_event.gt.60000) stop
109 read(61,*,err=4,
end=4) z_store(n_point),
110 > x_store(n_point),y_store(n_point)
112 if(z_store(n_point).ge.0)
then
113 x_store(n_point)=x_store(n_point)/10.
114 y_store(n_point)=y_store(n_point)/10.
118 x_store(0)=x_store(n_point)
119 y_store(0)=y_store(n_point)
120 z_store(0)=z_store(n_point)
123 inter_layer_new=x_store(0)
132 if(f_tmp(i1).eq.1)
then
134 if(z_store(i1).eq.z_store(i2).and.
135 > f_tmp(i2).eq.1)
then
136 r1=sqrt((x_store(i1)-x_store(i2))**2+
137 > (y_store(i1)-y_store(i2))**2)
138 if(r1.lt.dist_cut) f_tmp(i2)=0
146 if(f_tmp(i1).eq.1)
then
148 x_tmp(n_tmp)=x_store(i1)
149 y_tmp(n_tmp)=y_store(i1)
150 z_tmp(n_tmp)=z_store(i1)
155 x_store(i1)=x_tmp(i1)
156 y_store(i1)=y_tmp(i1)
157 z_store(i1)=z_tmp(i1)
167 if(z_store(i1).eq.z_store(i2))
then
168 r1=sqrt((x_store(i1)-x_store(i2))**2+(y_store(i1)-y_store(i2
169 if(r1.lt.dist(i1))
then
205 x_crack(2)=96.0-(x+48.0)
206 x_scaler=amin1(x_crack(1),x_crack(2))
210 r1=abs(y-y_crack(i2)+48.8)
211 if(r1.le.y_scaler) y_scaler=r1
217 r2=par(1)*r1**par(2)*exp(-r1*par(3))
231 if(dist(i1).gt.dist_cut.and.dist(i1).le.e_cut)
then
232 r1=0.5*(1.+(dist(i1)-dist_cut)/(e_cut-dist_cut))
238 if(x_scaler.lt.10.0) q=q*((x_scaler/10.0)**0.7)
239 if(y_scaler.lt.10.0) q=q*((y_scaler/10.0)**0.25)
240 if(y_scaler.lt.1.0) q=q/6.
250 x_int=2.*radius_max*(rand(0)-.5)
251 y_int=2.*radius_max*(rand(0)-.5)
252 r1=sqrt(x_int**2+y_int**2)
253 if(r1.gt.radius_max)
goto 3
258 q_int=q/real(n_int)*8.*
259 > ((1.-ratio)/q_integral1*exp(-0.5*((r1/sigma1)**2))+
260 > ratio/q_integral2*exp(-0.5*((r1/sigma2)**2)))
262 q_check=q_check+q_int
267 x_deposit=x+x_int+48.0
268 y_deposit=y+y_int+48.8
270 if(x_deposit.lt.0.0.or.x_deposit.gt.96.0) q_int=0.
274 if(y_deposit.lt.0.27)
then
276 elseif(y_deposit.gt.32.27.and.y_deposit.lt.32.8)
then
278 elseif(y_deposit.gt.64.8.and.y_deposit.lt.65.33)
then
280 elseif(y_deposit.gt.97.33)
then
284 if(y_deposit.le.32.27)
then
285 i3=int(y_deposit-0.27)
286 elseif(y_deposit.le.64.80)
then
287 i3=int(y_deposit-0.8)
288 elseif(y_deposit.le.97.33)
then
289 i3=int(y_deposit-1.33)
300 q_pad(i2,i3,i4)=q_pad(i2,i3,i4)+q_int
301 if(i_int.lt.n_int)
goto 3
310 if(q_pad(i1,i2,i3).gt.t) hit(i1,i2,i3)=1
317 write(62,*) i_event,inter_layer,-1,-1
321 if(hit(i1,i2,i3).eq.1)
then
322 write(62,*) i_event,i1,i2,i3
330 write(60,*) q,q_check
334 inter_layer=inter_layer_new