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
43 CHARACTER*256 outputfilename
92 READ(*,*) pbeam, ebeam
96 READ(*,*) mcset_xmin, mcset_xmax
98 READ(*,*) mcset_ymin, mcset_ymax
100 READ(*,*) mcset_q2min, mcset_q2max
102 READ(*,*) genset_fstruct, genset_r
106 READ(*,*) mcset_w2min,mcset_w2max
108 READ(*,*) mcset_numin,mcset_numax
110 READ(*,*) mcset_pbvalue, mcset_ptvalue
112 READ(*,*) mcset_pbeam, mcset_ptarget
114 100
READ(*,*,
end=200)
param, j, rval
115 if (
param.eq.
'LST')
then
117 write(*,*)
'LST(',j,
')=',rval
119 if (
param.eq.
'PARL')
then
121 write(*,*)
'PARL(',j,
')=',rval
123 if (
param.eq.
'PARJ')
then
125 write(*,*)
'PARJ(',j,
')=',rval
127 if (
param.eq.
'MSTJ')
then
129 write(*,*)
'MSTJ(',j,
')=',rval
131 if (
param.eq.
'MSTU')
then
133 write(*,*)
'MSTU(',j,
')=',rval
135 if (
param.eq.
'PARU')
then
137 write(*,*)
'PARU(',j,
')=',rval
139 if (
param.eq.
'PYPAR')
then
141 write(*,*)
'PYPAR(',j,
')=',rval
148 200
write(*,*)
'*********************************************'
149 write(*,*)
'NOW all parameters are read by PEPSI'
150 write(*,*)
'*********************************************'
153 if (mcset_pbvalue*mcset_ptvalue.lt.0.)
then
155 elseif (mcset_pbvalue*mcset_ptvalue.gt.0.)
then
165 if (lst(40).ne.0.and.parl(1).eq.3.and.parl(2).eq.2)
then
194 initseed = today(1) + 10*today(2) + today(3) +
now(1) + 5*
now(3)
195 write(6,*)
'SEED = ', initseed
196 call
rndmq(idum1,idum2,initseed,
' ')
198 if (abs(ltype).eq.11)
then
201 write(*,*)
"Only positron and electron beam supported"
204 if ((parl(1).eq.1).and.(parl(2).eq.1))
then
206 elseif ((parl(1).eq.1).and.(parl(2).eq.0))
then
208 elseif ((parl(1).eq.2).and.(parl(2).eq.1))
then
210 elseif ((parl(1).eq.3).and.(parl(2).eq.2))
then
213 write(*,*)
"Currently only p,n,d,he-3 as target supported"
216 pbeame=sqrt(pbeam**2+massp**2)
219 ebeame=sqrt(ebeam**2+masse**2)
220 ebeamenucl=pgamma*ebeame-pgamma*pbeta*(-ebeam)
221 epznucl=-pgamma*pbeta*(ebeame)+pgamma*(-ebeam)
222 write(*,*) ebeamenucl, ebeame, epznucl, -ebeam
223 mcset_enebeam=sngl(ebeamenucl)
227 call
linit(0,ltype,(-ebeam),pbeam,lst(23))
238 outputfilename=outname
239 open(asciilun, file=outputfilename)
240 write(*,*)
'the outputfile will be named: ', outname
243 mcextraweight = parl(23)
249 write(29,*)
' PEPSI EVENT FILE '
250 write(29,*)
'============================================'
252 30
format(
'I, ievent, genevent, process, subprocess, nucleon,
253 & struckparton, partontrck, trueY, trueQ2, trueX, trueW2,
254 & trueNu, FixedWeight, weight, dxsec, Extraweight,
255 & dilut, F1, F2, A1, A2, R, Depol, d, eta, eps, chi,
256 & gendilut, genF1, genF2, genA1, genA2, genR, genDepol, gend,
257 & geneta, geneps, genchi, Sigcor, radgamEnucl, nrTracks')
259 write(29,*)
'============================================'
260 write(29,*)
' I K(I,1) K(I,2) K(I,3) K(I,4) K(I,5)
261 & P(I,1) P(I,2) P(I,3) P(I,4) P(I,5) V(I,1) V(I,2) V(I,3)'
262 write(29,*)
'============================================'
269 if (qedrad.eq.0)
then
271 write(*,*)
'Generating full event with LEPTO/PEPSI.'
282 if (lst(21).ne.0)
then
283 write(*,*)
'PEPSI failed, trying again,
284 & no rad-corrections'
306 call
mkasym(dble(q2), dble(
x), mcset_tara, mcset_tarz, da1, da2)
307 call
mkf2(dble(q2), dble(
x), mcset_tara, mcset_tarz,
f2, f1)
308 call
mkr(dble(q2), dble(
x),
r)
309 call
fdilut(dble(q2), dble(
x), mcset_tara, dilut)
313 depol=(
y*((1.+gamma2*
y/2.)*(2.-
y)-2*
y**2*masse**2/q2))/
314 & (
y**2*(1.-2.*masse**2/q2)*(1.+gamma2)+2.*(1.+
r)*
315 & (1.-
y-gamma2*(
y**2)/4.))
316 d=depol*((sqrt(1.-
y-gamma2*(
y**2)/4.)*(1+gamma2*
y/2.)) /
317 & (1.-
y/2.)*(1+gamma2*
y/2.)-
y**2*masse**2/q2)
318 eta=(sqrt(gamma2)*(1.-
y-gamma2*
y**2/4.-
y**2*masse**2/q2)) /
319 & ((1.+gamma2**2*
y/2.)*(1-
y/2.)-
y**2*masse**2/q2)
320 chi=(sqrt(gamma2)*(1.-
y/2.-
y**2.*masse**2/q2))/(1.+gamma2*
y/2.)
321 eps=1./(1.+1./2.*(1.-2.*masse**2/q2)*((
y**2+gamma2*
y**2)/
322 & (1.-
y-gamma2*(
y**2)/4.)))
324 dbrack = (4.*paru(1)*alpha**2)/q2**2
326 dxsec = (1.-
y-(massp*
x*
y/2./ebeame))*
f2/
x+
y**2*f1
328 dxsec = dbrack * dxsec * 0.389379292
330 write(29,32) 0, iev,
genevent, lst(23), lst(24), lst(22),
331 & lst(25), lst(26),
y, q2,
x, w2, u, mcfixedweight, weight,
332 & dxsec, mcextraweight,
real(dilut),
real(F1),
333 &
real(F2),
real(dA1),
real(dA2),
real(R),
real(Depol),
real(d),
334 &
real(eta),
real(eps),
real(chi),
real(gendilut),
real(genF1),
335 &
real(genF2),
real(genA1),
real(genA2),
real(genR),
336 &
real(genDepol),
real(gend),
real(geneta),
real(geneps),
337 &
real(genchi), mcradcor_sigcor, radgamenucl, tracknr
338 32
format((i4,1
x,$),(i10,1
x,$),6(i6,1
x,$),
339 & 33(e18.10,1
x,$),i12,/)
340 write(29,*)
'============================================'
343 write(29,34) i,
k(i,1),
k(i,2),
k(i,3),
k(i,4),
k(i,5),
344 &
p(i,1),
p(i,2),
p(i,3),
p(i,4),
p(i,5),
345 &
v(i,1),
v(i,2),
v(i,3)
347 34
format(2(i6,1
x,$),i10,1
x,$,3(i6,1
x,$),8(f15.6,1
x,$),/)
348 write(29,*)
'=============== Event finished ==============='
356 write(*,*)
'==================================================='
357 write(*,*)
'Pepsi total cross section in pb from numerical',
358 &
' integration', parl(23)
359 write(*,*)
'Pepsi total cross section in pb from MC simulation',
361 write(*,*)
'Total Number of generated events', nev
362 write(*,*)
'Total Number of trials', nevgen
363 write(*,*)
'==================================================='