13 common/lypara/ipy(80),pypar(80),pyvar(80)
18 integer nevgen, i, j, lastgenevent,
genevent
19 integer iev, nev, nprt
20 integer idum1, idum2, initseed
21 integer ltype, tracknr,
t1,
t2
22 integer*4 today(3),
now(3)
24 real mcfixedweight, mcextraweight
25 double precision dilut, f1,
f2,
r, da1, da2
26 double precision gendilut, genf1, genf2, genr, gena1, gena2
27 DOUBLE PRECISION radgamenucl
28 DOUBLE PRECISION pbeame, pbeta, pgamma, ebeame, epznucl
29 DOUBLE PRECISION depol, gamma2,
d, eta,
eps, chi
30 DOUBLE PRECISION gendepol, gend, geneta, geneps, genchi
31 DOUBLE PRECISION dbrack, dxsec
40 CHARACTER*256 outputfilename
87 READ(*,*) pbeam, ebeam
91 READ(*,*) mcset_xmin, mcset_xmax
93 READ(*,*) mcset_ymin, mcset_ymax
95 READ(*,*) mcset_q2min, mcset_q2max
97 READ(*,*) genset_fstruct, genset_r
101 READ(*,*) mcset_w2min,mcset_w2max
103 READ(*,*) mcset_numin,mcset_numax
105 READ(*,*) mcset_pbvalue, mcset_ptvalue
107 READ(*,*) mcset_pbeam, mcset_ptarget
109 100
READ(*,*,
end=200)
param, j, rval
110 if (
param.eq.
'LST')
then
112 write(*,*)
'LST(',j,
')=',rval
114 if (
param.eq.
'PARL')
then
116 write(*,*)
'PARL(',j,
')=',rval
118 if (
param.eq.
'PARJ')
then
120 write(*,*)
'PARJ(',j,
')=',rval
122 if (
param.eq.
'MSTJ')
then
124 write(*,*)
'MSTJ(',j,
')=',rval
126 if (
param.eq.
'MSTU')
then
128 write(*,*)
'MSTU(',j,
')=',rval
130 if (
param.eq.
'PARU')
then
132 write(*,*)
'PARU(',j,
')=',rval
134 if (
param.eq.
'PYPAR')
then
136 write(*,*)
'PYPAR(',j,
')=',rval
139 200
write(*,*)
'*********************************************'
140 write(*,*)
'NOW all parameters are read by PEPSI'
141 write(*,*)
'*********************************************'
144 if (mcset_pbvalue*mcset_ptvalue.lt.0.)
then
146 elseif (mcset_pbvalue*mcset_ptvalue.gt.0.)
then
156 if (lst(40).ne.0.and.parl(1).eq.3.and.parl(2).eq.2)
then
185 initseed = today(1) + 10*today(2) + today(3) +
now(1) + 5*
now(3)
186 write(6,*)
'SEED = ', initseed
187 call
rndmq(idum1,idum2,initseed,
' ')
189 if (abs(ltype).eq.11)
then
192 write(*,*)
"Only positron and electron beam supported"
195 if ((parl(1).eq.1).and.(parl(2).eq.1))
then
197 elseif ((parl(1).eq.1).and.(parl(2).eq.0))
then
199 elseif ((parl(1).eq.2).and.(parl(2).eq.1))
then
202 write(*,*)
"Currently only p,n,d as target supported"
205 pbeame=sqrt(pbeam**2+massp**2)
208 ebeame=sqrt(ebeam**2+masse**2)
209 ebeamenucl=pgamma*ebeame-pgamma*pbeta*(-ebeam)
210 epznucl=-pgamma*pbeta*(ebeame)+pgamma*(-ebeam)
211 write(*,*) ebeamenucl, ebeame, epznucl, -ebeam
212 mcset_enebeam=sngl(ebeamenucl)
216 call
linit(0,ltype,(-ebeam),pbeam,lst(23))
222 outputfilename=outname
223 open(asciilun, file=outputfilename)
224 write(*,*)
'the outputfile will be named: ', outname
227 mcextraweight = parl(23)
233 write(29,*)
' PEPSI EVENT FILE '
234 write(29,*)
'============================================'
236 30
format(
'I, ievent, genevent, process, subprocess, nucleon,
237 & struckparton, partontrck, trueY, trueQ2, trueX, trueW2,
238 & trueNu, FixedWeight, weight, dxsec, Extraweight,
239 & dilut, F1, F2, A1, A2, R, Depol, d, eta, eps, chi,
240 & gendilut, genF1, genF2, genA1, genA2, genR, genDepol, gend,
241 & geneta, geneps, genchi, Sigcor, radgamEnucl, nrTracks')
243 write(29,*)
'============================================'
244 write(29,*)
' I K(I,1) K(I,2) K(I,3) K(I,4) K(I,5)
245 & P(I,1) P(I,2) P(I,3) P(I,4) P(I,5) V(I,1) V(I,2) V(I,3)'
246 write(29,*)
'============================================'
253 if (qedrad.eq.0)
then
255 write(*,*)
'Generating full event with LEPTO/PEPSI.'
266 if (lst(21).ne.0)
then
267 write(*,*)
'PEPSI failed, trying again,
268 & no rad-corrections'
290 call
mkasym(dble(q2), dble(
x), mcset_tara, mcset_tarz, da1, da2)
291 call
mkf2(dble(q2), dble(
x), mcset_tara, mcset_tarz,
f2, f1)
292 call
mkr(dble(q2), dble(
x),
r)
293 call
fdilut(dble(q2), dble(
x), mcset_tara, dilut)
297 depol=(
y*((1.+gamma2*
y/2.)*(2.-
y)-2*
y**2*masse**2/q2))/
298 & (
y**2*(1.-2.*masse**2/q2)*(1.+gamma2)+2.*(1.+
r)*
299 & (1.-
y-gamma2*(
y**2)/4.))
300 d=depol*((sqrt(1.-
y-gamma2*(
y**2)/4.)*(1+gamma2*
y/2.)) /
301 & (1.-
y/2.)*(1+gamma2*
y/2.)-
y**2*masse**2/q2)
302 eta=(sqrt(gamma2)*(1.-
y-gamma2*
y**2/4.-
y**2*masse**2/q2)) /
303 & ((1.+gamma2**2*
y/2.)*(1-
y/2.)-
y**2*masse**2/q2)
304 chi=(sqrt(gamma2)*(1.-
y/2.-
y**2.*masse**2/q2))/(1.+gamma2*
y/2.)
305 eps=1./(1.+1./2.*(1.-2.*masse**2/q2)*((
y**2+gamma2*
y**2)/
306 & (1.-
y-gamma2*(
y**2)/4.)))
308 dbrack = (4.*paru(1)*alpha**2)/q2**2
310 dxsec = (1.-
y-(massp*
x*
y/2./ebeame))*
f2/
x+
y**2*f1
312 dxsec = dbrack * dxsec * 0.389379292
314 write(29,32) 0, iev,
genevent, lst(23), lst(24), lst(22),
315 & lst(25), lst(26),
y, q2,
x, w2, u, mcfixedweight, weight,
316 & dxsec, mcextraweight,
real(dilut),
real(F1),
317 &
real(F2),
real(dA1),
real(dA2),
real(R),
real(Depol),
real(d),
318 &
real(eta),
real(eps),
real(chi),
real(gendilut),
real(genF1),
319 &
real(genF2),
real(genA1),
real(genA2),
real(genR),
320 &
real(genDepol),
real(gend),
real(geneta),
real(geneps),
321 &
real(genchi), mcradcor_sigcor, radgamenucl, tracknr
322 32
format((i4,1
x,$),(i10,1
x,$),6(i6,1
x,$),
323 & 33(e18.10,1
x,$),i12,/)
324 write(29,*)
'============================================'
327 write(29,34) i,
k(i,1),
k(i,2),
k(i,3),
k(i,4),
k(i,5),
328 &
p(i,1),
p(i,2),
p(i,3),
p(i,4),
p(i,5),
329 &
v(i,1),
v(i,2),
v(i,3)
331 34
format(2(i6,1
x,$),i10,1
x,$,3(i6,1
x,$),8(f15.6,1
x,$),/)
332 write(29,*)
'=============== Event finished ==============='
340 write(*,*)
'==================================================='
341 write(*,*)
'Pepsi total cross section in pb from numerical',
342 &
' integration', parl(23)
343 write(*,*)
'Pepsi total cross section in pb from MC simulation',
345 write(*,*)
'Total Number of generated events', nev
346 write(*,*)
'Total Number of trials', nevgen
347 write(*,*)
'==================================================='