11 integer nevgen, i, j, lastgenevent,
genevent
12 integer iev, nev, nprt
13 integer idum1, idum2, initseed
14 integer ltype, tracknr,
t1,
t2
15 integer*4 today(3),
now(3)
17 real mcfixedweight, mcextraweight
18 double precision dilut, f1,
f2,
r, da1, da2
19 double precision gendilut, genf1, genf2, genr, gena1, gena2
20 DOUBLE PRECISION radgamenucl
21 DOUBLE PRECISION pbeame, pbeta, pgamma, ebeame, epznucl
22 DOUBLE PRECISION depol, gamma2,
d, eta,
eps, chi
23 DOUBLE PRECISION gendepol, gend, geneta, geneps, genchi
24 DOUBLE PRECISION dbrack, dxsec
28 c---------------------------------------------------------------------
30 c ---------------------------------------------------------------------
33 CHARACTER*256 outputfilename
69 c init all the parameters and
read them
in
80 READ(*,*) pbeam, ebeam
84 READ(*,*) mcset_xmin, mcset_xmax
86 READ(*,*) mcset_ymin, mcset_ymax
88 READ(*,*) mcset_q2min, mcset_q2max
90 READ(*,*) genset_fstruct, genset_r
91 c...
Read switch
for rad-corrections
94 READ(*,*) mcset_w2min,mcset_w2max
96 READ(*,*) mcset_numin,mcset_numax
98 READ(*,*) mcset_pbvalue, mcset_ptvalue
99 c...
Read beam and
Target polarisation
100 READ(*,*) mcset_pbeam, mcset_ptarget
101 c...
Read all the pepsi/
lepto parameters
102 100
READ(*,*,
end=200)
param, j, rval
103 if (
param.eq.
'LST')
then
105 write(*,*)
'LST(',j,
')=',rval
107 if (
param.eq.
'PARL')
then
109 write(*,*)
'PARL(',j,
')=',rval
111 if (
param.eq.
'PARJ')
then
113 write(*,*)
'PARJ(',j,
')=',rval
115 if (
param.eq.
'MSTJ')
then
117 write(*,*)
'MSTJ(',j,
')=',rval
119 if (
param.eq.
'MSTU')
then
121 write(*,*)
'MSTU(',j,
')=',rval
123 if (
param.eq.
'PARU')
then
125 write(*,*)
'PARU(',j,
')=',rval
128 200
write(*,*)
'*********************************************'
129 write(*,*)
'NOW all parameters are read by PEPSI'
130 write(*,*)
'*********************************************'
132 c ... pepsi polarization
133 if (mcset_pbvalue*mcset_ptvalue.lt.0.)
then
135 elseif (mcset_pbvalue*mcset_ptvalue.gt.0.)
then
141 c ... polarization
for helium 3
142 c use lst(39)=1
for ideal helium 3 (no
s prime and
d state)
143 c use lst(39)=3 or (02 should work too ?)
for a real helium 3.
145 if (lst(40).ne.0.and.parl(1).eq.3.and.parl(2).eq.2)
then
164 c cut(10)=mcset_numax
174 initseed = today(1) + 10*today(2) + today(3) +
now(1) + 5*
now(3)
175 write(6,*)
'SEED = ', initseed
176 call
rndmq(idum1,idum2,initseed,
' ')
178 if (abs(ltype).eq.11)
then
181 write(*,*)
"Only positron and electron beam supported"
184 if ((parl(1).eq.1).and.(parl(2).eq.1))
then
186 elseif ((parl(1).eq.1).and.(parl(2).eq.0))
then
188 elseif ((parl(2).eq.2).and.(parl(2).eq.1))
then
191 write(*,*)
"Currently only p,n,d as target supported"
194 pbeame=sqrt(pbeam**2+massp**2)
197 ebeame=sqrt(ebeam**2+masse**2)
198 ebeamenucl=pgamma*ebeame-pgamma*pbeta*(-ebeam)
199 epznucl=-pgamma*pbeta*(ebeame)+pgamma*(-ebeam)
200 write(*,*) ebeamenucl, ebeame, epznucl, -ebeam
201 mcset_enebeam=sngl(ebeamenucl)
205 call
linit(0,ltype,(-ebeam),pbeam,lst(23))
208 c ---------------------------------------------------------------------
210 c ---------------------------------------------------------------------
211 outputfilename=outname
212 open(asciilun, file=outputfilename)
213 write(*,*)
'the outputfile will be named: ', outname
215 c the total integrated xsec,
in pbarns
216 mcextraweight = parl(23)
222 write(29,*)
' PEPSI EVENT FILE '
223 write(29,*)
'============================================'
225 30
format(
'I, ievent, genevent, process, subprocess, nucleon,
226 & struckparton, partontrck, trueY, trueQ2, trueX, trueW2,
227 & trueNu, FixedWeight, weight, dxsec, Extraweight,
228 & dilut, F1, F2, A1, A2, R, Depol, d, eta, eps, chi,
229 & gendilut, genF1, genF2, genA1, genA2, genR, genDepol, gend,
230 & geneta, geneps, genchi, Sigcor, radgamEnucl, nrTracks')
232 write(29,*)
'============================================'
233 write(29,*)
' I K(I,1) K(I,2) K(I,3) K(I,4) K(I,5)
234 & P(I,1) P(I,2) P(I,3) P(I,4) P(I,5) V(I,1) V(I,2) V(I,3)'
235 write(29,*)
'============================================'
242 if (qedrad.eq.0)
then
244 write(*,*)
'Generating full event with LEPTO/PEPSI.'
255 if (lst(21).ne.0)
then
256 write(*,*)
'PEPSI failed, trying again,
257 & no rad-corrections'
277 if ((
k(i,1).eq.0).and.(
k(i,2).eq.0).and.(
k(i,3).eq.0).and.
278 & (
k(i,4).eq.0).and.(
k(i,5).eq.0))
then
286 call
mkasym(dble(q2), dble(
x), mcset_tara, mcset_tarz, da1, da2)
287 call
mkf2(dble(q2), dble(
x), mcset_tara, mcset_tarz,
f2, f1)
288 call
mkr(dble(q2), dble(
x),
r)
289 call
fdilut(dble(q2), dble(
x), mcset_tara, dilut)
293 depol=(
y*((1.+gamma2*
y/2.)*(2.-
y)-2*
y**2*masse**2/q2))/
294 & (
y**2*(1.-2.*masse**2/q2)*(1.+gamma2)+2.*(1.+
r)*
295 & (1.-
y-gamma2*(
y**2)/4.))
296 d=depol*((sqrt(1.-
y-gamma2*(
y**2)/4.)*(1+gamma2*
y/2.)) /
297 & (1.-
y/2.)*(1+gamma2*
y/2.)-
y**2*masse**2/q2)
298 eta=(sqrt(gamma2)*(1.-
y-gamma2*
y**2/4.-
y**2*masse**2/q2)) /
299 & ((1.+gamma2**2*
y/2.)*(1-
y/2.)-
y**2*masse**2/q2)
300 chi=(sqrt(gamma2)*(1.-
y/2.-
y**2.*masse**2/q2))/(1.+gamma2*
y/2.)
301 eps=1./(1.+1./2.*(1.-2.*masse**2/q2)*((
y**2+gamma2*
y**2)/
302 & (1.-
y-gamma2*(
y**2)/4.)))
304 dbrack = (4.*paru(1)*alpha**2)/q2**2
305 c cross section
in hbar^2
c^2/gev^2/dq^2/
dx
306 dxsec = (1.-
y-(massp*
x*
y/2./ebeame))*
f2/
x+
y**2*f1
307 c cross sectin
in mbarn/dq^2/
dx
308 dxsec = dbrack * dxsec * 0.389379292
310 write(29,32) 0, iev,
genevent, lst(23), lst(24), lst(22),
311 & lst(25), lst(26),
y, q2,
x, w2, u, mcfixedweight, weight,
312 & dxsec, mcextraweight,
real(dilut),
real(F1),
313 &
real(F2),
real(dA1),
real(dA2),
real(R),
real(Depol),
real(d),
314 &
real(eta),
real(eps),
real(chi),
real(gendilut),
real(genF1),
315 &
real(genF2),
real(genA1),
real(genA2),
real(genR),
316 &
real(genDepol),
real(gend),
real(geneta),
real(geneps),
317 &
real(genchi), mcradcor_sigcor, radgamenucl, tracknr
318 32
format((i4,1
x,$),(i10,1
x,$),6(i6,1
x,$),
319 & 33(e18.10,1
x,$),i12,/)
320 write(29,*)
'============================================'
323 write(29,34) i,
k(i,1),
k(i,2),
k(i,3),
k(i,4),
k(i,5),
324 &
p(i,1),
p(i,2),
p(i,3),
p(i,4),
p(i,5),
325 &
v(i,1),
v(i,2),
v(i,3)
327 34
format(2(i6,1
x,$),i10,1
x,$,3(i6,1
x,$),8(f15.6,1
x,$),/)
328 write(29,*)
'=============== Event finished ==============='
335 c normalisation the number
is in pbarns
336 write(*,*)
'==================================================='
337 write(*,*)
'Pepsi total cross section in pb from numerical',
338 &
' integration', parl(23)
339 write(*,*)
'Pepsi total cross section in pb from MC simulation',
341 write(*,*)
'Total Number of generated events', nev
342 write(*,*)
'Total Number of trials', nevgen
343 write(*,*)
'==================================================='