Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lujoin.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file lujoin.f
1 
2 C*********************************************************************
3 
4  SUBROUTINE lujoin(NJOIN,IJOIN)
5 
6 C...Purpose: to connect a sequence of partons with colour flow indices,
7 C...as required for subsequent shower evolution (or other operations).
8  common/lujets/n,k(9000,5),p(9000,5),v(9000,5)
9  SAVE /lujets/
10  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
11  SAVE /ludat1/
12  common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
13  SAVE /ludat2/
14  dimension ijoin(*)
15 
16 C...Check that partons are of right types to be connected.
17  IF(njoin.LT.2) goto 120
18  kqsum=0
19  DO 100 ijn=1,njoin
20  i=ijoin(ijn)
21  IF(i.LE.0.OR.i.GT.n) goto 120
22  IF(k(i,1).LT.1.OR.k(i,1).GT.3) goto 120
23  kc=lucomp(k(i,2))
24  IF(kc.EQ.0) goto 120
25  kq=kchg(kc,2)*isign(1,k(i,2))
26  IF(kq.EQ.0) goto 120
27  IF(ijn.NE.1.AND.ijn.NE.njoin.AND.kq.NE.2) goto 120
28  IF(kq.NE.2) kqsum=kqsum+kq
29  100 IF(ijn.EQ.1) kqs=kq
30  IF(kqsum.NE.0) goto 120
31 
32 C...Connect the partons sequentially (closing for gluon loop).
33  kcs=(9-kqs)/2
34  IF(kqs.EQ.2) kcs=int(4.5+rlu(0))
35  DO 110 ijn=1,njoin
36  i=ijoin(ijn)
37  k(i,1)=3
38  IF(ijn.NE.1) ip=ijoin(ijn-1)
39  IF(ijn.EQ.1) ip=ijoin(njoin)
40  IF(ijn.NE.njoin) in=ijoin(ijn+1)
41  IF(ijn.EQ.njoin) in=ijoin(1)
42  k(i,kcs)=mstu(5)*in
43  k(i,9-kcs)=mstu(5)*ip
44  IF(ijn.EQ.1.AND.kqs.NE.2) k(i,9-kcs)=0
45  110 IF(ijn.EQ.njoin.AND.kqs.NE.2) k(i,kcs)=0
46 
47 C...Error exit: no action taken.
48  RETURN
49  120 CALL luerrm(12,
50  &'(LUJOIN:) given entries can not be joined by one string')
51 
52  RETURN
53  END