COSMOS v7.655  COSMOSv7655
(AirShowerMC)
qgsjet01.f
Go to the documentation of this file.
1 C from Sergey. Jul.2010; typevt is the flag for NSD
2 C only typevt part is added from the version above (KK)
3 C name is changed from qgsjet01c.f to qgsjet01.f
4 C======================================================================C
5 C C
6 C QQQ GGG SSSS JJJJJJJ EEEEEEE TTTTTTT C
7 C Q Q G G S S J E T C
8 C Q Q G S J E T C
9 C Q Q G GGG SSSS J EEEEE T C
10 C Q Q Q G G S J E T C
11 C Q Q G G S S J J E T C
12 C QQQ QQ GGG SSSS JJJ EEEEEEE T C
13 C C
14 C C
15 C----------------------------------------------------------------------C
16 C C
17 C QUARK - GLUON - STRING - MODEL C
18 C C
19 C HIGH ENERGY HADRON INTERACTION PROGRAM C
20 C C
21 C BY C
22 C C
23 C N. N. KALMYKOV AND S. S. OSTAPCHENKO C
24 C C
25 C MOSCOW STATE UNIVERSITY, MOSCOW, RUSSIA C
26 C e-mail: serg@eas.npi.msu.su C
27 C----------------------------------------------------------------------C
28 C SUBROUTINE VERSION TO BE LINKED WITH C
29 C C O R S I K A C
30 C KARLSRUHE AIR SHOWER SIMULATION PROGRAM C
31 C WITH MODIFICATIONS C
32 C BY C
33 C D. HECK IK FZK KARLSRUHE C
34 C----------------------------------------------------------------------C
35 C last modification: June 15, 2005 C
36 C Version qgsjet01c.f C
37 C----------------------------------------------------------------------C
38 C modifications are marked by cdh
39 C=======================================================================
40 
41  SUBROUTINE psaini
42 c Common initialization procedure
43 c-----------------------------------------------------------------------
44  IMPLICIT DOUBLE PRECISION (a-h,o-z)
45  INTEGER DEBUG
46  CHARACTER *7 TY
47  LOGICAL LCALC,LSECT
48 ********************************************
49  dimension eq(17),mij(17,17,4),nij(17,17,4),csjet(17,17,68),
50  *cs1(17,17,68),gz0(2),gz1(3)
51  COMMON /xsect/ gsect(10,5,4)
52  COMMON /area1/ ia(2),icz,icp
53  COMMON /area5/ rd(2),cr1(2),cr2(2),cr3(2)
54 ********************************************
55  COMMON /area6/ pi,bm,am
56  COMMON /area7/ rp1
57  COMMON /area10/ stmass,am0,amn,amk,amc,amlamc,amlam,ameta
58  COMMON /area15/ fp(5),rq(5),cd(5)
59  COMMON /area16/ cc(5)
60  COMMON /area17/ del,rs,rs0,fs,alfp,rr,sh,delh
61  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
62  COMMON /area19/ ahl(5)
63 ********************************************
64  COMMON /area22/ sjv0,fjs0(5,3)
65 ********************************************
66  COMMON /area23/ rjv(50)
67  COMMON /area24/ rjs(50,5,10)
68  COMMON /area27/ fp0(5)
69  COMMON /area28/ arr(4)
70  COMMON /area29/ cstot(17,17,68)
71  COMMON /area30/ cs0(17,17,68)
72  COMMON /area31/ csborn(17,68)
73  COMMON /area32/ csq(17,2,2),csbq(17,2,2)
74  COMMON /area33/ fsud(10,2)
75  COMMON /area34/ qrt(10,101,2)
76  COMMON /area35/ sjv(10,5),fjs(10,5,15)
77  COMMON /area39/ jcalc
78  COMMON /area40/ jdifr
79  COMMON /area41/ ty(5)
80  COMMON /area43/ moniou
81  COMMON /debug/ debug
82 ********************************************
83  COMMON /area44/ gz(10,5,4),gzp(10,5,4)
84 c Auxiliary common blocks to calculate hadron-nucleus cross-sections
85  COMMON /ar1/ anorm
86  COMMON /ar2/ rrr,rrrm
87 ********************************************
88 cdh 8/10/98
89  COMMON /area48/ asect(10,6,4)
90 cdh 8/12/98
91  COMMON /version/version
92  SAVE
93 c-------------------------------------------------
94  WRITE(moniou,100)
95  100 FORMAT(' ',
96  * '====================================================',
97  * /,' ','| |',
98  * /,' ','| QUARK GLUON STRING JET MODEL |',
99  * /,' ','| |',
100  * /,' ','| HADRONIC INTERACTION MONTE CARLO |',
101  * /,' ','| BY |',
102  * /,' ','| N.N. KALMYKOV AND S.S. OSTAPCHENKO |',
103  * /,' ','| |',
104  * /,' ','| e-mail: serg@eas.npi.msu.su |',
105  * /,' ','| |',
106  * /,' ','| Publication to be cited when using this program: |',
107  * /,' ','| N.N. Kalmykov & S.S. Ostapchenko, A.I. Pavlov |',
108  * /,' ','| Nucl. Phys. B (Proc. Suppl.) 52B (1997) 17 |',
109  * /,' ','| |',
110  * /,' ','| last modification: June 15, 2005 by D. Heck |',
111  * /,' ','| (version qgsjet01c.f) |',
112  * /,' ','====================================================',
113  * /)
114  IF(debug.GE.1)WRITE (moniou,210)
115 210 FORMAT(2x,'PSAINI - MAIN INITIALIZATION PROCEDURE')
116 cdh
117  version = 2001.3
118 
119 c AHL(i) - parameter for the energy sharing procedure (govern leading hadronic state
120 c inelasticity for primary pion, nucleon, kaon, D-meson, Lambda_C correspondingly)
121  ahl(1)=1.d0-2.d0*arr(1)
122  ahl(2)=1.d0-arr(1)-arr(2)
123  ahl(3)=1.d0-arr(1)-arr(3)
124  ahl(4)=1.d0-arr(1)-arr(4)
125  ahl(5)=ahl(2)+arr(1)-arr(4)
126 
127 c-------------------------------------------------
128 c 1/CC(i) = C_i - shower enhancement coefficients for one vertex
129 c (C_ab=C_a*C_b) (i - ICZ)
130  cc(2)=1.d0/dsqrt(cd(2))
131  cc(1)=1.d0/cc(2)/cd(1)
132  cc(3)=1.d0/cc(2)/cd(3)
133  cc(4)=1.d0/cc(2)/cd(4)
134  cc(5)=1.d0/cc(2)/cd(5)
135 
136 c FP0(i) - vertex constant (FP_ij=FP0_i*FP0_j) for pomeron-hadron interaction (i - ICZ)
137  fp0(2)=dsqrt(fp(2))
138  fp0(1)=fp(1)/fp0(2)
139  fp0(3)=fp(3)/fp0(2)
140  fp0(4)=fp(4)/fp0(2)
141  fp0(5)=fp(5)/fp0(2)
142 
143 c SH - hard interaction effective squared (SH=pi*R_h^2, R_h^2=4/Q0^2)
144  sh=4.d0/qt0*pi
145 c Auxiliary constants for the hard interaction
146  aqt0=dlog(4.d0*qt0)
147  qlog=dlog(qt0/alm)
148  qll=dlog(qlog)
149 
150 ********************************************
151  INQUIRE(file='QGSDAT01',exist=lcalc)
152  IF(lcalc)then
153  IF(debug.GE.1)WRITE (moniou,211)
154 211 FORMAT(2x,'PSAINI: HARD CROSS SECTION RATIOS READOUT FROM THE'
155  * ,' FILE QGSDAT01')
156  OPEN(1,file='QGSDAT01',status='OLD')
157  READ (1,*)csborn,cs0,cstot,csq,csbq,
158  * fsud,qrt,sjv,fjs,rjv,rjs,gz,gzp,gsect
159  CLOSE(1)
160  ELSE
161 ********************************************
162 
163  IF(debug.GE.1)WRITE (moniou,201)
164 201 FORMAT(2x,'PSAINI: HARD CROSS SECTIONS CALCULATION')
165 c--------------------------------------------------
166 c Hard pomeron inclusive cross sections calculation
167 c--------------------------------------------------
168 c EQ(I) - energy squared tabulation (Q0^2, 4*Q0^2, ...)
169  DO 1 i=1,17
170 1 eq(i)=qt0*4.d0**float(i-1)
171 
172  DO 2 i=1,17
173 c QI - effective momentum (Qt**2/(1-z)**2) cutoff for the Born process
174  qi=eq(i)
175 c M, L define parton types (1-g, 2-q)
176  DO 2 m=1,2
177  DO 2 l=1,2
178 c K defines c.m. energy squared for the process (for current energy tabulation)
179  DO 2 k=1,17
180  k1=k+17*(m-1)+34*(l-1)
181  IF(k.LE.i.OR.k.EQ.2)THEN
182  csborn(i,k1)=0.d0
183  ELSE
184 c SK - c.m. energy squared for the hard interaction
185  sk=eq(k)
186 c CSBORN(I,K1) - Born cross-section (2->2 process) - procedure PSBORN
187  csborn(i,k1)=psborn(qi,sk,m-1,l-1)
188  ENDIF
189 2 CONTINUE
190 
191 c Cross-sections initialization
192  DO 3 i=1,17
193  DO 3 j=1,17
194  n=max(i,j)
195  DO 3 m=1,2
196  DO 3 l=1,2
197  ml=m+2*l-2
198  DO 3 k=1,17
199  k1=k+17*(m-1)+34*(l-1)
200  csjet(i,j,k1)=0.d0
201  IF(k.LE.n.OR.k.EQ.2)THEN
202  cstot(i,j,k1)=-80.d0
203  cs0(i,j,k1)=-80.d0
204  mij(i,j,ml)=k+1
205  nij(i,j,ml)=k+1
206  ELSE
207  cstot(i,j,k1)=dlog(csborn(n,k1))
208  cs0(i,j,k1)=cstot(i,j,k1)
209  ENDIF
210 3 CONTINUE
211 
212 c N-maximal number of ladder runs taken into account
213  n=2
214 4 CONTINUE
215  IF(debug.GE.2)WRITE (moniou,202)n,eq(mij(1,1,1)),eq(nij(1,1,1))
216 202 FORMAT(2x,'PSAINI: NUMBER OF LADDER RUNS TO BE CONSIDERED:',i2/
217  * 4x,'MINIMAL MASSES SQUARED FOR THE UNORDERED AND STRICTLY',
218  * ' ORDERED LADDERS:'/4x,e10.3,3x,e10.3)
219  DO 6 i=1,17
220 c QI - effective momentum cutoff for upper end of the ladder
221  qi=eq(i)
222  DO 6 j=1,17
223 c QJ - effective momentum cutoff for lower end of the ladder
224  qj=eq(j)
225 c QQ - maximal effective momentum cutoff
226  qq=max(qi,qj)
227 c S2MIN - minimal energy squared for 2->2 subprocess
228  s2min=max(qq,4.d0*qt0)
229  sm=dsqrt(qt0/s2min)
230 c SMIN - minimal energy squared for 2->3 subprocess
231  smin=s2min*(1.d0+sm)/(1.d0-sm)
232 
233 c M, L define parton types (1-g, 2-q)
234  DO 6 m=1,2
235  DO 6 l=1,2
236  ml=m+2*l-2
237 c KMIN corresponds to minimal energy at which more runs are to be considered -
238 c stored in array NIJ(I,J,ML) - for strictly ordered ladder
239  kmin=nij(i,j,ml)
240  IF(kmin.LE.17)THEN
241  DO 5 k=kmin,17
242  sk=eq(k)
243  IF(sk.LE.smin)THEN
244  nij(i,j,ml)=nij(i,j,ml)+1
245  ELSE
246  k1=k+17*(m-1)+34*(l-1)
247 c CS1(I,J,K1) - cross-section for strictly ordered ladder (highest virtuality run
248 c is the lowest one) - procedure PSJET1
249  cs1(i,j,k1)=psjet1(qi,qj,sk,s2min,m-1,l)
250  ENDIF
251 5 CONTINUE
252  ENDIF
253 6 CONTINUE
254 
255  DO 8 i=1,17
256  DO 8 j=1,17
257  DO 8 m=1,2
258  DO 8 l=1,2
259  ml=m+2*l-2
260  kmin=nij(i,j,ml)
261  IF(kmin.LE.17)THEN
262  DO 7 k=kmin,17
263  k1=k+17*(m-1)+34*(l-1)
264 c CSJ - cross-section for strictly ordered ladder (highest virtuality run is the
265 c lowest one) - Born contribution is added
266  csj=cs1(i,j,k1)+csborn(max(i,j),k1)
267  IF(debug.GE.2)WRITE (moniou,204)csj,exp(cs0(i,j,k1))
268 204 FORMAT(2x,'PSAINI: NEW AND OLD VALUES OF THE CONTRIBUTION',
269  * ' OF THE STRICTLY ORDERED LADDER:'/4x,e10.3,3x,e10.3)
270  IF(csj.EQ.0.d0.OR.abs(1.d0-exp(cs0(i,j,k1))/csj).LT.1.d-2)THEN
271  nij(i,j,ml)=nij(i,j,ml)+1
272  ELSE
273 c CS0(I,J,K1) - cross-section logarithm for strictly ordered ladder
274  cs0(i,j,k1)=dlog(csj)
275  ENDIF
276 7 CONTINUE
277  ENDIF
278 8 CONTINUE
279 
280  DO 10 i=1,17
281  qi=eq(i)
282  DO 10 j=1,17
283  qj=eq(j)
284  qq=max(qi,qj)
285  s2min=max(qq,4.d0*qt0)
286  sm=dsqrt(qt0/s2min)
287 c SMIN - minimal energy squared for 2->3 subprocess
288  smin=s2min*(1.d0+sm)/(1.d0-sm)
289 
290  DO 10 m=1,2
291  DO 10 l=1,2
292  ml=m+2*l-2
293 c KMIN corresponds to minimal energy at which more runs are to be considered
294 c stored in array MIJ(I,J,ML) - for any ordering in the ladder
295  kmin=mij(i,j,ml)
296  IF(kmin.LE.17)THEN
297  DO 9 k=kmin,17
298  sk=eq(k)
299  IF(sk.LE.smin)THEN
300  mij(i,j,ml)=mij(i,j,ml)+1
301  ELSE
302  k1=k+17*(m-1)+34*(l-1)
303 c CS1(I,J,K1) - cross-section for any ordering in the ladder (highest virtuality
304 c run is somewhere in the middle; runs above and below it are strictly ordered
305 c towards highest effective momentum run) - procedure PSJET
306  cs1(i,j,k1)=psjet(qi,qj,sk,s2min,m-1,l)
307  ENDIF
308 9 CONTINUE
309  ENDIF
310 10 CONTINUE
311 
312  DO 12 i=1,17
313  DO 12 j=1,17
314  DO 12 m=1,2
315  DO 12 l=1,2
316  ml=m+2*l-2
317 c KMIN corresponds to minimal energy at which more runs are to be considered
318  kmin=mij(i,j,ml)
319  IF(kmin.LE.17)THEN
320  DO 11 k=kmin,17
321  k1=k+17*(m-1)+34*(l-1)
322  k2=k+17*(l-1)+34*(m-1)
323  csj=cs1(i,j,k1)+exp(cs0(j,i,k2))
324  IF(csj.EQ.0.d0.OR.abs(1.d0-exp(cstot(i,j,k1))/csj).LT.1.d-2)
325  * mij(i,j,ml)=mij(i,j,ml)+1
326  IF(debug.GE.2)WRITE (moniou,203)csj,exp(cstot(i,j,k1))
327 203 FORMAT(2x,'PSAINI: NEW AND OLD VALUES OF THE UNORDERED LADDER',
328  * ' CROSS SECTION:'/4x,e10.3,3x,e10.3)
329 11 cstot(i,j,k1)=dlog(csj)
330  ENDIF
331 12 CONTINUE
332 
333 c One more run
334  n=n+1
335  DO 13 l=1,4
336 13 IF(mij(1,1,l).LE.17.OR.nij(1,1,l).LE.17)GOTO 4
337 
338 c Logarithms of the Born cross-section are calculated - to be interpolated in the
339 c PSBINT procedure
340  DO 14 i=1,17
341  DO 14 k=1,17
342  DO 14 m=1,2
343  DO 14 l=1,2
344  k1=k+17*(m-1)+34*(l-1)
345  IF(k.LE.i.OR.k.EQ.2)THEN
346  csborn(i,k1)=-80.d0
347  ELSE
348  csborn(i,k1)=dlog(csborn(i,k1))
349  ENDIF
350 14 CONTINUE
351 
352 c Total and Born hard cross-sections logarithms for minimal cutoff (QT0) - to be
353 c interpolated in the PSJINT0 procedure
354  DO 15 m=1,2
355  DO 15 l=1,2
356  DO 15 k=1,17
357  IF(k.LE.2)THEN
358  csq(k,m,l)=-80.d0
359  csbq(k,m,l)=-80.d0
360  ELSE
361  k1=k+17*(m-1)+34*(l-1)
362  csbq(k,m,l)=csborn(1,k1)
363  csq(k,m,l)=cstot(1,1,k1)
364  ENDIF
365 15 CONTINUE
366 
367 c-------------------------------------------------
368 c FSUD(K,M)=-ln(SUD) - timelike Sudakov formfactor logarithm - procedure
369 c PSUDT(QMAX,M-1), M=1 - g, M=2 - q
370  DO 17 m=1,2
371  fsud(1,m)=0.d0
372  DO 17 k=2,10
373 c QMAX is the maximal effective momentum ( Qt**2/z**2/(1-z)**2 in case of the timelike
374 c evolution )
375  qmax=qtf*4.d0**(1.d0+k)
376 17 fsud(k,m)=psudt(qmax,m-1)
377 
378 c QRT(K,L,M) - effective momentum logarithm for timelike branching ( ln QQ/16/QTF )
379 c for given QMAX (defined by K, QLMAX = ln QMAX/16/QTF ) and a number
380 c of random number values (defined by L) - to be interpolated by the PSQINT
381 c procedure; M=1 - g, M=2 - q
382  DO 18 m=1,2
383  DO 18 k=1,10
384  qlmax=1.38629d0*(k-1)
385  qrt(k,1,m)=0.d0
386  qrt(k,101,m)=qlmax
387  DO 18 i=1,99
388  IF(k.EQ.1)THEN
389  qrt(k,i+1,m)=0.d0
390  ELSE
391  qrt(k,i+1,m)=psroot(qlmax,.01d0*i,m)
392  ENDIF
393 18 CONTINUE
394 c-------------------------------------------------
395 
396  IF(debug.GE.2)WRITE (moniou,205)
397 205 FORMAT(2x,'PSAINI: PRETABULATION OF THE INTERACTION EIKONALS')
398 c-------------------------------------------------
399 ************************************************************************
400 c-------------------------------------------------
401 c Interaction cross sections
402 c Factors for interaction eikonals calculation
403 c (convolution of the hard cross-sections with partons structure functions)
404 c - to be used in the PSPSFAZ procedure
405 c-------------------------------------------------
406  ia(1)=1
407 c-------------------------------------------------
408  DO 21 ie=1,10
409 c Energy of the interaction (per nucleon)
410  e0n=10.d0**ie
411 c-------------------------------------------------
412 c Energy dependent factors:
413 c WP0, WM0 - initial light cone momenta for the interaction (E+-p)
414  s=2.d0*e0n*amn
415 c Y0 - total rapidity range for the interaction
416  y0=dlog(s)
417 
418 c Type of the incident hadron (icz = 1: pion, 2: nucleon, 3: kaon, etc
419  DO 21 icz=1,5
420 c RS - soft pomeron elastic scattering slope (lambda_ab)
421  rs=rq(icz)+alfp*y0
422 c RS0 - initial slope (sum of the pomeron-hadron vertices slopes squared - R_ab)
423  rs0=rq(icz)
424 c FS - factor for pomeron eikonal calculation
425 c (gamma_ab * s**del /lambda_ab * C_ab
426  fs=fp(icz)*exp(y0*del)/rs*cd(icz)
427 c RP1 - factor for the impact parameter dependence of the eikonal ( in fm^2 )
428  rp1=rs*4.d0*.0391d0/am**2
429 c Factor for cross-sections calculation ( in mb )
430  g0=pi*rp1/cd(icz)*am**2*10.d0
431 c SJV - valence-valence cross-section (divided by 8*pi*lambda_ab)
432  sjv(ie,icz)=pshard(s,icz)
433  sjv0=sjv(ie,icz)
434 
435  DO 19 i=1,5
436  DO 19 m=1,3
437  z=.2d0*i
438 c Eikonals for gluon-gluon and valence-gluon semihard interactions
439 c (m=1 - gg, 2 - qg, 3 - gq);
440 c Z - impact parameter factor ( exp(-b**2/R_p) )
441  m1=m+3*(icz-1)
442  fjs(ie,i,m1)=dlog(psfsh(s,z,icz,m-1)/z)
443  fjs0(i,m)=fjs(ie,i,m1)
444 19 CONTINUE
445 
446  DO 20 iia=1,4
447 c Target mass number IA(2)
448  ia(2)=4**(iia-1)
449  IF(debug.GE.1)WRITE (moniou,206)e0n,ty(icz),ia(2)
450 206 FORMAT(2x,'PSAINI: INITIAL PARTICLE ENERGY:',e10.3,2x,
451  *'ITS TYPE:',a7,2x,'TARGET MASS NUMBER:',i2)
452 c-------------------------------------------------
453 c Nuclear radii
454  IF(ia(2).GT.10)THEN
455 c RD - Wood-Saxon density radius (fit to the data of Murthy et al.)
456  rd(2)=0.7d0*float(ia(2))**.446/am
457  ELSE
458 c RD - gaussian density radius (for light nucleus)
459  rd(2)=.9d0*float(ia(2))**.3333/am
460  ENDIF
461 
462  IF(ia(2).EQ.1)THEN
463 c Hadron-proton interaction
464 c BM - impact parameter cutoff value
465  bm=2.d0*dsqrt(rp1)
466 c XXFZ - impact parameter integration for the hadron-nucleon interaction eikonal;
467 c GZ0 - total and absorptive cross-sections (up to a factor); first parameter is
468 c used only in case of hadron-nucleus interaction (to make convolution with target
469 c nucleus profile function)
470  CALL xxfz(0.d0,gz0)
471  if (debug .ge.1) write (moniou,*)gz0
472 c GTOT - total cross-section
473  gtot=g0*gz0(1)
474 c GABS - cut pomerons cross-section
475  gabs=g0*gz0(2)*.5d0
476 c GD0 - cross-section for the cut between pomerons
477  gd0=gtot-gabs
478 c GDP - projectile diffraction cross section
479  gdp=(1.d0-cc(icz))*cc(2)*gd0
480 c GDT - target diffraction cross section
481  gdt=(1.d0-cc(2))*cc(icz)*gd0
482 c GDD - double diffractive cross section
483  gdd=(1.d0-cc(icz))*(1.d0-cc(2))*gd0
484 c GIN - inelastic cross section
485  gin=gabs+gdp+gdt+gdd
486  gel=gd0*cc(icz)*cc(2)
487 c
488  IF(debug.GE.1)WRITE (moniou,225)gtot,gin,gel,gdp,gdt,gdd
489 c
490 225 FORMAT(2x,'PSAINI: HADRON-PROTON CROSS SECTIONS:'/
491  * 4x,'GTOT=',e10.3,2x,'GIN=',e10.3,2x,'GEL=',e10.3/4x,
492  * 'GDIFR_PROJ=',e10.3,2x,'GDIFR_TARG=',e10.3,2x,
493  * 'G_DOUBLE_DIFR',e10.3)
494 c GZ - probability to have target diffraction
495  gz(ie,icz,iia)=gdt/gin
496  gzp(ie,icz,iia)=(gdp+gdd)/gin ! so00
497 C??????
498  gsect(ie,icz,iia)=log(gin)
499 C??????
500  ELSE
501 
502 c Hadron-nucleus interaction
503 c BM - impact parameter cutoff value
504  bm=rd(2)+dlog(29.d0)
505 c RRR - Wood-Saxon radius for the target nucleus
506  rrr=rd(2)
507 c RRRM - auxiliary parameter for numerical integration
508  rrrm=rrr+dlog(9.d0)
509 c ANORM - nuclear density normalization factor multiplied by RP1
510  anorm=1.5d0/pi/rrr**3/(1.d0+(pi/rrr)**2)*rp1
511 
512 c GAU(GZ) - cross sections calculation ( integration over impact parameters less than
513 c BM )
514  CALL xxgau(gz1)
515 c GAU1(GZ) - cross sections calculation ( integration over impact
516 c parameters greater than BM )
517  CALL xxgau1(gz1)
518 c GIN - total inelastic cross section
519  gin=gz1(1)+gz1(2)+gz1(3)
520 c
521  IF(debug.GE.1)WRITE (moniou,224)
522  * gin*10.d0,gz1(1)*10.d0,gz1(2)*10.d0
523 c
524 224 FORMAT(2x,'PSAINI: HADRON-NUCLEUS CROSS SECTIONS:'/
525  * 4x,'GIN=',e10.3,2x,'GDIFR_TARG=',e10.3,2x,
526  * 'GDIFR_PROJ=',e10.3)
527 c GZ - probability to have target diffraction
528  gz(ie,icz,iia)=gz1(1)/gin
529  gzp(ie,icz,iia)=gz1(2)/gin ! so00
530 C??????
531  gin=gin*10.
532  gsect(ie,icz,iia)=log(gin)
533 C??????
534  ENDIF
535 20 CONTINUE
536 21 CONTINUE
537 
538 c Rejection functions calculation - to be interpolated in the RJINT procedure
539  DO 23 i=1,50
540 c Rapidity range tabulation for the hard interaction
541  yj=aqt0+.5d0*i
542 c Rejection function for valence quark energy distribution
543  rjv(i)=psrejv(exp(yj))
544 
545  DO 22 j=1,5
546  DO 22 m=1,2
547  z=.2d0*j
548  DO 22 icz=1,5
549 c RS0 - initial slope (sum of the pomeron-hadron vertices slopes squared - R_ab)
550  rs0=rq(icz)
551  m1=m+2*(icz-1)
552 c Rejection function for semihard block energy distribution (m=1 - gg,
553 c 2 - qg)
554  rjs(i,j,m1)=psrejs(exp(yj),z,m-1)
555 22 CONTINUE
556 23 CONTINUE
557 
558  IF(debug.GE.1)WRITE (moniou,212)
559 212 FORMAT(2x,'PSAINI: HARD CROSS SECTIONS ARE WRITTEN TO THE FILE'
560  * ,' QGSDAT01')
561  OPEN(1,file='QGSDAT01',status='unknown')
562  WRITE (1,*)csborn,cs0,cstot,csq,csbq,
563  * fsud,qrt,sjv,fjs,rjv,rjs,gz,gzp,gsect
564  CLOSE(1)
565  ENDIF
566 ************************************************************************
567 
568 cdh 8/10/98
569 c Nuclear cross sections
570  INQUIRE(file='SECTNU',exist=lcalc)
571  IF(lcalc)then
572  IF(debug.GE.1)WRITE (moniou,208)
573 208 FORMAT(2x,'PSAINI: NUCLEAR CROSS SECTIONS READOUT FROM THE FILE'
574  * ,' SECTNU')
575  OPEN(2,file='SECTNU',status='OLD')
576  READ (2,*)asect
577  CLOSE(2)
578  ELSE
579 cdh NITER=1000 !NUMBER OF ITERATIONS
580  niter=5000 !NUMBER OF ITERATIONS
581  DO ie=1,10
582  e0n=10.d0**ie
583  DO iia1=1,6
584  iap=2**iia1
585  DO iia2=1,4
586  iat=4**(iia2-1)
587  IF(debug.GE.1)WRITE (moniou,207)e0n,iap,iat
588 207 FORMAT(2x,'PSAINI: INITIAL NUCLEUS ENERGY:',e10.3,2x,
589  * 'PROJECTILE MASS:',i2,2x,'TARGET MASS:',i2)
590  CALL xxaini(e0n,2,iap,iat)
591  CALL crossc_kk(niter,gtot,gprod,gabs,gdd,gqel,gcoh)
592  IF(debug.GE.1)WRITE (moniou,209)
593  * gtot,gprod,gabs,gdd,gqel,gcoh
594 c WRITE (*,*)GTOT,GPROD
595 209 FORMAT(2x,'GTOT',d10.3,' GPROD',d10.3,' GABS',d10.3/2x,
596  * 'GDD',d10.3,' GQEL',d10.3,' GCOH',d10.3)
597  asect(ie,iia1,iia2)=log(gprod)
598  ENDDO
599  ENDDO
600  ENDDO
601  OPEN(2,file='SECTNU',status='UNKNOWN')
602  WRITE (2,*)asect
603  CLOSE(2)
604  ENDIF
605 cdh end
606  IF(debug.GE.3)WRITE (moniou,218)
607 218 FORMAT(2x,'PSAINI - END')
608  RETURN
609  END
610 C=======================================================================
611 
612  FUNCTION psapint(X,J,L)
613 c PSAPINT - integrated Altarelli-Parisi function
614 c X - light cone momentum share value,
615 c J - type of initial parton (0 - g, 1 - q)
616 c L - type of final parton (0 - g, 1 - q)
617 C-----------------------------------------------------------------------
618  IMPLICIT DOUBLE PRECISION (a-h,o-z)
619  INTEGER DEBUG
620  COMMON /area43/ moniou
621  COMMON /debug/ debug
622  SAVE
623 
624  IF(debug.GE.2)WRITE (moniou,201)x,j,l
625 201 FORMAT(2x,'PSAPINT: X=',e10.3,2x,'J= ',i1,2x,'L= ',i1)
626  IF(j.EQ.0)THEN
627  IF(l.EQ.0)THEN
628  psapint=6.d0*(dlog(x/(1.d0-x))-x**3/3.d0+x**2/2.d0-2.d0*x)
629  ELSE
630  psapint=3.d0*(x+x**3/1.5d0-x*x)
631  ENDIF
632  ELSE
633  IF(l.EQ.0)THEN
634  psapint=(dlog(x)-x+.25d0*x*x)/.375d0
635  ELSE
636  z=1.d0-x
637  psapint=-(dlog(z)-z+.25d0*z*z)/.375d0
638  ENDIF
639  ENDIF
640  IF(debug.GE.2)WRITE (moniou,202)psapint
641 202 FORMAT(2x,'PSAPINT=',e10.3)
642  RETURN
643  END
644 C=======================================================================
645 
646  SUBROUTINE psasetc
647 c Common model parameters setting
648 c-----------------------------------------------------------------------
649  IMPLICIT DOUBLE PRECISION (a-h,o-z)
650  INTEGER DEBUG
651  CHARACTER*7 TY
652  COMMON /area15/ fp(5),rq(5),cd(5)
653  COMMON /area17/ del,rs,rs0,fs,alfp,rr,sh,delh
654  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
655  COMMON /area25/ ahv(5)
656  COMMON /area26/ factork
657  COMMON /area41/ ty(5)
658  COMMON /area43/ moniou
659  COMMON /debug/ debug
660  SAVE
661 
662  IF(debug.GE.1)WRITE (moniou,210)
663 210 FORMAT(2x,'PSASETC - COMMON MODEL PARAMETERS SETTING')
664 
665 c Soft pomeron parameters:
666 c DEL - overcriticity,
667 c ALFP - trajectory slope;
668 c FP(i) - vertices for pomeron-hadrons interaction (gamma(i)*gamma(proton)),
669 c RQ(i) - vertices slopes (R(i)**2+R(proton)**2),
670 c CD(i) - shower enhancement coefficients
671 c (i=1,...5 - pion,proton,kaon,D-meson,Lambda_C ),
672 c (Kaidalov et al., Sov.J.Nucl.Phys.,1984 - proton and pion parameters)
673  del=.07d0
674  alfp=.21d0
675 
676  fp(1)=2.43d0
677  rq(1)=2.4d0
678  cd(1)=1.6d0
679 
680  fp(2)=3.64d0
681  rq(2)=3.56d0
682  cd(2)=1.5d0
683 
684  fp(3)=1.75d0
685  rq(3)=2.d0
686  cd(3)=1.7d0
687 
688  fp(4)=1.21d0
689  rq(4)=1.78d0
690  cd(4)=2.0d0
691 
692  fp(5)=2.43d0
693  rq(5)=2.4d0
694  cd(5)=2.0d0
695 
696 c-------------------------------------------------
697 c Hard interaction parameters:
698 c ALM - Lambda_QCD squared,
699 c QT0 - Q**2 cutoff,
700 c RR - vertex constant square for soft pomeron interaction with the hard block (r**2),;
701 c BET - gluon structure function parameter for the soft pomeron ((1-x)**BET),
702 c AMJ0 - jet mass,
703 c QTF - Q**2 cutoff for the timelike evolution,
704 c FACTORK - K-factor value;
705 c DELH is not a parameter of the model; it is used only for energy sharing
706 c procedure - initially energy is shared according to s**DELH dependence
707 c for the hard interaction cross-section and then rejection is used according
708 c to real Sigma_hard(s) dependence.
709  alm=.04d0
710  rr=.35d0 ! produces 76 mbarn for p-pbar at Tevatron energies
711 cdh RR=.53D0 ! produces 80 mbarn for p-pbar at Tevatron energies
712  qt0=4.d0
713  bet=1.d0
714  delh=0.25d0
715  amj0=0.d0
716  qtf=.5d0
717  factork=2.d0
718 
719 c-------------------------------------------------
720 c Valence quark structure functions for the hard scattering
721 c (~1/sqrt(x)*(1-x)**AHV(i), i=1,...5 corresponds to pion, nucleon etc.)
722  ahv(1)=1.5d0
723  ahv(2)=2.5d0
724  ahv(3)=2.d0
725  ahv(4)=4.d0
726  ahv(5)=5.d0
727 c Initial particle types
728  ty(1)='pion '
729  ty(2)='nucleon'
730  ty(3)='kaon '
731  ty(4)='D-meson'
732  ty(5)='LambdaC'
733  RETURN
734  END
735 C=======================================================================
736 
737  FUNCTION psbint(QQ,S,M,L)
738 C PSBINT - Born cross-section interpolation
739 c QQ - effective momentum cutoff for the scattering,
740 c S - total c.m. energy squared for the scattering,
741 c M - parton type at current end of the ladder (1 - g, 2 - q)
742 c L - parton type at opposite end of the ladder (1 - g, 2 - q)
743 C-----------------------------------------------------------------------
744  IMPLICIT DOUBLE PRECISION (a-h,o-z)
745  INTEGER DEBUG
746  dimension wi(3),wk(3)
747  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
748  COMMON /area31/ csj(17,68)
749  COMMON /area43/ moniou
750  COMMON /debug/ debug
751  SAVE
752 
753  IF(debug.GE.2)WRITE (moniou,201)qq,s,m,l
754 201 FORMAT(2x,'PSBINT: QQ=',e10.3,2x,'S= ',e10.3,2x,'M= ',i1,2x,
755  * 'L= ',i1)
756  psbint=0.d0
757  IF(s.LE.max(4.d0*qt0,qq))THEN
758  IF(debug.GE.3)WRITE (moniou,202)psbint
759 202 FORMAT(2x,'PSBINT=',e10.3)
760  RETURN
761  ENDIF
762 
763  ml=17*(m-1)+34*(l-1)
764  qli=dlog(qq/qt0)/1.38629d0
765  sl=dlog(s/qt0)/1.38629d0
766  sql=sl-qli
767  i=int(qli)
768  k=int(sl)
769  IF(i.GT.13)i=13
770 
771  IF(sql.GT.10.d0)THEN
772  IF(k.GT.14)k=14
773  wi(2)=qli-i
774  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
775  wi(1)=1.d0-wi(2)+wi(3)
776  wi(2)=wi(2)-2.d0*wi(3)
777  wk(2)=sl-k
778  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
779  wk(1)=1.d0-wk(2)+wk(3)
780  wk(2)=wk(2)-2.d0*wk(3)
781 
782  DO 1 i1=1,3
783  DO 1 k1=1,3
784 1 psbint=psbint+csj(i+i1,k+k1+ml)*wi(i1)*wk(k1)
785  psbint=exp(psbint)
786  ELSEIF(sql.LT.1.d0.AND.i.NE.0)THEN
787  sq=(s/qq-1.d0)/3.d0
788  wi(2)=qli-i
789  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
790  wi(1)=1.d0-wi(2)+wi(3)
791  wi(2)=wi(2)-2.d0*wi(3)
792 
793  DO 2 i1=1,3
794  i2=i+i1
795  k2=i2+1+ml
796 2 psbint=psbint+csj(i2,k2)*wi(i1)
797  psbint=exp(psbint)*sq
798  ELSEIF(k.EQ.1)THEN
799  sq=(s/qt0/4.d0-1.d0)/3.d0
800  wi(2)=qli
801  wi(1)=1.d0-qli
802 
803  DO 3 i1=1,2
804 3 psbint=psbint+csj(i1,3+ml)*wi(i1)
805  psbint=exp(psbint)*sq
806  ELSEIF(k.LT.15)THEN
807  kl=int(sql)
808  IF(i+kl.GT.12)i=12-kl
809  IF(i+kl.EQ.1)kl=2
810  wi(2)=qli-i
811  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
812  wi(1)=1.d0-wi(2)+wi(3)
813  wi(2)=wi(2)-2.d0*wi(3)
814  wk(2)=sql-kl
815  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
816  wk(1)=1.d0-wk(2)+wk(3)
817  wk(2)=wk(2)-2.d0*wk(3)
818 
819  DO 4 i1=1,3
820  i2=i+i1
821  DO 4 k1=1,3
822  k2=i2+kl+k1-1+ml
823 4 psbint=psbint+csj(i2,k2)*wi(i1)*wk(k1)
824  psbint=exp(psbint)
825 
826  ELSE
827  k=15
828  IF(i.GT.k-3)i=k-3
829  wi(2)=qli-i
830  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
831  wi(1)=1.d0-wi(2)+wi(3)
832  wi(2)=wi(2)-2.d0*wi(3)
833  wk(2)=sl-k
834  wk(1)=1.d0-wk(2)
835 
836  DO 5 i1=1,3
837  DO 5 k1=1,2
838 5 psbint=psbint+csj(i+i1,k+k1+ml)*wi(i1)*wk(k1)
839  psbint=exp(psbint)
840  ENDIF
841  IF(debug.GE.3)WRITE (moniou,202)psbint
842  RETURN
843  END
844 C=======================================================================
845 
846  FUNCTION psborn(QQ,S,IQ1,IQ2)
847 c PSFBORN -hard 2->2 parton scattering Born cross-section
848 c S is the c.m. energy square for the scattering process,
849 c IQ1 - parton type at current end of the ladder (0 - g, 1,2 - q)
850 c IQ2 - parton type at opposite end of the ladder (0 - g, 1,2 - q)
851 c-----------------------------------------------------------------------
852  IMPLICIT DOUBLE PRECISION (a-h,o-z)
853  INTEGER DEBUG
854  COMMON /area6/ pi,bm,am
855  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
856  COMMON /area26/ factork
857  COMMON /area43/ moniou
858  COMMON /debug/ debug
859  COMMON /ar3/ x1(7),a1(7)
860  SAVE
861 
862  IF(debug.GE.2)WRITE (moniou,201)qq,s,iq1,iq2
863 201 FORMAT(2x,'PSBORN: QQ=',e10.3,2x,'S= ',e10.3,2x,'IQ1= ',i1,2x,
864  * 'IQ2= ',i1)
865  tmin=s*(.5d0-dsqrt(.25d0-qt0/s))
866  tmin=max(tmin,s*qq/(s+qq))
867 
868  IF(iq1*iq2.EQ.0)THEN
869  iq=iq2
870  ELSE
871  iq=2
872  ENDIF
873 
874  psborn=0.d0
875  DO 1 i=1,7
876  DO 1 m=1,2
877  t=2.d0*tmin/(1.d0+2.d0*tmin/s-x1(i)*(2*m-3)*(1.d0-2.d0*tmin/s))
878  qt=t*(1.d0-t/s)
879  fb=psfborn(s,t,iq1,iq)+psfborn(s,s-t,iq1,iq)
880 1 psborn=psborn+a1(i)*fb/dlog(qt/alm)**2*t**2
881  psborn=psborn*(.5d0/tmin-1.d0/s)*factork*pi**3/2.25d0**2/s**2
882  IF(iq1.EQ.0.AND.iq2.EQ.0)psborn=psborn*.5d0
883  IF(debug.GE.3)WRITE (moniou,202)psborn
884 202 FORMAT(2x,'PSBORN=',e10.3)
885  RETURN
886  END
887 C=======================================================================
888 
889  SUBROUTINE pscajet(QQ,IQ1,QV,ZV,QM,IQV,LDAU,LPAR,JQ)
890 c Final state emission process (all branchings as well as parton masses
891 c are determined)
892 C-----------------------------------------------------------------------
893 c QQ - maximal effective momentum transfer for the first branching
894 c IQ1, IQ2 - initial jet flavours in forward and backward direction
895 c (0 - for gluon)
896 c QV(i,j) - effective momentum for the branching of the parton in i-th row
897 c on j-th level (0 - in case of no branching) - to be determined
898 c ZV(i,j) - Z-value for the branching of the parton in i-th row
899 c on j-th level - to be determined
900 c QM(i,j) - mass squared for the parton in i-th row
901 c on j-th level - to be determined
902 c IQV(i,j) - flavour for the parton in i-th row on j-th level
903 c - to be determined
904 c LDAU(i,j) - first daughter row for the branching of the parton in i-th row
905 c on j-th level - to be determined
906 c LPAR(i,j) - the parent row for the parton in i-th row
907 c on j-th level - to be determined
908  IMPLICIT DOUBLE PRECISION (a-h,o-z)
909  INTEGER DEBUG
910  dimension qmax(30,50),iqm(2),lnv(50),
911  * qv(30,50),zv(30,50),qm(30,50),iqv(30,50),
912  * ldau(30,49),lpar(30,50)
913 
914  COMMON /area11/ b10
915  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
916  COMMON /area43/ moniou
917  COMMON /debug/ debug
918 
919  SAVE
920  EXTERNAL qsran
921 
922  IF(debug.GE.2)WRITE (moniou,201)qq,iq1,jq
923 201 FORMAT(2x,'PSCAJET: QQ=',e10.3,2x,'IQ1= ',i1,2x,'JQ=',i1)
924 
925  DO 1 i=2,20
926 1 lnv(i)=0
927  lnv(1)=1
928  qmax(1,1)=qq
929  iqv(1,1)=iq1
930  nlev=1
931  nrow=1
932 
933 2 qlmax=dlog(qmax(nrow,nlev)/qtf/16.d0)
934  iq=min(1,iabs(iqv(nrow,nlev)))+1
935 
936  IF(qsran(b10).GT.psudint(qlmax,iq))THEN
937  q=psqint(qlmax,qsran(b10),iq)
938  z=pszsim(q,iq)
939 
940  ll=lnv(nlev+1)+1
941  ldau(nrow,nlev)=ll
942  lpar(ll,nlev+1)=nrow
943  lpar(ll+1,nlev+1)=nrow
944  lnv(nlev+1)=ll+1
945 
946  IF(iq.NE.1)THEN
947  IF((3-2*jq)*iqv(nrow,nlev).GT.0)THEN
948  iqm(1)=0
949  iqm(2)=iqv(nrow,nlev)
950  ELSE
951  iqm(2)=0
952  iqm(1)=iqv(nrow,nlev)
953  z=1.d0-z
954  ENDIF
955  ELSE
956 *********************************************************
957  wg=psfap(z,0,0)
958 *********************************************************
959  wg=wg/(wg+psfap(z,0,1))
960  IF(qsran(b10).LT.wg)THEN
961  iqm(1)=0
962  iqm(2)=0
963  ELSE
964  iqm(1)=int(3.d0*qsran(b10)+1.d0)*(3-2*jq)
965  iqm(2)=-iqm(1)
966  ENDIF
967  IF(qsran(b10).LT..5d0)z=1.d0-z
968  ENDIF
969 
970  qv(nrow,nlev)=q
971  zv(nrow,nlev)=z
972 
973  nrow=ll
974  nlev=nlev+1
975  qmax(nrow,nlev)=q*z**2
976  qmax(nrow+1,nlev)=q*(1.d0-z)**2
977  iqv(nrow,nlev)=iqm(1)
978  iqv(nrow+1,nlev)=iqm(2)
979  IF(debug.GE.3)WRITE (moniou,203)nlev,nrow,q,z
980 203 FORMAT(2x,'PSCAJET: NEW BRANCHING AT LEVEL NLEV=',i2,
981  * ' NROW=',i2/4x,' EFFECTIVE MOMENTUM Q=',e10.3,2x,' Z=',e10.3)
982  GOTO 2
983  ELSE
984 
985  qv(nrow,nlev)=0.d0
986  zv(nrow,nlev)=0.d0
987  qm(nrow,nlev)=amj0
988  IF(debug.GE.3)WRITE (moniou,204)nlev,nrow
989 204 FORMAT(2x,'PSCAJET: NEW FINAL JET AT LEVEL NLEV=',i2,
990  * ' NROW=',i2)
991  ENDIF
992 
993 4 CONTINUE
994  IF(nlev.EQ.1)THEN
995  IF(debug.GE.3)WRITE (moniou,202)
996 202 FORMAT(2x,'PSCAJET - END')
997  RETURN
998  ENDIF
999  lprow=lpar(nrow,nlev)
1000 
1001  IF(ldau(lprow,nlev-1).EQ.nrow)THEN
1002  nrow=nrow+1
1003  GOTO 2
1004  ELSE
1005  z=zv(lprow,nlev-1)
1006  qm(lprow,nlev-1)=z*(1.d0-z)*qv(lprow,nlev-1)
1007  * +qm(nrow-1,nlev)/z+qm(nrow,nlev)/(1.d0-z)
1008  nrow=lprow
1009  nlev=nlev-1
1010  IF(debug.GE.3)WRITE (moniou,205)nlev,nrow,qm(lprow,nlev)
1011 205 FORMAT(2x,'PSCAJET: JET MASS AT LEVEL NLEV=',i2,
1012  * ' NROW=',i2,' - QM=',e10.3)
1013  GOTO 4
1014  ENDIF
1015  END
1016 C=======================================================================
1017 
1018  SUBROUTINE psconf
1019 c Simulation of the interaction configuration: impact parameter, nucleons positions,
1020 c numbers of cut soft pomerons and semihard blocks, their connections.
1021 c-----------------------------------------------------------------------
1022  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1023  INTEGER DEBUG
1024 c XA(56,3),XB(56,3) - arrays for projectile and target nucleons positions recording,
1025 c FHARD(i) give the factors to the scattering amplitude due to
1026 c valence quark-gluon (i=1), gluon-valence quark (i=2) and
1027 c valence quark-valence quark (i=3) interactions
1028 cdh DIMENSION XA(56,3),XB(56,3),FHARD(3)
1029  dimension xa(64,3),xb(64,3),fhard(3)
1030  COMMON /area1/ ia(2),icz,icp
1031  COMMON /area2/ s,y0,wp0,wm0
1032  COMMON /area6/ pi,bm,am
1033 c Arrays for interaction configuration recording:
1034 c LQA(i) (LQB(j)) - numbers of cut soft pomerons, connected to i-th projectile
1035 c (j-th target) nucleon (hadron);
1036 c LHA(i) (LHB(j)) - the same for hard pomerons numbers;
1037 c IAS(k) (IBS(k)) - number (position in array) of the projectile (target) nucleon,
1038 c connected to k-th block of soft pomerons;
1039 c NQS(k) - number of soft pomerons in k-th block;
1040 c IAH(k) (IBH(k)) - number (position in array) of the projectile (target) nucleon,
1041 c connected to k-th hard pomeron;
1042 c ZH(k) - impact parameter between the two nucleons connected to k-th hard pomeron
1043 c (more exactly exp(-b**2/RP1));
1044 c LVA(i)=1 if valence quark from i-th nucleon (i=1 for hadron) is involved into
1045 c the hard interaction and LVA(i)=0 otherwise, LVB(j) - similar.
1046  COMMON /area9/ lqa(56),lqb(56),nqs(1000),ias(1000),ibs(1000),
1047  * lha(56),lhb(56),zh(4000),iah(4000),ibh(4000),
1048  * iqh(4000),lva(56),lvb(56)
1049  COMMON /area10/ stmass,am0,amn,amk,amc,amlamc,amlam,ameta
1050  COMMON /area11/ b10
1051 c NSP - number of secondary particles
1052  COMMON /area12/ nsp
1053  COMMON /area16/ cc(5)
1054  COMMON /area40/ jdifr
1055  COMMON /area43/ moniou
1056 **************************************************
1057  COMMON /area45/ gdt,gdp !so00
1058 **************************************************
1059  COMMON /area99/ nwt
1060  COMMON /debug/ debug
1061 
1062  dimension iwt(56)
1063  SAVE
1064  EXTERNAL qsran
1065  integer ng1evt,ng2evt,ikoevt
1066  real rglevt,sglevt,eglevt,fglevt,typevt
1067  common/c2evt/ng1evt,ng2evt,rglevt,sglevt,eglevt,fglevt,ikoevt
1068  *,typevt !in epos.inc
1069 
1070  IF(debug.GE.1)WRITE (moniou,201)
1071 201 FORMAT(2x,'PSCONF - CONFIGURATION OF THE INTERACTION')
1072 
1073 100 nsp=0
1074  typevt=1 !NSD
1075  IF(ia(1).EQ.1)THEN
1076 **************************************************
1077  IF(jdifr.EQ.1.AND.qsran(b10).LT.gdt)THEN
1078 c Target diffraction
1079  IF(ia(2).NE.1)THEN
1080 c ICT - partner target nucleon type (proton - 2 or neutron - 3)
1081  ict=int(2.5+qsran(b10))
1082  ELSE
1083 c Target proton
1084  ict=2
1085  ENDIF
1086  wpi=wp0
1087  wmi=wm0
1088 c write (*,*)'difr'
1089  CALL xxdtg(wpi,wmi,icp,ict,0)
1090  typevt=3 !SD (low mass)
1091  goto 21 !so00
1092  ELSEIF(abs(jdifr).EQ.1.AND.qsran(b10).LT.gdp)THEN !so00
1093  IF(ia(2).NE.1)THEN !so00
1094 c ICT - partner target nucleon type (proton - 2 or neutron - 3)
1095  ict=int(2.5+qsran(b10)) !so00
1096  ELSE !so00
1097 c Target proton
1098  ict=2 !so00
1099  ENDIF !so00
1100  IF(debug.GE.2)WRITE (moniou,206) !so00
1101 206 FORMAT(2x,'PROJECTILE HADRON DIFFRACTION') !so00
1102  icp0=icp !so00
1103  wpi=wp0 !so00
1104  wmi=wm0 !so00
1105  lq=0 !so00
1106  CALL xxdpr(wpi,wmi,icp0,ict,lq) !so00
1107  typevt=3 !SD (low mass)
1108  goto 21 !so00
1109  ENDIF
1110 **************************************************
1111 c For hadron projectile we have given position in transverse plane;
1112 c initially primary hadron is positioned at (X,Y)=(0,0)
1113  DO 1 i=1,3
1114 1 xa(1,i)=0.d0
1115  ENDIF
1116 
1117 c-------------------------------------------------
1118 c Inelastic interaction at B<BM (usual case)
1119 c-------------------------------------------------
1120 c NW - number of wounded nucleons in the primary (NW=1 for hadron);
1121 c NT - number of target nucleons being in their active diffractive state;
1122 c LS - number of cut soft pomeron blocks (froissarons);
1123 c NHP - number of cut pomerons having hard block (referred below as hard blocks);
1124 c NQS(k) - number of cut soft pomerons in k-th block;
1125 c IAS(k) (IBS(k)) - number (position in array) of the projectile (target) nucleon,
1126 c connected to k-th block of soft pomerons;
1127 c IAH(k) (IBH(k)) - number 3(position in array) of the projectile (target) nucleon,
1128 c connected to k-th hard pomeron;
1129 c ZH(k) - impact parameter between the two nucleons connected to k-th hard pomeron
1130 c (more exactly exp(-b**2/RP1));
1131 c LQA(i) (LQB(j)) - total number of cut soft pomerons, connected to i-th projectile
1132 c (j-th target) nucleon (hadron);
1133 c LHA(i) (LHB(j)) - total number of cut hard blocks, connected to i-th projectile
1134 c (j-th target) nucleon (hadron);
1135 c LVA(i)=1 if valence quark from i-th nucleon (i=1 for hadron) is involved into
1136 c the hard interaction and LVA(i)=0 otherwise, LVB(j) - similar.
1137 c-------------------------------------------------
1138 c Initialization
1139 2 DO 3 i=1,ia(1)
1140  lha(i)=0
1141  lva(i)=0
1142 3 lqa(i)=0
1143  DO 4 i=1,ia(2)
1144  lhb(i)=0
1145  lvb(i)=0
1146 4 lqb(i)=0
1147 
1148 c-------------------------------------------------
1149 c The beginning
1150 5 CONTINUE
1151 **************************************************
1152  IF(ia(2).NE.1)THEN !changed!!!!!!!!! dh 8/10/98
1153 c For target nucleus number of target nucleons being in their active
1154 c diffractive state is simulated (for each nucleon probability equals
1155 c 1./C_n, - shower enhancenment coefficient)
1156  nt=0
1157  DO 6 i=1,ia(2)
1158 6 nt=nt+int(cc(2)+qsran(b10))
1159 c In case of no active target nucleon the event is rejected
1160  IF(nt.EQ.0)GOTO 5
1161  IF(debug.GE.3)WRITE (moniou,203)nt
1162 203 FORMAT(2x,'PSCONF: NUMBER OF ACTIVE TARGET NUCLEONS NT=',
1163  * i2)
1164 c PSGEA(NT,XB,2) - target nucleons positions simulation:
1165 cdh CALL PSGEA(NT,XB,2) !changed!!!!!!!!!
1166  CALL psgea(ia(2),xb,2) !changed!!!!!!!!! 25.03.99
1167 c NT - number of target nucleons being in their active diffractive state;
1168 c XB(i,n) - n-th nucleon coordinates (i=1,2,3 corresponds to x,y,z);
1169 c parameter 2 means target
1170  ELSE !changed!!!!!!!!! dh 8/10/98
1171  nt=1 !changed!!!!!!!!! dh 8/10/98
1172  xb(1,1)=0.d0 !changed!!!!!!!!! dh 8/10/98
1173  xb(1,2)=0.d0 !changed!!!!!!!!! dh 8/10/98
1174  ENDIF !changed!!!!!!!!! dh 8/10/98
1175 **************************************************
1176 
1177 c-------------------------------------------------
1178 c Impact parameter square is simulated uniformly (B**2<BM**2)
1179  b=bm*dsqrt(qsran(b10))
1180  IF(debug.GE.2)WRITE (moniou,204)b*am
1181 204 FORMAT(2x,'PSCONF: IMPACT PARAMETER FOR THE INTERACTION:',
1182  * e10.3,' FM')
1183 c PSGEA(IA(1),XA,1) - projectile nucleons positions simulation:
1184 c IA(1) - projectile nucleus mass number;
1185 c XA(i,n) - n-th nucleon coordinates (i=1,2,3 corresponds to x,y,z);
1186 c parameter 1 means projectile
1187  IF(ia(1).GT.1)CALL psgea(ia(1),xa,1)
1188 
1189  nw=0
1190  ls=0
1191  ns=0
1192  nhp=0
1193  DO 101 it = 1,nt
1194  iwt(it) = 0
1195  101 CONTINUE
1196 
1197 c-------------------------------------------------
1198 c Cycle over all projectile nucleons ( for projectile hadron we have only IN=1 )
1199  DO 14 in=1,ia(1)
1200  IF(debug.GE.2.AND.icz.EQ.2)WRITE (moniou,205)in
1201 205 FORMAT(2x,'PSCONF: ',i2,'-TH PROJECTILE NUCLEON')
1202 c Only nucleons in their active diffractive state are considered (for each nucleon
1203 c probability equals 1./C_n, C_n = 1./CC(2) - shower enhancenment coefficient)
1204  IF(ia(1).NE.1.AND.qsran(b10).GT.cc(2))GOTO 12
1205 c Projectile nucleons positions are shifted according the to impact parameter B
1206  x=xa(in,1)+b
1207  y=xa(in,2)
1208 
1209  iqs=0
1210  nw=nw+1
1211 c-------------------------------------------------
1212 c Cycle over all target nucleons in active state
1213  DO 11 m=1,nt
1214 c Z - b-factor for pomeron eikonal calculation (exp(-R_ij/R_p))
1215  z=psdr(x-xb(m,1),y-xb(m,2))
1216 c VV - eikonal for nucleon-nucleon (hadron-nucleon) interaction
1217 c (sum of the soft and semihard eikonals)
1218  vv=2.d0*psfaz(z,fsoft,fhard,fshard)
1219  ev=exp(-vv)
1220 c EH - eikonal contribution of valence quarks hard interactions
1221  eh=fhard(1)+fhard(2)+fhard(3)
1222 c eh=0.d0
1223  aks=qsran(b10)
1224 c 1.-EXP(-VV)*(1.D0-2.D0*EH) is the probability for inelastic nucleon-nucleon
1225 c (hadron-nucleon) interaction (for given nucleons positions)
1226  IF(aks.GT.1.d0-ev*(1.d0-2.d0*eh))GOTO 11
1227  IF(debug.GE.2)WRITE (moniou,208)m
1228 208 FORMAT(2x,'PSCONF: INTERACTION WITH',i2,'-TH TARGET NUCLEON')
1229 C INCREMENT THE NUMBER IWT OF WOUNDED TARGET NUCLEONS
1230  iwt(m) = 1
1231 
1232 c-------------------------------------------------
1233 c IQV - type of the hard interaction: 0 - gg, 1 - qg, 2 - gq, 3 - qq
1234  iqv=0
1235 
1236 c 2*EH*EV = 2*EH*EXP(-VV) - probability for only valence quarks hard interactions
1237 c (with no one soft or semihard)
1238  sum=2.d0*eh*ev
1239 
1240 c-------------------------------------------------
1241  IF(aks.LT.sum)THEN
1242  aks1=eh*qsran(b10)
1243  IF(aks1.LT.fhard(1))THEN
1244 c Rejection in case of valence quark already involved into the interaction
1245  IF(lva(nw).NE.0)GOTO 11
1246 c LVA(NW)=1 - valence quark-gluon interaction
1247  lva(nw)=1
1248  iqv=1
1249  ELSEIF(aks1.LT.fhard(1)+fhard(2))THEN
1250 c Rejection in case of valence quark already involved into the interaction
1251  IF(lvb(m).NE.0)GOTO 11
1252 c LVB(M)=1 - gluon-valence quark interaction
1253  lvb(m)=1
1254  iqv=2
1255  ELSE
1256 c Rejection in case of valence quarks already involved into the interaction
1257  IF(lva(nw)+lvb(m).NE.0)GOTO 11
1258 c LVA(NW)=LVB(M)=1 - valence quark-valence quark interaction
1259  lva(nw)=1
1260  lvb(m)=1
1261  iqv=3
1262  ENDIF
1263  n=1
1264 c LNH - number of new hard blocks (resulted from current nucleon-nucleon interaction)
1265  lnh=1
1266  GOTO 22
1267  ENDIF
1268 c-------------------------------------------------
1269 
1270 c LNH - number of new hard blocks - initialization
1271  lnh=0
1272 c WH - probability to have semihard interaction
1273  wh=2.d0*fshard/vv
1274 c N - number of cut pomerons (both soft ones and having hard blocks) for the
1275 c nucleon-nucleon (hadron-nucleon) interaction - is determined according to Poisson
1276 c with average value VV (twice the eikonal)
1277  DO 7 n=1,45
1278  ev=ev*vv/n
1279  sum=sum+ev
1280 7 IF(aks.LT.sum)GOTO 8
1281 
1282 c LNH - number of hard blocks for nucleon-nucleon (hadron-nucleon)
1283 c interaction (according to WH probability)
1284 8 DO 9 i=1,n
1285 9 lnh=lnh+int(wh+qsran(b10))
1286 
1287 c-------------------------------------------------
1288  aks1=.5d0*qsran(b10)
1289 c EH is the probability to have valence quarks interactions in addition to the
1290 c soft and semihard
1291  IF(aks1.LT.eh)THEN
1292  IF(aks1.LT.fhard(1))THEN
1293  IF(lva(nw).NE.0)GOTO 22
1294 c Valence quark-gluon interaction
1295  lva(nw)=1
1296  iqv=1
1297  ELSEIF(aks1.LT.fhard(1)+fhard(2))THEN
1298  IF(lvb(m).NE.0)GOTO 22
1299 c Gluon-valence quark interaction
1300  lvb(m)=1
1301  iqv=2
1302  ELSE
1303  IF(lva(nw)+lvb(m).NE.0)GOTO 22
1304 c Valence quark-valence quark interaction
1305  lva(nw)=1
1306  lvb(m)=1
1307  iqv=3
1308  ENDIF
1309  n=n+1
1310  lnh=lnh+1
1311  ENDIF
1312 
1313 22 iqs=1
1314  IF(lnh.NE.0)THEN
1315 c-------------------------------------------------
1316 c New hard blocks recording:
1317 c LNH - number of new hard blocks,
1318 c LHA(i) (LHB(j)) - total number of cut hard blocks, connected to i-th projectile
1319 c (j-th target) nucleon (hadron);
1320 c IAH(k) (IBH(k)) - number (position in array) of the projectile (target) nucleon,
1321 c connected to k-th hard block;
1322 c ZH(k) - factor exp(-R_ij/R_p) for k-th hard block;
1323 c IQH(k) - type of the hard interaction: 0 - gg, 1 - qg, 2 - gq, 3 - qq
1324 c-------------------------------------------------
1325 c N - number of cut soft pomerons
1326  n=n-lnh
1327  lha(nw)=lha(nw)+lnh
1328  lhb(m)=lhb(m)+lnh
1329  DO 10 i=1,lnh
1330  i1=nhp+i
1331  If (i1 .ge. 4000) then
1332  write(moniou,*)'psconf: I1 > 4000, index out of bounds'
1333  stop
1334  endif
1335  IF(i.EQ.1.AND.iqv.NE.0)THEN
1336  iqh(i1)=iqv
1337  ELSE
1338  iqh(i1)=0
1339  ENDIF
1340  IF(debug.GE.2)WRITE (moniou,209)i1,nw,m,iqh(i1)
1341 209 FORMAT(2x,'PSCONF: ',i4,'-TH HARD BLOCK IS CONNECTED TO',1x,
1342  * i2,'-TH PROJECTILE NUCLEON (HADRON) AND'/4x,i2,
1343  * '-TH TARGET NUCLEON; TYPE OF THE SEMIHARD INTERACTION:',i1)
1344  zh(i1)=z
1345  iah(i1)=nw
1346 10 ibh(i1)=m
1347 c-------------------------------------------------
1348 c NHP - total number of hard blocks
1349  nhp=nhp+lnh
1350  ENDIF
1351 
1352 c-------------------------------------------------
1353  IF(n.GT.0)THEN
1354 c One more block of soft pomerons; soft block characteristics recording
1355  ls=ls+1
1356  ias(ls)=nw
1357  ibs(ls)=m
1358  lqa(nw)=lqa(nw)+n
1359  lqb(m)=lqb(m)+n
1360  nqs(ls)=n
1361  IF(debug.GE.2)WRITE (moniou,210)ls,nw,m,n
1362 210 FORMAT(2x,'PSCONF: ',i4,'-TH SOFT BLOCK IS CONNECTED TO',1x,
1363  * i2,'-TH PROJECTILE NUCLEON (HADRON) AND'/4x,i2,
1364  * '-TH TARGET NUCLEON; NUMBER OF POMERONS IN THE BLOCK NP=',
1365  * i2)
1366  ENDIF
1367 11 CONTINUE
1368 c-------------------------------------------------
1369 
1370  IF(iqs.NE.0)GOTO 14
1371 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1372 c Projectile diffraction
1373 c For each projectile nucleon (hadron) diffractive dissociation probability is
1374 c (1.D0-CC(ICZ))*PSV(X,Y,XB,NT);
1375 c XXV(X,Y,XB,NT) - nucleon-nucleus scattering eikonal factor
1376 c ( (1-eikonal)**2 ) for given nucleons positions
1377 c (For projectile hadron only in case of JPERI=0, otherwise it was considered
1378 c before at any impact parameter )
1379  IF(jdifr.EQ.1 .AND. ia(1).NE. 1
1380  * .AND.qsran(b10).LT.(1.d0-cc(icz))*psv(x,y,xb,nt))THEN
1381 **************************************************
1382  IF(ia(2).NE.1)THEN
1383 c ICT - partner target nucleon type (proton - 2 or neutron - 3)
1384  ict=int(2.5+qsran(b10))
1385  ELSE
1386 c Target proton
1387  ict=2
1388  ENDIF
1389 c Projectile nucleon
1390  IF(debug.GE.2)WRITE(moniou,207)in
1391 207 FORMAT(2x,i2,'-TH PROJECTILE NUCLEON DIFFRACTION')
1392  icp0=int(2.5+qsran(b10))
1393  wpi=wp0
1394  wmi=wm0
1395  IF(ia(2).EQ.1)THEN
1396  lq=0
1397  ELSE
1398  lq=1
1399  ENDIF
1400  CALL xxdpr(wpi,wmi,icp0,ict,lq)
1401  GOTO 14
1402  ENDIF
1403 **************************************************
1404 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1405 c No interaction for projectile nucleon considered
1406  nw=nw-1
1407 12 CONTINUE
1408 
1409 c One more projectile spectator (noninteracting) nucleon (spectator positions
1410 c are recorded to simulate nuclear fragmentation)
1411  ns=ns+1
1412  IF(ns.NE.in)THEN
1413  DO 13 l=1,3
1414 13 xa(ns,l)=xa(in,l)
1415  ENDIF
1416 14 CONTINUE
1417 
1418 c In case of no one interacting (or D-diffracted) nucleon the event is
1419 c rejected, new impact parameter is generated and all the procedure is
1420 c repeated
1421  IF(ns.EQ.ia(1))THEN
1422  IF(debug.GE.3)WRITE (moniou,211)
1423 211 FORMAT(2x,'PSCONF: NO ONE NUCLEON (HADRON) INTERACTS - ',
1424  * 'REJECTION')
1425  GOTO 5
1426  ENDIF
1427 c-------------------------------------------------
1428 cdh if(nhp.gt.150)then ! changed 18. Feb. 04
1429  if(nhp.gt.1500)then
1430  WRITE (moniou,213)nhp
1431 213 FORMAT(2x,'PSCONF: TOO GREAT NUMBER OF HARD POMERONS: NHP=',
1432  * i5,' - REJECTION')
1433  GOTO 100
1434  endif
1435 
1436  nwt = 0
1437 C number of interacting target nucleons
1438  DO 102 it = 1,nt
1439  nwt = nwt + iwt(it)
1440  102 CONTINUE
1441 
1442 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1443 c Fragmentation of the spectator part of the nucleus
1444  CALL xxfragm(ns,xa)
1445 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1446 
1447 c Inelastic interaction - energy sharing procedure
1448 20 IF(nw.NE.0)CALL psshar(ls,nhp,nw,nt)
1449 21 continue !so00
1450  IF(debug.GE.3)WRITE (moniou,212)
1451 212 FORMAT(2x,'PSCONF - END')
1452  RETURN
1453 c////////////////
1454  entry qgs1getdiffcode( jcode )
1455  jcode = jdiff
1456 c//////////////
1457  END
1458 C=======================================================================
1459 
1460  SUBROUTINE pscs(C,S)
1461 c C,S - COS and SIN generation for uniformly distributed angle 0<fi<2*pi
1462 c-----------------------------------------------------------------------
1463  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1464  INTEGER DEBUG
1465  COMMON /area11/ b10
1466  COMMON /area43/ moniou
1467  COMMON /debug/ debug
1468  SAVE
1469  EXTERNAL qsran
1470 
1471  IF(debug.GE.2)WRITE (moniou,201)
1472 201 FORMAT(2x,'PSCS - COS(FI) AND SIN(FI) ARE GENERATED',
1473  * ' (0<FI<2*PI)')
1474 1 s1=2.d0*qsran(b10)-1.d0
1475  s2=2.d0*qsran(b10)-1.d0
1476  s3=s1*s1+s2*s2
1477  IF(s3.GT.1.d0)GOTO 1
1478  s3=dsqrt(s3)
1479  c=s1/s3
1480  s=s2/s3
1481  IF(debug.GE.3)WRITE (moniou,202)c,s
1482 202 FORMAT(2x,'PSCS: C=',e10.3,2x,'S=',e10.3)
1483  RETURN
1484  END
1485 C=======================================================================
1486 
1487  SUBROUTINE psdeftr(S,EP,EY)
1488 c Determination of the parameters for the Lorentz transform to the rest frame
1489 c system for 4-vector EP
1490 c-----------------------------------------------------------------------
1491  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1492  INTEGER DEBUG
1493  dimension ey(3),ep(4)
1494  COMMON /area43/ moniou
1495  COMMON /debug/ debug
1496  SAVE
1497 
1498  IF(debug.GE.2)WRITE (moniou,201)ep,s
1499 201 FORMAT(2x,'PSDEFTR - LORENTZ BOOST PARAMETERS:'/
1500  * 4x,'4-VECTOR EP=',4e10.3/4x,'4-VECTOR SQUARED S=',e10.3)
1501  DO 2 i=1,3
1502  IF(ep(i+1).EQ.0.d0)THEN
1503  ey(i)=1.d0
1504  ELSE
1505  wp=ep(1)+ep(i+1)
1506  wm=ep(1)-ep(i+1)
1507  IF(wm/wp.LT.1.d-8)THEN
1508  ww=s
1509  DO 1 l=1,3
1510 1 IF(l.NE.i)ww=ww+ep(l+1)**2
1511  wm=ww/wp
1512  ENDIF
1513  ey(i)=dsqrt(wm/wp)
1514  ep(1)=wp*ey(i)
1515  ep(i+1)=0.d0
1516  ENDIF
1517 2 CONTINUE
1518  IF(debug.GE.3)WRITE (moniou,202)ey
1519 202 FORMAT(2x,'PSDEFTR: LORENTZ BOOST PARAMETERS EY(I)=',2x,3e10.3)
1520  RETURN
1521  END
1522 C=======================================================================
1523 
1524  SUBROUTINE psdefrot(EP,S0X,C0X,S0,C0)
1525 c Determination of the parameters the spacial rotation to the lab. system
1526 c for 4-vector EP
1527 c-----------------------------------------------------------------------
1528  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1529  INTEGER DEBUG
1530  dimension ep(4)
1531  COMMON /area43/ moniou
1532  COMMON /debug/ debug
1533  SAVE
1534 
1535  IF(debug.GE.2)WRITE (moniou,201)ep
1536 201 FORMAT(2x,'PSDEFROT - SPACIAL ROTATION PARAMETERS'/4x,
1537  * '4-VECTOR EP=',2x,4(e10.3,1x))
1538 c Transverse momentum square for the current parton (EP)
1539  pt2=ep(3)**2+ep(4)**2
1540  IF(pt2.NE.0.d0)THEN
1541  pt=dsqrt(pt2)
1542 c System rotation to get Pt=0 - Euler angles are determined (C0X = cos theta,
1543 c S0X = sin theta, C0 = cos phi, S0 = sin phi)
1544  c0x=ep(3)/pt
1545  s0x=ep(4)/pt
1546 c Total momentum for the gluon
1547  pl=dsqrt(pt2+ep(2)**2)
1548  s0=pt/pl
1549  c0=ep(2)/pl
1550  ELSE
1551  c0x=1.d0
1552  s0x=0.d0
1553  pl=abs(ep(2))
1554  s0=0.d0
1555  c0=ep(2)/pl
1556  ENDIF
1557 
1558  ep(2)=pl
1559  ep(3)=0.d0
1560  ep(4)=0.d0
1561  IF(debug.GE.3)WRITE (moniou,202)s0x,c0x,s0,c0,ep
1562 202 FORMAT(2x,'PSDEFROT: SPACIAL ROTATION PARAMETERS'/
1563  * 4x,'S0X=',e10.3,2x,'C0X=',e10.3,2x,'S0=',e10.3,2x,'C0=',e10.3/
1564  * 4x,'ROTATED 4-VECTOR EP=',4(e10.3,1x))
1565  RETURN
1566  END
1567 C=======================================================================
1568 
1569  FUNCTION psdr(X,Y)
1570 c PSDR - impact parameter factor for eikonals calculation (exp(-Rij/Rp)=Z)
1571 c-----------------------------------------------------------------------
1572  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1573  INTEGER DEBUG
1574  COMMON /area7/ rp
1575  COMMON /area43/ moniou
1576  COMMON /debug/ debug
1577  SAVE
1578 
1579  IF(debug.GE.2)WRITE (moniou,201)x,y
1580 201 FORMAT(2x,'PSDR: NUCLEON COORDINATES - X=',e10.3,2x,'Y=',e10.3)
1581  psdr=exp(-(x*x+y*y)/rp)
1582  IF(debug.GE.3)WRITE (moniou,202)psdr
1583 202 FORMAT(2x,'PSDR=',e10.3)
1584  RETURN
1585  END
1586 C=======================================================================
1587 
1588  FUNCTION psfap(X,J,L)
1589 C PSFAP - Altarelli-Parisi function (multiplied by X)
1590 c X - light cone momentum share value,
1591 c J - type of the parent parton (0-g,1-q)
1592 c L - type of the daughter parton (0-g,1-q)
1593 C-----------------------------------------------------------------------
1594  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1595  INTEGER DEBUG
1596  COMMON /area43/ moniou
1597  COMMON /debug/ debug
1598  SAVE
1599 
1600  IF(debug.GE.2)WRITE (moniou,201)x,j,l
1601 201 FORMAT(2x,'PSFAP - ALTARELLI-PARISI FUNCTION:',2x,
1602  * 'X=',e10.3,2x,'J=',i1,2x,'L=',i1)
1603  IF(j.EQ.0)THEN
1604  IF(l.EQ.0)THEN
1605  psfap=((1.d0-x)/x+x/(1.d0-x)+x*(1.d0-x))*6.d0
1606  ELSE
1607  psfap=(x**2+(1.d0-x)**2)*3.d0
1608  ENDIF
1609  ELSE
1610  IF(l.EQ.0)THEN
1611  psfap=(1.d0+(1.d0-x)**2)/x/.75d0
1612  ELSE
1613  psfap=(x**2+1.d0)/(1.d0-x)/.75d0
1614  ENDIF
1615  ENDIF
1616  IF(debug.GE.3)WRITE (moniou,202)psfap
1617 202 FORMAT(2x,'PSFAP=',e10.3)
1618  RETURN
1619  END
1620 C=======================================================================
1621 
1622  FUNCTION psfaz(Z,FSOFT,FHARD,FSHARD)
1623 c Interaction eikonal for hadron-nucleon (nucleon-nucleon) scattering
1624 c Z - impact parameter factor, Z=exp(-b**2/Rp),
1625 c FSOFT - soft pomeron eikonal - to be determined,
1626 c FSHARD - semihard interaction eikonal (gg) - to be determined,
1627 c FHARD(k) - hard interaction eikonal (k=1 - qg, 2 - gq, 3 - qq) -
1628 c to be determined,
1629 c-----------------------------------------------------------------------
1630  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1631  INTEGER DEBUG
1632  dimension fhard(3)
1633  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
1634  COMMON /area22/ sjv,fjs(5,3)
1635  COMMON /area43/ moniou
1636  COMMON /debug/ debug
1637  SAVE
1638 
1639  IF(debug.GE.2)WRITE (moniou,201)z
1640 201 FORMAT(2x,'PSFAZ - HADRON-NUCLEON (NUCLEON-NUCLEON)',
1641  * ' INTERACTION EIKONAL; Z=',e10.3)
1642  fsoft=fs*z
1643  fhard(3)=sjv*z**(rs/rs0)
1644 
1645  jz=int(5.d0*z)
1646  IF(jz.GT.3)jz=3
1647  wz=5.d0*z-jz
1648 
1649  DO 1 i=1,3
1650  IF(jz.EQ.0)THEN
1651  fsr=(exp(fjs(1,i))*wz+(exp(fjs(2,i))-2.d0*
1652  * exp(fjs(1,i)))*wz*(wz-1.d0)*.5d0)*z
1653  ELSE
1654  fsr=exp(fjs(jz,i)+(fjs(jz+1,i)-fjs(jz,i))*wz
1655  * +(fjs(jz+2,i)+fjs(jz,i)-2.d0*fjs(jz+1,i))
1656  * *wz*(wz-1.d0)*.5d0)*z
1657  ENDIF
1658  IF(i.NE.1)THEN
1659  fhard(i-1)=fsr
1660  ELSE
1661  fshard=fsr
1662  ENDIF
1663 1 CONTINUE
1664 
1665  psfaz=fsoft+fshard
1666  IF(debug.GE.3)WRITE (moniou,202)psfaz,fsoft,fshard,fhard
1667 202 FORMAT(2x,'PSFAZ=',e10.3,2x,'FSOFT=',e10.3,2x,'FSHARD=',e10.3/4x
1668  * ,'FHARD=',3e10.3)
1669  RETURN
1670  END
1671 C=======================================================================
1672 
1673  FUNCTION psfborn(S,T,IQ1,IQ2)
1674 c PSFBORN - integrand for the Born cross-section (matrix element squared)
1675 c S - total c.m. energy squared for the scattering,
1676 c T - invariant variable for the scattering abs[(p1-p3)**2],
1677 c IQ1 - parton type at current end of the ladder (0 - g, 1,2 - q)
1678 c IQ2 - parton type at opposite end of the ladder (0 - g, 1,2 - q)
1679 c-----------------------------------------------------------------------
1680  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1681  INTEGER DEBUG
1682  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
1683  COMMON /area43/ moniou
1684  COMMON /debug/ debug
1685  SAVE
1686 
1687  IF(debug.GE.2)WRITE (moniou,201)s,t,iq1,iq2
1688 201 FORMAT(2x,'PSFBORN - HARD SCATTERING MATRIX ELEMENT SQUARED:'/
1689  * 4x,'S=',e10.3,2x,'|T|=',e10.3,2x,'IQ1=',i2,2x,'IQ2=',i2)
1690  u=s-t
1691  IF(iq1.EQ.0.AND.iq2.EQ.0)THEN
1692 c Gluon-gluon
1693  psfborn=(3.d0-t*u/s**2+s*u/t**2+s*t/u**2)*4.5d0
1694  ELSEIF(iq1*iq2.EQ.0)THEN
1695 c Gluon-quark
1696  psfborn=(s**2+u**2)/t**2+(s/u+u/s)/2.25d0
1697  ELSEIF(iq1.EQ.iq2)THEN
1698 c Quark-quark (of the same flavor)
1699  psfborn=((s**2+u**2)/t**2+(s**2+t**2)/u**2)/2.25d0
1700  * -s**2/t/u/3.375d0
1701  ELSEIF(iq1+iq2.EQ.0)THEN
1702 c Quark-antiquark (of the same flavor)
1703  psfborn=((s**2+u**2)/t**2+(u**2+t**2)/s**2)/2.25d0
1704  * -u**2/t/s/3.375d0
1705  ELSE
1706 c Quark-quark (different flavors)
1707  psfborn=(s**2+u**2)/t**2/2.25d0
1708  ENDIF
1709  IF(debug.GE.2)WRITE (moniou,202)psfborn
1710 202 FORMAT(2x,'PSFBORN=',e10.3)
1711  RETURN
1712  END
1713 C=======================================================================
1714 
1715  FUNCTION psfsh(S,Z,ICZ,IQQ)
1716 c PSFSH - semihard interaction eikonal
1717 c S - energy squared for the interaction (hadron-hadron),
1718 c ICZ - type of the primaty hadron (nucleon)
1719 c Z - impact parameter factor, Z=exp(-b**2/Rp),
1720 c IQQ - type of the hard interaction (0 - gg, 1 - qg, 2 - gq)
1721 c-----------------------------------------------------------------------
1722  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1723  INTEGER DEBUG
1724  COMMON /area6/ pi,bm,am
1725  COMMON /area15/ fp(5),rq(5),cd(5)
1726  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
1727  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
1728  COMMON /area19/ ahl(5)
1729  COMMON /area25/ ahv(5)
1730  COMMON /area27/ fp0(5)
1731  COMMON /ar3/ x1(7),a1(7)
1732  COMMON /area43/ moniou
1733  COMMON /debug/ debug
1734  SAVE
1735 
1736  IF(debug.GE.2)WRITE (moniou,201)s,z,iqq,icz
1737 201 FORMAT(2x,'PSFSH - SEMIHARD INTERACTION EIKONAL:'/
1738  * 4x,'S=',e10.3,2x,'Z=',e10.3,2x,'IQQ=',i1,2x,'ICZ=',i1)
1739  xmin=4.d0*qt0/s
1740  xmin=xmin**(delh-del)
1741  psfsh=0.d0
1742  IF(iqq.EQ.1)THEN
1743  icv=icz
1744  icq=2
1745  ELSEIF(iqq.EQ.2)THEN
1746  icv=2
1747  icq=icz
1748  ENDIF
1749  iq=(iqq+1)/2
1750 
1751 c Numerical integration over Z1
1752  DO 3 i=1,7
1753  DO 3 m=1,2
1754  z1=(.5d0*(1.d0+xmin-(2*m-3)*x1(i)*(1.d0-xmin)))**(1.d0/
1755  * (delh-del))
1756 c SJ is the DLA inclusive hard partonic (gluon-gluon) interaction
1757 c cross-section (inclusive cut ladder cross section) for minimal
1758 c 4-momentum transfer squre QT0 and c.m. energy square s_hard = exp YJ;
1759 c SJB - Born cross-section
1760  CALL psjint0(z1*s,sj,sjb,iq,0)
1761 c GY= Sigma_hard_tot(YJ,QT0) - total hard partonic (gluon-gluon)
1762 c interaction cross-section for minimal 4-momentum transfer square QT0 and
1763 c c.m. energy square s_hard = exp YJ; SH=pi*R_hard**2 (R_hard**2=4/QT0)
1764  gy=2.d0*sh*psgint((sj-sjb)/sh*.5d0)+sjb
1765  IF(debug.GE.3)WRITE (moniou,203)z1*s,gy
1766 203 FORMAT(2x,'PSFSH:',2x,'S_HARD=',e10.3,2x,'SIGMA_HARD=',e10.3)
1767 
1768  IF(iqq.EQ.0)THEN
1769  st2=0.d0
1770  DO 1 j=1,7
1771  DO 1 k=1,2
1772  xx=.5d0*(1.d0+x1(j)*(2*k-3))
1773 1 st2=st2+a1(j)*psftild(z1**xx,icz)*
1774  * psftild(z1**(1.d0-xx),2)
1775 
1776  rh=rs0-alf*dlog(z1)
1777  psfsh=psfsh-a1(i)*dlog(z1)*gy/z1**delh*z**(rs/rh)/rh*st2
1778  ELSE
1779 
1780  st2=0.d0
1781  DO 2 j=1,7
1782  DO 2 k=1,2
1783  xx=.5d0*(1.d0+x1(j)*(2*k-3))
1784  xam=z1**(del+.5d0)
1785  xa=(xam+(1.d0-xam)*xx)**(1.d0/(del+.5d0))
1786  rh=rs0+alf*dlog(xa/z1)
1787 2 st2=st2+a1(j)*(1.d0-xa)**ahv(icv)*z**(rs/rh)/rh*
1788  * psftild(z1/xa,icq)
1789  st2=st2*(1.d0-xam)
1790 
1791  psfsh=psfsh+a1(i)*gy/z1**delh*st2
1792  ENDIF
1793 3 CONTINUE
1794 
1795  IF(iqq.EQ.0)THEN
1796  psfsh=psfsh*.125d0*rr*(1.d0-xmin)/(delh-del)*fp0(icz)*fp0(2)
1797  * *cd(icz)
1798  ELSE
1799  psfsh=psfsh*dsqrt(rr)/16.d0*fp0(icq)*(1.d0-xmin)/(delh-del)/
1800  * (del+.5d0)*gamfun_kk(ahv(icv)+1.5d0)
1801  * /gamfun_kk(ahv(icv)+1.d0)/pi*cd(icz)
1802  IF(icz.EQ.2.OR.iqq.EQ.2)THEN
1803  psfsh=psfsh*3.d0
1804  ELSEIF((icz-1)*(icz-3)*(icz-5).EQ.0)THEN
1805  psfsh=psfsh*2.d0
1806  ENDIF
1807  ENDIF
1808  IF(debug.GE.3)WRITE (moniou,202)psfsh
1809 202 FORMAT(2x,'PSFSH=',e10.3)
1810  RETURN
1811  END
1812 C=======================================================================
1813 
1814  FUNCTION psftild(Z,ICZ)
1815 c PSFTILD - auxilliary function for semihard eikonals calculation -
1816 c integration over semihard block light cone momentum share x
1817 c Z - x-cutoff from below,
1818 c ICZ - type of the hadron to which the semihard block is connected
1819 c-----------------------------------------------------------------------
1820  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1821  INTEGER DEBUG
1822  COMMON /area17/ del,rs,rs0,fs,alfp,rr,sh,delh
1823  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
1824  COMMON /area19/ ahl(5)
1825  COMMON /ar3/ x1(7),a1(7)
1826  COMMON /area43/ moniou
1827  COMMON /debug/ debug
1828  SAVE
1829 
1830  IF(debug.GE.2)WRITE (moniou,201)z,icz
1831 201 FORMAT(2x,'PSFTILD:',2x,'Z=',e10.3,2x,'ICZ=',i1)
1832  psftild=0.
1833  DO 1 i=1,7
1834  DO 1 m=1,2
1835  xb=1.d0-(1.d0-z)*(.5d0*(1.d0+(2*m-3)*x1(i)))**(1.d0/
1836  * (ahl(icz)+1.d0))
1837 1 psftild=psftild+a1(i)*xb**del*(1.d0-z/xb)**bet
1838  psftild=psftild*.5d0*(1.d0-z)**(ahl(icz)+1.d0)/(ahl(icz)+1.d0)
1839  IF(debug.GE.3)WRITE (moniou,202)psftild
1840 202 FORMAT(2x,'PSFTILD=',e10.3)
1841  RETURN
1842  END
1843 C=======================================================================
1844 
1845  SUBROUTINE psgea(IA,XA,JJ)
1846 c PSGEA - nuclear configuration simulation (nucleons positions)
1847 c IA - number of nucleons to be considered
1848 c-----------------------------------------------------------------------
1849  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1850  INTEGER DEBUG
1851 cdh DIMENSION XA(56,3)
1852  dimension xa(64,3)
1853  COMMON /area5/ rd(2),ca1(2),ca2(2),ca3(2)
1854  COMMON /area11/ b10
1855  COMMON /area43/ moniou
1856  COMMON /debug/ debug
1857  SAVE
1858  EXTERNAL qsran
1859 
1860  IF(debug.GE.2)WRITE (moniou,201)jj,ia
1861 201 FORMAT(2x,'PSGEA - CONFIGURATION OF THE NUCLEUS ',i1,';',2x,
1862  * 'COORDINATES FOR ',i2,' NUCLEONS')
1863 cdh IF(JJ.EQ.2.OR.IA.GE.10)THEN
1864  IF(ia.GE.10)THEN !this line had been changed!!!!!!! dh 8/10/98
1865 cdh
1866  DO 7 i=1,ia
1867 1 zuk=qsran(b10)*ca1(jj)-1.d0
1868  IF(zuk)2,2,3
1869 2 tt=rd(jj)*(qsran(b10)**.3333d0-1.d0)
1870  GOTO 6
1871 3 IF(zuk.GT.ca2(jj))GOTO 4
1872  tt=-dlog(qsran(b10))
1873  GOTO 6
1874 4 IF(zuk.GT.ca3(jj))GOTO 5
1875  tt=-dlog(qsran(b10))-dlog(qsran(b10))
1876  GOTO 6
1877 5 tt=-dlog(qsran(b10))-dlog(qsran(b10))-dlog(qsran(b10))
1878 6 IF(qsran(b10).GT.1.d0/(1.d0+exp(-abs(tt))))GOTO 1
1879  rim=tt+rd(jj)
1880  z=rim*(2.d0*qsran(b10)-1.d0)
1881  rim=dsqrt(rim*rim-z*z)
1882  xa(i,3)=z
1883  CALL pscs(c,s)
1884  xa(i,1)=rim*c
1885 7 xa(i,2)=rim*s
1886  ELSE
1887 
1888  DO 9 l=1,3
1889  summ=0.d0
1890  DO 8 i=1,ia-1
1891  j=ia-i
1892  aks=rd(jj)*(qsran(b10)+qsran(b10)+qsran(b10)-1.5d0)
1893  k=j+1
1894  xa(k,l)=summ-aks*sqrt(float(j)/k)
1895 8 summ=summ+aks/sqrt(float(j*k))
1896 9 xa(1,l)=summ
1897  ENDIF
1898  IF(debug.GE.3)THEN
1899  WRITE (moniou,203)
1900  DO 206 i=1,ia
1901 206 WRITE (moniou,204)i,(xa(i,l),l=1,3)
1902  WRITE (moniou,202)
1903  ENDIF
1904 202 FORMAT(2x,'PSGEA - END')
1905 203 FORMAT(2x,'PSGEA: POSITIONS OF THE NUCLEONS')
1906 204 FORMAT(2x,'PSGEA: ',i2,' - ',3(e10.3,1x))
1907  RETURN
1908  END
1909 C=======================================================================
1910 
1911  FUNCTION psgint(Z)
1912 c Auxiliary function for eikonal cross-sections calculation
1913 c GINT = int(dt) [0<t<Z] (1-exp(-t))/t
1914 c-----------------------------------------------------------------------
1915  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1916  INTEGER DEBUG
1917  COMMON /ar3/ x1(7),a1(7)
1918  COMMON /area43/ moniou
1919  COMMON /debug/ debug
1920  SAVE
1921 
1922  f(z,x)=(1.-exp(-.5*z*(1.+x)))/(1.+x)
1923 
1924  IF(debug.GE.2)WRITE (moniou,201)z
1925 201 FORMAT(2x,'PSGINT:',2x,'Z=',e10.3)
1926  psgint=0.
1927  DO 5 i=1,7
1928 5 psgint=psgint+a1(i)*(f(z,x1(i))+f(z,-x1(i)))
1929  IF(debug.GE.3)WRITE (moniou,202)psgint
1930 202 FORMAT(2x,'PSGINT=',e10.3)
1931  RETURN
1932  END
1933 C=======================================================================
1934 
1935  FUNCTION pshard(S,ICZ)
1936 c PSHARD - hard quark-quark interaction cross-section
1937 c S - energy squared for the interaction (hadron-hadron),
1938 c ICZ - type of the primaty hadron (nucleon)
1939 c-----------------------------------------------------------------------
1940  IMPLICIT DOUBLE PRECISION (a-h,o-z)
1941  INTEGER DEBUG
1942  COMMON /ar3/ x1(7),a1(7)
1943  COMMON /area6/ pi,bm,am
1944  COMMON /area15/ fp(5),rq(5),cd(5)
1945  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
1946  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
1947  COMMON /area19/ ahl(5)
1948  COMMON /area25/ ahv(5)
1949  COMMON /area43/ moniou
1950  COMMON /debug/ debug
1951  SAVE
1952 
1953  IF(debug.GE.2)WRITE (moniou,201)s,icz
1954 201 FORMAT(2x,'PSHARD - HARD QUARK-QUARK INTERACTION CROSS',
1955  * ' SECTION:',
1956  * 2x,'S=',e10.3,2x,'ICZ=',i1)
1957  xmin=4.d0*qt0/s
1958  xmin=xmin**(delh+.5d0)
1959  pshard=0.d0
1960 
1961 c Numerical integration over Z1
1962  DO 2 i=1,7
1963  DO 2 m=1,2
1964  z1=(.5d0*(1.d0+xmin-(2*m-3)*x1(i)*(1.d0-xmin)))**(1.d0/
1965  * (delh+.5d0))
1966 
1967  st2=0.d0
1968  DO 1 j=1,7
1969  DO 1 k=1,2
1970  xx=.5d0*(1.d0+x1(j)*(2*k-3))
1971  st2=st2+a1(j)*(1.d0-z1**xx)**ahv(icz)*
1972  * (1.d0-z1**(1.d0-xx))**ahv(2)
1973 1 CONTINUE
1974 
1975 c SJ is the DLA inclusive hard partonic (gluon-gluon) interaction
1976 c cross-section (inclusive cut ladder cross section) for minimal
1977 c 4-momentum transfer squre QT0 and c.m. energy square s_hard = exp YJ;
1978 c SJB - Born cross-section
1979  CALL psjint0(z1*s,sj,sjb,1,1)
1980 c GY= Sigma_hard_tot(YJ,QT0) - total hard partonic (quark-quark)
1981 c interaction cross-section for minimal 4-momentum transfer square QT0 and
1982 c c.m. energy square s_hard = exp YJ; SH=pi*R_hard**2 (R_hard**2=4/QT0)
1983  gy=2.d0*sh*psgint((sj-sjb)/sh*.5d0)+sjb
1984 
1985  IF(debug.GE.3)WRITE (moniou,203)z1*s,gy
1986 203 FORMAT(2x,'PSHARD:',2x,'S_HARD=',e10.3,2x,'SIGMA_HARD=',e10.3)
1987  pshard=pshard-a1(i)*dlog(z1)*gy/z1**delh*st2
1988 2 CONTINUE
1989 
1990  pshard=pshard*(1.d0-xmin)/(.5d0+delh)*.25d0
1991  pshard=pshard/(gamfun_kk(ahv(icz)+1.d0)*
1992  * gamfun_kk(ahv(2)+1.d0)*pi)*
1993  * gamfun_kk(ahv(icz)+1.5d0)*gamfun_kk(ahv(2)+1.5d0)
1994 
1995  IF(icz.EQ.2)THEN
1996  pshard=pshard*9.d0
1997  ELSEIF((icz-1)*(icz-3)*(icz-5).EQ.0)THEN
1998  pshard=pshard*6.d0
1999  ELSE
2000  pshard=pshard*3.d0
2001  ENDIF
2002 
2003 c Hard cross-section is divided by Regge radius RS0 and multiplied by
2004 c shower enhancement coefficient CD(ICZ) - to be used for the eikonal
2005 c calculation
2006  pshard=pshard/(8.d0*pi*rs0)*cd(icz)
2007  IF(debug.GE.2)WRITE (moniou,202)pshard
2008 202 FORMAT(2x,'PSHARD=',e10.3)
2009  RETURN
2010  END
2011 C=======================================================================
2012 
2013  SUBROUTINE pshot(WP0,WM0,Z,IPC,EPC,IZP,IZT,ICZ,IQQ)
2014 c Semihard jets production simulation (resulted from parton-parton
2015 c interaction);
2016 c WP0,WM0 - light cone momenta shares (E+-P_l) for the initial partons
2017 c IZP, IZT - types for target and projectile nucleons (hadron)
2018 c WPQ - light cone momenta for the soft preevolution - to be determined below
2019 c IQQ - type of the hard interaction: 0 - gg, 1 - qg, 2 - gq, 3 - qq
2020 c-----------------------------------------------------------------------
2021  IMPLICIT DOUBLE PRECISION (a-h,o-z)
2022  INTEGER DEBUG
2023  CHARACTER*2 TYQ
2024  dimension ep(4,2),ept(4),ept0(4),ep3(4),epj(4),epj1(4),ey(3),
2025  * qmin(2),wp(2),iqc(2),iqp(2),
2026  * ipc(2,2),epc(8,2),iqj(2),eqj(4,2),ipq(2,2),epq(8,2),
2027  * ebal(4),
2028  * qv1(30,50),zv1(30,50),qm1(30,50),iqv1(2,30,50),
2029  * ldau1(30,49),lpar1(30,50),
2030  * qv2(30,50),zv2(30,50),qm2(30,50),iqv2(2,30,50),
2031  * ldau2(30,49),lpar2(30,50)
2032  COMMON /area6/ pi,bm,ammm
2033  COMMON /area8/ wwm,be(4),dc(5),deta,almpt
2034  COMMON /area10/ stmass,am(7)
2035  COMMON /area11/ b10
2036  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
2037  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
2038  COMMON /area42/ tyq(15)
2039  COMMON /area43/ moniou
2040  COMMON /area46/ epjet(4,2,15000),ipjet(2,15000)
2041  COMMON /area47/ njtot
2042  COMMON /debug/ debug
2043  SAVE
2044  EXTERNAL qsran
2045 
2046  IF(debug.GE.1)WRITE (moniou,201)iqq,wp0,wm0
2047 201 FORMAT(2x,'PSHOT - SEMIHARD INTERACTION SIMULATION:'/
2048  * 4x,'TYPE OF THE INTERACTION:',i2/
2049  * 4x,'INITIAL LIGHT CONE MOMENTA:',2e10.3)
2050 c S - total energy squared for the semihard interaction (including preevolution)
2051  njtot0=njtot
2052  izp0=izp
2053  izt0=izt
2054 
2055 301 s=wp0*wm0
2056  njtot=njtot0
2057  izp=izp0
2058  izt=izt0
2059 
2060  IF(iqq.EQ.3)THEN
2061 c WPI,WMI - light cone momenta for the hard interaction
2062  wpi=wp0
2063  wmi=wm0
2064 c PSJINT0(S,SJ,SJB,1,1) - cross-sections interpolation:
2065 c SJ - inclusive hard quark-quark interaction
2066 c cross-section (inclusive cut ladder cross section) for minimal
2067 c 4-momentum transfer square QT0 and c.m. energy square s_hard = S;
2068 c SJB - Born cross-section
2069  CALL psjint0(s,sj,sjb,1,1)
2070 c GY= Sigma_hard_tot(YJ,QT0) - total hard quark-quark
2071 c interaction cross-section for minimal 4-momentum transfer square QT0 and
2072 c c.m. energy square s_hard = S
2073  gy=2.d0*sh*psgint((sj-sjb)/sh*.5d0)+sjb
2074 
2075  ELSE
2076 c-------------------------------------------------
2077 c Rejection function normalization
2078 c-------------------------------------------------
2079 c XMIN corresponds to minimal energy squared for the hard interaction - 4.D0*(QT0+AMJ0)
2080 c AMJ0 - jet mass squared (could be put equal zero)
2081  xmin=4.d0*(qt0+amj0)/s
2082  xmin1=xmin**(delh-del)
2083 c S - maximal available energy for the rejection function normalization
2084 c Auxilliary type of parton (1 - gluon, 2 - (anti-)quark)
2085  iq=(iqq+1)/2
2086 c Rejection function initialization (corresponding to maximal preevolution - minimal x):
2087 c Ysoft = - ln x, (1-x)**bet is due to gluon structure function in the soft pomeron
2088  IF(iqq.EQ.0)THEN
2089  gb0=-dlog(xmin)*(1.d0-dsqrt(xmin))**(2.d0*bet)
2090  ELSE
2091  gb0=(1.d0-xmin)**bet
2092  ENDIF
2093 
2094 c SJ0 is the inclusive hard (parton IQ - gluon) interaction
2095 c cross-section (inclusive cut ladder cross section) for minimal
2096 c 4-momentum transfer square QT0 and c.m. energy square s_hard = SI;
2097 c SJB0 - Born cross-section
2098  CALL psjint0(s,sj,sjb,iq,0)
2099 c GY= Sigma_hard_tot(YJ,QT0) - total hard (parton IQ - gluon)
2100 c interaction cross-section for minimal 4-momentum transfer square QT0 and
2101 c c.m. energy square s_hard = SI
2102  gy0=2.d0*sh*psgint((sj-sjb)/sh*.5d0)+sjb
2103  gb0=gb0*gy0/s**delh/rs0*z
2104 c-------------------------------------------------
2105 c End of rejection function normalization
2106 c-------------------------------------------------
2107 
2108 c-------------------------------------------------
2109 c The sharing of the light cone momenta between soft preevolution and
2110 c hard interaction:
2111 c ( first energy-momentum is shared according to
2112 c f_hard(YJ)~ZPM**(DELH-DEL-1) and then rejected as
2113 c W_rej ~Sigma_hard_tot(YJ) / exp(DELH*YJ)
2114 c ZPM = s_hard / S
2115 c YJ = ln s_hard - rapidity range for the hard parton-parton interaction;
2116 c-------------------------------------------------
2117 1 zpm=(xmin1+qsran(b10)*(1.d0-xmin1))**(1.d0/(delh-del))
2118 c SJ is the DLA inclusive hard partonic (gluon-gluon) interaction
2119 c cross-section (inclusive cut ladder cross section) for minimal
2120 c 4-momentum transfer square QT0 and c.m. energy square s_hard = exp YJ;
2121 c SJB - Born cross-section
2122  CALL psjint0(zpm*s,sj,sjb,iq,0)
2123  yj=dlog(zpm*s)
2124 c RH - interaction radius due to soft preevolution
2125  rh=rs0-alf*dlog(zpm)
2126 
2127  IF(iqq.EQ.0)THEN
2128 c XP, XM - light cone momunta shares for the hard interaction
2129  xp=zpm**qsran(b10)
2130  xm=zpm/xp
2131 c Ysoft = - ln ZPM - part of rejection function,
2132 c (1-XP)**bet*(1-XM)**bet is due to gluon structure function in the soft pomeron
2133  gbyj=-dlog(zpm)*((1.-xp)*(1.-xm))**bet
2134 c WPI,WMI - light cone momenta for the hard interaction
2135  wpi=wp0*xp
2136  wmi=wm0*xm
2137  ELSE
2138  IF(iqq.EQ.1)THEN
2139  wpi=wp0
2140  wmi=wm0*zpm
2141  ELSE
2142  wpi=wp0*zpm
2143  wmi=wm0
2144  ENDIF
2145  gbyj=(1.d0-zpm)**bet
2146  ENDIF
2147 
2148 c GY= Sigma_hard_tot(YJ,QT0) - total hard partonic
2149 c interaction cross-section for minimal 4-momentum transfer square QT0 and
2150 c c.m. energy square s_hard = exp YJ
2151  gy=2.d0*sh*psgint((sj-sjb)/sh*.5d0)+sjb
2152 
2153 c-------------------------------------------------
2154 c GBYJ - rejection function for the YJ (ZPM) simulation:
2155 c GBYJ ~ Sigma_hard_tot(YJ,QT0) / exp(DELH*YJ) * exp(-b**2/RH) / RH,
2156  gbyj=gbyj*gy*exp(-delh*yj)/gb0*z**(rs/rh)/rh
2157  IF(qsran(b10).GT.gbyj)GOTO 1
2158  ENDIF
2159 c-------------------------------------------------
2160  s=wpi*wmi
2161 
2162  IF(debug.GE.2)WRITE (moniou,203)s
2163 203 FORMAT(2x,'PSHOT: MASS SQUARED FOR THE HARD PARTON-PARTON',
2164  * ' INTERACTION:',e10.3)
2165 
2166 c In case of valence quark hard interaction the type of quark is determined by the
2167 c procedure PSVDEF - flavor combinatorics (not good here); IQC(1) - flavor
2168 c for the upper quark (0 in case of gluon),
2169 c IQC(2) - the same for the lower one
2170  DO 302 i=1,8
2171  DO 302 m=1,2
2172 302 epc(i,m)=0.d0
2173 
2174  IF((iqq-1)*(iqq-3).EQ.0)THEN
2175  CALL psvdef(izp,ic1,icz)
2176  iqc(1)=ic1
2177  ipc(1,1)=0
2178  ipc(2,1)=0
2179  ELSE
2180  iqc(1)=0
2181  ipc(1,1)=-int(2.d0*qsran(b10)+1.d0)
2182  ipc(2,1)=-ipc(1,1)
2183  wp1=wp0-wpi
2184  wp2=wp1*qsran(b10)
2185  wp1=wp1-wp2
2186  epc(1,1)=.5d0*wp1
2187  epc(2,1)=epc(1,1)
2188  epc(5,1)=.5d0*wp2
2189  epc(6,1)=epc(5,1)
2190  ENDIF
2191 
2192  IF((iqq-2)*(iqq-3).EQ.0)THEN
2193  CALL psvdef(izt,ic1,2)
2194  iqc(2)=ic1
2195  ipc(1,2)=0
2196  ipc(2,2)=0
2197  ELSE
2198  iqc(2)=0
2199  ipc(1,2)=-int(2.d0*qsran(b10)+1.d0)
2200  ipc(2,2)=-ipc(1,2)
2201  wm1=wm0-wmi
2202  wm2=wm1*qsran(b10)
2203  wm1=wm1-wm2
2204  epc(1,2)=.5d0*wm1
2205  epc(2,2)=-epc(1,2)
2206  epc(5,2)=.5d0*wm2
2207  epc(6,2)=-epc(5,2)
2208  ENDIF
2209 
2210  ept(1)=.5d0*(wpi+wmi)
2211  ept(2)=.5d0*(wpi-wmi)
2212  ept(3)=0.d0
2213  ept(4)=0.d0
2214 c Minimal 4-momentum transfer squares above and below current ladder run
2215  qmin(1)=qt0
2216  qmin(2)=qt0
2217  DO 303 l=1,2
2218  DO 303 m=1,2
2219  ipq(l,m)=ipc(l,m)
2220  DO 303 i=1,4
2221 303 epq(i+4*(l-1),m)=epc(i+4*(l-1),m)
2222 c Minimal 4-momentum transfer square for gluon-gluon (virtual) interaction
2223  qminn=max(qmin(1),qmin(2))
2224  si=psnorm(ept)
2225 
2226 5 CONTINUE
2227 c 4-momentum squared (c.m. energy square for gluon-gluon (virtual)
2228 c interaction)
2229  IF(debug.GE.2)WRITE (moniou,208)ilad, si,iqc,ept
2230 208 FORMAT(2x,'PSHOT: ',i2,'-TH HARD LADDER;',
2231  * ' MASS SQUARED FOR THE LADDDER:',e10.3/
2232  * 4x,'LADDER END FLAVORS:',2i3/4x,
2233  * 'LADDER 4-MOMENTUM: ',4e10.3)
2234 
2235  ebal(1)=.5*(wp0+wm0)-ept(1)
2236  ebal(2)=.5*(wp0-wm0)-ept(2)
2237  ebal(3)=0.d0-ept(3)
2238  ebal(4)=0.d0-ept(4)
2239  do 503 l=1,4
2240  do 501 m=1,2
2241  ebal(l)=ebal(l)-epq(l,m)
2242 501 if(iqc(m).eq.0) ebal(l)=ebal(l)-epq(l+4,m)
2243  if(njtot.ne.0)then
2244  do 502 i=1,njtot
2245  do 502 m=1,2
2246 502 ebal(l)=ebal(l)-epjet(l,m,i)
2247  endif
2248 503 continue
2249 c write (*,*)'ebal',ebal,si,njtot
2250 
2251  pt2=ept(3)**2+ept(4)**2
2252  pt=dsqrt(pt2)
2253  ww=si+pt2
2254  sww=dsqrt(ww)
2255 
2256  iqp(1)=min(1,iabs(iqc(1)))
2257  iqp(2)=min(1,iabs(iqc(2)))
2258 
2259 c Longitudinal momenta for the interaction
2260  wp(1)=ept(1)+ept(2)
2261  wp(2)=ept(1)-ept(2)
2262 
2263  s2min=max(qminn,4.d0*(qt0+amj0))
2264 c WWMIN is the minimal energy square needed for triple s-channel gluons
2265 c production with transverse momentum squares q_t**2 above QMIN(JJ),QMINN
2266  wwmin=(s2min+(pt-dsqrt(qt0))**2+(qt0+amj0)*(dsqrt(s2min/qt0)-
2267  * 1.d0))/(1.d0-dsqrt(qt0/s2min))
2268 c SJB/SJ is the probability for the last pair of gluons production
2269 c (SJB is the Born cross-section and SJ is the inclusive interaction
2270 c (cut ladder) cross-section)
2271  sj=psjint(qmin(1),qmin(2),si,iqp(1)+1,iqp(2)+1)
2272  sjb=psbint(qminn,si,iqp(1)+1,iqp(2)+1)
2273 
2274  IF(debug.GE.2)WRITE (moniou,251)s2min,wwmin,sj,sjb
2275 251 FORMAT(2x,'PSHOT: KINEMATICAL BOUNDS S2MIN=',e10.3,
2276  * 2x,'WWMIN=',e10.3/4x,'JET CROSS SETION SJ=',e10.3,
2277  * 2x,'BORN CROSS SECTION SJB=',e10.3)
2278 
2279  IF(qsran(b10).LT.sjb/sj.
2280  * or.ww.LT.1.2d0*wwmin)GOTO 12
2281 
2282  IF((sj-sjb)/sj.GT..1d0)THEN
2283  sj1=psjint1(qmin(1),qmin(2),si,iqp(1)+1,iqp(2)+1)
2284  sj2=psjint1(qmin(2),qmin(1),si,iqp(2)+1,iqp(1)+1)
2285  dsj=(sj2-sj1)/(sj-sjb)*.5d0
2286  ELSE
2287  dsj=0.d0
2288  ENDIF
2289 c Current s-channel gluon is simulated either above the run (JJ=1) or
2290 c below it (JJ=2)
2291  jj=int(1.5d0+dsj+qsran(b10))
2292 
2293  aq=-(si+amj0+2.d0*pt*dsqrt(qt0))/ww
2294  bq=(qt0+amj0)/ww
2295  cq=qt0/ww
2296  pq=-aq**2/3.d0+bq
2297  qq=aq**3/13.5d0-aq*bq/3.d0+cq
2298  pq=dsqrt(-pq/3.d0)
2299  cosq=-.5d0*qq/pq**3
2300  fq=atan(1.d0/cosq**2-1.d0)
2301  IF(cosq.LT.0.d0)fq=pi-fq
2302  fq=fq/3.d0
2303 
2304 c XMIN is the minimal longitudinal momentum transfer share in current
2305 c ladder run (corresponding to minimal 4-momentum transfer square QMIN(JJ))
2306  xmin=1.d0+aq/3.d0-2.d0*pq*cos(fq)
2307  xmax=1.d0+aq/3.d0-pq*(dsqrt(3.d0)*sin(fq)-cos(fq))
2308 c QQMAX is the maximal 4-momentum transfer square in the current run
2309 c (corresponding to X=XMIN and 4-momentum transfer at next simulation
2310 c step to be equal QMAX)
2311  qqmax=qt0/(1.d0-xmax)**2
2312  qqmin=qt0/(1.d0-xmin)**2
2313 
2314  IF(qqmin.LT.s2min)THEN
2315  xmm=(si-s2min+amj0+2.d0*pt*dsqrt(qt0))/ww*.5d0
2316  xmin=1.d0-xmm-dsqrt(xmm*xmm-(qt0+amj0)/ww)
2317  qqmin=qt0/(1.d0-xmin)**2
2318 
2319  IF(qqmin.LT.qmin(jj))THEN
2320  qqmin=qmin(jj)
2321  xmm1=ww-2.d0*pt*dsqrt(qqmin)+qqmin
2322  xmm=(si-s2min+amj0)/xmm1*.5d0
2323  xmin=1.d0-xmm-dsqrt(xmm*xmm-amj0/xmm1)
2324  ENDIF
2325  ENDIF
2326 
2327 *********************************************************
2328  xm0=max(.5d0,1.d0-dsqrt(qt0/qmin(jj)))
2329  IF(xm0.GT..95d0*xmax.OR.xm0.LT.1.05d0*xmin)
2330  * xm0=.5d0*(xmax+xmin)
2331  qm0=qt0/(1.d0-xm0)**2
2332  s2max=xm0*ww
2333 
2334  sj0=psjint(qm0,qmin(3-jj),s2max,1,iqp(3-jj)+1)*
2335  * psfap(xm0,iqp(jj),0)+
2336  * psjint(qm0,qmin(3-jj),s2max,2,iqp(3-jj)+1)
2337  * *psfap(xm0,iqp(jj),1)
2338 
2339  gb0=sj0*qm0/qlog*psuds(qm0,iqp(jj))*1.5d0
2340  IF(xm0.LE..5d0)THEN
2341  gb0=gb0*xm0**(1.d0-delh)
2342  ELSE
2343  gb0=gb0*(1.d0-xm0)*2.d0**delh
2344  ENDIF
2345 c XMIN, XMAX are put into power DELH to simulate X value below
2346  xmin2=max(.5d0,xmin)
2347  xmin1=xmin**delh
2348  xmax1=min(xmax,.5d0)**delh
2349  IF(xmin.GE..5d0)THEN
2350  djl=1.d0
2351  ELSEIF(xmax.LT..5d0)THEN
2352  djl=0.d0
2353  ELSE
2354  djl=1.d0/(1.d0+((2.d0*xmin)**delh-1.d0)/delh/
2355  * dlog(2.d0*(1.d0-xmax)))
2356  ENDIF
2357 
2358 7 CONTINUE
2359 c Simulation of the longitudinal momentum transfer share in current
2360 c ladder run - from XMIN to XMAX according to dX * X**(DELH-1)
2361  IF(qsran(b10).GT.djl)THEN
2362  x=(xmin1+qsran(b10)*(xmax1-xmin1))**(1.d0/delh)
2363  ELSE
2364  x=1.d0-(1.d0-xmin2)*((1.d0-xmax)/(1.d0-xmin2))**qsran(b10)
2365  ENDIF
2366 *********************************************************
2367 
2368 c Effective momentum squared QQ in the ladder run is simulated
2369 c first as dq**2/q**4 from QMIN(J) to QMAX
2370  qq=qqmin/(1.d0+qsran(b10)*(qqmin/qqmax-1.d0))
2371 
2372  IF(debug.GE.2)WRITE (moniou,253)qq,qqmin,qqmax
2373 253 FORMAT(2x,'PSHOT: QQ=',e10.3,2x,'QQMIN=',e10.3,2x,
2374  * 'QQMAX=',e10.3)
2375 
2376  qt2=qq*(1.d0-x)**2
2377  IF(qt2.LT.qt0)GOTO 7
2378 
2379  IF(qq.GT.qminn)THEN
2380  qmin2=qq
2381  ELSE
2382  qmin2=qminn
2383  ENDIF
2384 
2385  qt=dsqrt(qt2)
2386  CALL pscs(ccos,ssin)
2387 c EP3 is now 4-vector for s-channel gluon produced in current ladder run
2388  ep3(3)=qt*ccos
2389  ep3(4)=qt*ssin
2390  pt2=(ept(3)-ep3(3))**2+(ept(4)-ep3(4))**2
2391  s2min2=max(s2min,qmin2)
2392 
2393  zmin=(qt2+amj0)/ww/(1.d0-x)
2394 c S2 is the maximal c.m. energy square for the parton-parton interaction
2395 c in the next ladder run
2396  s2=x*(1.d0-zmin)*ww-pt2
2397 c Rejection in case of too low WW2 (insufficient for elastic gluon-gluon
2398 c scattering with transverse momentum square q_t**2 above QMIN2)
2399  IF(s2.LT.s2min2)GOTO 7
2400 
2401  sj1=psjint(qq,qmin(3-jj),s2,1,iqp(3-jj)+1)
2402  * *psfap(x,iqp(jj),0)
2403  sj2=psjint(qq,qmin(3-jj),s2,2,iqp(3-jj)+1)
2404  * *psfap(x,iqp(jj),1)
2405 
2406 c GB7 is the rejection function for X and Q**2 simulation. It consists
2407 c from factor
2408 c Q**2/Qmin**2 * ln(Qmin**2/Lambda_qcd**2)/ln(Q**2/Lambda_qcd**2)
2409 c from Q**2 simulation and factor SJ/(X*WW)**DELH * const from X simulation
2410  gb7=(sj1+sj2)/dlog(qt2/alm)*qq*psuds(qq,iqp(jj))/gb0
2411 
2412 *********************************************************
2413  IF(x.LE..5d0)THEN
2414  gb7=gb7*x**(1.d0-delh)
2415  ELSE
2416  gb7=gb7*(1.d0-x)*2.d0**delh
2417  ENDIF
2418 *********************************************************
2419  IF(qsran(b10).GT.gb7)GOTO 7
2420 
2421  IF(qsran(b10).LT.sj1/(sj1+sj2))THEN
2422  IF(iqc(jj).EQ.0)THEN
2423  jt=1
2424  jq=int(1.5d0+qsran(b10))
2425  iqj(1)=ipq(jq,jj)
2426  iqj(2)=0
2427  DO 31 i=1,4
2428  eqj(i,1)=epq(i+4*(jq-1),jj)
2429 31 eqj(i,2)=0.d0
2430  ELSE
2431  jt=2
2432  IF(iqc(jj).GT.0)THEN
2433  jq=1
2434  ELSE
2435  jq=2
2436  ENDIF
2437  iqj(1)=0
2438  DO 32 i=1,4
2439 32 eqj(i,1)=0.d0
2440 
2441  ipq(jq,jj)=ipq(1,jj)
2442  DO 135 i=1,4
2443 135 epq(i+4*(jq-1),jj)=epq(i,jj)
2444  ENDIF
2445  iq1=iqc(jj)
2446  iqc(jj)=0
2447 
2448  ELSE
2449  IF(iqp(jj).NE.0)THEN
2450  iq1=0
2451  jt=3
2452  IF(iqc(jj).GT.0)THEN
2453  jq=1
2454  ELSE
2455  jq=2
2456  ENDIF
2457  iqj(1)=ipq(1,jj)
2458  iqj(2)=0
2459  DO 33 i=1,4
2460  eqj(i,1)=epq(i,jj)
2461 33 eqj(i,2)=0.d0
2462 
2463  ELSE
2464  iq1=int(3.d0*qsran(b10)+1.d0)*(2*int(.5d0+qsran(b10))-1)
2465  iqc(jj)=-iq1
2466  jt=4
2467  IF(iq1.GT.0)THEN
2468  jq=1
2469  ELSE
2470  jq=2
2471  ENDIF
2472  iqj(1)=ipq(jq,jj)
2473  DO 34 i=1,4
2474 34 eqj(i,1)=epq(i+4*(jq-1),jj)
2475  ENDIF
2476  ENDIF
2477  IF(debug.GE.3)WRITE (moniou,240)jt
2478 
2479  CALL pscajet(qt2,iq1,qv1,zv1,qm1,iqv1,
2480  * ldau1,lpar1,jq)
2481  z=(qt2+qm1(1,1))/ww/(1.d0-x)
2482  si=x*(1.d0-z)*ww-pt2
2483 
2484  IF(si.GT.s2min2)THEN
2485  iq=min(1,iabs(iqc(jj)))+1
2486  gb=psjint(qq,qmin(3-jj),si,iq,iqp(3-jj)+1)/
2487  * psjint(qq,qmin(3-jj),s2,iq,iqp(3-jj)+1)
2488  IF(qsran(b10).GT.gb)GOTO 301
2489  ELSE
2490  GOTO 301
2491  ENDIF
2492 
2493  wp3=wp(jj)*(1.d0-x)
2494  wm3=(qt2+qm1(1,1))/wp3
2495  ep3(1)=.5d0*(wp3+wm3)
2496  ep3(2)=.5d0*(wp3-wm3)*(3-2*jj)
2497 
2498  pt3=dsqrt(ep3(3)**2+ep3(4)**2)
2499 
2500  CALL psrec(ep3,qv1,zv1,qm1,iqv1,ldau1,lpar1,iqj,eqj,jfl,jq)
2501  IF(jfl.EQ.0)GOTO 301
2502 
2503  IF(jt.EQ.1)THEN
2504  ipq(jq,jj)=iqj(2)
2505  DO 35 i=1,4
2506 35 epq(i+4*(jq-1),jj)=eqj(i,2)
2507 
2508  IF(ipc(jq,jj).EQ.0)THEN
2509  ipc(jq,jj)=iqj(1)
2510  DO 36 i=1,4
2511 36 epc(i+4*(jq-1),jj)=eqj(i,1)
2512  ENDIF
2513 
2514  ELSEIF(jt.EQ.2)THEN
2515  ipq(3-jq,jj)=iqj(1)
2516  DO 37 i=1,4
2517 37 epq(i+4*(2-jq),jj)=eqj(i,1)
2518 
2519  ELSEIF(jt.EQ.3)THEN
2520  ipq(1,jj)=iqj(2)
2521  DO 38 i=1,4
2522 38 epq(i,jj)=eqj(i,2)
2523 
2524  IF(ipc(jq,jj).EQ.0)THEN
2525  ipc(jq,jj)=iqj(1)
2526  DO 39 i=1,4
2527 39 epc(i+4*(jq-1),jj)=eqj(i,1)
2528  ENDIF
2529 
2530  ELSEIF(jt.EQ.4)THEN
2531  IF(ipc(jq,jj).EQ.0)THEN
2532  ipc(jq,jj)=iqj(1)
2533  DO 40 i=1,4
2534 40 epc(i+4*(jq-1),jj)=eqj(i,1)
2535  ENDIF
2536  IF(jq.EQ.1)THEN
2537  ipq(1,jj)=ipq(2,jj)
2538  DO 30 i=1,4
2539 30 epq(i,jj)=epq(i+4,jj)
2540  ENDIF
2541  ENDIF
2542 
2543  IF(iabs(iq1).EQ.3)THEN
2544  iqqq=8+iq1/3*4
2545  ELSE
2546  iqqq=8+iq1
2547  ENDIF
2548  IF(debug.GE.2)WRITE (moniou,209)tyq(iqqq),qt2,ep3
2549 209 FORMAT(2x,'PSHOT: NEW JET FLAVOR:',a2,
2550  * ' PT SQUARED FOR THE JET:',e10.3/
2551  * 4x,'JET 4-MOMENTUM:',4e10.3)
2552  DO 8 i=1,4
2553 8 ept(i)=ept(i)-ep3(i)
2554 c C.m. energy square, minimal 4-momentum transfer square and gluon 4-vector
2555 c for the next ladder run
2556  qmin(jj)=qq
2557  qminn=qmin2
2558 
2559 c Next simulation step will be considered for current ladder
2560  GOTO 5
2561 C------------------------------------------------
2562 
2563 C------------------------------------------------
2564 c The last gluon pair production (elastic scattering) in the ladder
2565 c is simulated
2566 12 CONTINUE
2567  IF(debug.GE.2)WRITE (moniou,211)si
2568 211 FORMAT(2x,'PSHOT: HIGHEST VIRTUALITY SUBPROCESS IN THE LADDER'/
2569  * 4x,'MASS SQUARED FOR THE PROCESS:',e10.3)
2570 
2571  xmin=qminn/(qminn+si)
2572  xmin1=.5d0-dsqrt(.25d0-(qt0+amj0)/si)
2573  xmin=max(xmin,xmin1)
2574  tmin=si*xmin
2575 
2576  IF(iqc(1).NE.0.OR.iqc(2).NE.0)THEN
2577  gb0=tmin**2/dlog(tmin*(1.d0-xmin)/alm)**2*
2578  * psfborn(si,tmin,iqc(1),iqc(2))
2579  ELSE
2580  gb0=.25d0*si**2/dlog(tmin*(1.d0-xmin)/alm)**2*
2581  * psfborn(si,.5d0*si,iqc(1),iqc(2))
2582  ENDIF
2583 
2584 C------------------------------------------------
2585 c 4-momentum transfer squared is simulated first as dq_t**2/q_t**4 from
2586 c tmin to s/2
2587 13 q2=tmin/(1.d0-qsran(b10)*(1.d0-2.d0*tmin/si))
2588  z=q2/si
2589  qt2=q2*(1.d0-z)
2590  IF(qsran(b10).LT..5d0)THEN
2591  jm=2
2592  tq=si-q2
2593  ELSE
2594  jm=1
2595  tq=q2
2596  ENDIF
2597 
2598  gb=q2**2/dlog(qt2/alm)**2/gb0*
2599  * psfborn(si,tq,iqc(1),iqc(2))
2600  IF(debug.GE.3)WRITE (moniou,241)q2,gb
2601 241 FORMAT(2x,'PSHOT: Q2=',e10.3,' GB=',e10.3)
2602 
2603  IF(qsran(b10).GT.gb)GOTO 13
2604 
2605  IF(iqc(1).EQ.0.AND.iqc(2).EQ.0)THEN
2606  jq=int(1.5d0+qsran(b10))
2607  iqj(1)=ipq(jq,jm)
2608  DO 51 i=1,4
2609 51 eqj(i,1)=epq(i+4*(jq-1),jm)
2610 
2611  IF(qsran(b10).LT..5d0)THEN
2612  jt=1
2613  IF(ipq(3-jq,jm)*ipq(jq,3-jm).NE.0)THEN
2614  ipj=ipq(3-jq,jm)
2615  ipj1=ipq(jq,3-jm)
2616  IF(iabs(ipj).EQ.3)ipj=ipj*4/3
2617  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
2618  DO 52 i=1,4
2619  epj(i)=epq(i+4*(2-jq),jm)
2620 52 epj1(i)=epq(i+4*(jq-1),3-jm)
2621  CALL psjdef(ipj,ipj1,epj,epj1,jfl)
2622  IF(jfl.EQ.0)GOTO 301
2623  ELSEIF(ipq(3-jq,jm).NE.0)THEN
2624  ipc(jq,3-jm)=ipq(3-jq,jm)
2625  DO 53 i=1,4
2626 53 epc(i+4*(jq-1),3-jm)=epq(i+4*(2-jq),jm)
2627  ELSEIF(ipq(jq,3-jm).NE.0)THEN
2628  ipc(3-jq,jm)=ipq(jq,3-jm)
2629  DO 54 i=1,4
2630 54 epc(i+4*(2-jq),jm)=epq(i+4*(jq-1),3-jm)
2631  ENDIF
2632 
2633  iqj(2)=0
2634  DO 55 i=1,4
2635 55 eqj(i,2)=0.d0
2636 
2637  ELSE
2638  jt=2
2639  iqj(2)=ipq(3-jq,3-jm)
2640  DO 56 i=1,4
2641 56 eqj(i,2)=epq(i+4*(2-jq),3-jm)
2642  ENDIF
2643 
2644  ELSEIF(iqc(1)*iqc(2).EQ.0)THEN
2645  IF(iqc(1)+iqc(2).GT.0)THEN
2646  jq=1
2647  ELSE
2648  jq=2
2649  ENDIF
2650 
2651  IF(qsran(b10).LT..5d0)THEN
2652  IF(iqc(jm).EQ.0)THEN
2653  jt=3
2654  iqj(1)=ipq(jq,jm)
2655  iqj(2)=0
2656  DO 57 i=1,4
2657  eqj(i,1)=epq(i+4*(jq-1),jm)
2658 57 eqj(i,2)=0.d0
2659 
2660  IF(ipq(3-jq,jm)*ipq(1,3-jm).NE.0)THEN
2661  ipj=ipq(3-jq,jm)
2662  ipj1=ipq(1,3-jm)
2663  IF(iabs(ipj).EQ.3)ipj=ipj*4/3
2664  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
2665  DO 58 i=1,4
2666  epj(i)=epq(i+4*(2-jq),jm)
2667 58 epj1(i)=epq(i,3-jm)
2668  CALL psjdef(ipj,ipj1,epj,epj1,jfl)
2669  IF(jfl.EQ.0)GOTO 301
2670  ELSEIF(ipq(3-jq,jm).NE.0)THEN
2671  ipc(jq,3-jm)=ipq(3-jq,jm)
2672  DO 59 i=1,4
2673 59 epc(i+4*(jq-1),3-jm)=epq(i+4*(2-jq),jm)
2674  ELSEIF(ipq(1,3-jm).NE.0)THEN
2675  ipc(3-jq,jm)=ipq(1,3-jm)
2676  DO 60 i=1,4
2677 60 epc(i+4*(2-jq),jm)=epq(i,3-jm)
2678  ENDIF
2679 
2680  ELSE
2681  jt=4
2682  iqj(1)=0
2683  DO 61 i=1,4
2684 61 eqj(i,1)=0.d0
2685 
2686  IF(ipq(1,jm)*ipq(3-jq,3-jm).NE.0)THEN
2687  ipj=ipq(1,jm)
2688  ipj1=ipq(3-jq,3-jm)
2689  IF(iabs(ipj).EQ.3)ipj=ipj*4/3
2690  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
2691  DO 62 i=1,4
2692  epj(i)=epq(i,jm)
2693 62 epj1(i)=epq(i+4*(2-jq),3-jm)
2694  CALL psjdef(ipj,ipj1,epj,epj1,jfl)
2695  IF(jfl.EQ.0)GOTO 301
2696  ELSEIF(ipq(3-jq,3-jm).NE.0)THEN
2697  ipc(jq,jm)=ipq(3-jq,3-jm)
2698  DO 63 i=1,4
2699 63 epc(i+4*(jq-1),jm)=epq(i+4*(2-jq),3-jm)
2700  ELSEIF(ipq(1,jm).NE.0)THEN
2701  ipc(3-jq,3-jm)=ipq(1,jm)
2702  DO 64 i=1,4
2703 64 epc(i+4*(2-jq),3-jm)=epq(i,jm)
2704  ENDIF
2705  ENDIF
2706 
2707  ELSE
2708  IF(iqc(jm).EQ.0)THEN
2709  jt=5
2710  iqj(2)=ipq(3-jq,jm)
2711  iqj(1)=ipq(1,3-jm)
2712  DO 65 i=1,4
2713  eqj(i,2)=epq(i+4*(2-jq),jm)
2714 65 eqj(i,1)=epq(i,3-jm)
2715  ELSE
2716  jt=6
2717  iqj(1)=ipq(jq,3-jm)
2718  DO 66 i=1,4
2719 66 eqj(i,1)=epq(i+4*(jq-1),3-jm)
2720  ENDIF
2721  ENDIF
2722 
2723  ELSEIF(iqc(1)*iqc(2).GT.0)THEN
2724  jt=7
2725  IF(iqc(1).GT.0)THEN
2726  jq=1
2727  ELSE
2728  jq=2
2729  ENDIF
2730  iqj(1)=ipq(1,3-jm)
2731  DO 67 i=1,4
2732 67 eqj(i,1)=epq(i,3-jm)
2733 
2734  ELSE
2735  jt=8
2736  IF(iqc(jm).GT.0)THEN
2737  jq=1
2738  ELSE
2739  jq=2
2740  ENDIF
2741  iqj(1)=0
2742  DO 68 i=1,4
2743 68 eqj(i,1)=0.d0
2744 
2745  IF(ipq(1,jm)*ipq(1,3-jm).NE.0)THEN
2746  ipj=ipq(1,jm)
2747  ipj1=ipq(1,3-jm)
2748  IF(iabs(ipj).EQ.3)ipj=ipj*4/3
2749  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
2750  DO 69 i=1,4
2751  epj(i)=epq(i,jm)
2752 69 epj1(i)=epq(i,3-jm)
2753  CALL psjdef(ipj,ipj1,epj,epj1,jfl)
2754  IF(jfl.EQ.0)GOTO 301
2755  ELSEIF(ipq(1,3-jm).NE.0)THEN
2756  ipc(jq,jm)=ipq(1,3-jm)
2757  DO 70 i=1,4
2758 70 epc(i+4*(jq-1),jm)=epq(i,3-jm)
2759  ELSEIF(ipq(1,jm).NE.0)THEN
2760  ipc(3-jq,3-jm)=ipq(1,jm)
2761  DO 71 i=1,4
2762 71 epc(i+4*(2-jq),3-jm)=epq(i,jm)
2763  ENDIF
2764  ENDIF
2765  IF(jt.NE.8)THEN
2766  jq2=jq
2767  ELSE
2768  jq2=3-jq
2769  ENDIF
2770  IF(debug.GE.3)WRITE (moniou,240)jt
2771 240 FORMAT(2x,'PSHOT: COLOUR CONNECTION JT=:',i1)
2772 
2773  CALL pscajet(qt2,iqc(jm),qv1,zv1,qm1,iqv1,
2774  * ldau1,lpar1,jq)
2775  CALL pscajet(qt2,iqc(3-jm),qv2,zv2,qm2,iqv2,
2776  * ldau2,lpar2,jq2)
2777 
2778  amt1=qt2+qm1(1,1)
2779  amt2=qt2+qm2(1,1)
2780 
2781  IF(dsqrt(si).GT.dsqrt(amt1)+dsqrt(amt2))THEN
2782  z=xxtwdec(si,amt1,amt2)
2783  ELSE
2784  GOTO 301
2785  ENDIF
2786 
2787  CALL psdeftr(si,ept,ey)
2788 
2789  wp3=z*dsqrt(si)
2790  wm3=(qt2+qm1(1,1))/wp3
2791  ep3(1)=.5d0*(wp3+wm3)
2792  ep3(2)=.5d0*(wp3-wm3)
2793  qt=dsqrt(qt2)
2794  CALL pscs(ccos,ssin)
2795 c ep3 is now 4-vector for first s-channel gluon produced in the ladder run
2796  ep3(3)=qt*ccos
2797  ep3(4)=qt*ssin
2798 
2799  CALL pstrans(ep3,ey)
2800  pt3=dsqrt(ep3(3)**2+ep3(4)**2)
2801 
2802  CALL psrec(ep3,qv1,zv1,qm1,iqv1,ldau1,lpar1,iqj,eqj,jfl,jq)
2803  IF(jfl.EQ.0)GOTO 301
2804 
2805  if(iabs(iqc(jm)).eq.3)then
2806  iqqq=8+iqc(jm)/3*4
2807  else
2808  iqqq=8+iqc(jm)
2809  endif
2810  IF(debug.GE.2)WRITE (moniou,209)tyq(iqqq),qt2
2811 
2812  wp3=(1.d0-z)*dsqrt(si)
2813  wm3=(qt2+qm2(1,1))/wp3
2814  ep3(1)=.5d0*(wp3+wm3)
2815  ep3(2)=.5d0*(wp3-wm3)
2816  ep3(3)=-qt*ccos
2817  ep3(4)=-qt*ssin
2818  CALL pstrans(ep3,ey)
2819  pt3=dsqrt(ep3(3)**2+ep3(4)**2)
2820 
2821  IF(jt.EQ.1)THEN
2822  IF(ipc(jq,jm).EQ.0)THEN
2823  ipc(jq,jm)=iqj(1)
2824  DO 72 i=1,4
2825 72 epc(i+4*(jq-1),jm)=eqj(i,1)
2826  ENDIF
2827 
2828  iqj(1)=iqj(2)
2829  iqj(2)=ipq(3-jq,3-jm)
2830  DO 73 i=1,4
2831  eqj(i,1)=eqj(i,2)
2832 73 eqj(i,2)=epq(i+4*(2-jq),3-jm)
2833 
2834  ELSEIF(jt.EQ.2)THEN
2835  IF(ipc(jq,jm).EQ.0)THEN
2836  ipc(jq,jm)=iqj(1)
2837  DO 74 i=1,4
2838 74 epc(i+4*(jq-1),jm)=eqj(i,1)
2839  ENDIF
2840  IF(ipc(3-jq,3-jm).EQ.0)THEN
2841  ipc(3-jq,3-jm)=iqj(2)
2842  DO 75 i=1,4
2843 75 epc(i+4*(2-jq),3-jm)=eqj(i,2)
2844  ENDIF
2845 
2846  iqj(2)=ipq(3-jq,jm)
2847  iqj(1)=ipq(jq,3-jm)
2848  DO 76 i=1,4
2849  eqj(i,2)=epq(i+4*(2-jq),jm)
2850 76 eqj(i,1)=epq(i+4*(jq-1),3-jm)
2851 
2852  ELSEIF(jt.EQ.3)THEN
2853  IF(ipc(jq,jm).EQ.0)THEN
2854  ipc(jq,jm)=iqj(1)
2855  DO 77 i=1,4
2856 77 epc(i+4*(jq-1),jm)=eqj(i,1)
2857  ENDIF
2858  iqj(1)=iqj(2)
2859  DO 78 i=1,4
2860 78 eqj(i,1)= eqj(i,2)
2861 
2862  ELSEIF(jt.EQ.4)THEN
2863  iqj(2)=iqj(1)
2864  iqj(1)=ipq(jq,3-jm)
2865  DO 79 i=1,4
2866  eqj(i,2)=eqj(i,1)
2867 79 eqj(i,1)=epq(i+4*(jq-1),3-jm)
2868 
2869  ELSEIF(jt.EQ.5)THEN
2870  IF(ipc(3-jq,jm).EQ.0)THEN
2871  ipc(3-jq,jm)=iqj(2)
2872  DO 80 i=1,4
2873 80 epc(i+4*(2-jq),jm)=eqj(i,2)
2874  ENDIF
2875  IF(ipc(jq,3-jm).EQ.0)THEN
2876  ipc(jq,3-jm)=iqj(1)
2877  DO 81 i=1,4
2878 81 epc(i+4*(jq-1),3-jm)=eqj(i,1)
2879  ENDIF
2880 
2881  iqj(1)=ipq(jq,jm)
2882  DO 82 i=1,4
2883 82 eqj(i,1)=epq(i+4*(jq-1),jm)
2884 
2885  ELSEIF(jt.EQ.6)THEN
2886  IF(ipc(jq,3-jm).EQ.0)THEN
2887  ipc(jq,3-jm)=iqj(1)
2888  DO 83 i=1,4
2889 83 epc(i+4*(jq-1),3-jm)=eqj(i,1)
2890  ENDIF
2891 
2892  iqj(2)=ipq(3-jq,3-jm)
2893  iqj(1)=ipq(1,jm)
2894  DO 84 i=1,4
2895  eqj(i,2)=epq(i+4*(2-jq),3-jm)
2896 84 eqj(i,1)=epq(i,jm)
2897 
2898  ELSEIF(jt.EQ.7)THEN
2899  IF(ipc(jq,3-jm).EQ.0)THEN
2900  ipc(jq,3-jm)=iqj(1)
2901  DO 85 i=1,4
2902 85 epc(i+4*(jq-1),3-jm)=eqj(i,1)
2903  ENDIF
2904  iqj(1)=ipq(1,jm)
2905  DO 86 i=1,4
2906 86 eqj(i,1)= epq(i,jm)
2907  ENDIF
2908 
2909  CALL psrec(ep3,qv2,zv2,qm2,iqv2,ldau2,lpar2,iqj,eqj,jfl,jq2)
2910  IF(jfl.EQ.0)GOTO 301
2911 
2912  if(iabs(iqc(3-jm)).eq.3)then
2913  iqqq=8+iqc(3-jm)/3*4
2914  else
2915  iqqq=8+iqc(3-jm)
2916  endif
2917  IF(debug.GE.2)WRITE (moniou,209)tyq(iqqq),qt2
2918  IF(debug.GE.2)WRITE (moniou,212)njtot
2919 212 FORMAT(2x,'PSHOT: TOTAL NUMBER OF JETS:',i2)
2920 
2921  IF(jt.EQ.1)THEN
2922  IF(ipc(3-jq,3-jm).EQ.0)THEN
2923  ipc(3-jq,3-jm)=iqj(2)
2924  DO 87 i=1,4
2925 87 epc(i+4*(2-jq),3-jm)=eqj(i,2)
2926  ENDIF
2927 
2928  ELSEIF(jt.EQ.2)THEN
2929  IF(ipc(3-jq,jm).EQ.0)THEN
2930  ipc(3-jq,jm)=iqj(2)
2931  DO 88 i=1,4
2932 88 epc(i+4*(2-jq),jm)=eqj(i,2)
2933  ENDIF
2934  IF(ipc(jq,3-jm).EQ.0)THEN
2935  ipc(jq,3-jm)=iqj(1)
2936  DO 89 i=1,4
2937 89 epc(i+4*(jq-1),3-jm)=eqj(i,1)
2938  ENDIF
2939 
2940  ELSEIF(jt.EQ.4)THEN
2941  IF(ipc(jq,3-jm).EQ.0)THEN
2942  ipc(jq,3-jm)=iqj(1)
2943  DO 90 i=1,4
2944 90 epc(i+4*(jq-1),3-jm)=eqj(i,1)
2945  ENDIF
2946 
2947  ELSEIF(jt.EQ.5)THEN
2948  IF(ipc(jq,jm).EQ.0)THEN
2949  ipc(jq,jm)=iqj(1)
2950  DO 91 i=1,4
2951 91 epc(i+4*(jq-1),jm)=eqj(i,1)
2952  ENDIF
2953 
2954  ELSEIF(jt.EQ.6)THEN
2955  IF(ipc(3-jq,3-jm).EQ.0)THEN
2956  ipc(3-jq,3-jm)=iqj(2)
2957  DO 92 i=1,4
2958 92 epc(i+4*(2-jq),3-jm)=eqj(i,2)
2959  ENDIF
2960  IF(ipc(jq,jm).EQ.0)THEN
2961  ipc(jq,jm)=iqj(1)
2962  DO 93 i=1,4
2963 93 epc(i+4*(jq-1),jm)=eqj(i,1)
2964  ENDIF
2965 
2966  ELSEIF(jt.EQ.7)THEN
2967  IF(ipc(jq,jm).EQ.0)THEN
2968  ipc(jq,jm)=iqj(1)
2969  DO 94 i=1,4
2970 94 epc(i+4*(jq-1),jm)=eqj(i,1)
2971  ENDIF
2972  ENDIF
2973 C------------------------------------------------
2974 
2975  IF(debug.GE.3)WRITE (moniou,217)
2976 217 FORMAT(2x,'PSHOT - END')
2977  ebal(1)=.5*(wp0+wm0)
2978  ebal(2)=.5*(wp0-wm0)
2979  ebal(3)=0.d0
2980  ebal(4)=0.d0
2981  do 500 i=1,njtot
2982  do 500 m=1,2
2983  do 500 l=1,4
2984 500 ebal(l)=ebal(l)-epjet(l,m,i)
2985 c write (*,*)'ebal',ebal
2986  RETURN
2987  END
2988 C=======================================================================
2989 
2990  SUBROUTINE psjdef(IPJ,IPJ1,EPJ,EPJ1,JFL)
2991 c Procedure for jet hadronization - each gluon is
2992 c considered to be splitted into quark-antiquark pair and usual soft
2993 c strings are assumed to be formed between quark and antiquark
2994 c-----------------------------------------------------------------------
2995  IMPLICIT DOUBLE PRECISION (a-h,o-z)
2996  INTEGER DEBUG
2997  dimension epj(4),epj1(4),ept(4)
2998  COMMON /area10/ stmass,am(7)
2999  COMMON /area43/ moniou
3000  COMMON /debug/ debug
3001  COMMON /area46/ epjet(4,2,15000),ipjet(2,15000)
3002  COMMON /area47/ njtot
3003  SAVE
3004 
3005 c if(ipj*ipj1.gt.0.and.iabs(ipj).ne.3.and.iabs(ipj).le.4.
3006 c * and.iabs(ipj1).ne.3.and.iabs(ipj1).le.4.or.
3007 c * ipj*ipj1.lt.0.and.(iabs(ipj).eq.3.or.iabs(ipj).gt.4.
3008 c * or.iabs(ipj1).eq.3.or.iabs(ipj1).eq.4))then
3009 c write (*,*)'ipj,ipj1',ipj,ipj1
3010 c read (*,*)
3011 c endif
3012 
3013  IF(debug.GE.2)WRITE (moniou,201)ipj,ipj1,epj,epj1
3014 201 FORMAT(2x,'PSJDEF: PARTON FLAVORS',
3015  * ': IPJ=',i2,2x,'IPJ1=',i2/
3016  * 4x,'PARTON 4-MOMENTA:',2x,4(e10.3,1x))
3017  DO 1 i=1,4
3018 1 ept(i)=epj(i)+epj1(i)
3019 
3020 c Invariant mass squared for the jet
3021  ww=psnorm(ept)
3022 c Minimal mass squared for the jet
3023  IF(iabs(ipj).LE.2)THEN
3024  am1=am(1)
3025  ELSEIF(iabs(ipj).EQ.4)THEN
3026  am1=am(3)
3027  ELSE
3028  am1=am(2)
3029  ENDIF
3030  IF(iabs(ipj1).LE.2)THEN
3031  am2=am(1)
3032  ELSEIF(iabs(ipj1).EQ.4)THEN
3033  am2=am(3)
3034  ELSE
3035  am2=am(2)
3036  ENDIF
3037  amj=(am1+am2)**2
3038 
3039  IF(amj.GT.ww)THEN
3040  jfl=0
3041  RETURN
3042  ELSE
3043  jfl=1
3044  ENDIF
3045 
3046  njtot=njtot+1
3047  IF( njtot . gt. 15000 ) THEN
3048  WRITE(moniou,*)'PSJDEF: TOO MANY JETS'
3049  WRITE(moniou,*)'PSJDEF: NJTOT = ',njtot
3050  stop
3051  ENDIF
3052  ipjet(1,njtot)=ipj
3053  ipjet(2,njtot)=ipj1
3054  DO 2 i=1,4
3055  epjet(i,1,njtot)=epj(i)
3056 2 epjet(i,2,njtot)=epj1(i)
3057 
3058  IF(debug.GE.3)WRITE (moniou,202)
3059 202 FORMAT(2x,'PSJDEF - END')
3060  RETURN
3061  END
3062 C=======================================================================
3063 
3064  FUNCTION psjet(Q1,Q2,S,S2MIN,J,L)
3065 C PSJET - inclusive hard cross-section calculation (one more run is added
3066 c to the ladder) - for any ordering
3067 c Q1 - effective momentum cutoff for current end of the ladder,
3068 c Q2 - effective momentum cutoff for opposide end of the ladder,
3069 c S - total c.m. energy squared for the ladder,
3070 c S2MIN - minimal c.m. energy squared for BORN process (above Q1 and Q2)
3071 c J - parton type at current end of the ladder (0 - g, 1 - q)
3072 c L - parton type at opposite end of the ladder (1 - g, 2 - q)
3073 C-----------------------------------------------------------------------
3074  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3075  INTEGER DEBUG
3076  COMMON /area6/ pi,bm,am
3077  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
3078  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3079  common/ar3/x1(7),a1(7)
3080  COMMON /area43/ moniou
3081  COMMON /debug/ debug
3082  SAVE
3083 
3084  IF(debug.GE.2)WRITE (moniou,201)s,q1,q2,s2min,j,l
3085 201 FORMAT(2x,'PSJET - UNORDERED LADDER CROSS SECTION:'/
3086  * 4x,'S=',e10.3,2x,'Q1=',e10.3,2x,'Q2=',e10.3,2x,'S2MIN=',
3087  * e10.3,2x,'J=',i1,2x,'L=',i1)
3088  psjet=0.d0
3089 
3090  p=dsqrt(1.d0-3.d0*qt0/s)
3091  cosf=(1.d0-18.d0*qt0/s)/p**3
3092  fi=atan(1.d0/cosf**2-1.d0)
3093  IF(cosf.LT.0.d0)fi=pi-fi
3094  fi=fi/3.d0
3095  zmax=(2.d0-p*(dsqrt(3.d0)*sin(fi)-cos(fi)))/3.d0
3096  zmin=(1.d0-p*cos(fi))/1.5d0
3097 
3098  IF(qt0/(1.d0-zmin)**2.LT.s2min)
3099  * zmin=.5d0*(1.d0+s2min/s-dsqrt((1.d0-s2min/s)**2-4.d0*qt0/s))
3100 
3101 ***********************************************************
3102  IF(1.d0-zmin.LT.dsqrt(qt0/q1))THEN
3103  qmin=qt0/(1.d0-zmin)**2
3104  ELSE
3105  qmin=q1
3106  ENDIF
3107 
3108  qmax=qt0/(1.d0-zmax)**2
3109  sud0=psuds(qmin,j)
3110 ***********************************************************
3111 
3112  IF(debug.GE.3)WRITE (moniou,203)qmin,qmax
3113 203 FORMAT(2x,'PSJET:',2x,'QMIN=',e10.3,2x,'QMAX=',e10.3)
3114  IF(qmax.GT.qmin)THEN
3115 
3116 c Numerical integration over transverse momentum square;
3117 c Gaussian integration is used
3118  DO 3 i=1,7
3119  DO 3 m=1,2
3120  qi=2.d0*qmin/(1.d0+qmin/qmax+(2*m-3)*x1(i)*(1.d0-qmin/qmax))
3121 
3122  zmax=(1.d0-dsqrt(qt0/qi))**delh
3123  zmin=((qi+max(qi,s2min))/(qi+s))**delh
3124 
3125  fsj=0.d0
3126 
3127  IF(debug.GE.3)WRITE (moniou,204)qi,zmin,zmax
3128 204 FORMAT(2x,'PSJET:',2x,'QI=',e10.3,2x,'ZMIN=',e10.3,2x,
3129  * 'ZMAX=',e10.3)
3130  IF(zmax.GT.zmin)THEN
3131  DO 2 i1=1,7
3132  DO 2 m1=1,2
3133  z=(.5d0*(zmax+zmin+(2*m1-3)*x1(i1)*(zmax-zmin)))**
3134  * (1.d0/delh)
3135  qt=qi*(1.d0-z)**2
3136  s2=z*s-qi*(1.d0-z)
3137 
3138  sj=0.d0
3139  DO 1 k=1,2
3140 1 sj=sj+psjint(qi,q2,s2,k,l)*psfap(z,j,k-1)*z
3141 2 fsj=fsj+a1(i1)*sj/dlog(qt/alm)/z**delh
3142  fsj=fsj*(zmax-zmin)
3143  ENDIF
3144 
3145 3 psjet=psjet+a1(i)*fsj*qi*psuds(qi,j)
3146  psjet=psjet*(1.d0/qmin-1.d0/qmax)/sud0/delh/18.d0
3147  ENDIF
3148  IF(debug.GE.3)WRITE (moniou,202)psjet
3149 202 FORMAT(2x,'PSJET=',e10.3)
3150  RETURN
3151  END
3152 C=======================================================================
3153 
3154  FUNCTION psjet1(Q1,Q2,S,S2MIN,J,L)
3155 C PSJET1 - inclusive hard cross-section calculation (one more run is added
3156 c to the ladder) - for strict ordering
3157 c Q1 - effective momentum cutoff for current end of the ladder,
3158 c Q2 - effective momentum cutoff for opposide end of the ladder,
3159 c S - total c.m. energy squared for the ladder,
3160 c S2MIN - minimal c.m. energy squared for BORN process (above Q1 and Q2)
3161 c J - parton type at current end of the ladder (0 - g, 1 - q)
3162 c L - parton type at opposite end of the ladder (1 - g, 2 - q)
3163 C-----------------------------------------------------------------------
3164  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3165  INTEGER DEBUG
3166  COMMON /area6/ pi,bm,am
3167  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
3168  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3169  common/ar3/x1(7),a1(7)
3170  COMMON /area43/ moniou
3171  COMMON /debug/ debug
3172  SAVE
3173 
3174  IF(debug.GE.2)WRITE (moniou,201)s,q1,q2,s2min,j,l
3175 201 FORMAT(2x,'PSJET1 - STRICTLY ORDERED LADDER CROSS SECTION:'/
3176  * 4x,'S=',e10.3,2x,'Q1=',e10.3,2x,'Q2=',e10.3,2x,'S2MIN=',
3177  * e10.3,2x,'J=',i1,2x,'L=',i1)
3178  psjet1=0.d0
3179 
3180  p=dsqrt(1.d0-3.d0*qt0/s)
3181  cosf=(1.d0-18.d0*qt0/s)/p**3
3182  fi=atan(1.d0/cosf**2-1.d0)
3183  IF(cosf.LT.0.d0)fi=pi-fi
3184  fi=fi/3.d0
3185  zmax=(2.d0-p*(dsqrt(3.d0)*sin(fi)-cos(fi)))/3.d0
3186  zmin=(1.d0-p*cos(fi))/1.5d0
3187 
3188  IF(qt0/(1.d0-zmin)**2.LT.s2min)
3189  * zmin=.5d0*(1.d0+s2min/s-dsqrt((1.d0-s2min/s)**2-4.d0*qt0/s))
3190 
3191 ***********************************************************
3192  IF(1.d0-zmin.LT.dsqrt(qt0/q1))THEN
3193  qmin=qt0/(1.d0-zmin)**2
3194  ELSE
3195  qmin=q1
3196  ENDIF
3197 
3198  qmax=qt0/(1.d0-zmax)**2
3199  sud0=psuds(qmin,j)
3200 ***********************************************************
3201 
3202  IF(debug.GE.3)WRITE (moniou,203)qmin,qmax
3203 203 FORMAT(2x,'PSJET1:',2x,'QMIN=',e10.3,2x,'QMAX=',e10.3)
3204  IF(qmax.GT.qmin)THEN
3205 
3206 c Numerical integration over transverse momentum square;
3207 c Gaussian integration is used
3208  DO 3 i=1,7
3209  DO 3 m=1,2
3210  qi=2.d0*qmin/(1.d0+qmin/qmax+(2*m-3)*x1(i)*(1.d0-qmin/qmax))
3211 
3212  zmax=(1.d0-dsqrt(qt0/qi))**delh
3213  zmin=((qi+max(qi,s2min))/(qi+s))**delh
3214 
3215  fsj=0.d0
3216 
3217  IF(debug.GE.3)WRITE (moniou,204)qi,zmin,zmax
3218 204 FORMAT(2x,'PSJET1:',2x,'QI=',e10.3,2x,'ZMIN=',e10.3,2x,
3219  * 'ZMAX=',e10.3)
3220  IF(zmax.GT.zmin)THEN
3221  DO 2 i1=1,7
3222  DO 2 m1=1,2
3223  z=(.5d0*(zmax+zmin+(2*m1-3)*x1(i1)*(zmax-zmin)))**
3224  * (1.d0/delh)
3225  qt=qi*(1.d0-z)**2
3226  s2=z*s-qi*(1.d0-z)
3227 
3228  sj=0.d0
3229  DO 1 k=1,2
3230 1 sj=sj+psjint1(qi,q2,s2,k,l)*psfap(z,j,k-1)*z
3231 
3232 2 fsj=fsj+a1(i1)*sj/dlog(qt/alm)/z**delh
3233  fsj=fsj*(zmax-zmin)
3234  ENDIF
3235 
3236 3 psjet1=psjet1+a1(i)*fsj*qi*psuds(qi,j)
3237  psjet1=psjet1*(1.d0/qmin-1.d0/qmax)/sud0/delh/18.d0
3238  ENDIF
3239  IF(debug.GE.3)WRITE (moniou,202)psjet1
3240 202 FORMAT(2x,'PSJET1=',e10.3)
3241  RETURN
3242  END
3243 C=======================================================================
3244 
3245  FUNCTION psjint(Q1,Q2,S,M,L)
3246 C PSJINT - inclusive hard cross-section interpolation - for any ordering
3247 c in the ladder
3248 c Q1 - effective momentum cutoff for current end of the ladder,
3249 c Q2 - effective momentum cutoff for opposide end of the ladder,
3250 c S - total c.m. energy squared for the ladder,
3251 c M - parton type at current end of the ladder (1 - g, 2 - q)
3252 c L - parton type at opposite end of the ladder (1 - g, 2 - q)
3253 C-----------------------------------------------------------------------
3254  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3255  INTEGER DEBUG
3256  dimension wi(3),wj(3),wk(3)
3257  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3258  COMMON /area29/ csj(17,17,68)
3259  COMMON /area43/ moniou
3260  COMMON /debug/ debug
3261  SAVE
3262 
3263  IF(debug.GE.2)WRITE (moniou,201)s,q1,q2,m,l
3264 201 FORMAT(2x,'PSJINT - UNORDERED LADDER CROSS SECTION INTERPOL.:'/
3265  * 4x,'S=',e10.3,2x,'Q1=',e10.3,2x,'Q2=',e10.3,2x,
3266  * 2x,'M=',i1,2x,'L=',i1)
3267  psjint=0.d0
3268  qq=max(q1,q2)
3269  IF(s.LE.max(4.d0*qt0,qq))THEN
3270  IF(debug.GE.3)WRITE (moniou,202)psjint
3271 202 FORMAT(2x,'PSJINT=',e10.3)
3272  RETURN
3273  ENDIF
3274 
3275  ml=17*(m-1)+34*(l-1)
3276  qli=dlog(q1/qt0)/1.38629d0
3277  qlj=dlog(q2/qt0)/1.38629d0
3278  sl=dlog(s/qt0)/1.38629d0
3279  sql=sl-max(qli,qlj)
3280  i=int(qli)
3281  j=int(qlj)
3282  k=int(sl)
3283  IF(i.GT.13)i=13
3284  IF(j.GT.13)j=13
3285 
3286  IF(sql.GT.10.d0)THEN
3287  IF(k.GT.14)k=14
3288  IF(i.GT.k-3)i=k-3
3289  IF(j.GT.k-3)j=k-3
3290  wi(2)=qli-i
3291  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3292  wi(1)=1.d0-wi(2)+wi(3)
3293  wi(2)=wi(2)-2.d0*wi(3)
3294  wj(2)=qlj-j
3295  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3296  wj(1)=1.d0-wj(2)+wj(3)
3297  wj(2)=wj(2)-2.d0*wj(3)
3298  wk(2)=sl-k
3299  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
3300  wk(1)=1.d0-wk(2)+wk(3)
3301  wk(2)=wk(2)-2.d0*wk(3)
3302 
3303  DO 1 i1=1,3
3304  DO 1 j1=1,3
3305  DO 1 k1=1,3
3306 1 psjint=psjint+csj(i+i1,j+j1,k+k1+ml)*wi(i1)*wj(j1)*wk(k1)
3307  psjint=exp(psjint)
3308  ELSEIF(sql.LT.1.d0.AND.i+j.NE.0)THEN
3309  sq=(s/max(q1,q2)-1.d0)/3.d0
3310  wi(2)=qli-i
3311  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3312  wi(1)=1.d0-wi(2)+wi(3)
3313  wi(2)=wi(2)-2.d0*wi(3)
3314  wj(2)=qlj-j
3315  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3316  wj(1)=1.d0-wj(2)+wj(3)
3317  wj(2)=wj(2)-2.d0*wj(3)
3318 
3319  DO 2 i1=1,3
3320  i2=i+i1
3321  DO 2 j1=1,3
3322  j2=j+j1
3323  k2=max(i2,j2)+1+ml
3324 2 psjint=psjint+csj(i2,j2,k2)*wi(i1)*wj(j1)
3325  psjint=exp(psjint)*sq
3326  ELSEIF(k.EQ.1)THEN
3327  sq=(s/qt0/4.d0-1.d0)/3.d0
3328  wi(2)=qli
3329  wi(1)=1.d0-qli
3330  wj(2)=qlj
3331  wj(1)=1.d0-qlj
3332 
3333  DO 3 i1=1,2
3334  DO 3 j1=1,2
3335 3 psjint=psjint+csj(i1,j1,3+ml)*wi(i1)*wj(j1)
3336  psjint=exp(psjint)*sq
3337  ELSEIF(k.LT.15)THEN
3338  kl=int(sql)
3339  IF(i+kl.GT.12)i=12-kl
3340  IF(j+kl.GT.12)j=12-kl
3341  IF(i+j+kl.EQ.1)kl=2
3342  wi(2)=qli-i
3343  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3344  wi(1)=1.d0-wi(2)+wi(3)
3345  wi(2)=wi(2)-2.d0*wi(3)
3346  wj(2)=qlj-j
3347  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3348  wj(1)=1.d0-wj(2)+wj(3)
3349  wj(2)=wj(2)-2.d0*wj(3)
3350  wk(2)=sql-kl
3351  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
3352  wk(1)=1.d0-wk(2)+wk(3)
3353  wk(2)=wk(2)-2.d0*wk(3)
3354 
3355  DO 4 i1=1,3
3356  i2=i+i1
3357  DO 4 j1=1,3
3358  j2=j+j1
3359  DO 4 k1=1,3
3360  k2=max(i2,j2)+kl+k1-1+ml
3361 4 psjint=psjint+csj(i2,j2,k2)*wi(i1)*wj(j1)*wk(k1)
3362  psjint=exp(psjint)
3363  ELSE
3364  k=15
3365  IF(i.GT.k-3)i=k-3
3366  IF(j.GT.k-3)j=k-3
3367  wi(2)=qli-i
3368  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3369  wi(1)=1.d0-wi(2)+wi(3)
3370  wi(2)=wi(2)-2.d0*wi(3)
3371  wj(2)=qlj-j
3372  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3373  wj(1)=1.d0-wj(2)+wj(3)
3374  wj(2)=wj(2)-2.d0*wj(3)
3375  wk(2)=sl-k
3376  wk(1)=1.d0-wk(2)
3377 
3378  DO 5 i1=1,3
3379  DO 5 j1=1,3
3380  DO 5 k1=1,2
3381 5 psjint=psjint+csj(i+i1,j+j1,k+k1+ml)*wi(i1)*wj(j1)*wk(k1)
3382  psjint=exp(psjint)
3383  ENDIF
3384  IF(debug.GE.3)WRITE (moniou,202)psjint
3385  RETURN
3386  END
3387 C=======================================================================
3388 
3389  SUBROUTINE psjint0(S,SJ,SJB,M,L)
3390 C PSJINT0 - inclusive hard cross-section interpolation - for minimal
3391 c effective momentum cutoff in the ladder
3392 c S - total c.m. energy squared for the ladder,
3393 c SJ - inclusive jet cross-section,
3394 c SJB - Born cross-section,
3395 c M - parton type at current end of the ladder (0 - g, 1 - q)
3396 c L - parton type at opposite end of the ladder (0 - g, 1 - q)
3397 C-----------------------------------------------------------------------
3398  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3399  INTEGER DEBUG
3400  dimension wk(3)
3401  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3402  COMMON /area32/ csj(17,2,2),csb(17,2,2)
3403  COMMON /area43/ moniou
3404  COMMON /debug/ debug
3405  SAVE
3406 
3407  IF(debug.GE.2)WRITE (moniou,201)s,m,l
3408 201 FORMAT(2x,'PSJINT0 - HARD CROSS SECTION INTERPOLATION:'/
3409  * 4x,'S=',e10.3,2x,'M=',i1,2x,'L=',i1)
3410  sj=0.d0
3411  sjb=0.d0
3412  IF(s.LE.4.d0*qt0)THEN
3413  IF(debug.GE.3)WRITE (moniou,202)sj,sjb
3414 202 FORMAT(2x,'PSJINT0: SJ=',e10.3,2x,'SJB=',e10.3)
3415  RETURN
3416  ENDIF
3417 
3418  sl=dlog(s/qt0)/1.38629d0
3419  k=int(sl)
3420  IF(k.EQ.1)THEN
3421  sq=(s/qt0/4.d0-1.d0)/3.d0
3422  sjb=exp(csb(3,m+1,l+1))*sq
3423  sj=exp(csj(3,m+1,l+1))*sq
3424  ELSE
3425  IF(k.GT.14)k=14
3426  wk(2)=sl-k
3427  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
3428  wk(1)=1.d0-wk(2)+wk(3)
3429  wk(2)=wk(2)-2.d0*wk(3)
3430 
3431  DO 1 k1=1,3
3432  sj=sj+csj(k+k1,m+1,l+1)*wk(k1)
3433 1 sjb=sjb+csb(k+k1,m+1,l+1)*wk(k1)
3434  sjb=exp(sjb)
3435  sj=exp(sj)
3436  ENDIF
3437  IF(debug.GE.3)WRITE (moniou,202)sj,sjb
3438  RETURN
3439  END
3440 C=======================================================================
3441 
3442  FUNCTION psjint1(Q1,Q2,S,M,L)
3443 C PSJINT1 - inclusive hard cross-section interpolation - for strict ordering
3444 c in the ladder
3445 c Q1 - effective momentum cutoff for current end of the ladder,
3446 c Q2 - effective momentum cutoff for opposide end of the ladder,
3447 c S - total c.m. energy squared for the ladder,
3448 c M - parton type at current end of the ladder (1 - g, 2 - q)
3449 c L - parton type at opposite end of the ladder (1 - g, 2 - q)
3450 C-----------------------------------------------------------------------
3451  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3452  INTEGER DEBUG
3453  dimension wi(3),wj(3),wk(3)
3454  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3455  COMMON /area30/ csj(17,17,68)
3456  COMMON /area43/ moniou
3457  COMMON /debug/ debug
3458  SAVE
3459 
3460  IF(debug.GE.2)WRITE (moniou,201)s,q1,q2,m,l
3461 201 FORMAT(2x,'PSJINT1 - STRICTLY ORDERED LADDER CROSS SECTION',
3462  * ' INTERPOLATION:'/
3463  * 4x,'S=',e10.3,2x,'Q1=',e10.3,2x,'Q2=',e10.3,2x,
3464  * 4x,'M=',i1,2x,'L=',i1)
3465  psjint1=0.d0
3466  qq=max(q1,q2)
3467  IF(s.LE.max(4.d0*qt0,qq))THEN
3468  IF(debug.GE.3)WRITE (moniou,202)psjint1
3469 202 FORMAT(2x,'PSJINT1=',e10.3)
3470  RETURN
3471  ENDIF
3472 
3473  ml=17*(m-1)+34*(l-1)
3474  qli=dlog(q1/qt0)/1.38629d0
3475  qlj=dlog(q2/qt0)/1.38629d0
3476  sl=dlog(s/qt0)/1.38629d0
3477  sql=sl-max(qli,qlj)
3478  i=int(qli)
3479  j=int(qlj)
3480  k=int(sl)
3481  IF(i.GT.13)i=13
3482  IF(j.GT.13)j=13
3483 
3484  IF(sql.GT.10.d0)THEN
3485  IF(k.GT.14)k=14
3486  IF(i.GT.k-3)i=k-3
3487  IF(j.GT.k-3)j=k-3
3488  wi(2)=qli-i
3489  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3490  wi(1)=1.d0-wi(2)+wi(3)
3491  wi(2)=wi(2)-2.d0*wi(3)
3492  wj(2)=qlj-j
3493  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3494  wj(1)=1.d0-wj(2)+wj(3)
3495  wj(2)=wj(2)-2.d0*wj(3)
3496  wk(2)=sl-k
3497  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
3498  wk(1)=1.d0-wk(2)+wk(3)
3499  wk(2)=wk(2)-2.d0*wk(3)
3500 
3501  DO 1 i1=1,3
3502  DO 1 j1=1,3
3503  DO 1 k1=1,3
3504 1 psjint1=psjint1+csj(i+i1,j+j1,k+k1+ml)*wi(i1)*wj(j1)*wk(k1)
3505  psjint1=exp(psjint1)
3506  ELSEIF(sql.LT.1.d0.AND.i+j.NE.0)THEN
3507  sq=(s/max(q1,q2)-1.d0)/3.d0
3508  wi(2)=qli-i
3509  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3510  wi(1)=1.d0-wi(2)+wi(3)
3511  wi(2)=wi(2)-2.d0*wi(3)
3512  wj(2)=qlj-j
3513  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3514  wj(1)=1.d0-wj(2)+wj(3)
3515  wj(2)=wj(2)-2.d0*wj(3)
3516 
3517  DO 2 i1=1,3
3518  i2=i+i1
3519  DO 2 j1=1,3
3520  j2=j+j1
3521  k2=max(i2,j2)+1+ml
3522 2 psjint1=psjint1+csj(i2,j2,k2)*wi(i1)*wj(j1)
3523  psjint1=exp(psjint1)*sq
3524  ELSEIF(k.EQ.1)THEN
3525  sq=(s/qt0/4.d0-1.d0)/3.d0
3526  wi(2)=qli
3527  wi(1)=1.d0-qli
3528  wj(2)=qlj
3529  wj(1)=1.d0-qlj
3530 
3531  DO 3 i1=1,2
3532  DO 3 j1=1,2
3533 3 psjint1=psjint1+csj(i1,j1,3+ml)*wi(i1)*wj(j1)
3534  psjint1=exp(psjint1)*sq
3535  ELSEIF(k.LT.15)THEN
3536  kl=int(sql)
3537  IF(i+kl.GT.12)i=12-kl
3538  IF(j+kl.GT.12)j=12-kl
3539  IF(i+j+kl.EQ.1)kl=2
3540 
3541  wi(2)=qli-i
3542  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3543  wi(1)=1.d0-wi(2)+wi(3)
3544  wi(2)=wi(2)-2.d0*wi(3)
3545  wj(2)=qlj-j
3546  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3547  wj(1)=1.d0-wj(2)+wj(3)
3548  wj(2)=wj(2)-2.d0*wj(3)
3549  wk(2)=sql-kl
3550  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
3551  wk(1)=1.d0-wk(2)+wk(3)
3552  wk(2)=wk(2)-2.d0*wk(3)
3553 
3554  DO 4 i1=1,3
3555  i2=i+i1
3556  DO 4 j1=1,3
3557  j2=j+j1
3558  DO 4 k1=1,3
3559  k2=max(i2,j2)+kl+k1-1+ml
3560 4 psjint1=psjint1+csj(i2,j2,k2)*wi(i1)*wj(j1)*wk(k1)
3561  psjint1=exp(psjint1)
3562  ELSE
3563  k=15
3564  IF(i.GT.k-3)i=k-3
3565  IF(j.GT.k-3)j=k-3
3566  wi(2)=qli-i
3567  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
3568  wi(1)=1.d0-wi(2)+wi(3)
3569  wi(2)=wi(2)-2.d0*wi(3)
3570  wj(2)=qlj-j
3571  wj(3)=wj(2)*(wj(2)-1.d0)*.5d0
3572  wj(1)=1.d0-wj(2)+wj(3)
3573  wj(2)=wj(2)-2.d0*wj(3)
3574  wk(2)=sl-k
3575  wk(1)=1.d0-wk(2)
3576 
3577  DO 5 i1=1,3
3578  DO 5 j1=1,3
3579  DO 5 k1=1,2
3580 5 psjint1=psjint1+csj(i+i1,j+j1,k+k1+ml)*wi(i1)*wj(j1)*wk(k1)
3581  psjint1=exp(psjint1)
3582  ENDIF
3583  IF(debug.GE.3)WRITE (moniou,202)psjint1
3584  RETURN
3585  END
3586 C=======================================================================
3587 
3588  FUNCTION pslam(S,A,B)
3589 c Kinematical function for two particle decay - maximal Pt-value
3590 c A - first particle mass squared,
3591 C B - second particle mass squared,
3592 C S - two particle invariant mass
3593 c-----------------------------------------------------------------------
3594  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3595  INTEGER DEBUG
3596  COMMON /area43/ moniou
3597  COMMON /debug/ debug
3598  SAVE
3599 
3600  IF(debug.GE.2)WRITE (moniou,201)s,a,b
3601 201 FORMAT(2x,'PSLAM - KINEMATICAL FUNCTION S=',e10.3,2x,'A=',
3602  * e10.3,2x,'B=',e10.3)
3603  pslam=.25d0/s*(s+a-b)**2-a
3604  IF(debug.GE.3)WRITE (moniou,202)pslam
3605 202 FORMAT(2x,'PSLAM=',e10.3)
3606  RETURN
3607  END
3608 C=======================================================================
3609 
3610  FUNCTION psnorm(EP)
3611 c 4-vector squared calculation
3612 c-----------------------------------------------------------------------
3613  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3614  INTEGER DEBUG
3615  dimension ep(4)
3616  COMMON /area43/ moniou
3617  COMMON /debug/ debug
3618  SAVE
3619 
3620  IF(debug.GE.2)WRITE (moniou,201)ep
3621 201 FORMAT(2x,'PSNORM - 4-VECTOR SQUARED FOR ',
3622  * 'EP=',4(e10.3,1x))
3623  psnorm=ep(1)**2
3624  DO 1 i=1,3
3625 1 psnorm=psnorm-ep(i+1)**2
3626  IF(debug.GE.3)WRITE (moniou,202)psnorm
3627 202 FORMAT(2x,'PSNORM=',e10.3)
3628  RETURN
3629  END
3630 C=======================================================================
3631 
3632  SUBROUTINE psrec(EP,QV,ZV,QM,IQV,LDAU,LPAR,IQJ,EQJ,JFL,JQ)
3633 c Jet reconstructuring procedure - 4-momenta for all final jets are determined
3634 c EP(i) - jet 4-momentum
3635 C-----------------------------------------------------------------------
3636 c QV(i,j) - effective momentum for the branching of the parton in i-th row
3637 c on j-th level (0 - in case of no branching)
3638 c ZV(i,j) - Z-value for the branching of the parton in i-th row
3639 c on j-th level
3640 c QM(i,j) - mass squared for the parton in i-th row
3641 c on j-th level
3642 c IQV(i,j) - flavours for the parton in i-th row on j-th level
3643 c LDAU(i,j) - first daughter row for the branching of the parton in i-th row
3644 c on j-th level
3645 c LPAR(i,j) - the parent row for the parton in i-th row on j-th level
3646 C-----------------------------------------------------------------------
3647  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3648  INTEGER DEBUG
3649  dimension ep(4),ep3(4),epv(4,30,50),
3650  * qv(30,50),zv(30,50),qm(30,50),iqv(30,50),
3651  * ldau(30,49),lpar(30,50),
3652  * iqj(2),eqj(4,2),ipq(2,30,50),epq(8,30,50),
3653  * epj(4),epj1(4)
3654  COMMON /area43/ moniou
3655  COMMON /debug/ debug
3656  SAVE
3657 
3658  IF(debug.GE.2)WRITE (moniou,201)jq,ep,iqj
3659 201 FORMAT(2x,'PSREC - JET RECONSTRUCTURING: JQ=',i1/
3660  * 4x,'JET 4-MOMENTUM EP=',4(e10.3,1x)/4x,'IQJ=',2i2)
3661  jfl = 1
3662  DO 1 i=1,4
3663  epv(i,1,1)=ep(i)
3664 1 epq(i,1,1)=eqj(i,1)
3665  ipq(1,1,1)=iqj(1)
3666 
3667  IF(iqv(1,1).EQ.0)THEN
3668  DO 2 i=1,4
3669 2 epq(i+4,1,1)=eqj(i,2)
3670  ipq(2,1,1)=iqj(2)
3671  ENDIF
3672 
3673  nlev=1
3674  nrow=1
3675 
3676 3 CONTINUE
3677 
3678  IF(qv(nrow,nlev).EQ.0.d0)THEN
3679  ipj=iqv(nrow,nlev)
3680  IF(ipj.NE.0)THEN
3681  IF(epq(1,nrow,nlev).NE.0.d0)THEN
3682  IF(iabs(ipj).EQ.3)ipj=ipj*4/3
3683  DO 4 i=1,4
3684  epj(i)=epv(i,nrow,nlev)
3685 4 epj1(i)=epq(i,nrow,nlev)
3686  ipj1=ipq(1,nrow,nlev)
3687  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
3688  CALL psjdef(ipj,ipj1,epj,epj1,jfl)
3689  IF(debug.GE.3)WRITE (moniou,211)ipj,ipj1,jfl
3690 211 FORMAT(2x,'PSREC - NEW STRING FLAVOURS: ',2i3,' JFL=',i1)
3691  IF(jfl.EQ.0)RETURN
3692  ELSE
3693  ipq(1,nrow,nlev)=ipj
3694  DO 5 i=1,4
3695 5 epq(i,nrow,nlev)=epv(i,nrow,nlev)
3696  IF(debug.GE.3)WRITE (moniou,212)ipj,
3697  * (epv(i,nrow,nlev),i=1,4),jfl
3698 212 FORMAT(2x,'PSREC: NEW FINAL JET FLAVOR: ',i3,2x,
3699  * 'JET 4-MOMENTUM:', 4(e10.3,1x),' JFL=',i1)
3700  ENDIF
3701 
3702  ELSE
3703  ipj=int(2.d0*qsran(b10)+1.d0)*(3-2*jq)
3704  DO 6 i=1,4
3705 6 epj(i)=.5d0*epv(i,nrow,nlev)
3706 
3707  DO 9 m=1,2
3708  IF(epq(1+4*(m-1),nrow,nlev).NE.0.d0)THEN
3709  DO 7 i=1,4
3710 7 epj1(i)=epq(4*(m-1)+i,nrow,nlev)
3711  ipj1=ipq(m,nrow,nlev)
3712  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
3713  CALL psjdef(ipj,ipj1,epj,epj1,jfl)
3714  IF(jfl.EQ.0)RETURN
3715  ELSE
3716  ipq(m,nrow,nlev)=ipj
3717  DO 8 i=1,4
3718 8 epq(4*(m-1)+i,nrow,nlev)=epj(i)
3719  ENDIF
3720 9 ipj=-ipj
3721  ENDIF
3722 
3723  IF(debug.GE.3)WRITE (moniou,204)nlev,nrow,iqv(nrow,nlev),
3724  * (epv(i,nrow,nlev),i=1,4)
3725 204 FORMAT(2x,'PSREC: FINAL JET AT LEVEL NLEV=',i2,
3726  * ' NROW=',i2/4x,'JET FLAVOR: ',i3,2x,'JET 4-MOMENTUM:',
3727  * 4(e10.3,1x))
3728  ELSE
3729 
3730  DO 10 i=1,4
3731 10 ep3(i)=epv(i,nrow,nlev)
3732  CALL psdefrot(ep3,s0x,c0x,s0,c0)
3733  z=zv(nrow,nlev)
3734  qt2=(z*(1.d0-z))**2*qv(nrow,nlev)
3735  ldrow=ldau(nrow,nlev)
3736 
3737  wp0=ep3(1)+ep3(2)
3738  wpi=z*wp0
3739  wmi=(qt2+qm(ldrow,nlev+1))/wpi
3740  ep3(1)=.5d0*(wpi+wmi)
3741  ep3(2)=.5d0*(wpi-wmi)
3742  qt=dsqrt(qt2)
3743  CALL pscs(c,s)
3744  ep3(3)=qt*c
3745  ep3(4)=qt*s
3746  CALL psrotat(ep3,s0x,c0x,s0,c0)
3747 
3748  DO 11 i=1,4
3749 11 epv(i,ldrow,nlev+1)=ep3(i)
3750  IF(debug.GE.3)WRITE (moniou,206)nlev+1,ldrow,ep3
3751 206 FORMAT(2x,'PSREC: JET AT LEVEL NLEV=',i2,
3752  * ' NROW=',i2/4x,'JET 4-MOMENTUM:',4(e10.3,1x))
3753 
3754  wpi=(1.d0-z)*wp0
3755  wmi=(qt2+qm(ldrow+1,nlev+1))/wpi
3756  ep3(1)=.5d0*(wpi+wmi)
3757  ep3(2)=.5d0*(wpi-wmi)
3758  ep3(3)=-qt*c
3759  ep3(4)=-qt*s
3760  CALL psrotat(ep3,s0x,c0x,s0,c0)
3761  IF(debug.GE.3)WRITE (moniou,206)nlev+1,ldrow+1,ep3
3762 
3763  DO 12 i=1,4
3764 12 epv(i,ldrow+1,nlev+1)=ep3(i)
3765 
3766  IF(iqv(nrow,nlev).EQ.0)THEN
3767  IF(iqv(ldrow,nlev+1).NE.0)THEN
3768  ipq(1,ldrow,nlev+1)=ipq(1,nrow,nlev)
3769  ipq(1,ldrow+1,nlev+1)=ipq(2,nrow,nlev)
3770  DO 13 i=1,4
3771  epq(i,ldrow,nlev+1)=epq(i,nrow,nlev)
3772 13 epq(i,ldrow+1,nlev+1)=epq(i+4,nrow,nlev)
3773  ELSE
3774  ipq(1,ldrow,nlev+1)=ipq(1,nrow,nlev)
3775  ipq(2,ldrow,nlev+1)=0
3776  ipq(1,ldrow+1,nlev+1)=0
3777  ipq(2,ldrow+1,nlev+1)=ipq(2,nrow,nlev)
3778  DO 14 i=1,4
3779  epq(i,ldrow,nlev+1)=epq(i,nrow,nlev)
3780  epq(i+4,ldrow,nlev+1)=0.d0
3781  epq(i,ldrow+1,nlev+1)=0.d0
3782 14 epq(i+4,ldrow+1,nlev+1)=epq(i+4,nrow,nlev)
3783  ENDIF
3784  ELSE
3785  IF(iqv(ldrow,nlev+1).EQ.0)THEN
3786  ipq(1,ldrow,nlev+1)=ipq(1,nrow,nlev)
3787  ipq(2,ldrow,nlev+1)=0
3788  ipq(1,ldrow+1,nlev+1)=0
3789  DO 15 i=1,4
3790  epq(i,ldrow,nlev+1)=epq(i,nrow,nlev)
3791  epq(i+4,ldrow,nlev+1)=0.d0
3792 15 epq(i,ldrow+1,nlev+1)=0.d0
3793  ELSE
3794  ipq(1,ldrow,nlev+1)=0
3795  ipq(1,ldrow+1,nlev+1)=0
3796  ipq(2,ldrow+1,nlev+1)=ipq(1,nrow,nlev)
3797  DO 16 i=1,4
3798  epq(i,ldrow,nlev+1)=0.d0
3799  epq(i,ldrow+1,nlev+1)=0.d0
3800 16 epq(i+4,ldrow+1,nlev+1)=epq(i,nrow,nlev)
3801  ENDIF
3802  ENDIF
3803 
3804  nrow=ldrow
3805  nlev=nlev+1
3806  GOTO 3
3807  ENDIF
3808 
3809 17 CONTINUE
3810  IF(nlev.EQ.1)THEN
3811  iqj(1)=ipq(1,1,1)
3812  DO 18 i=1,4
3813 18 eqj(i,1)=epq(i,1,1)
3814  IF(iqv(1,1).EQ.0)THEN
3815  iqj(2)=ipq(2,1,1)
3816  DO 19 i=1,4
3817 19 eqj(i,2)=epq(i+4,1,1)
3818  ENDIF
3819  IF(debug.GE.3)WRITE (moniou,202)iqj
3820 202 FORMAT(2x,'PSREC - END',2x,'iqj=',2i2)
3821  RETURN
3822  ENDIF
3823 
3824  lprow=lpar(nrow,nlev)
3825 
3826  IF(ldau(lprow,nlev-1).EQ.nrow)THEN
3827  IF(iqv(nrow,nlev).EQ.0)THEN
3828  IF(epq(1,lprow,nlev-1).EQ.0.d0)THEN
3829  ipq(1,lprow,nlev-1)=ipq(1,nrow,nlev)
3830  DO 20 i=1,4
3831 20 epq(i,lprow,nlev-1)=epq(i,nrow,nlev)
3832  ENDIF
3833  ipq(1,nrow+1,nlev)=ipq(2,nrow,nlev)
3834  DO 21 i=1,4
3835 21 epq(i,nrow+1,nlev)=epq(i+4,nrow,nlev)
3836  ELSE
3837  IF(iqv(lprow,nlev-1).EQ.0)THEN
3838  IF(epq(1,lprow,nlev-1).EQ.0.d0)THEN
3839  ipq(1,lprow,nlev-1)=ipq(1,nrow,nlev)
3840  DO 22 i=1,4
3841 22 epq(i,lprow,nlev-1)=epq(i,nrow,nlev)
3842  ENDIF
3843  ELSE
3844  ipq(1,nrow+1,nlev)=ipq(1,nrow,nlev)
3845  DO 23 i=1,4
3846 23 epq(i,nrow+1,nlev)=epq(i,nrow,nlev)
3847  ENDIF
3848  ENDIF
3849  nrow=nrow+1
3850  GOTO 3
3851 
3852  ELSE
3853  IF(iqv(nrow,nlev).EQ.0)THEN
3854  IF(iqv(lprow,nlev-1).EQ.0)THEN
3855  IF(epq(5,lprow,nlev-1).EQ.0.d0)THEN
3856  ipq(2,lprow,nlev-1)=ipq(2,nrow,nlev)
3857  DO 24 i=1,4
3858 24 epq(i+4,lprow,nlev-1)=epq(i+4,nrow,nlev)
3859  ENDIF
3860  ELSE
3861  IF(epq(1,lprow,nlev-1).EQ.0.d0)THEN
3862  ipq(1,lprow,nlev-1)=ipq(2,nrow,nlev)
3863  DO 25 i=1,4
3864 25 epq(i,lprow,nlev-1)=epq(i+4,nrow,nlev)
3865  ENDIF
3866  ENDIF
3867  ELSE
3868  IF(iqv(lprow,nlev-1).EQ.0.AND.
3869  * epq(5,lprow,nlev-1).EQ.0.d0)THEN
3870  ipq(2,lprow,nlev-1)=ipq(1,nrow,nlev)
3871  DO 26 i=1,4
3872 26 epq(i+4,lprow,nlev-1)=epq(i,nrow,nlev)
3873  ENDIF
3874  ENDIF
3875 
3876  nrow=lprow
3877  nlev=nlev-1
3878  GOTO 17
3879  ENDIF
3880  END
3881 C=======================================================================
3882 
3883  FUNCTION psrejs(S,Z,IQQ)
3884 c PSREJS - rejection function for the energy sharing for semihard
3885 c interaction (Hi_semihard(S)/S**delh)
3886 c S - energy squared for the semihard interaction,
3887 c Z - impact parameter factor, Z=exp(-b**2/Rp),
3888 c IQQ - type of the hard interaction (0 - gg, 1 - qg, 2 - gq)
3889 c-----------------------------------------------------------------------
3890  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3891  INTEGER DEBUG
3892  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
3893  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3894  COMMON /ar3/ x1(7),a1(7)
3895  COMMON /area43/ moniou
3896  COMMON /debug/ debug
3897  SAVE
3898 
3899  IF(debug.GE.2)WRITE (moniou,201)s,z,iqq
3900 201 FORMAT(2x,'PSREJS - REJECTION FUNCTION TABULATION: '/
3901  * 4x,'S=',e10.3,2x,'Z=',e10.3,2x,'IQQ=',i1)
3902  xmin=4.d0*(qt0+amj0)/s
3903  xmin=xmin**(delh-del)
3904  psrejs=0.d0
3905 
3906 c Numerical integration over Z1
3907  DO 2 i=1,7
3908  DO 2 m=1,2
3909  z1=(.5d0*(1.d0+xmin-(2*m-3)*x1(i)*(1.d0-xmin)))**(1.d0/
3910  *(delh-del))
3911 
3912 c SJ is the inclusive hard partonic interaction
3913 c cross-section (inclusive cut ladder cross section) for minimal
3914 c 4-momentum transfer squre QT0 and c.m. energy square s_hard = exp YJ;
3915 c SJB - Born cross-section
3916  yj=dlog(z1*s)
3917  CALL psjint0(z1*s,sj,sjb,iqq,0)
3918 c GY= Sigma_hard_tot(YJ,QT0) - total hard partonic
3919 c interaction cross-section for minimal 4-momentum transfer square QT0 and
3920 c c.m. energy square s_hard = exp YJ; SH=pi*R_hard**2 (R_hard**2=4/QT0)
3921  gy=2.d0*sh*psgint((sj-sjb)/sh*.5d0)+sjb
3922  rh=rs0-alf*dlog(z1)
3923 
3924  IF(iqq.NE.0)THEN
3925  psrejs=psrejs+a1(i)*gy/(z1*s)**delh*z**(rs0/rh)/rh*
3926  * (1.d0-z1)*bet
3927  ELSE
3928  st2=0.d0
3929  DO 1 j=1,7
3930 1 st2=st2+a1(j)*((1.d0-z1**(.5d0*(1.d0+x1(j))))*
3931  * (1.d0-z1**(.5d0*(1.d0-x1(j)))))**bet
3932 
3933  psrejs=psrejs-a1(i)*dlog(z1)*gy/(z1*s)**delh*z**(rs0/rh)/rh*st2
3934  ENDIF
3935 2 CONTINUE
3936  psrejs=dlog(psrejs*(1.d0-xmin)/z)
3937  IF(debug.GE.2)WRITE (moniou,202)psrejs
3938 202 FORMAT(2x,'PSREJS=',e10.3)
3939  RETURN
3940  END
3941 C=======================================================================
3942 
3943  FUNCTION psrejv(S)
3944 c PSREJV - rejection function for the energy sharing for quark-quark hard
3945 c interaction (sigma_hard(S)/S**delh)
3946 c S - energy squared for the hard interaction
3947 c-----------------------------------------------------------------------
3948  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3949  INTEGER DEBUG
3950  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
3951  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3952  COMMON /area43/ moniou
3953  COMMON /debug/ debug
3954  SAVE
3955 
3956  IF(debug.GE.2)WRITE (moniou,201)s
3957 201 FORMAT(2x,'PSREJV - REJECTION FUNCTION TABULATION: ',
3958  * 'S=',e10.3)
3959 c SJ is the inclusive hard QUARK-QUARK interaction
3960 c cross-section (inclusive cut ladder cross section) for minimal
3961 c 4-momentum transfer squre QT0 and c.m. energy square s;
3962 c SJB - Born cross-section
3963  CALL psjint0(s,sj,sjb,1,1)
3964 
3965 c GY= Sigma_hard_tot(YJ,QT0) - total hard partonic (quark-quark)
3966 c interaction cross-section for minimal 4-momentum transfer square QT0 and
3967 c c.m. energy square s; SH=pi*R_hard**2 (R_hard**2=4/QT0)
3968  gy=2.d0*sh*psgint((sj-sjb)/sh*.5d0)+sjb
3969  psrejv=dlog(gy/s**delh)
3970  IF(debug.GE.3)WRITE (moniou,202)psrejv
3971 202 FORMAT(2x,'PSREJV=',e10.3)
3972  RETURN
3973  END
3974 C=======================================================================
3975 
3976  FUNCTION psrjint(YJ,Z0,IQQ)
3977 c PSRJINT - Rejection function for the energy sharing (Hi_semih(S)/S**delh)
3978 c YJ=ln S,
3979 c Z0 - impact parameter factor, Z0=exp(-b**2/Rp),
3980 c IQQ - type of hard interaction (0 - gg; 1 - qg, 2 - gq; 3 - qq)
3981 c-----------------------------------------------------------------------
3982  IMPLICIT DOUBLE PRECISION (a-h,o-z)
3983  INTEGER DEBUG
3984  dimension a(3)
3985  COMMON /area1/ ia(2),icz,icp
3986  COMMON /area17/ del,rs,rs0,fs,alf,rr,sh,delh
3987  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
3988  COMMON /area23/ rjv(50)
3989  COMMON /area24/ rjs(50,5,10)
3990  COMMON /area43/ moniou
3991  COMMON /debug/ debug
3992  SAVE
3993 
3994  IF(debug.GE.2)WRITE (moniou,201)yj,z0,iqq
3995 201 FORMAT(2x,'PSRJINT - REJECTION FUNCTION INTERPOLATION:'/
3996  * 4x,'YJ=',e10.3,2x,'Z0=',e10.3,2x,'IQQ=',i1)
3997  yy=(yj-aqt0)*2.d0
3998 * JY=INT(YY)
3999  jy=min(48,int(yy)) ! modified 15.oct.03 D.H.
4000 
4001  IF(iqq.EQ.3)THEN
4002  IF(jy.EQ.0)THEN
4003  psrjint=exp(rjv(1))*yy+(exp(rjv(2))-2.d0*
4004  * exp(rjv(1)))*yy*(yy-1.d0)*.5d0
4005  ELSE
4006  psrjint=exp(rjv(jy)+(rjv(jy+1)-rjv(jy))*(yy-jy)
4007  * +(rjv(jy+2)+rjv(jy)-2.d0*rjv(jy+1))*(yy-jy)*
4008  * (yy-jy-1.d0)*.5d0)
4009  ENDIF
4010  ELSE
4011  z=z0**(rs/rs0)
4012  iq=(iqq+1)/2+1+2*(icz-1)
4013  jz=int(5.d0*z)
4014  IF(jz.GT.3)jz=3
4015  wz=5.d0*z-jz
4016 
4017  IF(jz.EQ.0)THEN
4018  i1=2
4019  ELSE
4020  i1=1
4021  ENDIF
4022 
4023  DO 1 i=i1,3
4024  j1=jz+i-1
4025  IF(jy.EQ.0)THEN
4026  a(i)=exp(rjs(1,j1,iq))*yy+(exp(rjs(2,j1,iq))-2.d0*
4027  * exp(rjs(1,j1,iq)))*yy*(yy-1.d0)*.5d0
4028  IF(a(i).GT.0.d0)THEN
4029  a(i)=dlog(a(i))
4030  ELSE
4031  a(i)=-80.d0
4032  ENDIF
4033  ELSE
4034  a(i)=rjs(jy,j1,iq)+(rjs(jy+1,j1,iq)-
4035  * rjs(jy,j1,iq))*(yy-jy)
4036  * +(rjs(jy+2,j1,iq)+rjs(jy,j1,iq)-2.d0*
4037  * rjs(jy+1,j1,iq))*(yy-jy)*(yy-jy-1.d0)*.5d0
4038  ENDIF
4039 1 CONTINUE
4040 
4041  IF(jz.NE.0)THEN
4042  psrjint=exp(a(1)+(a(2)-a(1))*wz+(a(3)+a(1)-2.d0*a(2))*wz*
4043  * (wz-1.d0)*.5d0)*z
4044  ELSE
4045  psrjint=(exp(a(2))*wz+(exp(a(3))-2.d0*exp(a(2)))*wz*
4046  * (wz-1.d0)*.5d0)*z
4047  IF(psrjint.LE.0.d0)psrjint=1.d-10
4048  ENDIF
4049  ENDIF
4050  IF(debug.GE.3)WRITE (moniou,202)psrjint
4051 202 FORMAT(2x,'PSRJINT=',e10.3)
4052  RETURN
4053  END
4054 C=======================================================================
4055 
4056  FUNCTION psroot(QLMAX,G,J)
4057 c PSROOT - effective momentum tabulation for given set of random number
4058 c values and maximal effective momentum QMAX values - according to the
4059 c probability of branching: (1 - timelike Sudakov formfactor)
4060 c QLMAX - ln QMAX/16/QTF,
4061 c G - dzeta number (some function of ksi)
4062 c J - type of the parton (1-g,2-q)
4063 c-----------------------------------------------------------------------
4064  IMPLICIT DOUBLE PRECISION (a-h,o-z)
4065  INTEGER DEBUG
4066  COMMON /area43/ moniou
4067  COMMON /debug/ debug
4068  SAVE
4069 
4070  IF(debug.GE.2)WRITE (moniou,201)qlmax,g,j
4071 201 FORMAT(2x,'PSQINT - BRANCHING MOMENTUM TABULATION:'/
4072  * 4x,'QLMAX=',e10.3,2x,'G=',e10.3,2x,'J=',i1)
4073  ql0=0.d0
4074  ql1=qlmax
4075  f0=-g
4076  f1=1.d0-g
4077  sud0=-dlog(psudint(qlmax,j))
4078 
4079 1 ql2=ql1-(ql1-ql0)*f1/(f1-f0)
4080  IF(ql2.LT.0.d0)THEN
4081  ql2=0.d0
4082  f2=-g
4083  ELSEIF(ql2.GT.qlmax)THEN
4084  ql2=qlmax
4085  f2=1.d0-g
4086  ELSE
4087  f2=-dlog(psudint(ql2,j))/sud0-g
4088  ENDIF
4089 
4090  IF(abs(f2).GT.1.d-3)THEN
4091  ql0=ql1
4092  ql1=ql2
4093  f0=f1
4094  f1=f2
4095  GOTO 1
4096  ELSE
4097  psroot=ql2
4098  ENDIF
4099  IF(debug.GE.3)WRITE (moniou,202)psroot
4100 202 FORMAT(2x,'PSROOT=',e10.3)
4101  RETURN
4102  END
4103 C=======================================================================
4104 
4105  SUBROUTINE psrotat(EP,S0X,C0X,S0,C0)
4106 c Spacial rotation to the lab. system for 4-vector EP
4107 c-----------------------------------------------------------------------
4108  IMPLICIT DOUBLE PRECISION (a-h,o-z)
4109  INTEGER DEBUG
4110  dimension ep(4),ep1(3)
4111  COMMON /area43/ moniou
4112  COMMON /debug/ debug
4113  SAVE
4114 
4115  IF(debug.GE.2)WRITE (moniou,201)ep,s0x,c0x,s0,c0
4116 201 FORMAT(2x,'PSROTAT - SPACIAL ROTATION:'/4x,
4117  * '4-VECTOR EP=',4(e10.3,1x)/4x,'S0X=',e10.3,'C0X=',e10.3,
4118  * 2x,'S0=',e10.3,'C0=',e10.3)
4119  ep1(3)=ep(4)
4120  ep1(2)=ep(2)*s0+ep(3)*c0
4121  ep1(1)=ep(2)*c0-ep(3)*s0
4122 
4123  ep(2)=ep1(1)
4124  ep(4)=ep1(2)*s0x+ep1(3)*c0x
4125  ep(3)=ep1(2)*c0x-ep1(3)*s0x
4126  IF(debug.GE.3)WRITE (moniou,202)ep
4127 202 FORMAT(2x,'PSROTAT: ROTATED 4-VECTOR EP=',
4128  * 2x,4e10.3)
4129  RETURN
4130  END
4131 C=======================================================================
4132 
4133  FUNCTION psqint(QLMAX,G,J)
4134 c PSQINT - effective momentum interpolation for given random number G
4135 c and maximal effective momentum QMAX
4136 c QLMAX - ln QMAX/16/QTF,
4137 c G - random number (0<G<1)
4138 c J - type of the parton (1-g,2-q)
4139 c-----------------------------------------------------------------------
4140  IMPLICIT DOUBLE PRECISION (a-h,o-z)
4141  INTEGER DEBUG
4142  dimension wi(3),wk(3)
4143  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
4144  COMMON /area34/ qrt(10,101,2)
4145  COMMON /area43/ moniou
4146  COMMON /debug/ debug
4147  SAVE
4148 
4149  IF(debug.GE.2)WRITE (moniou,201)qlmax,g,j
4150 201 FORMAT(2x,'PSQINT - BRANCHING MOMENTUM INTERPOLATION:'/
4151  * 4x,'QLMAX=',e10.3,2x,'G=',e10.3,2x,'J=',i1)
4152  qli=qlmax/1.38629d0
4153  sud0=1.d0/psudint(qlmax,j)
4154  sl=100.d0*dlog(1.d0-g*(1.d0-sud0))/dlog(sud0)
4155  i=int(qli)
4156  k=int(sl)
4157  IF(k.GT.98)k=98
4158  wk(2)=sl-k
4159  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
4160  wk(1)=1.d0-wk(2)+wk(3)
4161  wk(2)=wk(2)-2.d0*wk(3)
4162  psqint=0.d0
4163 
4164  IF(i.GT.7)i=7
4165  wi(2)=qli-i
4166  wi(3)=wi(2)*(wi(2)-1.d0)*.5d0
4167  wi(1)=1.d0-wi(2)+wi(3)
4168  wi(2)=wi(2)-2.d0*wi(3)
4169 
4170  DO 1 k1=1,3
4171  DO 1 i1=1,3
4172 1 psqint=psqint+qrt(i+i1,k+k1,j)*wi(i1)*wk(k1)
4173  IF(psqint.LE.0.d0)psqint=0.d0
4174  psqint=16.d0*qtf*exp(psqint)
4175  IF(debug.GE.3)WRITE (moniou,202)psqint
4176 202 FORMAT(2x,'PSQINT=',e10.3)
4177  RETURN
4178  END
4179 C=======================================================================
4180 
4181  SUBROUTINE psshar(LS,NHP,NW,NT)
4182 c Inelastic interaction - energy sharing procedure:
4183 c LS - total number of cut soft pomeron blocks (froissarons),
4184 c NHP - total number of hard pomerons,
4185 c NW - number of interacting projectile nucleons (excluding diffracted),
4186 c NT - number of target nucleons in active state
4187 c-----------------------------------------------------------------------
4188  IMPLICIT DOUBLE PRECISION (a-h,o-z)
4189  INTEGER DEBUG
4190 C D.H. REAL*16 GBH,GBH0
4191  dimension wp(56),wm(56),wha(4000),whb(4000),lha0(56),
4192  * lhb0(56),izp(56),izt(56),wp0h(56),wm0h(56),
4193  * wpp(2),wmm(2),ep3(4),lqa0(56),lqb0(56),ipc(2,2),epc(8,2),
4194  * ila(56),ilb(56),ela(4,56),elb(4,56),ep(4),ep1(4)
4195  COMMON /area1/ ia(2),icz,icp
4196  COMMON /area2/ s,y0,wp0,wm0
4197  COMMON /area9/ lqa(56),lqb(56),nqs(1000),ias(1000),ibs(1000),
4198  * lha(56),lhb(56),zh(4000),iah(4000),ibh(4000),
4199  * iqh(4000),lva(56),lvb(56)
4200  COMMON /area10/ stmass,am(7)
4201  COMMON /area11/ b10
4202  COMMON /area12/ nsh
4203  COMMON /area17/ del,rs,rs0,fs,alfp,rr,sh,delh
4204  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
4205  COMMON /area19/ ahl(5)
4206  COMMON /area20/ wppp
4207  COMMON /area25/ ahv(5)
4208  COMMON /area43/ moniou
4209  COMMON /debug/ debug
4210  COMMON /area47/ njtot
4211  SAVE
4212  EXTERNAL qsran
4213  DATA xdiv /100.d0/
4214 
4215  IF(debug.GE.1)WRITE (moniou,201)nw,nt,nhp,ls
4216 201 FORMAT(2x,'PSSHARE - ENERGY SHARING PROCEDURE'/
4217  * 4x,'NUMBER OF WOUNDED PROJECTILE NUCLEONS(HADRONS) NW=',i2/
4218  * 4x,'NUMBER OF TARGET NUCLEONS IN THE ACTIVE STATE NT=',i2/
4219  * 4x,'NUMBER OF SEMIHARD BLOCKS NHP=',i3/
4220  * 4x,'NUMBER OF SOFT POMERON BLOCKS LS=',i3)
4221  nsh1=nsh
4222  DO 101 i=1,nw
4223 101 lqa0(i)=lqa(i)
4224  DO 102 i=1,nt
4225 102 lqb0(i)=lqb(i)
4226 
4227 100 nsh=nsh1
4228  njtot=0
4229  DO 103 i=1,nw
4230 103 lqa(i)=lqa0(i)
4231  DO 104 i=1,nt
4232 104 lqb(i)=lqb0(i)
4233 c-------------------------------------------------
4234 c Initial nucleons (hadrons) types recording
4235  IF(ia(1).NE.1)THEN
4236 c IZP(i) - i-th projectile nucleons type (proton - 2, neutron - 3)
4237  DO 1 i=1,nw
4238 1 izp(i)=int(2.5+qsran(b10))
4239  ELSE
4240 c IZP(1)=ICP - projectile hadron type
4241  izp(1)=icp
4242  ENDIF
4243  IF(ia(2).NE.1)THEN
4244 c IZT(j) - j-th target nucleon type (proton - 2 or neutron - 3)
4245  DO 2 i=1,nt
4246 2 izt(i)=int(2.5+qsran(b10))
4247  ELSE
4248 c Target proton
4249  izt(1)=2
4250  ENDIF
4251 c-------------------------------------------------
4252 
4253 c WREJ - parameter for energy sharing (to minimise rejection)
4254  wrej=.0001d0
4255 
4256 3 CONTINUE
4257 
4258  IF(nhp.NE.0)THEN
4259  IF(debug.GE.3)WRITE (moniou,211)nhp
4260 211 FORMAT(2x,'PSSHARE: NUMBER OF HARD POMERONS NHP=',i3)
4261 c-------------------------------------------------
4262 c-------------------------------------------------
4263 c Rejection function initialization:
4264 c-------------------------------------------------
4265 c energy-momentum will be shared between pomerons
4266 c according to s**DEL dependence for soft pomeron and
4267 c according to s**DELH dependence for pomeron with hard block,
4268 c then rejection is used according to real Sigma_hard(s) dependence.
4269 c Rejection is expected to be minimal for the uniform energy
4270 c distribution between pomerons ( s_hard = s / LHA(I) / LHB(J) )
4271  gbh0=.6d0
4272 c NREJ - total number of rejections
4273  nrej=0
4274  nhp1=nhp
4275 
4276  DO 5 ih=1,nhp1
4277  IF(debug.GE.3)WRITE (moniou,212)ih
4278 212 FORMAT(2x,'PSSHARE: GBH-INI; CONTRIBUTION FROM ',i3,
4279  * '-TH HARD POMERON')
4280 c-------------------------------------------------
4281 c LHA(i) (LHB(j)) - total number of cut hard blocks, connected to i-th projectile
4282 c (j-th target) nucleon (hadron);
4283 c IAH(ih) (IBH(ih)) - number (position in array) of the projectile (target) nucleon,
4284 c connected to ih-th hard block;
4285 c ZH(ih) - factor exp(-R_ij/R_p) for ih-th hard block;
4286 c IQH(ih) - type of the hard interaction: 0 - gg, 1 - qg, 2 - gq, 3 - qq
4287  iqq=iqh(ih)
4288  z=zh(ih)
4289  i=iah(ih)
4290  j=ibh(ih)
4291 
4292 c Uniform energy distribution between hard pomerons
4293  za=1.d0/lha(i)
4294  zb=1.d0/lhb(j)
4295 c SI - c.m. energy squared for one hard block
4296  si=za*zb*s
4297 
4298  IF(si.LT.4.d0*(qt0+amj0))THEN
4299 c-------------------------------------------------
4300 c One hard pomeron is removed (the energy is insufficient to simulate
4301 c great number of pomerons)
4302 c-------------------------------------------------
4303  nhp=nhp-1
4304  lha(i)=lha(i)-1
4305  lhb(j)=lhb(j)-1
4306 
4307  IF(iqq.EQ.1)THEN
4308  lva(i)=0
4309  ELSEIF(iqq.EQ.2)THEN
4310  lvb(j)=0
4311  ELSEIF(iqq.EQ.3)THEN
4312  lva(i)=0
4313  lvb(j)=0
4314  ENDIF
4315 c Rewriting of other hard pomerons characteristics
4316  IF(nhp.GE.ih)THEN
4317  DO 4 ih1=ih,nhp
4318  iqh(ih1)=iqh(ih1+1)
4319  zh(ih1)=zh(ih1+1)
4320  iah(ih1)=iah(ih1+1)
4321 4 ibh(ih1)=ibh(ih1+1)
4322  ENDIF
4323 c End of removing - event will be simulated from the very beginning
4324 c-------------------------------------------------
4325  GOTO 3
4326  ENDIF
4327 
4328 c Total rapidity for the interaction (for one hard block)
4329  yi=dlog(si)
4330  IF(yi.GT.17.d0)yi=17.d0
4331 c Rejection function normalization (on maximal available energy)
4332  gbh0=gbh0/psrjint(yi,z,iqq)
4333  gbh0 = gbh0/xdiv
4334 5 CONTINUE
4335  IF(debug.GE.3)WRITE (moniou,213)
4336 213 FORMAT(2x,'PSSHARE: GBH-INI - END')
4337 c-------------------------------------------------
4338 c End of rejection function normalization
4339 c-------------------------------------------------
4340 
4341 c-------------------------------------------------
4342 c LHA0(i), LHB0(j) arrays are used for energy sharing procedure
4343 c (they define number of remained cut hard blocks connected to given nucleon from
4344 c projectile or target respectively);
4345 c WP, WM - arrays for the rest of light cone momenta (E+-P_l) for those
4346 c nucleons (hadrons)
4347 c Hard pomerons connected to valence quarks are excluded from LHA0(i), LHB0(j)
4348 c (to be considered separetely)
4349 6 DO 7 i=1,nw
4350  lha0(i)=lha(i)-lva(i)
4351 7 wp(i)=wp0
4352 
4353  DO 8 i=1,nt
4354  lhb0(i)=lhb(i)-lvb(i)
4355 8 wm(i)=wm0
4356 
4357 c-------------------------------------------------
4358 c Projectile valence quarks light cone momenta are choosen according to
4359 c 1/sqrt(x) * x**delh * (1-x)**AHV(ICZ), ICZ is the type of the projectile
4360  DO 10 i=1,nw
4361  IF(lva(i).NE.0)THEN
4362 9 xw=qsran(b10)**(1.d0/(.5d0+delh))
4363  IF(qsran(b10).GT.(1.d0-xw)**ahv(icz))GOTO 9
4364  IF(debug.GE.3)WRITE (moniou,214)i,xw
4365 214 FORMAT(2x,'PSSHARE: ',i2,'-TH PROJ. NUCLEON (HADRON); LIGHT',
4366  * ' CONE MOMENTUM SHARE XW=',e10.3)
4367 c WP0H(i) - valence quark light cone momentum for i-th projectile nucleon
4368  wp0h(i)=xw*wp(i)
4369 c WP(i) - the remainder of the light cone momentum for i-th projectile nucleon
4370  wp(i)=wp(i)*(1.d0-xw)
4371  ENDIF
4372 10 CONTINUE
4373 
4374 c Target valence quarks light cone momenta are choosen according to
4375 c 1/sqrt(x) * x**delh * (1-x)**AHV(2) (target nucleon)
4376  DO 12 i=1,nt
4377  IF(lvb(i).NE.0)THEN
4378 11 xw=qsran(b10)**(1.d0/(.5d0+delh))
4379  IF(qsran(b10).GT.(1.d0-xw)**ahv(2))GOTO 11
4380  IF(debug.GE.3)WRITE (moniou,215)i,xw
4381 215 FORMAT(2x,'PSSHARE: ',i2,'-TH TARGET NUCLEON (HADRON); LIGHT',
4382  * ' CONE MOMENTUM SHARE XW=',e10.3)
4383 c WM0H(i) - valence quark light cone momentum for i-th target nucleon
4384  wm0h(i)=xw*wm(i)
4385 c WM(i) - the remainder of the light cone momentum for i-th target nucleon
4386  wm(i)=wm(i)*(1.d0-xw)
4387  ENDIF
4388 12 CONTINUE
4389 c-------------------------------------------------
4390 
4391  gbh=gbh0
4392 c-------------------------------------------------
4393 c Cycle over all cut hard blocks
4394 c-------------------------------------------------
4395  DO 18 ih=1,nhp1
4396 c-------------------------------------------------
4397 c IAH(ih) (IBH(ih)) - number (position in array) of the projectile (target) nucleon,
4398 c connected to ih-th hard block;
4399 c ZH(ih) - factor exp(-R_ij/R_p) for ih-th hard block;
4400 c IQH(ih) - type of the hard interaction: 0 - gg, 1 - qg, 2 - gq, 3 - qq
4401  iqq=iqh(ih)
4402  z=zh(ih)
4403  i=iah(ih)
4404  j=ibh(ih)
4405 
4406  IF((iqq-3)*(iqq-1).EQ.0)THEN
4407 c WHA(ih) - light cone momentum (E+P_l) for ih-th hard block
4408 c Read out of the valence quark light cone momentum
4409  wha(ih)=wp0h(i)
4410  ELSE
4411 c LHA0(i) - number of remained cut hard blocks connected to i-th projectile nucleon
4412  lha0(i)=lha0(i)-1
4413 c Energy is shared between pomerons according to s**DEL dependence for soft
4414 c pomeron and according to s**DELH dependence for the hard block;
4415 c AHL(ICZ) determines energetic spectrum of the leading hadronic state of
4416 c type ICZ
4417  bpi=1.d0/(1.d0+ahl(icz)+
4418  * (1.d0+delh)*lha0(i))
4419 c BPI=1.D0/(1.D0+AHL(ICZ)+(1.D0+DEL)*LQA(I)+
4420 c * (1.D0+DELH)*LHA0(I))
4421 15 xw=1.-qsran(b10)**bpi
4422 c Rejection according to XW**DELH
4423  IF(qsran(b10).GT.xw**delh)GOTO 15
4424 c WHA(ih) - light cone momentum (E+P_l) for ih-th hard block
4425  wha(ih)=wp(i)*xw
4426 c WP(i) - the remainder of the light cone momentum for i-th projectile nucleon
4427  wp(i)=wp(i)*(1.d0-xw)
4428  ENDIF
4429 
4430  IF((iqq-3)*(iqq-2).EQ.0)THEN
4431 c WHB(ih) - light cone momentum (E-P_l) for ih-th hard block
4432 c Read out of the valence quark light cone momentum
4433  whb(ih)=wm0h(j)
4434  ELSE
4435 c Energy is shared between pomerons - in the same way as above
4436  lhb0(j)=lhb0(j)-1
4437  bpi=1.d0/(1.d0+ahl(2)+(1.d0+delh)
4438  * *lhb0(j))
4439 c BPI=1.D0/(1.D0+AHL(2)+(1.D0+DEL)*LQB(J)+(1.D0+DELH)
4440 c * *LHB0(J))
4441 16 xw=1.-qsran(b10)**bpi
4442  IF(qsran(b10).GT.xw**delh)GOTO 16
4443 c WHB(ih) - light cone momentum (E-P_l) for ih-th hard block
4444  whb(ih)=wm(j)*xw
4445 c WM(j) - the remainder of the light cone momentum for j-th target nucleon
4446  wm(j)=wm(j)*(1.d0-xw)
4447  ENDIF
4448 
4449 c Invariant mass for ih-th hard block
4450  sw=wha(ih)*whb(ih)
4451  IF(sw.LT.4.d0*(qt0+amj0))THEN
4452 c Rejection in case of insufficient mass
4453  nrej=nrej+1
4454 
4455  IF(nrej.GT.30)THEN
4456 c-------------------------------------------------
4457 c In case of great number of rejections number of hard blocks is put down
4458 c-------------------------------------------------
4459 c Number of remained hard blocks
4460  nhp=nhp-1
4461  lha(i)=lha(i)-1
4462  lhb(j)=lhb(j)-1
4463 
4464  IF(iqq.EQ.1)THEN
4465  lva(i)=0
4466  ELSEIF(iqq.EQ.2)THEN
4467  lvb(j)=0
4468  ELSEIF(iqq.EQ.3)THEN
4469  lva(i)=0
4470  lvb(j)=0
4471  ENDIF
4472 
4473  IF(nhp.GE.ih)THEN
4474  DO 17 ih1=ih,nhp
4475  iqh(ih1)=iqh(ih1+1)
4476  zh(ih1)=zh(ih1+1)
4477  iah(ih1)=iah(ih1+1)
4478 17 ibh(ih1)=ibh(ih1+1)
4479  ENDIF
4480  GOTO 3
4481 c-------------------------------------------------
4482 c End of removing - event will be simulated from the very beginning
4483 c-------------------------------------------------
4484 
4485  ELSE
4486  GOTO 6
4487  ENDIF
4488  ENDIF
4489  IF(debug.GE.3)WRITE (moniou,216)ih,wha(ih),whb(ih),wp(i),wm(j)
4490 216 FORMAT(2x,'PSSHARE: ',i3,'-TH SEMIHARD BLOCK; LIGHT',
4491  * ' CONE MOMENTA SHARES:',2e10.3/
4492  * 4x,'REMAINED LIGHT CONE MOMENTA:',2e10.3)
4493 
4494  yh=dlog(sw)
4495 c PSRINT(YH,Z,IQQ) - phi_hard(s_hard) / s_hard ** DELH;
4496 c YH = ln s_hard;
4497 c Z - factor exp(-R_ij/R_p) for the hard block;
4498 c IQQ - type of the hard interaction: 0 - gg, 1 - qg, 2 - gq, 3 - qq
4499 c Rejection function is multiplied by PSRINT(YH,Z,IQQ) for the ih-th block
4500  gbh=gbh*psrjint(yh,z,iqq)
4501  gbh = gbh * xdiv
4502 18 CONTINUE
4503 c End of the loop for rejection function determination
4504 c-------------------------------------------------
4505 
4506 c-------------------------------------------------
4507 c Rejection procedure (due to the deviation of the phi_hard(s_hard)
4508 c dependence from pure powerlike s_hard ** DELH law)
4509  IF(debug.GE.2)WRITE (moniou,217)1.d0-gbh,nhp
4510 217 FORMAT(2x,'PSSHARE: REJECTION PROBABILITY:',e10.3,
4511  * 2x,'NUMBER OF SEMIHARD BLOCKS:',i3)
4512  IF(qsran(b10).GT.gbh)THEN
4513  nrej=nrej+1
4514 
4515  IF(nrej.GT.30)THEN
4516  IF(debug.GE.2)WRITE (moniou,218)
4517 218 FORMAT(2x,'PSSHARE: MORE THAN 30 REJECTIONS - HARD POMERON',
4518  * ' NUMBER IS PUT DOWN')
4519 c-------------------------------------------------
4520 c In case of great number of rejections number of hard blocks is put down
4521 c LNH - number of hard blocks to be removed
4522 c-------------------------------------------------
4523  lnh=1+nhp/20
4524  DO 19 ihp=nhp-lnh+1,nhp
4525  iih=iah(ihp)
4526  jih=ibh(ihp)
4527  iqq=iqh(ihp)
4528 
4529  IF(iqq.EQ.1)THEN
4530  lva(iih)=0
4531  ELSEIF(iqq.EQ.2)THEN
4532  lvb(jih)=0
4533  ELSEIF(iqq.EQ.3)THEN
4534  lva(iih)=0
4535  lvb(jih)=0
4536  ENDIF
4537 
4538  lha(iih)=lha(iih)-1
4539 19 lhb(jih)=lhb(jih)-1
4540 
4541  nhp=nhp-lnh
4542  GOTO 3
4543 c-------------------------------------------------
4544 c End of removing - event will be simulated from the very beginning
4545 c-------------------------------------------------
4546  ELSE
4547  GOTO 6
4548  ENDIF
4549  ENDIF
4550 
4551 ***********************************************************************
4552  DO 31 i=1,nw
4553 31 lha0(i)=lha(i)
4554  DO 32 i=1,nt
4555 32 lhb0(i)=lhb(i)
4556 ***********************************************************************
4557 
4558 c-------------------------------------------------
4559 c Particle production for all cut pomerons with hard blocks
4560 c-------------------------------------------------
4561  DO 20 ih=1,nhp
4562  iqq=iqh(ih)
4563  z=zh(ih)
4564  i=iah(ih)
4565  j=ibh(ih)
4566 ***********************************************************************
4567  lha0(i)=lha0(i)-1
4568  lhb0(j)=lhb0(j)-1
4569 ***********************************************************************
4570 c WPI, WMI - light cone momenta for current (ih-th) hard pomeron
4571  wpi=wha(ih)
4572  wmi=whb(ih)
4573  IF(debug.GE.2)WRITE (moniou,219)ih,iqq,wpi,wmi,wp(i),wm(j)
4574 219 FORMAT(2x,'PSSHARE: ',i3,
4575  * '-TH HARD BLOCK; TYPE OF THE INTERACTION:',i1/
4576  * 4x,'INITIAL LIGHT CONE MOMENTA:',2e10.3/
4577  * 4x,'REMAINED LIGHT CONE MOMENTA:',2e10.3)
4578 c-------------------------------------------------
4579 c PSHOT procedure is used for hard partonic interaction -
4580 c initial jets simulation
4581  CALL pshot(wpi,wmi,z,ipc,epc,izp(i),izt(j),icz,iqq)
4582  IF(iqq.EQ.1.OR.iqq.EQ.3)THEN
4583  IF((iabs(izp(i)).GT.5.OR.iabs(izp(i)).EQ.3).AND.
4584  * izp(i).GT.0.OR.iabs(izp(i)).NE.3.AND.
4585  * iabs(izp(i)).LE.5.AND.izp(i).LT.0)THEN
4586  jq=1
4587  ELSE
4588  jq=2
4589  ENDIF
4590  ila(i)=ipc(jq,1)
4591  DO 330 l=1,4
4592 330 ela(l,i)=epc(l+4*(jq-1),1)
4593  ENDIF
4594  IF(iqq.EQ.2.OR.iqq.EQ.3)THEN
4595  IF((iabs(izt(j)).GT.5.OR.iabs(izt(j)).EQ.3).AND.
4596  * izt(j).GT.0.OR.iabs(izt(j)).NE.3.AND.
4597  * iabs(izt(j)).LE.5.AND.izt(j).LT.0)THEN
4598  jq=1
4599  ELSE
4600  jq=2
4601  ENDIF
4602  ilb(j)=ipc(jq,2)
4603  DO 331 l=1,4
4604 331 elb(l,j)=epc(l+4*(jq-1),2)
4605  ENDIF
4606  IF(iqq.EQ.3.AND.ila(i)+ilb(j).EQ.0)nias=j
4607 c-------------------------------------------------
4608 c SW=WP(I)*WM(J)
4609 c IF(WP(I).LT.0.D0.OR.WM(J).LT.0.D0.OR.
4610 c * SW.LT.(AM(ICZ)+AM(2))**2)THEN
4611 c NREJ=NREJ+1
4612 c write (*,*)'i,j,WP(I),WM(J),sw',i,j,WP(I),WM(J),sw
4613 c GOTO 100
4614 c ENDIF
4615 
4616 c Leading hadronic state fragmentation is treated in the same way as low mass
4617 c diffraction (exhitation mass is determined by secodary reggeon intercept
4618 c dM**2~M**(-3))
4619  IF(lqa(i)+lha0(i).EQ.0.AND.lqb(j)+lhb0(j).EQ.0)THEN
4620  IF(lva(i).EQ.0.AND.lvb(j).EQ.0)THEN
4621  CALL xxddfr(wp(i),wm(j),izp(i),izt(j))
4622  ELSEIF(lva(i).EQ.0)THEN
4623  CALL xxdpr(wp(i),wm(j),izp(i),izt(j),1)
4624  IF(ilb(j).NE.0)THEN
4625  DO 341 l=1,4
4626 341 ep1(l)=elb(l,j)
4627  ep(1)=.5d0*wm(j)
4628  ep(2)=-ep(1)
4629  ep(3)=0.d0
4630  ep(4)=0.d0
4631  ipj1=ilb(j)
4632  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4633  CALL psjdef(izt(j),ipj1,ep,ep1,jfl)
4634  IF(jfl.EQ.0)GOTO 100
4635  ENDIF
4636  ELSEIF(lvb(j).EQ.0)THEN
4637  CALL xxdtg(wp(i),wm(j),izp(i),izt(j),1)
4638  IF(ila(i).NE.0)THEN
4639  DO 342 l=1,4
4640 342 ep1(l)=ela(l,i)
4641  ep(1)=.5d0*wp(i)
4642  ep(2)=ep(1)
4643  ep(3)=0.d0
4644  ep(4)=0.d0
4645  ipj1=ila(i)
4646  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4647  CALL psjdef(izp(i),ipj1,ep,ep1,jfl)
4648  IF(jfl.EQ.0)GOTO 100
4649  ENDIF
4650  ELSE
4651  IF(ila(i).NE.0)THEN
4652  DO 343 l=1,4
4653 343 ep1(l)=ela(l,i)
4654  ep(1)=.5d0*wp(i)
4655  ep(2)=ep(1)
4656  ep(3)=0.d0
4657  ep(4)=0.d0
4658  ipj1=ila(i)
4659  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4660  CALL psjdef(izp(i),ipj1,ep,ep1,jfl)
4661  IF(jfl.EQ.0)GOTO 100
4662  ENDIF
4663  IF(ilb(j).NE.0)THEN
4664  DO 351 l=1,4
4665 351 ep1(l)=elb(l,j)
4666  ep(1)=.5d0*wm(j)
4667  ep(2)=-ep(1)
4668  ep(3)=0.d0
4669  ep(4)=0.d0
4670  ipj1=ilb(j)
4671  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4672  CALL psjdef(izt(j),ipj1,ep,ep1,jfl)
4673  IF(jfl.EQ.0)GOTO 100
4674  ENDIF
4675  ENDIF
4676  ELSEIF(lqa(i)+lha0(i).EQ.0)THEN
4677  IF(lva(i).EQ.0)THEN
4678  CALL xxdpr(wp(i),wm(j),izp(i),izt(j),lqb(j)+lhb0(j))
4679  ELSE
4680  IF(ila(i).NE.0)THEN
4681  DO 344 l=1,4
4682 344 ep1(l)=ela(l,i)
4683  ep(1)=.5d0*wp(i)
4684  ep(2)=ep(1)
4685  ep(3)=0.d0
4686  ep(4)=0.d0
4687  ipj1=ila(i)
4688  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4689  CALL psjdef(izp(i),ipj1,ep,ep1,jfl)
4690  IF(jfl.EQ.0)GOTO 100
4691  ENDIF
4692  ENDIF
4693  ELSEIF(lqb(j)+lhb0(j).EQ.0)THEN
4694  IF(lvb(j).EQ.0)THEN
4695  CALL xxdtg(wp(i),wm(j),izp(i),izt(j),lqa(i)+lha0(i))
4696  ELSE
4697  IF(ilb(j).NE.0)THEN
4698  DO 345 l=1,4
4699 345 ep1(l)=elb(l,j)
4700  ep(1)=.5d0*wm(j)
4701  ep(2)=-ep(1)
4702  ep(3)=0.d0
4703  ep(4)=0.d0
4704  ipj1=ilb(j)
4705  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4706  CALL psjdef(izt(j),ipj1,ep,ep1,jfl)
4707  IF(jfl.EQ.0)GOTO 100
4708  ENDIF
4709  ENDIF
4710  ENDIF
4711 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4712 20 CONTINUE
4713 c-------------------------------------------------
4714 c End of the hard blocks loop
4715 c-------------------------------------------------
4716 
4717  ELSE
4718 c-------------------------------------------------
4719 c Initial light cone momenta initialization in case of no one cut hard block
4720  DO 21 i=1,nw
4721 21 wp(i)=wp0
4722  DO 22 i=1,nt
4723 22 wm(i)=wm0
4724  ENDIF
4725 
4726  IF(ls.NE.0)THEN
4727 c-------------------------------------------------
4728 c The loop for all cut froissarons (blocks of soft pomerons)
4729 c-------------------------------------------------
4730  DO 28 is=1,ls
4731 c NP=NQS(is) - number of cut pomerons in is-th block;
4732 c IAS(is) (IBS(is)) - number (position in array) of the projectile (target) nucleon,
4733 c connected to is-th block of soft pomerons;
4734 c LQA(i) (LQB(j)) - total number of cut soft pomerons, connected to i-th projectile
4735 c (j-th target) nucleon (hadron);
4736 c WP(i) (WM(j)) - the remainder of the light cone momentum for i-th projectile
4737 c (j-th target) nucleon (hadron);
4738 c NP=NQS(is) - number of cut pomerons in is-th block;
4739 c LQ1, LQ2 define the numbers of the remained cut pomerons connected
4740 c to given nucleons (hadrons)
4741  i=ias(is)
4742  j=ibs(is)
4743  lq1=lqa(i)
4744  lq2=lqb(j)
4745  wpn=wp(i)
4746  wmn=wm(j)
4747  np=nqs(is)
4748  IF(debug.GE.3)WRITE (moniou,222)is,i,j,np
4749 222 FORMAT(2x,'PSSHARE: ',i3,'-TH SOFT POMERON BLOCK IS',
4750  * ' CONNECTED TO ',i2,
4751  * '-TH PROJECTILE NUCLEON'/4x,'(HADRON) AND ',i2,
4752  * '-TH TARGET NUCLEON'/
4753  * 4x,'NUMBER OF CUT SOFT POMERONS IN THE BLOCK:',i2)
4754 c-------------------------------------------------
4755 c The loop for all cut pomerons in the block
4756  DO 27 ip=1,np
4757 
4758 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4759 c High mass diffraction - probability WPPP
4760 14 jpp=0
4761 cdh IF(LQ1.EQ.1.AND.WPN.EQ.WP0.AND.QSRAN(B10).LT.WPPP)THEN
4762  IF(lq1.EQ.1.AND.wpn.EQ.wp0.AND.qsran(b10).LT.wppp
4763  * .AND.lvb(j).EQ.0)THEN !!!!!!!!!!!!!!!!!!so-07.03.99
4764 c In case of only one cut soft pomeron high mass diffraction is simulated with the
4765 c probability WPPP/2 or triple pomeron contribution - also WPPP/2 to have AGK cancell.
4766 c - only for projectile hadron (nucleons) (for target - neglected)
4767 c YW is the branching point position (in rapidity)
4768  yw=1.d0+qsran(b10)*(y0-2.d0)
4769  IF(debug.GE.3)WRITE (moniou,223)yw
4770 223 FORMAT(2x,'PSSHARE: TRIPLE POMERON CONTRIBUTION YW=',e10.3)
4771 c Light cone momentum (E+P_l) for the diffractive state (which is just usual cut
4772 c pomeron)
4773  xpw=exp(-yw)
4774  jpp=1
4775 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4776 
4777  ELSE
4778  lq1=lq1-1
4779 c Energy-momentum is shared between pomerons according to s**DEL dependence for soft
4780 c pomeron; AHL(ICZ) determines energy spectrum of leading hadronic
4781 c state of type ICZ
4782  bpi=1.d0/(1.d0+ahl(icz)+(1.d0+del)*lq1)
4783 23 xpw=1.-qsran(b10)**bpi
4784 c Rejection according to XW**DEL
4785  IF(qsran(b10).GT.xpw**del)GOTO 23
4786  ENDIF
4787 
4788  lq2=lq2-1
4789 c Energy-momentum is shared between pomerons according to s**DEL dependence for soft
4790 c pomeron - similar to projectile case
4791  bpi=1.d0/(1.d0+ahl(2)+(1.d0+del)*lq2)
4792 24 xmw=1.-qsran(b10)**bpi
4793 c Rejection according to XW**DEL
4794  IF(qsran(b10).GT.xmw**del)GOTO 24
4795 c-------------------------------------------------
4796 
4797 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4798 c High mass diffraction is rejected in case of insufficient energy
4799  IF(jpp.EQ.1.AND.xpw*xmw*wpn*wmn.LT.2.72d0)THEN
4800  lq2=lq2+1
4801  GOTO 14
4802  ENDIF
4803 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4804 
4805 c WPI is the light cone momentum (E+P_l) for the pomeron;
4806 c WPN is the remainder of the light cone momentum for given nucleon (hadron)
4807  wpi=wpn*xpw
4808  wpn=wpn-wpi
4809  wmi=wmn*xmw
4810  wmn=wmn-wmi
4811 
4812 ************************************************************************
4813 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4814  IF(lq1.EQ.0.AND.lva(i).EQ.0)THEN
4815  CALL ixxdef(izp(i),ic11,ic12,icz)
4816  ELSE
4817  ic11=0
4818  ic12=0
4819  ENDIF
4820  IF(lq2.EQ.0.AND.lvb(j).EQ.0)THEN
4821  CALL ixxdef(izt(j),ic21,ic22,2)
4822  ELSE
4823  ic21=0
4824  ic22=0
4825  ENDIF
4826 
4827 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4828 c Fragmentation process for the pomeron ( quarks and antiquarks types at the
4829 c ends of the two strings are determined, energy-momentum is shared
4830 c between them and strings fragmentation is simulated )
4831  IF(debug.GE.3)WRITE (moniou,224)ip,wpi,wmi
4832 224 FORMAT(2x,'PSSHARE: ',i2,'-TH SOFT POMERON IN THE BLOCK'/
4833  * 4x,'LIGHT CONE MOMENTA FOR THE POMERON:',2e10.3)
4834  CALL xxstr(wpi,wmi,wpn,wmn,ic11,ic12,ic22,ic21)
4835 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4836 
4837 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4838 c Triple pomeron contribution simulation
4839  IF(jpp.EQ.1)THEN
4840  IF(qsran(b10).LT..5d0)THEN
4841  sw=wpn*wmn
4842  IF(wpn.LT.0.d0.OR.wmn.LT.0.d0.OR.
4843  * sw.LT.(am(icz)+am(2))**2)THEN
4844 cdh
4845  if (debug.ge.1)
4846  * write (*,*)'difr,i,j,WPn,WMn,sw,lq1,lq2',
4847  * i,j,wpn,wmn,sw,lq1,lq2
4848  nrej=nrej+1
4849  GOTO 100
4850  ENDIF
4851  typevt=3 !high mass diffraction
4852 
4853  IF(lq2.EQ.0)THEN
4854  CALL xxdtg(wpn,wmn,izp(i),izt(j),0)
4855  ELSE
4856  wp1=wpn
4857  wm1=am(icz)**2/wp1
4858  ep3(1)=.5d0*(wp1+wm1)
4859  ep3(2)=.5d0*(wp1-wm1)
4860  ep3(3)=0.d0
4861  ep3(4)=0.d0
4862  CALL xxreg(ep3,izp(i))
4863  wmn=wmn-wm1
4864  wpn=0.d0
4865  ENDIF
4866  GOTO 30
4867  ELSE
4868 
4869 c Triple pomeron contribution simulation (both pomerons are cut)
4870  IF(debug.GE.3)WRITE (moniou,225)
4871 225 FORMAT(2x,'PSSHARE: TRIPLE POMERON CONRITRIBUTION WITH 3 CUT',
4872  *' POMERONS')
4873  wmm(1)=1.d0/wpi
4874  wmn=wmn-wmm(1)
4875 c Light cone momentum (E-P_l) sharing for the two pomerons
4876  wmm(2)=wmm(1)*qsran(b10)
4877  wmm(1)=wmm(1)-wmm(2)
4878  lq1=2
4879  DO 26 l=1,2
4880  lq1=lq1-1
4881 c Light cone momentum (E+P_l) sharing for the two pomerons
4882  bpi=(1.d0+del)*lq1+1.d0+ahl(icz)
4883  bpi=1.d0/bpi
4884 25 xpw=1.-qsran(b10)**bpi
4885  IF(qsran(b10).GT.xpw**del)GOTO 25
4886  wpp(l)=wpn*xpw
4887  wpn=wpn*(1.d0-xpw)
4888 c Fragmentation process for the pomerons
4889 26 CALL xxstr(wpp(l),wmm(l),wpn,wmn,0,0,0,0)
4890  sw=wpn*wmn
4891  IF(wpn.LT.0.d0.OR.wmn.LT.0.d0.OR.
4892  * sw.LT.(am(icz)+am(2))**2)THEN
4893  nrej=nrej+1
4894  GOTO 100
4895  ENDIF
4896  ENDIF
4897  ENDIF
4898 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4899 27 CONTINUE
4900 c End of the pomeron loop
4901 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
4902 c SW=WPN*WMN
4903 c IF(WPN.LT.0.D0.OR.WMN.LT.0.D0.OR.
4904 c * SW.LT.(AM(ICZ)+AM(2))**2)THEN
4905 c NREJ=NREJ+1
4906 c GOTO 100
4907 c ENDIF
4908 
4909 c Leading hadronic state fragmentation is treated in the same way as low mass
4910 c diffraction (exhitation mass is determined by secodary reggeon intercept
4911 c dM**2~M**(-3))
4912  IF(lq1.EQ.0.AND.lq2.EQ.0)THEN
4913  IF(lva(i).EQ.0.AND.lvb(j).EQ.0)THEN
4914  CALL xxddfr(wpn,wmn,izp(i),izt(j))
4915  ELSEIF(lva(i).EQ.0)THEN
4916  CALL xxdpr(wpn,wmn,izp(i),izt(j),1)
4917  IF(ilb(j).NE.0)THEN
4918  DO 346 l=1,4
4919 346 ep1(l)=elb(l,j)
4920  ep(1)=.5d0*wmn
4921  ep(2)=-ep(1)
4922  ep(3)=0.d0
4923  ep(4)=0.d0
4924  ipj1=ilb(j)
4925  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4926  CALL psjdef(izt(j),ipj1,ep,ep1,jfl)
4927  IF(jfl.EQ.0)GOTO 100
4928  ENDIF
4929  ELSEIF(lvb(j).EQ.0)THEN
4930  CALL xxdtg(wpn,wmn,izp(i),izt(j),1)
4931  IF(ila(i).NE.0)THEN
4932  DO 347 l=1,4
4933 347 ep1(l)=ela(l,i)
4934  ep(1)=.5d0*wpn
4935  ep(2)=ep(1)
4936  ep(3)=0.d0
4937  ep(4)=0.d0
4938  ipj1=ila(i)
4939  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4940  CALL psjdef(izp(i),ipj1,ep,ep1,jfl)
4941  IF(jfl.EQ.0)GOTO 100
4942  ENDIF
4943  ELSE
4944  IF(ila(i).NE.0)THEN
4945  DO 348 l=1,4
4946 348 ep1(l)=ela(l,i)
4947  ep(1)=.5d0*wpn
4948  ep(2)=ep(1)
4949  ep(3)=0.d0
4950  ep(4)=0.d0
4951  ipj1=ila(i)
4952  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4953  CALL psjdef(izp(i),ipj1,ep,ep1,jfl)
4954  IF(jfl.EQ.0)GOTO 100
4955  ENDIF
4956  IF(ilb(j).NE.0)THEN
4957  DO 349 l=1,4
4958 349 ep1(l)=elb(l,j)
4959  ep(1)=.5d0*wmn
4960  ep(2)=-ep(1)
4961  ep(3)=0.d0
4962  ep(4)=0.d0
4963  ipj1=ilb(j)
4964  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4965  CALL psjdef(izt(j),ipj1,ep,ep1,jfl)
4966  IF(jfl.EQ.0)GOTO 100
4967  ENDIF
4968  ENDIF
4969 
4970  ELSEIF(lq1.EQ.0)THEN
4971  IF(lva(i).EQ.0)THEN
4972  CALL xxdpr(wpn,wmn,izp(i),izt(j),lq2)
4973  ELSE
4974  IF(ila(i).NE.0)THEN
4975  DO 350 l=1,4
4976 350 ep1(l)=ela(l,i)
4977  ep(1)=.5d0*wpn
4978  ep(2)=ep(1)
4979  ep(3)=0.d0
4980  ep(4)=0.d0
4981  ipj1=ila(i)
4982  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
4983  CALL psjdef(izp(i),ipj1,ep,ep1,jfl)
4984  IF(jfl.EQ.0)GOTO 100
4985  ENDIF
4986  ENDIF
4987 
4988  ELSEIF(lq2.EQ.0)THEN
4989  IF(lvb(j).EQ.0)THEN
4990  CALL xxdtg(wpn,wmn,izp(i),izt(j),lq1)
4991  ELSE
4992  IF(ilb(j).NE.0)THEN
4993  DO 352 l=1,4
4994 352 ep1(l)=elb(l,j)
4995  ep(1)=.5d0*wmn
4996  ep(2)=-ep(1)
4997  ep(3)=0.d0
4998  ep(4)=0.d0
4999  ipj1=ilb(j)
5000  IF(iabs(ipj1).EQ.3)ipj1=ipj1*4/3
5001  CALL psjdef(izt(j),ipj1,ep,ep1,jfl)
5002  IF(jfl.EQ.0)GOTO 100
5003  ENDIF
5004  ENDIF
5005  ENDIF
5006 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5007 c-------------------------------------------------
5008 c The numbers of the remained cut pomerons connected to given nucleons (hadrons)
5009 c as well as the rest of the longitudinal momenta for these nucleons are
5010 c recorded
5011 30 lqa(i)=lq1
5012  lqb(j)=lq2
5013  wp(i)=wpn
5014 28 wm(j)=wmn
5015  ENDIF
5016 c-------------------------------------------------
5017 c End of the soft blocks loop
5018 c-------------------------------------------------
5019  IF(ia(1).EQ.1.AND.lva(1).NE.0.AND.ila(1).EQ.0)THEN
5020  ep(1)=.5d0*wp(1)
5021  ep(2)=ep(1)
5022  ep(3)=0.d0
5023  ep(4)=0.d0
5024  ep1(1)=.5d0*wm(nias)
5025  ep1(2)=-ep1(1)
5026  ep1(3)=0.d0
5027  ep1(4)=0.d0
5028  CALL psjdef(izp(1),izt(nias),ep,ep1,jfl)
5029  IF(jfl.EQ.0)GOTO 100
5030  ENDIF
5031 cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
5032  CALL xxjetsim
5033 ************************************************************************
5034  IF(debug.GE.3)WRITE (moniou,227)
5035 227 FORMAT(2x,'PSSHARE - END')
5036  RETURN
5037  END
5038 C=======================================================================
5039 
5040  SUBROUTINE pstrans(EP,EY)
5041 c Lorentz transform according to parameters EY ( determining Lorentz shift
5042 c along the Z,X,Y-axis respectively (EY(1),EY(2),EY(3)))
5043 c-----------------------------------------------------------------------
5044  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5045  INTEGER DEBUG
5046  dimension ey(3),ep(4)
5047  COMMON /area43/ moniou
5048  COMMON /debug/ debug
5049  SAVE
5050 
5051  IF(debug.GE.2)WRITE (moniou,201)ep,ey
5052 201 FORMAT(2x,'PSTRANS - LORENTZ BOOST FOR 4-VECTOR'/4x,'EP=',
5053  * 2x,4(e10.3,1x)/4x,'BOOST PARAMETERS EY=',3e10.3)
5054 c Lorentz transform to lab. system according to 1/EY(i) parameters
5055  DO 1 i=1,3
5056  IF(ey(4-i).NE.1.d0)THEN
5057  wp=(ep(1)+ep(5-i))/ey(4-i)
5058  wm=(ep(1)-ep(5-i))*ey(4-i)
5059  ep(1)=.5d0*(wp+wm)
5060  ep(5-i)=.5d0*(wp-wm)
5061  ENDIF
5062 1 CONTINUE
5063  IF(debug.GE.3)WRITE (moniou,202)ep
5064 202 FORMAT(2x,'PSTRANS: TRANSFORMED 4-VECTOR EP=',
5065  * 2x,4(e10.3,1x))
5066  RETURN
5067  END
5068 C=======================================================================
5069 
5070  SUBROUTINE pstrans1(EP,EY)
5071 c Lorentz transform according to parameters EY ( determining Lorentz shift
5072 c along the Z,X,Y-axis respectively (EY(1),EY(2),EY(3)))
5073 c-----------------------------------------------------------------------
5074  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5075  INTEGER DEBUG
5076  dimension ey(3),ep(4)
5077  COMMON /area43/ moniou
5078  COMMON /debug/ debug
5079  SAVE
5080 
5081  IF(debug.GE.2)WRITE (moniou,201)ep,ey
5082 201 FORMAT(2x,'PSTRANS1 - LORENTZ BOOST FOR 4-VECTOR'/4x,'EP=',
5083  * 2x,4(e10.3,1x)/4x,'BOOST PARAMETERS EY=',3e10.3)
5084 c Lorentz transform to lab. system according to 1/EY(i) parameters
5085  DO 2 i=1,3
5086  IF(ey(i).NE.1.d0)THEN
5087  wp=(ep(1)+ep(i+1))*ey(i)
5088  wm=(ep(1)-ep(i+1))/ey(i)
5089  ep(1)=.5d0*(wp+wm)
5090  ep(i+1)=.5d0*(wp-wm)
5091  ENDIF
5092 2 CONTINUE
5093  IF(debug.GE.3)WRITE (moniou,202)ep
5094 202 FORMAT(2x,'PSTRANS1: TRANSFORMED 4-VECTOR EP=',
5095  * 2x,4(e10.3,1x))
5096  RETURN
5097  END
5098 C=======================================================================
5099 
5100  FUNCTION psudint(QLMAX,J)
5101 c PSUDINT - timelike Sudakov formfactor interpolation
5102 c QLMAX - ln QMAX/16/QTF,
5103 c J - type of the parton (0-g,1-q)
5104 c-----------------------------------------------------------------------
5105  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5106  INTEGER DEBUG
5107  dimension wk(3)
5108  COMMON /area33/ fsud(10,2)
5109  COMMON /area43/ moniou
5110  COMMON /debug/ debug
5111  SAVE
5112 
5113  IF(debug.GE.2)WRITE (moniou,201)j,qlmax
5114 201 FORMAT(2x,'PSUDINT - SPACELIKE FORM FACTOR INTERPOLATION:'/
5115  * 4x,'PARTON TYPE J=',
5116  * i1,2x,'MOMENTUM LOGARITHM QLMAX=',e10.3)
5117  ql=qlmax/1.38629d0
5118 
5119  IF(ql.LE.0.d0)THEN
5120  psudint=1.d0
5121  ELSE
5122  k=int(ql)
5123  IF(k.GT.7)k=7
5124  wk(2)=ql-k
5125  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
5126  wk(1)=1.d0-wk(2)+wk(3)
5127  wk(2)=wk(2)-2.d0*wk(3)
5128 
5129  psudint=0.d0
5130  DO 1 k1=1,3
5131 1 psudint=psudint+fsud(k+k1,j)*wk(k1)
5132  IF(psudint.LE.0.d0)psudint=0.d0
5133  psudint=exp(-psudint)
5134  ENDIF
5135  IF(debug.GE.3)WRITE (moniou,202)psudint
5136 202 FORMAT(2x,'PSUDINT=',e10.3)
5137  RETURN
5138  END
5139 C=======================================================================
5140 
5141  FUNCTION psuds(Q,J)
5142 c PSUDS - spacelike Sudakov formfactor
5143 c Q - maximal value of the effective momentum,
5144 c J - type of parton (0 - g, 1 - q)
5145 c-----------------------------------------------------------------------
5146  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5147  INTEGER DEBUG
5148  COMMON /area6/ pi,bm,am
5149  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
5150  COMMON /area43/ moniou
5151  COMMON /debug/ debug
5152  SAVE
5153 
5154  IF(debug.GE.2)WRITE (moniou,201)j,q
5155 201 FORMAT(2x,'PSUDS - SPACELIKE FORM FACTOR: PARTON TYPE J=',
5156  * i1,2x,'MOMENTUM Q=',e10.3)
5157  IF(q.GT.qt0)THEN
5158  qlm=dlog(q/alm)
5159  psuds=(qlm*dlog(qlm/qlog)-dlog(q/qt0))/9.d0
5160 
5161  IF(j.EQ.0)THEN
5162  psuds=psuds*6.d0
5163  ELSE
5164  psuds=psuds/.375d0
5165  ENDIF
5166  psuds=exp(-psuds)
5167 
5168  ELSE
5169  psuds=1.d0
5170  ENDIF
5171  IF(debug.GE.3)WRITE (moniou,202)psuds
5172 202 FORMAT(2x,'PSUDS=',e10.3)
5173  RETURN
5174  END
5175 C=======================================================================
5176 
5177  FUNCTION psudt(QMAX,J)
5178 c PSUDT - timelike Sudakov formfactor
5179 c QMAX - maximal value of the effective momentum,
5180 c J - type of parton (0 - g, 1 - q)
5181 c-----------------------------------------------------------------------
5182  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5183  INTEGER DEBUG
5184  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
5185  common/ar3/x1(7),a1(7)
5186  COMMON /area43/ moniou
5187  COMMON /debug/ debug
5188  SAVE
5189 
5190  IF(debug.GE.2)WRITE (moniou,201)j,qmax
5191 201 FORMAT(2x,'PSUDT - TIMELIKE FORM FACTOR: PARTON TYPE J=',
5192  * i1,2x,'MOMENTUM QMAX=',e10.3)
5193  psudt=0.d0
5194  qlmax=dlog(dlog(qmax/16.d0/alm))
5195  qfl=dlog(dlog(qtf/alm))
5196 
5197 c Numerical integration over transverse momentum square;
5198 c Gaussian integration is used
5199  DO 1 i=1,7
5200  DO 1 m=1,2
5201  qtl=.5d0*(qlmax+qfl+(2*m-3)*x1(i)*(qlmax-qfl))
5202  qt=alm*exp(exp(qtl))
5203  IF(qt.GE.qmax/16.d0)qt=qmax/16.0001d0
5204  zmin=.5d0-dsqrt((.25d0-dsqrt(qt/qmax)))
5205  zmax=1.d0-zmin
5206  IF(j.EQ.0)THEN
5207 ******************************************************
5208  ap=(psapint(zmax,0,0)-psapint(zmin,0,0)+
5209  * psapint(zmax,0,1)-psapint(zmin,0,1))*.5d0
5210 ******************************************************
5211  ELSE
5212  ap=psapint(zmax,1,0)-psapint(zmin,1,0)
5213  ENDIF
5214 1 psudt=psudt+a1(i)*ap
5215  psudt=psudt*(qlmax-qfl)/9.d0
5216  IF(debug.GE.3)WRITE (moniou,202)psudt
5217 202 FORMAT(2x,'PSUDT=',e10.3)
5218  RETURN
5219  END
5220 C=======================================================================
5221 
5222  FUNCTION psv(X,Y,XB,IB)
5223 c XXV - eikonal dependent factor for hadron-nucleus interaction
5224 c (used for total and diffractive hadron-nucleus cross-sections calculation)
5225 c-----------------------------------------------------------------------
5226  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5227  INTEGER DEBUG
5228 cdh DIMENSION XB(56,3),FHARD(3)
5229  dimension xb(64,3),fhard(3)
5230  COMMON /area43/ moniou
5231  COMMON /debug/ debug
5232  SAVE
5233 
5234  IF(debug.GE.2)WRITE (moniou,201)x,y,ib
5235 201 FORMAT(2x,'PSV - EIKONAL FACTOR: NUCLEON COORDINATES X=',
5236  * e10.3,2x,'Y=',e10.3/4x,'NUMBER OF ACTIVE TARGET NUCLEONS IB='
5237  * ,i2)
5238  dv=0.d0
5239 c????????????????????????????????????????????
5240  DO 1 m=1,ib
5241  z=psdr(x-xb(m,1),y-xb(m,2))
5242  dv=dv+psfaz(z,fsoft,fhard,fshard)+fhard(1)+fhard(2)+fhard(3)
5243 1 CONTINUE
5244  psv=(1.d0-exp(-dv))**2
5245 
5246 C DH=1.D0
5247 C DO 1 M=1,IB
5248 C Z=PSDR(X-XB(M,1),Y-XB(M,2))
5249 C DV=DV+PSFAZ(Z,FSOFT,FHARD,FSHARD)
5250 C 1 DH=DH*(1.D0-FHARD(1)-FHARD(2)-FHARD(3))
5251 c????????????????????????????????????????????????
5252  IF(debug.GE.3)WRITE (moniou,202)psv
5253 202 FORMAT(2x,'PSV=',e10.3)
5254  RETURN
5255  END
5256 C=======================================================================
5257 
5258  SUBROUTINE psvdef(ICH,IC1,ICZ)
5259 c Determination of valence quark flavour -
5260 c for valence quark hard scattering
5261 c-----------------------------------------------------------------------
5262  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5263  INTEGER DEBUG
5264  COMMON /area11/ b10
5265  COMMON /area43/ moniou
5266  COMMON /debug/ debug
5267  SAVE
5268  EXTERNAL qsran
5269 
5270  IF(debug.GE.2)WRITE (moniou,201)ich,icz
5271 201 FORMAT(2x,'PSVDEF: HADRON TYPE ICH=',i2,' AUXILLIARY TYPE ICZ='
5272  * ,i1)
5273 
5274  is=iabs(ich)/ich
5275  IF(icz.EQ.1)THEN
5276  ic1=ich*(1-3*int(.5+qsran(b10)))
5277  ich=-ic1-ich
5278  ELSEIF(icz.EQ.2)THEN
5279  IF(qsran(b10).GT..33333d0.OR.ich.LT.0)THEN
5280  ic1=ich-is
5281  ich=3*is
5282  ELSE
5283  ic1=4*is-ich
5284  ich=ich+4*is
5285  ENDIF
5286  ELSEIF(icz.EQ.3)THEN
5287  ic1=ich-3*is
5288  ich=-4*is
5289  ELSEIF(icz.EQ.4)THEN
5290  ic1=ich-9*is
5291  ich=5*is
5292  ENDIF
5293  IF(debug.GE.3)WRITE (moniou,202)ic1,ich
5294 202 FORMAT(2x,'PSVDEF-END: QUARK FLAVOR IC1=',i2,
5295  * 'DIQUARK TYPE ICH=',i2)
5296  RETURN
5297  END
5298 C=======================================================================
5299 
5300  FUNCTION pszsim(QQ,J)
5301 c PSZSIM - light cone momentum share simulation (for the timelike
5302 c branching)
5303 c QQ - effective momentum value,
5304 c J - type of the parent parton (0-g,1-q)
5305 c-----------------------------------------------------------------------
5306  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5307  INTEGER DEBUG
5308  COMMON /area11/ b10
5309  COMMON /area18/ alm,qt0,qlog,qll,aqt0,qtf,bet,amj0
5310  COMMON /area43/ moniou
5311  COMMON /debug/ debug
5312  SAVE
5313  EXTERNAL qsran
5314 
5315 
5316  IF(debug.GE.2)WRITE (moniou,201)qq,j
5317 201 FORMAT(2x,'PSZSIM - Z-SHARE SIMULATION: QQ=',e10.3,2x,'J=',i1)
5318  zmin=.5d0-dsqrt(.25d0-dsqrt(qtf/qq))
5319  qlf=dlog(qtf/alm)
5320 
5321 1 CONTINUE
5322  IF(j.EQ.1)THEN
5323  pszsim=.5d0*(2.d0*zmin)**qsran(b10)
5324 ******************************************************
5325  gb=pszsim*(psfap(pszsim,0,0)+psfap(pszsim,0,1))/7.5d0
5326 ******************************************************
5327  ELSE
5328  pszsim=zmin*((1.d0-zmin)/zmin)**qsran(b10)
5329  gb=pszsim*psfap(pszsim,1,0)*.375d0
5330  ENDIF
5331  qt=qq*(pszsim*(1.d0-pszsim))**2
5332  gb=gb/dlog(qt/alm)*qlf
5333  IF(debug.GE.3)WRITE (moniou,203)qt,gb
5334 203 FORMAT(2x,'PSZSIM: QT=',e10.3,2x,'GB=',e10.3)
5335  IF(qsran(b10).GT.gb)GOTO 1
5336  IF(debug.GE.3)WRITE (moniou,202)pszsim
5337 202 FORMAT(2x,'PSZSIM=',e10.3)
5338  RETURN
5339  END
5340 C=======================================================================
5341 
5342  SUBROUTINE ixxdef(ICH,IC1,IC2,ICZ)
5343 c Determination of parton flavours in forward and backward direction -
5344 c for valence quark hard scattering
5345 c-----------------------------------------------------------------------
5346  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5347  INTEGER DEBUG
5348  COMMON /area11/ b10
5349  COMMON /area43/ moniou
5350  COMMON /debug/ debug
5351  SAVE
5352  EXTERNAL qsran
5353 
5354  IF(debug.GE.2)WRITE (moniou,201)ich,icz
5355 201 FORMAT(2x,'IXXDEF: HADRON TYPE ICH=',i2,' AUXILLIARY TYPE ICZ='
5356  * ,i1)
5357  is=iabs(ich)/ich
5358  IF(icz.EQ.1)THEN
5359  ic1=ich*(1-3*int(.5+qsran(b10)))
5360  ich1=ich*int(.5d0+qsran(b10))
5361  ic2=-ic1*iabs(ich1)-(ich+ic1)*iabs(ich-ich1)
5362 
5363  ELSEIF(icz.EQ.2)THEN
5364 c Valence quark type simulation ( for the proton )
5365  ic1=int(1.3333+qsran(b10))
5366 c Leading nucleon type simulation ( flavors combinatorics )
5367  ich1=(2-ic1)*int(qsran(b10)+.5)+2
5368 c The type of the parton at the end of the rest string ( after the
5369 c leading nucleon ejection )
5370  ic2=(3-ich1)*(2-ic1)-2
5371 
5372  IF(iabs(ich).EQ.3)THEN
5373  ic1=3-ic1
5374  ic2=-3-ic2
5375  ich1=5-ich1
5376  ENDIF
5377  IF(ich.LT.0)THEN
5378  ic1=-ic1
5379  ic2=-ic2
5380  ich1=-ich1
5381  ENDIF
5382 
5383  ELSEIF(icz.EQ.3)THEN
5384  ic1=ich-3*is
5385  ic2=-is*int(1.5+qsran(b10))
5386  ich1=3*is-ic2
5387  ELSEIF(icz.EQ.4)THEN
5388  ic1=ich-9*is
5389  ic2=is*int(1.5+qsran(b10))
5390  ich1=9*is-ic2
5391  ELSEIF(icz.EQ.5)THEN
5392  ic1=is*int(1.5+qsran(b10))
5393  ic2=-ic1
5394  ich1=ich
5395  ENDIF
5396 
5397  ich=ich1
5398  IF(debug.GE.3)WRITE (moniou,202)ic1,ic2,ich
5399 202 FORMAT(2x,'IXXDEF-END: PARTON FLAVORS IC1=',i2,' IC2=',i2,
5400  * 'NEW HADRON TYPE ICH=',i2)
5401  RETURN
5402  END
5403 C=======================================================================
5404 
5405  FUNCTION ixxson(NS,AW,G)
5406 c Poisson distribution:
5407 c AW - average value,
5408 c NS-1 - maximal allowed value,
5409 c G - random number
5410 c-----------------------------------------------------------------------
5411  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5412  INTEGER DEBUG
5413  COMMON /area43/ moniou
5414  COMMON /debug/ debug
5415  SAVE
5416 
5417  IF(debug.GE.2)WRITE (moniou,201)ns-1,aw,g
5418 201 FORMAT(2x,'IXXSON - POISSON DITR.: AVERAGE AW=',e10.3,
5419  * ' MAXIMAL VALUE NS=',i2,' RANDOM NUMBER G=',e10.3)
5420  w=exp(-aw)
5421  summ=w
5422  DO 1 i=1,ns
5423  j = i
5424  IF(g.LT.summ)GOTO 2
5425  w=w*aw/i
5426 1 summ=summ+w
5427 2 ixxson=j-1
5428  IF(debug.GE.3)WRITE (moniou,202)ixxson
5429 202 FORMAT(2x,'IXXSON=',i2)
5430  RETURN
5431  END
5432 C=======================================================================
5433 
5434  SUBROUTINE xxaini(E0N,ICP0,IAP,IAT)
5435 c Additional initialization procedure
5436 c-----------------------------------------------------------------------
5437  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5438  INTEGER DEBUG
5439 ******************************************************
5440  dimension wk(3),wa(3)
5441 ******************************************************
5442  COMMON /area1/ ia(2),icz,icp
5443  COMMON /area2/ s,y0,wp0,wm0
5444  COMMON /area4/ ey0(3)
5445  COMMON /area5/ rd(2),cr1(2),cr2(2),cr3(2)
5446  COMMON /area6/ pi,bm,am
5447  COMMON /area7/ rp1
5448  COMMON /area10/ stmass,am0,amn,amk,amc,amlamc,amlam,ameta
5449  COMMON /area15/ fp(5),rq(5),cd(5)
5450  COMMON /area17/ del,rs,rs0,fs,alfp,rr,sh,delh
5451  COMMON /area22/ sjv,fjs(5,3)
5452  COMMON /area35/ sjv0(10,5),fjs0(10,5,15)
5453  COMMON /area43/ moniou
5454 ******************************************************
5455  COMMON /area44/ gz(10,5,4),gzp(10,5,4)
5456  COMMON /area45/ gdt,gdp !so00
5457 ******************************************************
5458  COMMON /debug/ debug
5459  SAVE
5460 
5461  IF(debug.GE.1)WRITE (moniou,201)icp0,iap,iat,e0n
5462 201 FORMAT(2x,'XXAINI - MINIINITIALIZATION: PARTICLE TYPE ICP0=',
5463  * i1,2x,'PROJECTILE MASS NUMBER IAP=',i2/4x,
5464  * 'TARGET MASS NUMBER IAT=',i2,' INTERACTION ENERGY E0N=',e10.3)
5465  icp=icp0
5466  ia(1)=iap
5467  ia(2)=iat
5468 c ICZ - auxiliary type for the primary particle (1- pion, 2 - nucleon, 3 - kaon,
5469 c 4 - D-meson, 5 - Lambda_C)
5470  IF(iabs(icp).LT.6)THEN
5471  icz=iabs(icp)/2+1
5472  ELSE
5473  icz=(iabs(icp)+1)/2
5474  ENDIF
5475 
5476 c Energy dependent factors:
5477 c WP0, WM0 - initial light cone momenta for the interaction (E+-p)
5478  s=2.d0*e0n*amn
5479  wp0=dsqrt(s)
5480  wm0=wp0
5481 c Y0 - total rapidity range for the interaction
5482  y0=dlog(s)
5483 c RS - soft pomeron elastic scattering slope (lambda_ab)
5484  rs=rq(icz)+alfp*y0
5485 c RS0 - initial slope (sum of the pomeron-hadron vertices slopes squared - R_ab)
5486  rs0=rq(icz)
5487 c FS - factor for pomeron eikonal calculation (gamma_ab * s**del /lambda_ab * C_ab
5488  fs=fp(icz)*exp(y0*del)/rs*cd(icz)
5489 c RP1 - factor for the impact parameter dependence of the eikonal ( in fm^2 )
5490  rp1=rs*4.d0*.0391d0/am**2
5491 
5492  ey0(2)=1.d0
5493  ey0(3)=1.d0
5494  ey0(1)=dsqrt(amn/e0n/2.d0)
5495 
5496 c-------------------------------------------------
5497 c Nuclear radii and weights for nuclear configurations simulation - procedure GEA
5498  DO 1 i=1,2
5499 c RD(I) - Wood-Saxon density radius (fit to the data of Murthy et al.)
5500  rd(i)=0.7d0*float(ia(i))**.446/am
5501  cr1(i)=1.d0+3.d0/rd(i)+6.d0/rd(i)**2+6.d0/rd(i)**3
5502  cr2(i)=3.d0/rd(i)
5503  cr3(i)=3.d0/rd(i)+6.d0/rd(i)**2
5504  IF(ia(i).LT.10.AND.ia(i).NE.1)THEN
5505 c RD(I) - gaussian density radius (for light nucleus)
5506  rd(i)=.9d0*float(ia(i))**.3333/am
5507  IF(ia(i).EQ.2)rd(i)=3.16d0
5508 c RD -> RD * A / (A-1) - to use Van Hove simulation method - procedure GEA
5509  rd(i)=rd(i)*dsqrt(2.d0*ia(i)/(ia(i)-1.))
5510  ENDIF
5511 1 CONTINUE
5512 
5513  gdt=0.d0
5514 c-------------------------------------------------
5515 c Impact parameter cutoff setting
5516 c-------------------------------------------------
5517  IF(ia(1).NE.1)THEN
5518 c Primary nucleus:
5519 c Impact parameter cutoff value ( only impact parameters less than BM are
5520 c simulated; probability to have larger impact parameter is less than 1% )
5521  bm=rd(1)+rd(2)+5.d0
5522  ELSE
5523 c Hadron-nucleus interaction
5524 c BM - impact parameter cutoff value
5525  bm=rd(2)+5.d0
5526  ENDIF
5527 
5528  ye=dlog10(e0n)
5529  IF(ye.LT.1.d0)ye=1.d0
5530  je=int(ye)
5531  IF(je.GT.8)je=8
5532 
5533 ******************************************************
5534  wk(2)=ye-je
5535  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
5536  wk(1)=1.d0-wk(2)+wk(3)
5537  wk(2)=wk(2)-2.d0*wk(3)
5538 
5539  sjv=sjv0(je,icz)*wk(1)+sjv0(je+1,icz)*wk(2)+sjv0(je+2,icz)*wk(3)
5540 
5541  DO 2 i=1,5
5542  DO 2 m=1,3
5543  m1=m+3*(icz-1)
5544 2 fjs(i,m)=fjs0(je,i,m1)*wk(1)+fjs0(je+1,i,m1)*wk(2)+
5545  *fjs0(je+2,i,m1)*wk(3)
5546 
5547  gdt=0.d0
5548  gdp=0.d0 !so00
5549  IF(ia(1).EQ.1)THEN
5550  ya=ia(2)
5551  ya=dlog(ya)/1.38629d0+1.d0
5552  ja=min(int(ya),2)
5553  wa(2)=ya-ja
5554  wa(3)=wa(2)*(wa(2)-1.d0)*.5d0
5555  wa(1)=1.d0-wa(2)+wa(3)
5556  wa(2)=wa(2)-2.d0*wa(3)
5557  DO 3 i=1,3
5558  DO 3 m=1,3
5559  gdp=gdp+gzp(je+i-1,icz,ja+m-1)*wk(i)*wa(m) !so00
5560 3 gdt=gdt+gz(je+i-1,icz,ja+m-1)*wk(i)*wa(m)
5561  ENDIF
5562 c write (*,*)'gdt=',gdt
5563 ******************************************************
5564 
5565  IF(debug.GE.3)WRITE (moniou,202)
5566 202 FORMAT(2x,'XXAINI - END')
5567  RETURN
5568  END
5569 C=======================================================================
5570 
5571  SUBROUTINE xxaset
5572 c Particular model parameters setting
5573 c-----------------------------------------------------------------------
5574  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5575  INTEGER DEBUG
5576  CHARACTER *2 TYQ
5577  COMMON /area3/ rmin,emax,eev
5578  COMMON /area6/ pi,bm,am
5579  COMMON /area8/ wwm,be(4),dc(5),deta,almpt
5580  COMMON /area10/ stmass,am0,amn,amk,amc,amlamc,amlam,ameta
5581  COMMON /area11/ b10
5582  COMMON /area20/ wppp
5583  COMMON /area21/ dmmin(5)
5584  COMMON /area28/ arr(4)
5585  COMMON /area40/ jdifr
5586  COMMON /area42/ tyq(15)
5587  COMMON /area43/ moniou
5588  COMMON /debug/ debug
5589  SAVE
5590 
5591  IF(debug.GE.1)WRITE (moniou,201)
5592 201 FORMAT(2x,'XXASET - HADRONIZATION PARAMETERS SETTING')
5593 c Regge intercepts for the uu~, qqq~q~, us~, uc~ trajectories
5594  arr(1)=0.5d0
5595  arr(2)=-.5d0
5596  arr(3)=0.d0
5597  arr(4)=-2.d0
5598 c WPPP - Triple pomeron interaction probability (for two cut pomerons and cut
5599 c between them)
5600  wppp=0.4d0
5601 c JDIFR - flag for the low mass diffraction (for JDIFR=0 not considered)
5602  jdifr=1
5603 
5604 c-------------------------------------------------
5605 c Parameters for the soft fragmentation:
5606 c DC(i) - relative probabilities for udu~d~(i=1), ss~(i=2), cc~(i=3)-pairs creation
5607 c from the vacuum for the quark (u,d,u~,d~) fragmentation;
5608 c ss~(i=4), cc~(i=5) - for the diquark (ud, u~d~) fragmentation
5609  dc(1)=.06d0
5610  dc(2)=.10d0
5611 * DC(3)=.0003D0 ! To switch off charmed particles set to 0.000
5612  dc(3)=.000d0
5613  dc(4)=.36d0
5614 * DC(5)=.01D0 ! To switch off charmed particles set to 0.000
5615  dc(5)=.0d0
5616 cc DETA - ratio of etas production density to all pions production density (1/9)
5617  deta=.11111d0
5618 c WWM defines mass threshold for string to decay into three or more hadrons
5619 c ( ajustable parameter for string fragmentation )
5620  wwm=.53d0
5621 c BE(i) - parameter for Pt distribution (exponential) for uu~(dd~), ss~, qqq~q~,
5622 c cc~ pairs respectively (for the soft fragmentation)
5623  be(1)=.22d0
5624  be(2)=.35d0
5625  be(3)=.29d0
5626  be(4)=.40d0
5627 c ALMPT - parameter for the fragmentation functions (soft ones):
5628 c ALMPT = 1 + 2 * alfa_R * <pt**2> (Kaidalov proposed 0.5 value for ALMPT-1,
5629 c Sov.J.Nucl.Phys.,1987))
5630  almpt=1.7d0
5631 
5632 c-------------------------------------------------
5633 c Parameters for nuclear spectator part fragmentation:
5634 c RMIN - coupling radius squared (fm^2),
5635 c EMAX - relative critical energy ( divided per mean excitation energy (~12.5 Mev)),
5636 c EEV - relative evaporation energy ( divided per mean excitation energy (~12.5 Mev))
5637  rmin=3.35d0
5638  emax=.11d0
5639  eev=.25d0
5640 
5641 c-------------------------------------------------
5642 c DMMIN(i) - minimal diffractive mass for low-mass diffraction for pion, nucleon,
5643 c kaon, D-meson, Lambda_C corresp.
5644  dmmin(1)=.76d0
5645  dmmin(2)=1.24d0
5646  dmmin(3)=.89d0
5647  dmmin(4)=2.01d0
5648  dmmin(5)=2.45d0
5649 c Proton, kaon, pion, D-meson, Lambda, Lambda_C, eta masses
5650  amn=.939d0
5651  amk=.496d0
5652  am0=.14d0
5653  amc=1.868d0
5654  amlam=1.116d0
5655  amlamc=2.27d0
5656  ameta=.548d0
5657 
5658 c-------------------------------------------------
5659 c B10 - initial value of the pseudorandom number,
5660 c PI - pi-number
5661 c AM - diffusive radius for the Saxon-Wood nuclear density parametrization
5662  b10=.43876194d0
5663  pi=3.1416d0
5664  am=.523d0
5665 
5666 C STMASS - minimal string mass to produce secondary particles
5667  stmass=4.d0*am0**2
5668 c Here and below all radii, distances and so on are divided by AM.
5669  rmin=rmin/am**2
5670 
5671  tyq(1)='DD'
5672  tyq(2)='UU'
5673  tyq(3)='C '
5674  tyq(4)='S '
5675  tyq(5)='UD '
5676  tyq(6)='D '
5677  tyq(7)='U '
5678  tyq(8)='G '
5679  tyq(9)='u '
5680  tyq(10)='d '
5681  tyq(11)='ud'
5682  tyq(12)='s '
5683  tyq(13)='c '
5684  tyq(14)='uu'
5685  tyq(15)='dd'
5686  IF(debug.GE.3)WRITE (moniou,202)
5687 202 FORMAT(2x,'XXASET - END')
5688  RETURN
5689  END
5690 C=======================================================================
5691 
5692  SUBROUTINE xxddfr(WP0,WM0,ICP,ICT)
5693 c Double diffractive dissociation
5694 c-----------------------------------------------------------------------
5695  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5696  INTEGER DEBUG
5697  dimension ep3(4),ep1(4),ep2(4),ey(3)
5698  COMMON /area1/ ia(2),icz,icp0
5699  COMMON /area2/ s,y0,wp00,wm00
5700  COMMON /area8/ wwm,be(4),dc(5),deta,almpt
5701  COMMON /area10/ stmass,am(7)
5702  COMMON /area11/ b10
5703  COMMON /area21/ dmmin(5)
5704  COMMON /area43/ moniou
5705  COMMON /debug/ debug
5706  SAVE
5707  EXTERNAL qsran
5708 
5709  IF(debug.GE.2)WRITE (moniou,201)icp,ict,wp0,wm0
5710 201 FORMAT(2x,'XXDDFR - LEADING CLUSTERS HADRONIZATION:'
5711  * /4x,'CLUSTER TYPES ICP=',i2,2x,
5712  * 'ICT=',i2/4x,'AVAILABLE LIGHT CONE MOMENTA: WP0=',e10.3,
5713  * ' WM0=',e10.3)
5714  DO 100 i=1,3
5715 100 ey(i)=1.d0
5716 
5717  sd0=wp0*wm0
5718  IF(sd0.LT.0.d0)sd0=0.d0
5719  ddmin1=dmmin(icz)
5720  ddmin2=dmmin(2)
5721  ddmax1=min(5.d0,dsqrt(sd0)-ddmin2)
5722 
5723  IF(ddmax1.LT.ddmin1)THEN
5724 c Registration of too slow "leading" hadron if its energy is insufficient for
5725 c diffractive exhitation
5726  IF(dsqrt(sd0).LT.am(icz)+am(2))THEN
5727  IF(wp0.GT.0.d0.AND.(am(icz)+am(2))**2/wp0.LT..5d0*wm00)THEN
5728  sd0=(am(icz)+am(2))**2
5729  wm0=sd0/wp0
5730  ELSE
5731  IF(debug.GE.3)WRITE (moniou,202)
5732  RETURN
5733  ENDIF
5734  ENDIF
5735 
5736  ep3(3)=0.d0
5737  ep3(4)=0.d0
5738  xw=xxtwdec(sd0,am(icz)**2,am(2)**2)
5739  wp1=xw*wp0
5740  wm1=am(icz)**2/wp1
5741  ep3(1)=.5d0*(wp1+wm1)
5742  ep3(2)=.5d0*(wp1-wm1)
5743  CALL xxreg(ep3,icp)
5744  wm2=wm0-wm1
5745  wp2=am(2)**2/wm2
5746  ep3(1)=.5d0*(wp2+wm2)
5747  ep3(2)=.5d0*(wp2-wm2)
5748  CALL xxreg(ep3,ict)
5749  wp0=0.d0
5750  wm0=0.d0
5751  IF(debug.GE.3)WRITE (moniou,202)
5752  RETURN
5753  ENDIF
5754 
5755  dmass1=(ddmin1/(1.d0-qsran(b10)*(1.d0-ddmin1/ddmax1)))**2
5756  ddmax2=min(5.d0,dsqrt(sd0)-dsqrt(dmass1))
5757  dmass2=(ddmin2/(1.d0-qsran(b10)*(1.d0-ddmin2/ddmax2)))**2
5758 
5759  wpd1=wp0*xxtwdec(sd0,dmass1,dmass2)
5760  wmd1=dmass1/wpd1
5761  wmd2=wm0-wmd1
5762  wpd2=dmass2/wmd2
5763 
5764  IF(icp.NE.0)is=iabs(icp)/icp
5765  IF(icz.EQ.5)THEN
5766  ich1=icp
5767  ich2=0
5768  amh1=am(5)**2
5769  amh2=am(1)**2
5770 
5771  ptmax=pslam(dmass1,amh1,amh2)
5772  IF(ptmax.LT.0.)ptmax=0.
5773  IF(ptmax.LT.be(4)**2)THEN
5774 1 pti=ptmax*qsran(b10)
5775  IF(qsran(b10).GT.exp(-dsqrt(pti)/be(4)))GOTO 1
5776  ELSE
5777 2 pti=(be(4)*dlog(qsran(b10)*qsran(b10)))**2
5778  IF(pti.GT.ptmax)GOTO 2
5779  ENDIF
5780  amt1=amh1+pti
5781  amt2=amh2+pti
5782  z=xxtwdec(dmass1,amt1,amt2)
5783  wp1=wpd1*z
5784  wm1=amt1/wp1
5785  ep3(1)=.5d0*(wp1+wm1)
5786  ep3(2)=.5d0*(wp1-wm1)
5787  pt=dsqrt(pti)
5788  CALL pscs(c,s)
5789  ep3(3)=pt*c
5790  ep3(4)=pt*s
5791  CALL xxreg(ep3,ich1)
5792 
5793  wp1=wpd1*(1.d0-z)
5794  wm1=amt2/wp1
5795  ep3(1)=.5d0*(wp1+wm1)
5796  ep3(2)=.5d0*(wp1-wm1)
5797  ep3(3)=-pt*c
5798  ep3(4)=-pt*s
5799  CALL xxreg(ep3,ich2)
5800  GOTO 3
5801  ENDIF
5802 
5803  IF(icz.EQ.1)THEN
5804  IF(icp.NE.0)THEN
5805  ic1=icp*(1-3*int(.5d0+qsran(b10)))
5806  ic2=-icp-ic1
5807  ELSE
5808  ic1=int(1.5d0+qsran(b10))*(2*int(.5d0+qsran(b10))-1)
5809  ic2=-ic1
5810  ENDIF
5811  ELSEIF(icz.EQ.2)THEN
5812  IF(qsran(b10).GT..33333d0)THEN
5813  ic1=3*is
5814  ic2=icp-is
5815  ELSE
5816  ic1=icp+4*is
5817  ic2=4*is-icp
5818  ENDIF
5819  ELSEIF(icz.EQ.3)THEN
5820  ic1=-4*is
5821  ic2=icp-3*is
5822  ELSEIF(icz.EQ.4)THEN
5823  ic1=5*is
5824  ic2=icp-9*is
5825  ENDIF
5826  CALL xxgener(wpd1,wmd1,ey,0.d0,1.d0,0.d0,1.d0,ic1,ic2)
5827 
5828 3 CONTINUE
5829  is=iabs(ict)/ict
5830  IF(qsran(b10).GT..33333d0)THEN
5831  ic1=3*is
5832  ic2=ict-is
5833  ELSE
5834  ic1=ict+4*is
5835  ic2=4*is-ict
5836  ENDIF
5837  CALL xxgener(wpd2,wmd2,ey,0.d0,1.d0,0.d0,1.d0,ic2,ic1)
5838  IF(debug.GE.3)WRITE (moniou,202)
5839 202 FORMAT(2x,'XXDDFR - END')
5840  RETURN
5841  END
5842 C=======================================================================
5843 
5844  SUBROUTINE xxdec2(EP,EP1,EP2,WW,A,B)
5845 c Two particle decay
5846 c-----------------------------------------------------------------------
5847  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5848  INTEGER DEBUG
5849  dimension ep(4),ep1(4),ep2(4),ey(3)
5850  COMMON /area43/ moniou
5851  COMMON /debug/ debug
5852  COMMON /area11/ b10
5853  SAVE
5854  EXTERNAL qsran
5855 
5856  IF(debug.GE.2)WRITE (moniou,201)
5857 201 FORMAT(2x,'XXDEC2 - TWO PARTICLE DECAY')
5858 
5859  pl=pslam(ww,a,b)
5860  ep1(1)=dsqrt(pl+a)
5861  ep2(1)=dsqrt(pl+b)
5862  pl=dsqrt(pl)
5863  cosz=2.d0*qsran(b10)-1.d0
5864  pt=pl*dsqrt(1.d0-cosz**2)
5865  ep1(2)=pl*cosz
5866  CALL pscs(c,s)
5867  ep1(3)=pt*c
5868  ep1(4)=pt*s
5869  do 1 i=2,4
5870 1 ep2(i)=-ep1(i)
5871  CALL psdeftr(ww,ep,ey)
5872  CALL pstrans(ep1,ey)
5873  CALL pstrans(ep2,ey)
5874  IF(debug.GE.3)WRITE (moniou,202)
5875 202 FORMAT(2x,'XXDEC2 - END')
5876  RETURN
5877  END
5878 C=======================================================================
5879 
5880  SUBROUTINE xxdec3(EP,EP1,EP2,EP3,SWW,AM1,AM2,AM3)
5882 c-----------------------------------------------------------------------
5883  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5884  INTEGER DEBUG
5885  dimension ep(4),ep1(4),ep2(4),ep3(4),ept(4),ey(3)
5886  common/area11/b10
5887  COMMON /area43/ moniou
5888  COMMON /debug/ debug
5889  SAVE
5890  EXTERNAL qsran
5891 
5892  IF(debug.GE.2)WRITE (moniou,201)
5893 201 FORMAT(2x,'XXDEC3 - THREE PARTICLE DECAY')
5894  am12=am1**2
5895  am23=(am2+am3)**2
5896  am32=(am2-am3)**2
5897  s23max=(sww-am1)**2
5898  emax=.25d0*(sww+(am12-am23)/sww)**2
5899  gb0=dsqrt((emax-am12)/emax*(1.d0-am23/s23max)
5900  * *(1.d0-am32/s23max))
5901 1 p1=qsran(b10)*(emax-am12)
5902  e1=dsqrt(p1+am12)
5903  s23=sww**2+am12-2.d0*e1*sww
5904  gb=dsqrt(p1*(1.d0-am23/s23)*(1.d0-am32/s23))/e1/gb0
5905  IF(qsran(b10).GT.gb)GOTO 1
5906 
5907  p1=dsqrt(p1)
5908  ep1(1)=e1
5909  cosz=2.d0*qsran(b10)-1.d0
5910  pt=p1*dsqrt(1.d0-cosz**2)
5911  ep1(2)=p1*cosz
5912  CALL pscs(c,s)
5913  ep1(3)=pt*c
5914  ep1(4)=pt*s
5915  do 2 i=2,4
5916 2 ept(i)=-ep1(i)
5917  ept(1)=sww-ep1(1)
5918  CALL psdeftr(sww**2,ep,ey)
5919  CALL pstrans(ep1,ey)
5920  CALL pstrans(ept,ey)
5921 
5922  CALL xxdec2(ept,ep2,ep3,s23,am2**2,am3**2)
5923  IF(debug.GE.3)WRITE (moniou,202)
5924 202 FORMAT(2x,'XXDEC3 - END')
5925  RETURN
5926  END
5927 C=======================================================================
5928 
5929  SUBROUTINE xxdpr(WP0,WM0,ICP,ICT,LQ2)
5930 c Projectile hadron dissociation
5931 c Leading hadronic state hadronization
5932 c-----------------------------------------------------------------------
5933  IMPLICIT DOUBLE PRECISION (a-h,o-z)
5934  INTEGER DEBUG
5935  dimension ep3(4),ep1(4),ep2(4),ey(3)
5936  COMMON /area1/ ia(2),icz,icp0
5937  COMMON /area2/ s,y0,wp00,wm00
5938  COMMON /area8/ wwm,be(4),dc(5),deta,almpt
5939  COMMON /area10/ stmass,am(7)
5940  COMMON /area11/ b10
5941  COMMON /area17/ del,rs,rs0,fs,alfp,rr,sh,delh
5942  COMMON /area21/ dmmin(5)
5943  COMMON /area43/ moniou
5944  COMMON /debug/ debug
5945  SAVE
5946  EXTERNAL qsran
5947 
5948 
5949  IF(debug.GE.2)WRITE (moniou,201)icp,ict,wp0,wm0
5950 201 FORMAT(2x,'XXDPR - LEADING (PROJECTILE) CLUSTER HADRONIZATION:'
5951  * /4x,'CLUSTER TYPE ICP=',i2,2x,'TARGET TYPE ',
5952  * 'ICT=',i2/4x,'AVAILABLE LIGHT CONE MOMENTA: WP0=',e10.3,
5953  * ' WM0=',e10.3)
5954  DO 100 i=1,3
5955 100 ey(i)=1.d0
5956 
5957  sd0=wp0*wm0
5958  IF(sd0.LT.0.d0)sd0=0.d0
5959  ddmax=min(5.d0,dsqrt(sd0)-am(2))
5960  ddmin=dmmin(icz)
5961 
5962  IF(ddmax.LT.ddmin)THEN
5963 c Registration of too slow "leading" hadron if its energy is insufficient for
5964 c diffractive exhitation
5965  ep3(3)=0.d0
5966  ep3(4)=0.d0
5967 
5968  IF(lq2.NE.0)THEN
5969  wpi=wp0
5970  IF(am(icz)**2.GT.wpi*wm0)THEN
5971  IF(wpi.GT.0.d0.AND.am(icz)**2/wpi.LT..5d0*wm00)THEN
5972  wmi=am(icz)**2/wpi
5973  wm0=wmi
5974  ELSE
5975  RETURN
5976  ENDIF
5977 cdh 2 lines added in accordance with s. ostapchenko 17.9.99
5978  ELSE
5979  wmi=am(icz)**2/wpi
5980 cdh
5981  ENDIF
5982  wm0=wm0-wmi
5983  wp0=0.d0
5984  ep3(1)=.5d0*(wpi+wmi)
5985  ep3(2)=.5d0*(wpi-wmi)
5986  CALL xxreg(ep3,icp)
5987  IF(debug.GE.3)WRITE (moniou,202)
5988  RETURN
5989  ELSE
5990 
5991  IF(dsqrt(sd0).LT.am(icz)+am(2))THEN
5992  IF(wp0.GT.0.d0.AND.(am(icz)+am(2))**2/wp0.LT..5d0*wm00)
5993  * THEN
5994  sd0=(am(icz)+am(2))**2
5995  wm0=sd0/wp0
5996  ELSE
5997  IF(debug.GE.3)WRITE (moniou,202)
5998  RETURN
5999  ENDIF
6000  ENDIF
6001  xw=xxtwdec(sd0,am(icz)**2,am(2)**2)
6002  wp1=xw*wp0
6003  wm1=am(icz)**2/wp1
6004  ep3(1)=.5d0*(wp1+wm1)
6005  ep3(2)=.5d0*(wp1-wm1)
6006  CALL xxreg(ep3,icp)
6007  wm2=wm0-wm1
6008  wp2=am(2)**2/wm2
6009  ep3(1)=.5d0*(wp2+wm2)
6010  ep3(2)=.5d0*(wp2-wm2)
6011  CALL xxreg(ep3,ict)
6012  wp0=0.d0
6013  wm0=0.d0
6014  ENDIF
6015  IF(debug.GE.3)WRITE (moniou,202)
6016  RETURN
6017  ENDIF
6018 
6019  IF(icp.NE.0)is=iabs(icp)/icp
6020 
6021  dmass=ddmin**2/(1.d0-qsran(b10)*(1.d0-(ddmin/ddmax)))**2
6022 
6023  IF(lq2.NE.0)THEN
6024  wpd=wp0
6025  wmd=dmass/wpd
6026  wm0=wm0-wmd
6027  wp0=0.d0
6028  ELSE
6029  IF(icz.EQ.5)THEN
6030  wpd=wp0*xxtwdec(sd0,dmass,am(2)**2)
6031  wmd=dmass/wpd
6032  wm2=wm0-wmd
6033  wp2=am(2)**2/wm2
6034  ep3(1)=.5d0*(wp2+wm2)
6035  ep3(2)=.5d0*(wp2-wm2)
6036  ep3(3)=0.d0
6037  ep3(4)=0.d0
6038  CALL xxreg(ep3,ict)
6039  ELSE
6040  ptmax=pslam(sd0,dmass,am(2)**2)
6041  IF(ptmax.LT.0.)ptmax=0.
6042  pti=-1.d0/rs*dlog(1.d0-qsran(b10)*(1.d0-exp(-rs*ptmax)))
6043 
6044  amt1=dmass+pti
6045  amt2=am(2)**2+pti
6046  wpd=wp0*xxtwdec(sd0,amt1,amt2)
6047  wmd=amt1/wpd
6048  wm2=wm0-wmd
6049  wp2=amt2/wm2
6050  pt=dsqrt(pti)
6051  CALL pscs(ccos,ssin)
6052  ep3(3)=pt*ccos
6053  ep3(4)=pt*ssin
6054  ep3(1)=.5d0*(wp2+wm2)
6055  ep3(2)=.5d0*(wp2-wm2)
6056  CALL xxreg(ep3,ict)
6057  ep3(3)=-ep3(3)
6058  ep3(4)=-ep3(4)
6059  ep3(1)=.5d0*(wpd+wmd)
6060  ep3(2)=.5d0*(wpd-wmd)
6061  CALL psdeftr(dmass,ep3,ey)
6062  wpd=dsqrt(dmass)
6063  wmd=wpd
6064  ENDIF
6065  wp0=0.d0
6066  wm0=0.d0
6067  ENDIF
6068 
6069  IF(icz.EQ.5)THEN
6070  ich1=icp
6071  ich2=0
6072  amh1=am(5)**2
6073  amh2=am(1)**2
6074 
6075  ptmax=pslam(dmass,amh1,amh2)
6076  IF(ptmax.LT.0.)ptmax=0.
6077  IF(ptmax.LT.be(4)**2)THEN
6078 1 pti=ptmax*qsran(b10)
6079  IF(qsran(b10).GT.exp(-dsqrt(pti)/be(4)))GOTO 1
6080  ELSE
6081 2 pti=(be(4)*dlog(qsran(b10)*qsran(b10)))**2
6082  IF(pti.GT.ptmax)GOTO 2
6083  ENDIF
6084  amt1=amh1+pti
6085  amt2=amh2+pti
6086  z=xxtwdec(dmass,amt1,amt2)
6087  wp1=wpd*z
6088  wm1=amt1/wp1
6089  ep3(1)=.5d0*(wp1+wm1)
6090  ep3(2)=.5d0*(wp1-wm1)
6091  pt=dsqrt(pti)
6092  CALL pscs(c,s)
6093  ep3(3)=pt*c
6094  ep3(4)=pt*s
6095  CALL xxreg(ep3,ich1)
6096 
6097  wp1=wpd*(1.d0-z)
6098  wm1=amt2/wp1
6099  ep3(1)=.5d0*(wp1+wm1)
6100  ep3(2)=.5d0*(wp1-wm1)
6101  ep3(3)=-pt*c
6102  ep3(4)=-pt*s
6103  CALL xxreg(ep3,ich2)
6104  IF(debug.GE.3)WRITE (moniou,202)
6105  RETURN
6106  ENDIF
6107 
6108  IF(icz.EQ.1)THEN
6109  IF(icp.NE.0)THEN
6110  ic1=icp*(1-3*int(.5d0+qsran(b10)))
6111  ic2=-icp-ic1
6112  ELSE
6113  ic1=int(1.5d0+qsran(b10))*(2*int(.5d0+qsran(b10))-1)
6114  ic2=-ic1
6115  ENDIF
6116  ELSEIF(icz.EQ.2)THEN
6117  IF(qsran(b10).GT..33333d0)THEN
6118  ic1=3*is
6119  ic2=icp-is
6120  ELSE
6121  ic1=icp+4*is
6122  ic2=4*is-icp
6123  ENDIF
6124  ELSEIF(icz.EQ.3)THEN
6125  ic1=-4*is
6126  ic2=icp-3*is
6127  ELSEIF(icz.EQ.4)THEN
6128  ic1=5*is
6129  ic2=icp-9*is
6130  ENDIF
6131  CALL xxgener(wpd,wmd,ey,0.d0,1.d0,0.d0,1.d0,
6132  * ic1,ic2)
6133  IF(debug.GE.3)WRITE (moniou,202)
6134 202 FORMAT(2x,'XXDPR - END')
6135  RETURN
6136  END
6137 C=======================================================================
6138 
6139  SUBROUTINE xxdtg(WP0,WM0,ICP,ICT,LQ1)
6140 c Target nucleon dissociation
6141 c Leading hadronic state hadronization
6142 c-----------------------------------------------------------------------
6143  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6144  INTEGER DEBUG
6145  dimension ep3(4),ey(3)
6146  COMMON /area1/ ia(2),icz,icp0
6147  COMMON /area2/ s,y0,wp00,wm00
6148  COMMON /area10/ stmass,am(7)
6149  COMMON /area11/ b10
6150  COMMON /area17/ del,rs,rs0,fs,alfp,rr,sh,delh
6151  COMMON /area21/ dmmin(5)
6152  COMMON /area43/ moniou
6153  COMMON /debug/ debug
6154  SAVE
6155  EXTERNAL qsran
6156 
6157 
6158  IF(debug.GE.2)WRITE (moniou,201)ict,icp,wp0,wm0
6159 201 FORMAT(2x,'XXDTG - LEADING (TARGET) CLUSTER HADRONIZATION:'
6160  * /4x,'CLUSTER TYPE ICT=',i2,2x,'PROJECTILE TYPE ',
6161  * 'ICP=',i2/4x,'AVAILABLE LIGHT CONE MOMENTA: WP0=',e10.3,
6162  * ' WM0=',e10.3)
6163  DO 100 i=1,3
6164 100 ey(i)=1.d0
6165 
6166  sd0=wp0*wm0
6167  IF(sd0.LT.0.d0)sd0=0.d0
6168  ddmin=dmmin(2)
6169  ddmax=min(5.d0,dsqrt(sd0)-am(icz))
6170 
6171  IF(ddmax.LT.ddmin)THEN
6172 c Registration of too slow "leading" hadron if its energy is insufficient for
6173 c diffractive exhitation
6174  ep3(3)=0.d0
6175  ep3(4)=0.d0
6176 
6177  IF(lq1.NE.0)THEN
6178  wmi=wm0
6179  IF( wp0.LE.0.d0.OR.am(2)**2.GT.wmi*wp0)RETURN
6180  wpi=am(2)**2/wmi
6181  wp0=wp0-wpi
6182  wm0=0.d0
6183  ep3(1)=.5d0*(wpi+wmi)
6184  ep3(2)=.5d0*(wpi-wmi)
6185  CALL xxreg(ep3,ict)
6186  IF(debug.GE.3)WRITE (moniou,202)
6187  RETURN
6188  ELSE
6189 
6190  IF(dsqrt(sd0).LT.am(icz)+am(2))THEN
6191  IF(wp0.GT.0.d0.AND.(am(icz)+am(2))**2/wp0.LT..5d0*wm00)
6192  * THEN
6193  sd0=(am(icz)+am(2))**2
6194  wm0=sd0/wp0
6195  ELSE
6196  IF(debug.GE.3)WRITE (moniou,202)
6197  RETURN
6198  ENDIF
6199  ENDIF
6200  xw=xxtwdec(sd0,am(icz)**2,am(2)**2)
6201  wp1=xw*wp0
6202  wm1=am(icz)**2/wp1
6203  ep3(1)=.5d0*(wp1+wm1)
6204  ep3(2)=.5d0*(wp1-wm1)
6205  CALL xxreg(ep3,icp)
6206  wm2=wm0-wm1
6207  wp2=am(2)**2/wm2
6208  ep3(1)=.5d0*(wp2+wm2)
6209  ep3(2)=.5d0*(wp2-wm2)
6210  CALL xxreg(ep3,ict)
6211  wp0=0.d0
6212  wm0=0.d0
6213  ENDIF
6214  IF(debug.GE.3)WRITE (moniou,202)
6215  RETURN
6216  ENDIF
6217 
6218  dmass=(ddmin/(1.d0-qsran(b10)*(1.d0-ddmin/ddmax)))**2
6219  IF(lq1.NE.0)THEN
6220  wmd=wm0
6221  wpd=dmass/wmd
6222  wp0=wp0-wpd
6223  wm0=0.d0
6224  ELSE
6225  ptmax=pslam(sd0,dmass,am(icz)**2)
6226  IF(ptmax.LT.0.)ptmax=0.
6227  pti=-1.d0/rs*dlog(1.d0-qsran(b10)*(1.d0-exp(-rs*ptmax)))
6228 
6229  amt1=dmass+pti
6230  amt2=am(icz)**2+pti
6231  wmd=wm0*xxtwdec(sd0,amt1,amt2)
6232  wpd=amt1/wmd
6233  wp2=wp0-wpd
6234  wm2=amt2/wp2
6235  pt=dsqrt(pti)
6236  CALL pscs(ccos,ssin)
6237  ep3(3)=pt*ccos
6238  ep3(4)=pt*ssin
6239  ep3(1)=.5d0*(wp2+wm2)
6240  ep3(2)=.5d0*(wp2-wm2)
6241  CALL xxreg(ep3,icp)
6242  ep3(3)=-ep3(3)
6243  ep3(4)=-ep3(4)
6244  ep3(1)=.5d0*(wpd+wmd)
6245  ep3(2)=.5d0*(wpd-wmd)
6246  CALL psdeftr(dmass,ep3,ey)
6247  wpd=dsqrt(dmass)
6248  wmd=wpd
6249  wp0=0.d0
6250  wm0=0.d0
6251  ENDIF
6252 
6253  is=iabs(ict)/ict
6254  IF(qsran(b10).GT..33333d0)THEN
6255  ic1=3*is
6256  ic2=ict-is
6257  ELSE
6258  ic1=ict+4*is
6259  ic2=4*is-ict
6260  ENDIF
6261  CALL xxgener(wpd,wmd,ey,
6262  * 0.d0,1.d0,0.d0,1.d0,ic2,ic1)
6263  IF(debug.GE.3)WRITE (moniou,202)
6264 202 FORMAT(2x,'XXDTG - END')
6265  RETURN
6266  END
6267 C=======================================================================
6268 
6269  SUBROUTINE xxfau(B,GZ)
6270 c Integrands for hadron-hadron and hadron-nucleus cross-sections calculation
6271 c-----------------------------------------------------------------------
6272  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6273  INTEGER DEBUG
6274  dimension gz(3),gz0(2)
6275  COMMON /area1/ ia(2),icz,icp
6276  COMMON /area16/ cc(5)
6277  COMMON /ar1/ anorm
6278  COMMON /area43/ moniou
6279  COMMON /debug/ debug
6280  SAVE
6281 
6282  IF(debug.GE.2)WRITE (moniou,201)
6283 201 FORMAT(2x,'XXFAU - INTEGRANDS FOR HADRON-HADRON AND '
6284  * ,'HADRON-NUCLEUS CROSS-SECTIONS CALCULATION')
6285 
6286  CALL xxfz(b,gz0)
6287  DO 1 l=1,2
6288 1 gz0(l)=gz0(l)*cc(2)*anorm*.5d0
6289 
6290  ab=float(ia(2))
6291 
6292  gz1=(1.d0-gz0(1))**ab
6293  gz2=(1.d0-gz0(2))**ab
6294  gz3=(1.d0-cc(2)*gz0(2)-2.d0*(1.d0-cc(2))*gz0(1))**ab
6295 
6296 
6297  gz(1)=cc(icz)**2*(gz2-gz3)
6298  gz(2)=cc(icz)*(1.d0-cc(icz))*(1.d0+gz2-2.d0*gz1)
6299  gz(3)=cc(icz)*(1.d0-gz2)
6300  IF(debug.GE.3)WRITE (moniou,202)
6301 202 FORMAT(2x,'XXFAU - END')
6302  RETURN
6303  END
6304 C=======================================================================
6305 
6306  SUBROUTINE xxfrag(SA,NA,RC)
6307 c Connected nucleon clasters extraction - used for the nuclear spectator part
6308 c multifragmentation:
6309 c-----------------------------------------------------------------------
6310  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6311  INTEGER DEBUG
6312 cdh DIMENSION SA(56,3)
6313  dimension sa(64,3)
6314  COMMON /area13/ nsf,iaf(56)
6315  COMMON /area43/ moniou
6316  COMMON /debug/ debug
6317  SAVE
6318 
6319  IF(debug.GE.2)WRITE (moniou,201)na
6320 201 FORMAT(2x,'XXFRAG-MULTIFRAGMENTATION: NUCLEUS MASS NUMBER: NA='
6321  * ,i2)
6322  IF(debug.GE.3)THEN
6323  WRITE (moniou,203)
6324 203 FORMAT(2x,'NUCLEONS COORDINATES:')
6325 204 FORMAT(2x,3e10.3)
6326  DO 205 i=1,na
6327 205 WRITE (moniou,204)(sa(i,l),l=1,3)
6328  ENDIF
6329 
6330  ni=1
6331  ng=1
6332  j=0
6333 1 j=j+1
6334  j1=ni+1
6335  DO 4 i=j1,na
6336  ri=0.d0
6337  DO 2 m=1,3
6338 2 ri=ri+(sa(j,m)-sa(i,m))**2
6339  IF(ri.GT.rc)GOTO 4
6340  ni=ni+1
6341  ng=ng+1
6342  IF(i.EQ.ni)GOTO 4
6343  DO 3 m=1,3
6344  s0=sa(ni,m)
6345  sa(ni,m)=sa(i,m)
6346 3 sa(i,m)=s0
6347 4 CONTINUE
6348  IF(j.LT.ni.AND.na-ni.GT.0)GOTO 1
6349  nsf=nsf+1
6350  iaf(nsf)=ng
6351  IF(debug.GE.3)WRITE (moniou,206)nsf,iaf(nsf)
6352 206 FORMAT(2x,'XXFRAG: FRAGMENT N',i2,2x,'FRAGMENT MASS - ',i2)
6353  ng=1
6354  j=ni
6355  ni=ni+1
6356  IF(na-ni)6,5,1
6357 5 nsf=nsf+1
6358  iaf(nsf)=1
6359  IF(debug.GE.3)WRITE (moniou,206)nsf,iaf(nsf)
6360 6 CONTINUE
6361  IF(debug.GE.3)WRITE (moniou,202)
6362 202 FORMAT(2x,'XXFRAG - END')
6363  RETURN
6364  END
6365 C=======================================================================
6366 
6367  SUBROUTINE xxfragm(NS,XA)
6368 c Fragmentation of the spectator part of the nucleus
6369 c XA(56,3) - arrays for spectator nucleons positions
6370 c NS - total number of spectators
6371 c-----------------------------------------------------------------------
6372  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6373 cdh DIMENSION XA(56,3)
6374  dimension xa(64,3)
6375  INTEGER DEBUG
6376  COMMON /area1/ ia(2),icz,icp
6377  COMMON /area3/ rmin,emax,eev
6378  COMMON /area11/ b10
6379 c NSF - number of secondary fragments;
6380 c IAF(i) - mass of the i-th fragment
6381  COMMON /area13/ nsf,iaf(56)
6382  COMMON /area43/ moniou
6383  COMMON /debug/ debug
6384  SAVE
6385  EXTERNAL qsran
6386 
6387  IF(debug.GE.2)WRITE (moniou,201)ns
6388 201 FORMAT(2x,'XXFRAGM: NUMBER OF SPECTATORS: NS=',i2)
6389 
6390  nsf=0
6391 
6392  IF(ns-1)6,1,2
6393 c Single spectator nucleon is recorded
6394 1 nsf=nsf+1
6395  iaf(nsf)=1
6396  IF(debug.GE.3)WRITE (moniou,205)
6397 205 FORMAT(2x,'XXFRAGM - SINGLE SPECTATOR')
6398  GOTO 6
6399 2 eex=0.d0
6400 c EEX - spectator part excitation energy; calculated as the sum of excitations
6401 c from all wounded nucleons ( including diffractively excited )
6402  DO 3 i=1,ia(1)-ns
6403 c Partial excitation is simulated according to distribution f(E) ~ 1/sqrt(E)
6404 c * exp(-E/(2*<E>)), for sqrt(E) we have then normal distribution
6405 3 eex=eex+(qsran(b10)+qsran(b10)+qsran(b10)+
6406  * qsran(b10)+qsran(b10)-2.5d0)**2*2.4d0
6407  IF(debug.GE.3)WRITE (moniou,203)eex
6408 203 FORMAT(2x,'XXFRAGM: EXCITATION ENERGY: EEX=',e10.3)
6409 
6410 c If the excitation energy per spectator is larger than EMAX
6411 c multifragmentation takes place ( percolation algorithm is used for it )
6412  IF(eex/ns.GT.emax)THEN
6413 c Multifragmentation
6414  CALL xxfrag(xa,ns,rmin)
6415  ELSE
6416 
6417 c Otherwise average number of eveporated nucleons equals EEX/EEV, where
6418 c EEV - mean excitation energy carried out by one nucleon
6419  nf=ixxson(ns,eex/eev,qsran(b10))
6420  nsf=nsf+1
6421 c Recording of the fragment produced
6422  iaf(nsf)=ns-nf
6423  IF(debug.GE.3)WRITE (moniou,206)iaf(nsf)
6424 206 FORMAT(2x,'XXFRAGM - EVAPORATION: MASS NUMBER OF THE FRAGMENT:'
6425  * ,i2)
6426 
6427 c Some part of excitation energy is carried out by alphas; we determine the
6428 c number of alphas simply as NF/4
6429  nal=nf/4
6430  IF(nal.NE.0)THEN
6431 c Recording of the evaporated alphas
6432  DO 4 i=1,nal
6433  nsf=nsf+1
6434 4 iaf(nsf)=4
6435  ENDIF
6436 
6437  nf=nf-4*nal
6438  IF(nf.NE.0)THEN
6439 c Recording of the evaporated nucleons
6440  DO 5 i=1,nf
6441  nsf=nsf+1
6442 5 iaf(nsf)=1
6443  ENDIF
6444  IF(debug.GE.3)WRITE (moniou,204)nf,nal
6445 204 FORMAT(2x,'XXFRAGM - EVAPORATION: NUMBER OF NUCLEONS NF=',i2,
6446  * 'NUMBER OF ALPHAS NAL=',i2)
6447  ENDIF
6448 6 CONTINUE
6449  IF(debug.GE.3)WRITE (moniou,202)
6450 202 FORMAT(2x,'XXFRAGM - END')
6451  RETURN
6452  END
6453 C=======================================================================
6454 
6455  SUBROUTINE xxfz(B,GZ)
6456 c Hadron-hadron and hadron-nucleus cross sections calculation
6457 c-----------------------------------------------------------------------
6458  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6459  INTEGER DEBUG
6460  dimension gz(2),fhard(3)
6461  COMMON /area1/ ia(2),icz,icp
6462  COMMON /area2/ s,y0,wp0,wm0
6463  COMMON /area7/ rp1
6464  COMMON /ar3/ x1(7),a1(7)
6465  COMMON /area43/ moniou
6466  COMMON /debug/ debug
6467  SAVE
6468 
6469  IF(debug.GE.2)WRITE (moniou,201)
6470 201 FORMAT(2x,'XXFZ - HADRONIC CROSS-SECTIONS CALCULATION')
6471 
6472  DO 1 l=1,2
6473 1 gz(l)=0.d0
6474  e1=exp(-1.d0)
6475 
6476  DO 2 i1=1,7
6477  DO 2 m=1,2
6478  z=.5d0+x1(i1)*(m-1.5d0)
6479  s1=dsqrt(rp1*z)
6480  zv1=exp(-z)
6481  s2=dsqrt(rp1*(1.d0-dlog(z)))
6482  zv2=e1*z
6483 C??????????
6484 C VV1=EXP(-PSFAZ(ZV1,FSOFT,FHARD,FSHARD))*(1.D0-FHARD(1)
6485 C * -FHARD(2)-FHARD(3))
6486 C VV2=EXP(-PSFAZ(ZV2,FSOFT,FHARD,FSHARD))*(1.D0-FHARD(1)
6487 C * -FHARD(2)-FHARD(3))
6488 
6489  vv1=exp(-psfaz(zv1,fsoft,fhard,fshard)-fhard(1)
6490  * -fhard(2)-fhard(3))
6491  vv2=exp(-psfaz(zv2,fsoft,fhard,fshard)-fhard(1)
6492  * -fhard(2)-fhard(3))
6493 c???????????
6494 
6495  IF(ia(2).EQ.1)THEN
6496  cg1=1.d0
6497  cg2=1.d0
6498  ELSE
6499  cg1=xxrot(b,s1)
6500  cg2=xxrot(b,s2)
6501  ENDIF
6502 
6503  DO 2 l=1,2
6504 2 gz(l)=gz(l)+ a1(i1)*(cg1*(1.d0-vv1**l)+cg2*(1.d0-vv2**l)/z)
6505  IF(debug.GE.3)WRITE (moniou,202)
6506 202 FORMAT(2x,'XXFZ - END')
6507  RETURN
6508  END
6509 C=======================================================================
6510 
6511  SUBROUTINE xxgau(GZ)
6512 c Impact parameter integration for impact parameters <BM -
6513 c for hadron-hadron and hadron-nucleus cross-sections calculation
6514 c-----------------------------------------------------------------------
6515  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6516  INTEGER DEBUG
6517  dimension gz(3),gz0(3)
6518  COMMON /area6/ pi,bm,am
6519  COMMON /ar3/ x1(7),a1(7)
6520  COMMON /ar2/ r,rm
6521  COMMON /area43/ moniou
6522  COMMON /debug/ debug
6523  SAVE
6524 
6525  IF(debug.GE.2)WRITE (moniou,201)
6526 201 FORMAT(2x,'XXGAU - NUCLEAR CROSS-SECTIONS CALCULATION')
6527 
6528  DO 1 i=1,3
6529 1 gz(i)=0.d0
6530 
6531  DO 2 i=1,7
6532  DO 2 m=1,2
6533  b=bm*dsqrt(.5d0+x1(i)*(m-1.5d0))
6534  CALL xxfau(b,gz0)
6535  DO 2 l=1,3
6536 2 gz(l)=gz(l)+gz0(l)*a1(i)
6537  DO 3 l=1,3
6538 3 gz(l)=gz(l)*(bm*am)**2*pi*.5d0
6539  IF(debug.GE.3)WRITE (moniou,202)
6540 202 FORMAT(2x,'XXGAU - END')
6541  RETURN
6542  END
6543 C=======================================================================
6544 
6545  SUBROUTINE xxgau1(GZ)
6546 c Impact parameter integration for impact parameters >BM -
6547 c for hadron-hadron and hadron-nucleus cross-sections calculation
6548 c-----------------------------------------------------------------------
6549  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6550  INTEGER DEBUG
6551  dimension gz(3),gz0(3)
6552  COMMON /area6/ pi,bm,am
6553  COMMON /ar5/ x5(2),a5(2)
6554  COMMON /ar2/ r,rm
6555  COMMON /area43/ moniou
6556  COMMON /debug/ debug
6557  SAVE
6558 
6559  IF(debug.GE.2)WRITE (moniou,201)
6560 201 FORMAT(2x,'XXGAU1 - NUCLEAR CROSS-SECTIONS CALCULATION')
6561 
6562  DO 1 i=1,2
6563  b=bm+x5(i)
6564  CALL xxfau(b,gz0)
6565  DO 1 l=1,3
6566 1 gz(l)=gz(l)+gz0(l)*a5(i)*exp(x5(i))*b*2.d0*pi*am*am
6567  IF(debug.GE.3)WRITE (moniou,202)
6568 202 FORMAT(2x,'XXGAU1 - END')
6569  RETURN
6570  END
6571 C=======================================================================
6572 
6573  SUBROUTINE xxgener(WP0,WM0,EY0,S0X,C0X,S0,C0,IC1,IC2)
6574 c To simulate the fragmentation of the string into secondary hadrons
6575 c The algorithm conserves energy-momentum;
6576 c WP0, WM0 are initial longitudinal momenta ( E+p, E-p ) of the quarks
6577 c at the ends of the string; IC1, IC2 - their types
6578 c The following partons types are used: 1 - u, -1 - U, 2 - d, -2 - D,
6579 c 3 - ud, -3 - UD, 4 - s, -4 - S, 5 - c, -5 - C,
6580 c 6 - uu, 7 - dd, -6 - UU, -7 - DD
6581 c-----------------------------------------------------------------------
6582  IMPLICIT DOUBLE PRECISION (a-h,o-z)
6583  INTEGER DEBUG
6584  CHARACTER *2 TYQ
6585  dimension wp(2),ic(2),ept(4),ep(4),ey(3),ey0(3)
6586 c WP(1), WP(2) - current longitudinal momenta of the partons at the string
6587 c ends, IC(1), IC(2) - their types
6588  COMMON /area8/ wwm,bep,ben,bek,bec,dc(5),deta,almpt
6589  COMMON /area10/ stmass,am0,amn,amk,amc,amlamc,amlam,ameta
6590  COMMON /area11/ b10
6591  COMMON /area19/ ahl(5)
6592 ********************************************************
6593  COMMON /area21/ dmmin(5)
6594 ********************************************************
6595  COMMON /area28/ arr(4)
6596  COMMON /area42/ tyq(15)
6597  COMMON /area43/ moniou
6598  COMMON /debug/ debug
6599  SAVE
6600  EXTERNAL qsran
6601 
6602  IF(debug.GE.2)WRITE (moniou,201)tyq(8+ic1),tyq(8+ic2),
6603  * wp0,wm0,ey0,s0x,c0x,s0,c0
6604 201 FORMAT(2x,'XXGENER: PARTON FLAVORS AT THE ENDS OF THE STRING:',
6605  * 2x,a2,2x,a2/4x,'LIGHT CONE MOMENTA OF THE STRING: ',e10.3,
6606  * 2x,e10.3/4x,'EY0=',3e10.3/4x,
6607  * 'S0X=',e10.3,2x,'C0X=',e10.3,2x,'S0=',e10.3,2x,'C0=',e10.3)
6608 
6609  ww=wp0*wm0
6610  ept(1)=.5d0*(wp0+wm0)
6611  ept(2)=.5d0*(wp0-wm0)
6612  ept(3)=0.d0
6613  ept(4)=0.d0
6614  ic(1)=ic1
6615  ic(2)=ic2
6616 
6617 1 sww=dsqrt(ww)
6618  CALL psdeftr(ww,ept,ey)
6619  j=int(2.d0*qsran(b10))+1
6620  IF(debug.GE.3)THEN
6621  iqt=8+ic(j)
6622  WRITE (moniou,203)j,tyq(iqt),ww
6623 203 FORMAT(2x,'XXGENER: CURRENT PARTON FLAVOR AT THE END ',i1,
6624  * ' OF THE STRING: ',a2/4x,' STRING MASS: ',e10.3)
6625  ENDIF
6626 
6627  iab=iabs(ic(j))
6628  is=ic(j)/iab
6629  IF(iab.GT.5)iab=3
6630  iaj=iabs(ic(3-j))
6631  IF(iaj.GT.5)iaj=3
6632  IF(iaj.EQ.3)THEN
6633  restm=amn
6634  ELSEIF(iaj.EQ.4)THEN
6635  restm=amk
6636  ELSEIF(iaj.EQ.5)THEN
6637  restm=amc
6638  ELSE
6639  restm=am0
6640  ENDIF
6641 
6642  IF(iab.LE.2.AND.sww.GT.restm+2.d0*am0+wwm.OR.
6643  *iab.EQ.3.AND.sww.GT.restm+am0+amn+wwm.OR.
6644  *iab.EQ.4.AND.sww.GT.restm+am0+amk+wwm.OR.
6645  *iab.EQ.5.AND.sww.GT.restm+am0+amc+wwm)THEN
6646 
6647  IF(iab.LE.2)THEN
6648  IF(sww.GT.restm+2.d0*amc.AND.qsran(b10).LT.dc(3))THEN
6649 c D-meson generation
6650  restm=(restm+amc)**2
6651  bet=bec
6652  ami=amc**2
6653  alf=almpt-arr(4)
6654  blf=ahl(4)
6655  ic0=ic(j)-9*is
6656  ic(j)=5*is
6657  ELSEIF(sww.GT.restm+2.d0*amn.AND.qsran(b10).LT.dc(1))THEN
6658 c Nucleon generation
6659  restm=(restm+amn)**2
6660  bet=ben
6661  ami=amn**2
6662  alf=almpt-arr(2)
6663  blf=ahl(2)
6664  ic0=ic(j)+is
6665  ic(j)=-3*is
6666  ELSEIF(sww.GT.restm+2.d0*amk.AND.qsran(b10).LT.dc(2))THEN
6667 c Kaon generation
6668  restm=(restm+amk)**2
6669  bet=bek
6670  ami=amk**2
6671  alf=almpt-arr(3)
6672  blf=ahl(3)
6673  ic0=ic(j)+3*is
6674  ic(j)=4*is
6675  ELSEIF(sww.GT.restm+ameta+am0.AND.qsran(b10).LT.deta)THEN
6676 c Eta generation
6677  restm=(restm+am0)**2
6678  bet=bek
6679  ami=ameta**2
6680  alf=almpt-arr(1)
6681  blf=ahl(1)
6682  ic0=10
6683  ELSE
6684 c Pion generation
6685  restm=(restm+am0)**2
6686  bet=bep
6687  ami=am0**2
6688  alf=almpt-arr(1)
6689  blf=ahl(1)
6690 
6691  IF(qsran(b10).LT..3333d0)THEN
6692  ic0=0
6693  ELSE
6694  ic0=3*is-2*ic(j)
6695  ic(j)=3*is-ic(j)
6696  ENDIF
6697  ENDIF
6698 
6699  ELSEIF(iab.EQ.3)THEN
6700  IF(sww.GT.restm+amc+amlamc.AND.qsran(b10).LT.dc(5).AND.
6701  * iabs(ic(j)).EQ.3)THEN
6702 c Lambda_C generation
6703  restm=(restm+amc)**2
6704  bet=bec
6705  ami=amlamc**2
6706  alf=almpt-arr(4)
6707  blf=ahl(5)
6708  ic0=9*is
6709  ic(j)=-5*is
6710  ELSEIF(sww.GT.restm+amk+amlam.AND.qsran(b10).LT.dc(4).AND.
6711  * iabs(ic(j)).EQ.3)THEN
6712 c Lambda generation
6713  restm=(restm+amk)**2
6714  bet=bek
6715  ami=amlam**2
6716  alf=almpt-arr(3)
6717  blf=ahl(2)+arr(1)-arr(3)
6718  ic0=6*is
6719  ic(j)=-4*is
6720  ELSE
6721 c Nucleon generation
6722  restm=(restm+am0)**2
6723  bet=ben
6724  ami=amn**2
6725  alf=almpt-arr(1)
6726  blf=ahl(2)
6727  IF(iabs(ic(j)).EQ.3)THEN
6728  ic0=is*int(2.5d0+qsran(b10))
6729  ic(j)=is-ic0
6730  ELSE
6731  ic0=ic(j)-4*is
6732  ic(j)=ic0-4*is
6733  ENDIF
6734  ENDIF
6735 
6736  ELSEIF(iab.EQ.4)THEN
6737  IF(sww.GT.restm+amn+amlam.AND.qsran(b10).LT.dc(1))THEN
6738 c Lambda generation
6739  restm=(restm+amn)**2
6740  bet=ben
6741  ami=amlam**2
6742  alf=almpt-arr(2)
6743  blf=ahl(2)+arr(1)-arr(3)
6744  ic0=6*is
6745  ic(j)=-3*is
6746  ELSE
6747 c Kaon generation
6748  restm=(restm+am0)**2
6749  bet=bep
6750  ami=amk**2
6751  alf=almpt-arr(1)
6752  blf=ahl(3)
6753  ic(j)=is*int(1.5d0+qsran(b10))
6754  ic0=-3*is-ic(j)
6755  ENDIF
6756 
6757  ELSEIF(iab.EQ.5)THEN
6758  IF(sww.GT.restm+amn+amlamc.AND.qsran(b10).LT.dc(1))THEN
6759 c Lambda_C generation
6760  restm=(restm+amn)**2
6761  bet=ben
6762  ami=amlamc**2
6763  alf=almpt-arr(2)
6764  blf=ahl(5)
6765  ic0=9*is
6766  ic(j)=-3*is
6767  ELSE
6768 c D-meson generation
6769  restm=(restm+am0)**2
6770  bet=bep
6771  ami=amc**2
6772  alf=almpt-arr(1)
6773  blf=ahl(4)
6774  ic(j)=is*int(1.5d0+qsran(b10))
6775  ic0=9*is-ic(j)
6776  ENDIF
6777  ENDIF
6778 
6779 ********************************************************
6780  ptmax=pslam(ww,restm,ami)
6781  IF(ptmax.LT.0.)ptmax=0.
6782 
6783  IF(ptmax.LT.bet**2)THEN
6784 2 pti=ptmax*qsran(b10)
6785  IF(qsran(b10).GT.exp(-dsqrt(pti)/bet))GOTO 2
6786  ELSE
6787 3 pti=(bet*dlog(qsran(b10)*qsran(b10)))**2
6788  IF(pti.GT.ptmax)GOTO 3
6789  ENDIF
6790 
6791  amt=ami+pti
6792  restm1=restm+pti
6793 ********************************************************
6794 c ALF=ALF+2.*PTI
6795 
6796  zmin=dsqrt(amt/ww)
6797  zmax=xxtwdec(ww,amt,restm1)
6798  z1=(1.-zmax)**alf
6799  z2=(1.-zmin)**alf
6800 4 z=1.-(z1+(z2-z1)*qsran(b10))**(1./alf)
6801  IF(qsran(b10).GT.(z/zmax)**blf)GOTO 4
6802  wp(j)=z*sww
6803  wp(3-j)=amt/wp(j)
6804  ep(1)=.5d0*(wp(1)+wp(2))
6805  ep(2)=.5d0*(wp(1)-wp(2))
6806  pti=dsqrt(pti)
6807  CALL pscs(c,s)
6808  ep(3)=pti*c
6809  ep(4)=pti*s
6810 
6811  ept(1)=sww-ep(1)
6812  DO 5 i=2,4
6813 5 ept(i)=-ep(i)
6814  ww=psnorm(ept)
6815  IF(ww.LT.restm)GOTO 4
6816 
6817  CALL pstrans(ep,ey)
6818  CALL pstrans(ept,ey)
6819 
6820  IF(s0x.NE.0.d0.OR.s0.NE.0.d0)THEN
6821  CALL psrotat(ep,s0x,c0x,s0,c0)
6822  ENDIF
6823 
6824  IF(ey0(1)*ey0(2)*ey0(3).NE.1.d0)THEN
6825  CALL pstrans(ep,ey0)
6826  ENDIF
6827  CALL xxreg(ep,ic0)
6828  ELSE
6829 
6830 
6831  ami2=restm**2
6832  bet=bep
6833  IF(iab.LE.2.AND.iaj.LE.2)THEN
6834  ami=am0**2
6835  ic0=-ic(1)-ic(2)
6836  IF(ic0.NE.0)THEN
6837  ic(j)=ic0*int(.5d0+qsran(b10))
6838  ic(3-j)=ic0-ic(j)
6839  ELSE
6840  IF(qsran(b10).LT..2d0)THEN
6841  ic(j)=0
6842  ic(3-j)=0
6843  ELSE
6844  ic(j)=3*is-2*ic(j)
6845  ic(3-j)=-ic(j)
6846  ENDIF
6847  ENDIF
6848 
6849  ELSEIF(iab.EQ.3.OR.iaj.EQ.3)THEN
6850  IF(iab.EQ.3)THEN
6851  ami=amn**2
6852  IF(iabs(ic(j)).EQ.3)THEN
6853  IF(iaj.EQ.3)THEN
6854  IF(iabs(ic(3-j)).EQ.3)THEN
6855  ic(j)=is*int(2.5d0+qsran(b10))
6856  ic(3-j)=-ic(j)
6857  ELSE
6858  ic(3-j)=ic(3-j)+4*is
6859  ic(j)=5*is+ic(3-j)
6860  ENDIF
6861  ELSEIF(iaj.LT.3)THEN
6862  IF(qsran(b10).LT..3333d0)THEN
6863  ic(j)=ic(3-j)+is
6864  ic(3-j)=0
6865  ELSE
6866  ic(j)=is*(4-iaj)
6867  ic(3-j)=is*(3-2*iaj)
6868  ENDIF
6869  ELSEIF(iaj.EQ.4)THEN
6870  ic(j)=is*int(2.5d0+qsran(b10))
6871  ic(3-j)=-ic(j)-2*is
6872  ELSEIF(iaj.EQ.5)THEN
6873  ic(j)=is*int(2.5d0+qsran(b10))
6874  ic(3-j)=-ic(j)+10*is
6875  ENDIF
6876  ELSE
6877  ic(j)=ic(j)-4*is
6878  ic0=ic(j)-4*is
6879  IF(iaj.EQ.3)THEN
6880  ic(3-j)=ic0-is
6881  ELSEIF(iaj.LT.3)THEN
6882  ic(3-j)=-ic(3-j)-ic0
6883  ELSEIF(iaj.EQ.4)THEN
6884  ic(3-j)=ic0-3*is
6885  ELSEIF(iaj.EQ.5)THEN
6886  ic(3-j)=ic0+9*is
6887  ENDIF
6888  ENDIF
6889  ELSE
6890  IF(iabs(ic(3-j)).EQ.3)THEN
6891  IF(iab.LT.3)THEN
6892  ami=am0**2
6893  IF(qsran(b10).LT..3333d0)THEN
6894  ic(3-j)=ic(j)+is
6895  ic(j)=0
6896  ELSE
6897  ic(3-j)=is*(4-iab)
6898  ic(j)=is*(3-2*iab)
6899  ENDIF
6900  ELSEIF(iab.EQ.4)THEN
6901  ami=amk**2
6902  ic(3-j)=is*int(2.5d0+qsran(b10))
6903  ic(j)=-ic(3-j)-2*is
6904  ELSEIF(iab.EQ.5)THEN
6905  ami=amc**2
6906  ic(3-j)=is*int(2.5d0+qsran(b10))
6907  ic(j)=-ic(3-j)+10*is
6908  ENDIF
6909  ELSE
6910  ic(3-j)=ic(3-j)-4*is
6911  ic0=ic(3-j)-4*is
6912  IF(iab.LT.3)THEN
6913  ami=am0**2
6914  ic(j)=-ic0-ic(j)
6915  ELSEIF(iab.EQ.4)THEN
6916  ami=amk**2
6917  ic(j)=ic0-3*is
6918  ELSEIF(iab.EQ.5)THEN
6919  ami=amc**2
6920  ic(j)=ic0+9*is
6921  ENDIF
6922  ENDIF
6923  ENDIF
6924 
6925  ELSEIF(iab.EQ.4.OR.iaj.EQ.4)THEN
6926 
6927  IF(iab.EQ.4)THEN
6928  ami=amk**2
6929 
6930  IF(iaj.EQ.4)THEN
6931  ic(j)=-is*int(4.5d0+qsran(b10))
6932  ic(3-j)=-ic(j)
6933  ELSEIF(iaj.EQ.5)THEN
6934  ic(j)=-is*int(4.5d0+qsran(b10))
6935  ic(3-j)=-ic(j)-12*is
6936  ELSE
6937  ic0=ic(3-j)+int(.6667d0+qsran(b10))*(-3*is-2*ic(3-j))
6938  ic(j)=ic0-3*is
6939  ic(3-j)=ic0-ic(3-j)
6940  ENDIF
6941  ELSE
6942  IF(iab.LE.2)THEN
6943  ami=am0**2
6944  ic0=ic(j)+int(.6667d0+qsran(b10))*(3*is-2*ic(j))
6945  ic(j)=ic0-ic(j)
6946  ic(3-j)=ic0+3*is
6947  ELSEIF(iab.EQ.5)THEN
6948  ami=amc**2
6949  ic(3-j)=is*int(4.5d0+qsran(b10))
6950  ic(j)=-ic(3-j)+12*is
6951  ENDIF
6952  ENDIF
6953 
6954  ELSEIF(iab.EQ.5.OR.iaj.EQ.5)THEN
6955 
6956  IF(iab.EQ.5)THEN
6957  ami=amc**2
6958 
6959  IF(iaj.EQ.5)THEN
6960  ic(j)=is*int(7.5d0+qsran(b10))
6961  ic(3-j)=-ic(j)
6962  ELSE
6963  ic0=ic(3-j)+int(.6667d0+qsran(b10))*(-3*is-2*ic(3-j))
6964  ic(j)=ic0+9*is
6965  ic(3-j)=ic0-ic(3-j)
6966  ENDIF
6967  ELSE
6968  ami=am0**2
6969  ic0=ic(j)+int(.6667d0+qsran(b10))*(3*is-2*ic(j))
6970  ic(j)=ic0-ic(j)
6971  ic(3-j)=ic0-9*is
6972  ENDIF
6973  ENDIF
6974 
6975  ptmax=pslam(ww,ami2,ami)
6976  IF(ptmax.LT.0.)ptmax=0.
6977  IF(ptmax.LT.bet**2)THEN
6978 6 pti=ptmax*qsran(b10)
6979  IF(qsran(b10).GT.exp(-dsqrt(pti)/bet))GOTO 6
6980  ELSE
6981 7 pti=(bet*dlog(qsran(b10)*qsran(b10)))**2
6982  IF(pti.GT.ptmax)GOTO 7
6983  ENDIF
6984 
6985  amt1=ami+pti
6986  amt2=ami2+pti
6987 
6988  z=xxtwdec(ww,amt1,amt2)
6989  wp(j)=z*sww
6990  wp(3-j)=amt1/wp(j)
6991  ep(1)=.5d0*(wp(1)+wp(2))
6992  ep(2)=.5d0*(wp(1)-wp(2))
6993  pti=dsqrt(pti)
6994  CALL pscs(c,s)
6995  ep(3)=pti*c
6996  ep(4)=pti*s
6997 
6998  ept(1)=sww-ep(1)
6999  DO 8 i=2,4
7000 8 ept(i)=-ep(i)
7001 
7002  CALL pstrans(ep,ey)
7003  CALL pstrans(ept,ey)
7004 
7005  IF(s0x.NE.0.d0.OR.s0.NE.0.d0)THEN
7006  CALL psrotat(ep,s0x,c0x,s0,c0)
7007  CALL psrotat(ept,s0x,c0x,s0,c0)
7008  ENDIF
7009  IF(ey0(1)*ey0(2)*ey0(3).NE.1.d0)THEN
7010  CALL pstrans(ep,ey0)
7011  CALL pstrans(ept,ey0)
7012  ENDIF
7013 
7014  CALL xxreg(ep,ic(j))
7015  CALL xxreg(ept,ic(3-j))
7016  IF(debug.GE.3)WRITE (moniou,202)
7017 202 FORMAT(2x,'XXGENER - END')
7018  RETURN
7019  ENDIF
7020  GOTO 1
7021  END
7022 C=======================================================================
7023 
7024  SUBROUTINE xxjetsim
7025 c Procedure for jet hadronization - each gluon is
7026 c considered to be splitted into quark-antiquark pair and usual soft
7027 c strings are assumed to be formed between quark and antiquark
7028 c-----------------------------------------------------------------------
7029  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7030  INTEGER DEBUG
7031  dimension ep(4),ep1(4),ey(3)
7032  COMMON /area10/ stmass,am(7)
7033  COMMON /area11/ b10
7034  COMMON /area43/ moniou
7035  COMMON /debug/ debug
7036  COMMON /area46/ epjet(4,2,15000),ipjet(2,15000)
7037  COMMON /area47/ njtot
7038  SAVE
7039 
7040  IF(debug.GE.2)WRITE (moniou,201)njtot
7041 201 FORMAT(2x,'XXJETSIM: TOTAL NUMBER OF JETS NJTOT=',i4)
7042  IF(njtot.EQ.0)RETURN
7043  DO 2 nj=1,njtot
7044  DO 1 i=1,4
7045  ep1(i)=epjet(i,1,nj)
7046 1 ep(i)=ep1(i)+epjet(i,2,nj)
7047  pt3=dsqrt(ep1(3)**2+ep1(4)**2)
7048  pt4=dsqrt(epjet(3,2,nj)**2+epjet(4,2,nj)**2)
7049 
7050 c Invariant mass square for the jet
7051  ww=psnorm(ep)
7052  sww=dsqrt(ww)
7053 
7054  CALL psdeftr(ww,ep,ey)
7055  CALL pstrans1(ep1,ey)
7056  CALL psdefrot(ep1,s0x,c0x,s0,c0)
7057 
7058 2 CALL xxgener(sww,sww,ey,s0x,c0x,s0,c0,ipjet(1,nj),ipjet(2,nj))
7059  IF(debug.GE.3)WRITE (moniou,202)
7060 202 FORMAT(2x,'XXJETSIM - END')
7061  RETURN
7062  END
7063 C=======================================================================
7064 
7065  SUBROUTINE xxreg(EP0,IC)
7066 c Registration of the produced hadron;
7067 c EP - 4-momentum,
7068 c IC - hadron type
7069 c-----------------------------------------------------------------------
7070  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7071  INTEGER DEBUG
7072  dimension ep(4),ep0(4)
7073  COMMON /area4/ ey0(3)
7074  COMMON /area10/ stmass,am0,amn,amk,amc,amlamc,amlam,ameta
7075  COMMON /area11/ b10
7076  COMMON /area12/ nsh
7077  COMMON /area14/ esp(4,95000),ich(95000)
7078  COMMON /area43/ moniou
7079  COMMON /debug/ debug
7080  SAVE
7081 
7082  IF(debug.GE.2)WRITE (moniou,201)ic,ep0
7083 201 FORMAT(2x,'XXREG: IC=',i2,2x,'C.M. 4-MOMENTUM:',2x,4(e10.3,1x))
7084  pt=dsqrt(ep0(3)**2+ep0(4)**2)
7085 c if(pt.gt.11.d0)write (MONIOU,*)'pt,ic,ep',pt,ic,ep0
7086 c if(pt.gt.11.d0)write (*,*)'pt,ic,ep',pt,ic,ep0
7087 
7088  nsh=nsh+1
7089  IF (nsh .GT. 95000) THEN
7090  WRITE(moniou,*)'XXREG: TOO MANY SECONDARY PARTICLES'
7091  WRITE(moniou,*)'XXREG: NSH = ',nsh
7092  stop
7093  ENDIF
7094  DO 4 i=1,4
7095 4 ep(i)=ep0(i)
7096  CALL pstrans(ep,ey0)
7097  IF(debug.GE.3)WRITE (moniou,202)ep
7098 202 FORMAT(2x,'XXREG: LAB. 4-MOMENTUM:',2x,4(e10.3,1x))
7099 
7100  ich(nsh)=ic
7101  DO 3 i=1,4
7102 3 esp(i,nsh)=ep(i)
7103 
7104  IF(debug.GE.3)WRITE (moniou,203)
7105 203 FORMAT(2x,'XXREG - END')
7106  RETURN
7107  END
7108 C=======================================================================
7109 
7110  FUNCTION xxrot(S,B)
7111 c Convolution of nuclear profile functions (axial angle integration)
7112 c-----------------------------------------------------------------------
7113  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7114  INTEGER DEBUG
7115  COMMON /ar8/ x2(4),a2
7116  COMMON /area43/ moniou
7117  COMMON /debug/ debug
7118  SAVE
7119 
7120  IF(debug.GE.2)WRITE (moniou,201)b
7121 201 FORMAT(2x,'XXROT - AXIAL ANGLE INTEGRATION OF THE ',
7122  * 'NUCLEAR PROFILE FUNCTION'/4x,
7123  * 'IMPACT PARAMETER B=',e10.3,2x,'NUCLEON COORDINATE S=',e10.3)
7124 
7125  xxrot=0.
7126  DO 1 i=1,4
7127  sb1=b**2+s**2-2.*b*s*(2.*x2(i)-1.)
7128  sb2=b**2+s**2-2.*b*s*(1.-2.*x2(i))
7129 1 xxrot=xxrot+(xxt(sb1)+xxt(sb2))
7130  xxrot=xxrot*a2
7131  IF(debug.GE.3)WRITE (moniou,202)xxrot
7132 202 FORMAT(2x,'XXROT=',e10.3)
7133  RETURN
7134  END
7135 C=======================================================================
7136 
7137  SUBROUTINE xxstr(WPI0,WMI0,WP0,WM0,IC10,IC120,IC210,IC20)
7138 **************************************************
7139 c Fragmentation process for the pomeron ( quarks and antiquarks types at the
7140 c ends of the two strings are determined, energy-momentum is shared
7141 c between them and strings fragmentation is simulated )
7142 c-----------------------------------------------------------------------
7143  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7144  INTEGER DEBUG
7145  dimension ey(3)
7146  COMMON /area6/ pi,bm,ammm
7147  COMMON /area10/ stmass,am(7)
7148  COMMON /area11/ b10
7149  COMMON /area43/ moniou
7150  COMMON /debug/ debug
7151  SAVE
7152  EXTERNAL qsran
7153 
7154  IF(debug.GE.2)WRITE (moniou,201)wpi0,wmi0,wp0,wm0
7155 201 FORMAT(2x,'XXSTR: WPI0=',e10.3,2x,'WMI0=',e10.3,2x,
7156  * 'WP0=',e10.3,2x,'WM0=',e10.3)
7157  DO 1 i=1,3
7158 1 ey(i)=1.d0
7159 
7160  wpi=wpi0
7161  wmi=wmi0
7162 c Quark-antiquark types (1 - u, 2 - d, -1 - u~, -2 - d~); s- and d- quarks are
7163 c taken into consideration at the fragmentation step
7164 **************************************************
7165  IF(ic10.EQ.0)THEN
7166  ic1=int(1.5+qsran(b10))
7167  ic12=-ic1
7168  ELSEIF(ic10.GT.0)THEN
7169  ic1=ic10
7170  ic12=ic120
7171  ELSE
7172  ic1=ic120
7173  ic12=ic10
7174  ENDIF
7175  IF(ic20.EQ.0)THEN
7176  ic2=int(1.5+qsran(b10))
7177  ic21=-ic2
7178  ELSEIF(ic20.gt.0)THEN
7179  ic2=ic20
7180  ic21=ic210
7181  ELSE
7182  ic2=ic210
7183  ic21=ic20
7184  ENDIF
7185 **************************************************
7186 
7187 c Longitudinal momenta for the strings
7188  wp1=wpi*cos(pi*qsran(b10))**2
7189  wm1=wmi*cos(pi*qsran(b10))**2
7190  wpi=wpi-wp1
7191  wmi=wmi-wm1
7192 c String masses
7193  sm1=wp1*wm1
7194  sm2=wpi*wmi
7195 c Too short strings are neglected (energy is given to partner string or to the hadron
7196 c (nucleon) to which the pomeron is connected)
7197  IF(sm1.GT.stmass.AND.sm2.GT.stmass)THEN
7198 c Strings fragmentation is simulated - GENER
7199  CALL xxgener(wp1,wm1,ey,0.d0,1.d0,0.d0,1.d0,ic1,ic21)
7200  CALL xxgener(wpi,wmi,ey,0.d0,1.d0,0.d0,1.d0,ic12,ic2)
7201  ELSEIF(sm1.GT.stmass)THEN
7202  CALL xxgener(wp1+wpi,wm1+wmi,ey,0.d0,1.d0,0.d0,1.d0,ic1,ic21)
7203  ELSEIF(sm2.GT.stmass)THEN
7204  CALL xxgener(wpi+wp1,wmi+wm1,ey,0.d0,1.d0,0.d0,1.d0,ic12,ic2)
7205  ELSE
7206  wp0=wp0+wp1+wpi
7207  wm0=wm0+wm1+wmi
7208  ENDIF
7209  IF(debug.GE.3)WRITE (moniou,202)wp0,wm0
7210 202 FORMAT(2x,'XXSTR - RETURNED LIGHT CONE MOMENTA:',
7211  * 2x,'WP0=',e10.3,2x,'WM0=',e10.3)
7212  RETURN
7213  END
7214 C=======================================================================
7215 
7216  FUNCTION xxt(B)
7217 c Nuclear profile function value at impact parameter squared B
7218 c-----------------------------------------------------------------------
7219  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7220  INTEGER DEBUG
7221  COMMON /area6/ pi,bm,am
7222  COMMON /ar2/ r,rm
7223  COMMON /ar5/ x5(2),a5(2)
7224  COMMON /ar9/ x9(3),a9(3)
7225  COMMON /area43/ moniou
7226  COMMON /debug/ debug
7227  SAVE
7228 
7229  IF(debug.GE.2)WRITE (moniou,201)b
7230 201 FORMAT(2x,'XXT - NUCLEAR PROFILE FUNCTION VALUE AT IMPACT',
7231  * ' PARAMETER SQUARED B=',e10.3)
7232  xxt=0.
7233  zm=rm**2-b
7234  IF(zm.GT.4.*b)THEN
7235  zm=dsqrt(zm)
7236  ELSE
7237  zm=2.*dsqrt(b)
7238  ENDIF
7239 
7240  DO 1 i=1,3
7241  z1=zm*(1.+x9(i))*0.5
7242  z2=zm*(1.-x9(i))*0.5
7243  quq=dsqrt(b+z1**2)-r
7244  IF (quq.LT.85.)xxt=xxt+a9(i)/(1.+exp(quq))
7245  quq=dsqrt(b+z2**2)-r
7246  IF (quq.LT.85.)xxt=xxt+a9(i)/(1.+exp(quq))
7247 1 CONTINUE
7248  xxt=xxt*zm*0.5
7249  dt=0.
7250  DO 2 i=1,2
7251  z1=x5(i)+zm
7252  quq=dsqrt(b+z1**2)-r-x5(i)
7253  IF (quq.LT.85.)dt=dt+a5(i)/(exp(-x5(i))+exp(quq))
7254 2 CONTINUE
7255  xxt=xxt+dt
7256  IF(debug.GE.3)WRITE (moniou,202)xxt
7257 202 FORMAT(2x,'XXT=',e10.3)
7258  RETURN
7259  END
7260 C=======================================================================
7261 
7262  FUNCTION xxtwdec(S,A,B)
7263 c Kinematical function for two particle decay -
7264 C light cone momentum share for
7265 c the particle of mass squared A,
7266 C B - partner's mass squared,
7267 C S - two particle invariant mass
7268 c-----------------------------------------------------------------------
7269  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7270  INTEGER DEBUG
7271  COMMON /area43/ moniou
7272  COMMON /debug/ debug
7273  SAVE
7274 
7275  IF(debug.GE.2)WRITE (moniou,201)s,a,b
7276 201 FORMAT(2x,'XXTWDEC: S=',e10.3,2x,'A=',e10.3,2x,'B=',e10.3)
7277 
7278  x=.5d0*(1.d0+(a-b)/s)
7279  dx=(x*x-a/s)
7280  IF(dx.GT.0.d0)THEN
7281  x=x+dsqrt(dx)
7282  ELSE
7283  x=dsqrt(a/s)
7284  ENDIF
7285  xxtwdec=x
7286  IF(debug.GE.3)WRITE (moniou,202)xxtwdec
7287 202 FORMAT(2x,'XXTWDEC=',e10.3)
7288  RETURN
7289  END
7290 C=======================================================================
7291 
7292  DOUBLE PRECISION FUNCTION gamfun_kk(Y)
7293 C Gamma function : See Abramowitz, page 257, form. 6.4.40
7294 c-----------------------------------------------------------------------
7295  IMPLICIT DOUBLE PRECISION(a-h,o-z)
7296  double precision
7297  + y,r,s,t,afspl,x,
7298  + coef(10),pi,zerod,halfd,oned,twod,tend
7299  SAVE
7300 C
7301  DATA coef/8.3333333333333334d-02,-2.7777777777777778d-03,
7302  . 7.9365079365079365d-04,-5.9523809523809524d-04,
7303  . 8.4175084175084175d-04,-1.9175269175269175d-03,
7304  . 6.4102564102564103d-03,-2.9550653594771242d-02,
7305  . 0.1796443723688306 ,-0.6962161084529506 /
7306  DATA pi/ 3.141592653589793d0/
7307  DATA zerod/0.d0/,halfd/0.5d0/,oned/1.d0/,twod/2.d0/,tend/10.d0/
7308 C
7309  x=y
7310  afspl=oned
7311  n=int(tend-y)
7312  DO 10 i=0,n
7313  afspl=afspl*x
7314  x=x+oned
7315 10 CONTINUE
7316  r=(x-halfd)* log(x)-x+halfd* log(twod*pi)
7317  s=x
7318  t=zerod
7319  DO 20 i=1,10
7320  t=t+coef(i)/s
7321  s=s*x**2
7322 20 CONTINUE
7323  gamfun_kk = exp(r+t)/afspl
7324  END
7325 C=======================================================================
7326 
7327  BLOCK DATA psdata
7328 c Constants for numerical integration (Gaussian weights)
7329 c-----------------------------------------------------------------------
7330  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7331  COMMON /ar3/ x1(7),a1(7)
7332  COMMON /ar5/ x5(2),a5(2)
7333  COMMON /ar8/ x2(4),a2
7334  COMMON /ar9/ x9(3),a9(3)
7335 
7336  DATA x1/.9862838d0,.9284349d0,.8272013d0,.6872929d0,.5152486d0,
7337  * .3191124d0,.1080549d0/
7338  DATA a1/.03511946d0,.08015809d0,.1215186d0,.1572032d0,
7339  * .1855384d0,.2051985d0,.2152639d0/
7340  DATA x2/.00960736d0,.0842652d0,.222215d0,.402455d0/
7341  DATA a2/.392699d0/
7342  DATA x5/.585786d0,3.41421d0/
7343  DATA a5/.853553d0,.146447d0/
7344  DATA x9/.93247d0,.661209d0,.238619d0/
7345  DATA a9/.171324d0,.360762d0,.467914d0/
7346  END
7347 
7348 c following subroutine/function added 8/10/98 dh
7349 C=======================================================================
7350 
7351  SUBROUTINE crossc_kk(NITER,GTOT,GPROD,GABS,GDD,GQEL,GCOH)
7352 c Nucleus-nucleus (nucleus-hydrogen) interaction cross sections
7353 c GTOT - total cross section
7354 c GPROD - production cross section (projectile diffraction included)
7355 c GABS - cut Pomerons cross section
7356 c GDD - projectile diffraction cross section
7357 c GQEL - quasielastic (projectile nucleon knock-out) cross section
7358 c GCOH - coherent (elastic with respect to the projectile) cross section
7359 c (target diffraction is not treated explicitely and contributes to
7360 c GDD, GQEL, GCOH).
7361 c-------------------------------------------------------------------------------
7362  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7363 cdh DIMENSION WABS(8),WDD(8),WQEL(8),WCOH(8),WTOT(8),
7364 cdh *WPROD(8),B0(8),XA(64,3),XB(64,3),AI(8)
7365  dimension wabs(20),wdd(20),wqel(20),wcoh(20),wtot(20),
7366  *wprod(20),b0(20),ai(20),xa(64,3),xb(64,3)
7367  COMMON /area1/ ia(2),icz,icp
7368  COMMON /area6/ pi,bm,am
7369  COMMON /area16/ cc(5)
7370  COMMON /ar3/ x1(7),a1(7)
7371  COMMON /ar5/ x5(2),a5(2)
7372  COMMON /ar9/ x9(3),a9(3)
7373  SAVE
7374  EXTERNAL qsran
7375 
7376  e1=exp(-1.d0)
7377 
7378 cdh DO I=1,3
7379 cdh B0(7-I)=BM*SQRT((1.+X9(I))/2.)
7380 cdh B0(I)=BM*SQRT((1.-X9(I))/2.)
7381 cdh AI(I)=A9(I)*(BM*AM)**2*5.*PI
7382 cdh AI(7-I)=AI(I)
7383  DO i=1,7
7384  b0(15-i)=bm*sqrt((1.+x1(i))/2.)
7385  b0(i)=bm*sqrt((1.-x1(i))/2.)
7386  ai(i)=a1(i)*(bm*am)**2*5.*pi
7387  ai(15-i)=ai(i)
7388  ENDDO
7389 
7390 cdh DO I=1,2
7391 cdh B0(6+I)=BM+X5(I)
7392 cdh AI(6+I)=A5(I)*B0(I)*EXP(X5(I))*20.*AM**2*PI
7393  DO i=1,3
7394  tp=(1.+x9(i))/2.
7395  tm=(1.-x9(i))/2.
7396  b0(14+i)=bm-log(tp)
7397  b0(21-i)=bm-log(tm)
7398  ai(14+i)=a9(i)*b0(14+i)/tp*10.*am**2*pi
7399  ai(21-i)=a9(i)*b0(21-i)/tm*10.*am**2*pi
7400  ENDDO
7401 
7402 cdh DO I=1,8
7403  DO i=1,20
7404  wabs(i)=0.
7405  wdd(i)=0.
7406  wqel(i)=0.
7407  wcoh(i)=0.
7408  ENDDO
7409 
7410  DO 1 nc=1,niter
7411  nt=0
7412  DO i=1,ia(2)
7413  nt=nt+int(qsran(b10)+cc(2))
7414  ENDDO
7415  IF(nt.EQ.0)GOTO 1
7416  IF(ia(1).EQ.1)THEN
7417  xa(1,1)=0.d0
7418  xa(1,2)=0.d0
7419  xa(1,3)=0.d0
7420  ELSE
7421  CALL psgea(ia(1),xa,1)
7422  ENDIF
7423  IF(ia(2).EQ.1)THEN
7424  xb(1,1)=0.d0
7425  xb(1,2)=0.d0
7426  xb(1,3)=0.d0
7427  ELSE
7428  CALL psgea(ia(2),xb,2)
7429  ENDIF
7430 
7431 cdh DO I=1,8
7432  DO i=1,20
7433  CALL gaucr(b0(i),gabs,gdd,gqel,gcoh,xa,xb,ia(1),nt)
7434  wabs(i)=wabs(i)+gabs
7435  wdd(i)=wdd(i)+gdd
7436  wqel(i)=wqel(i)+gqel
7437  wcoh(i)=wcoh(i)+gcoh
7438  ENDDO
7439 1 CONTINUE
7440 
7441  gabs=0.
7442  gdd=0.
7443  gqel=0.
7444  gcoh=0.
7445 cdh DO I=1,8
7446  DO i=1,20
7447  wabs(i)=wabs(i)/niter
7448  wdd(i)=wdd(i)/niter
7449  wqel(i)=wqel(i)/niter
7450  wcoh(i)=wcoh(i)/niter
7451  wprod(i)=wabs(i)+wdd(i)
7452  wtot(i)=wprod(i)+wqel(i)+wcoh(i)
7453  gabs=gabs+ai(i)*wabs(i)
7454  gdd=gdd+ai(i)*wdd(i)
7455  gqel=gqel+ai(i)*wqel(i)
7456  gcoh=gcoh+ai(i)*wcoh(i)
7457  ENDDO
7458  gprod=gabs+gdd
7459  gtot=gprod+gqel+gcoh
7460  RETURN
7461  END
7462 
7463 c following subroutine/function added 8/10/98 dh
7464 C=======================================================================
7465 
7466  SUBROUTINE gaucr(B,GABS,GDD,GQEL,GCOH,XA,XB,IA,NT)
7467 c-----------------------------------------------------------------------
7468  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7469  dimension xa(64,3),xb(64,3)
7470  COMMON /area15/ fp(5),rq(5),cd(5)
7471  COMMON /area16/ cc(5)
7472  SAVE
7473 
7474  gabs=1.
7475  gdd=1.
7476  gqel=1.
7477  gcoh=1.
7478  DO n=1,ia
7479  vv=1.d0-dsqrt(psv(xa(n,1)+b,xa(n,2),xb,nt))
7480  gabs=gabs*(1.-cc(2)*(1.-vv*vv))
7481  gdd=gdd*(1.-cc(2)*(1.-vv))**2
7482  gqel=gqel*(1.-2.d0*cc(2)*(1.-vv))
7483  gcoh=gcoh*(1.-cc(2)*(1.-vv))
7484  ENDDO
7485  gcoh=1.-2.*gcoh+gqel
7486  gqel=gdd-gqel
7487  gdd=gabs-gdd
7488  gabs=1.-gabs
7489  RETURN
7490  END
7491 
7492 c following subroutine/function added 8/10/98 dh
7493 C=======================================================================
7494 
7495  DOUBLE PRECISION FUNCTION sectnu(E0N,IAP,IAT)
7496 c Nucleus-nucleus (nucleus-hydrogen) particle production cross section
7497 c E0N - lab. energy per projectile nucleon,
7498 c IAP - projectile mass number (2<IAP<64)
7499 c IAT - target mass number (1<IAT<64)
7500 c-----------------------------------------------------------------------
7501  IMPLICIT DOUBLE PRECISION (a-h,o-z)
7502  dimension wk(3),wa(3),wb(3)
7503  COMMON /area48/ asect(10,6,4)
7504  SAVE
7505 
7506  sectnu=0.d0
7507  ye=dlog10(e0n)
7508  IF(ye.LT.1.d0)ye=1.d0
7509  je=int(ye)
7510  IF(je.GT.8)je=8
7511 
7512  wk(2)=ye-je
7513  wk(3)=wk(2)*(wk(2)-1.d0)*.5d0
7514  wk(1)=1.d0-wk(2)+wk(3)
7515  wk(2)=wk(2)-2.d0*wk(3)
7516 
7517  ya=iap
7518  ya=dlog(ya/2.d0)/.69315d0+1.d0
7519  ja=min(int(ya),4)
7520  wa(2)=ya-ja
7521  wa(3)=wa(2)*(wa(2)-1.d0)*.5d0
7522  wa(1)=1.d0-wa(2)+wa(3)
7523  wa(2)=wa(2)-2.d0*wa(3)
7524 
7525  yb=iat
7526  yb=dlog(yb)/1.38629d0+1.d0
7527  jb=min(int(yb),2)
7528  wb(2)=yb-jb
7529  wb(3)=wb(2)*(wb(2)-1.d0)*.5d0
7530  wb(1)=1.d0-wb(2)+wb(3)
7531  wb(2)=wb(2)-2.d0*wb(3)
7532 
7533  DO i=1,3
7534  DO m=1,3
7535  DO l=1,3
7536  sectnu=sectnu+asect(je+i-1,ja+m-1,jb+l-1)*wk(i)*wa(m)*wb(l)
7537  ENDDO
7538  ENDDO
7539  ENDDO
7540  sectnu=exp(sectnu)
7541  RETURN
7542  END
7543 
function psfaz(Z, FSOFT, FHARD, FSHARD)
Definition: qgsjet01.f:1623
subroutine psjint0(S, SJ, SJB, M, L)
Definition: qgsjet01.f:3390
nodes z
block data include Zlatfit h c fitting region data x1(1)/0.03/
double precision function gamfun_kk(Y)
Definition: qgsjet01.f:7293
subroutine psgea(IA, XA, JJ)
Definition: qgsjet01.f:1846
subroutine pstrans(EP, EY)
Definition: qgsjet01.f:5041
subroutine xxfau(B, GZ)
Definition: qgsjet01.f:6270
others if is ng
Definition: cblkManager.h:9
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
nodes i
! for length to thickness conversion or v v ! integer maxnodes real Hinf ! This is used when making table for dim simulation ! The slant length for vertical height to km is ! divided by LenStep m steps ! It can cover the slant length of about km for cos
Definition: Zatmos.h:8
integer npitbl real *nx dx real dx
Definition: Zcinippxc.h:10
subroutine xxdtg(WP0, WM0, ICP, ICT, LQ1)
Definition: qgsjet01.f:6140
subroutine xxfrag(SA, NA, RC)
Definition: qgsjet01.f:6307
subroutine xxgau1(GZ)
Definition: qgsjet01.f:6546
function psjet(Q1, Q2, S, S2MIN, J, L)
Definition: qgsjet01.f:3065
function psrejv(S)
Definition: qgsjet01.f:3944
subroutine xxdpr(WP0, WM0, ICP, ICT, LQ2)
Definition: qgsjet01.f:5930
function psjet1(Q1, Q2, S, S2MIN, J, L)
Definition: qgsjet01.f:3155
function psjint1(Q1, Q2, S, M, L)
Definition: qgsjet01.f:3443
function psfap(X, J, L)
Definition: qgsjet01.f:1589
function xxtwdec(S, A, B)
Definition: qgsjet01.f:7263
function psdr(X, Y)
Definition: qgsjet01.f:1570
subroutine psrotat(EP, S0X, C0X, S0, C0)
Definition: qgsjet01.f:4106
function psapint(X, J, L)
Definition: qgsjet01.f:613
subroutine psvdef(ICH, IC1, ICZ)
Definition: qgsjet01.f:5259
function pslam(S, A, B)
Definition: qgsjet01.f:3589
subroutine xxjetsim
Definition: qgsjet01.f:7025
subroutine psjdef(IPJ, IPJ1, EPJ, EPJ1, JFL)
Definition: qgsjet01.f:2991
subroutine psaini
Definition: qgsjet01.f:42
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real t endmap map ! pt before pz is set real pt
Definition: Zptcl.h:21
double precision function sectnu(E0N, IAP, IAT)
Definition: qgsjet01.f:7496
subroutine psrec(EP, QV, ZV, QM, IQV, LDAU, LPAR, IQJ, EQJ, JFL, JQ)
Definition: qgsjet01.f:3633
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
function psfsh(S, Z, ICZ, IQQ)
Definition: qgsjet01.f:1716
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
function xxrot(S, B)
Definition: qgsjet01.f:7111
subroutine xxaset
Definition: qgsjet01.f:5572
subroutine pstrans1(EP, EY)
Definition: qgsjet01.f:5071
function psgint(Z)
Definition: qgsjet01.f:1912
subroutine xxfragm(NS, XA)
Definition: qgsjet01.f:6368
function psjint(Q1, Q2, S, M, L)
Definition: qgsjet01.f:3246
subroutine xxgau(GZ)
Definition: qgsjet01.f:6512
function psqint(QLMAX, G, J)
Definition: qgsjet01.f:4134
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine pshot(WP0, WM0, Z, IPC, EPC, IZP, IZT, ICZ, IQQ)
Definition: qgsjet01.f:2014
subroutine xxdec3(EP, EP1, EP2, EP3, SWW, AM1, AM2, AM3)
Definition: qgsjet01.f:5881
subroutine xxaini(E0N, ICP0, IAP, IAT)
Definition: qgsjet01.f:5435
struct ob o[NpMax]
Definition: Zprivate.h:34
subroutine xxddfr(WP0, WM0, ICP, ICT)
Definition: qgsjet01.f:5693
function psbint(QQ, S, M, L)
Definition: qgsjet01.f:738
function pshard(S, ICZ)
Definition: qgsjet01.f:1936
subroutine crossc_kk(NITER, GTOT, GPROD, GABS, GDD, GQEL, GCOH)
Definition: qgsjet01.f:7352
! constants thru Cosmos real ! if multiplied to deg radian Torad ! light velocity m sec ! infinty ! kg m2 *Togpcm2 g cm2 ! g cm2 *Tokgpm2 kg m2 ! cm *Tom m ! m *Tocm cm ! g cm3 *Tokgpm3 kg m3 ! kg m3 *Togpcm3 g cm3 ! sec *Tonsec nsec ! Tesla m eh
Definition: Zglobalc.h:15
! constants thru Cosmos real * pi
Definition: Zglobalc.h:2
function psftild(Z, ICZ)
Definition: qgsjet01.f:1815
function psnorm(EP)
Definition: qgsjet01.f:3611
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
function psfborn(S, T, IQ1, IQ2)
Definition: qgsjet01.f:1674
subroutine ixxdef(ICH, IC1, IC2, ICZ)
Definition: qgsjet01.f:5343
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
function ixxson(NS, AW, G)
Definition: qgsjet01.f:5406
! to be included just before the execution code ! density as a function of height real fd0 real z0
Definition: Zstdatmosf.h:3
function xxt(B)
Definition: qgsjet01.f:7217
nodes a
dE dx *! Nuc Int sampling table b
Definition: cblkMuInt.h:130
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
subroutine xxgener(WP0, WM0, EY0, S0X, C0X, S0, C0, IC1, IC2)
Definition: qgsjet01.f:6574
dE dx *! Nuc Int sampling table h
Definition: cblkMuInt.h:130
function pszsim(QQ, J)
Definition: qgsjet01.f:5301
subroutine psconf
Definition: qgsjet01.f:1019
dE dx *! Nuc Int sampling table g
Definition: cblkMuInt.h:130
function psrjint(YJ, Z0, IQQ)
Definition: qgsjet01.f:3977
subroutine xxdec2(EP, EP1, EP2, WW, A, B)
Definition: qgsjet01.f:5845
*************************block data cblkTracking *************************implicit none data *ExactThick *Freec *RatioToE0 *MagChgDist *TimeStructure *Truncn *Truncx data *IncMuonPolari *KEminObs *ThinSampling *EthinRatio *Generate *LpmEffect *MagPairEmin e10
Definition: cblkTracking.h:9
subroutine xxfz(B, GZ)
Definition: qgsjet01.f:6456
nodes t
real *8 function qsran(X)
Definition: qgs01init.f:74
function psborn(QQ, S, IQ1, IQ2)
Definition: qgsjet01.f:847
subroutine gaucr(B, GABS, GDD, GQEL, GCOH, XA, XB, IA, NT)
Definition: qgsjet01.f:7467
subroutine psdefrot(EP, S0X, C0X, S0, C0)
Definition: qgsjet01.f:1525
real cut integer nc
Definition: Zprivate.h:1
block data include Zlatfit h c fitting region data x2(1)/0.5/data x1(2)/0.3/
function psudt(QMAX, J)
Definition: qgsjet01.f:5178
subroutine psasetc
Definition: qgsjet01.f:647
subroutine psdeftr(S, EP, EY)
Definition: qgsjet01.f:1488
function psv(X, Y, XB, IB)
Definition: qgsjet01.f:5223
function psrejs(S, Z, IQQ)
Definition: qgsjet01.f:3884
function psuds(Q, J)
Definition: qgsjet01.f:5142
integer n
Definition: Zcinippxc.h:1
function psudint(QLMAX, J)
Definition: qgsjet01.f:5101
subroutine psshar(LS, NHP, NW, NT)
Definition: qgsjet01.f:4182
block data cblkIncident data *Za1ry is
Definition: cblkIncident.h:5
subroutine pscs(C, S)
Definition: qgsjet01.f:1461
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
subroutine xxreg(EP0, IC)
Definition: qgsjet01.f:7066
subroutine xxstr(WPI0, WMI0, WP0, WM0, IC10, IC120, IC210, IC20)
Definition: qgsjet01.f:7138
subroutine pscajet(QQ, IQ1, QV, ZV, QM, IQV, LDAU, LPAR, JQ)
Definition: qgsjet01.f:890
dE dx *! Nuc Int sampling table f
Definition: cblkMuInt.h:130
dE dx *! Nuc Int sampling table c
Definition: cblkMuInt.h:130
function psroot(QLMAX, G, J)
Definition: qgsjet01.f:4057