Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyjoin.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyjoin.f
1 
2 C*********************************************************************
3 
4 C...PYJOIN
5 C...Connects a sequence of partons with colour flow indices,
6 C...as required for subsequent shower evolution (or other operations).
7 
8  SUBROUTINE pyjoin(NJOIN,IJOIN)
9 
10 C...Double precision and integer declarations.
11  IMPLICIT DOUBLE PRECISION(a-h, o-z)
12  IMPLICIT INTEGER(i-n)
13  INTEGER pyk,pychge,pycomp
14 C...Commonblocks.
15  common/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
16  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
17  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
18  SAVE /pyjets/,/pydat1/,/pydat2/
19 C...Local array.
20  dimension ijoin(*)
21 
22 C...Check that partons are of right types to be connected.
23  IF(njoin.LT.2) goto 120
24  kqsum=0
25  DO 100 ijn=1,njoin
26  i=ijoin(ijn)
27  IF(i.LE.0.OR.i.GT.n) goto 120
28  IF(k(i,1).LT.1.OR.k(i,1).GT.3) goto 120
29  kc=pycomp(k(i,2))
30  IF(kc.EQ.0) goto 120
31  kq=kchg(kc,2)*isign(1,k(i,2))
32  IF(kq.EQ.0) goto 120
33  IF(ijn.NE.1.AND.ijn.NE.njoin.AND.kq.NE.2) goto 120
34  IF(kq.NE.2) kqsum=kqsum+kq
35  IF(ijn.EQ.1) kqs=kq
36  100 CONTINUE
37  IF(kqsum.NE.0) goto 120
38 
39 C...Connect the partons sequentially (closing for gluon loop).
40  kcs=(9-kqs)/2
41  IF(kqs.EQ.2) kcs=int(4.5d0+pyr(0))
42  DO 110 ijn=1,njoin
43  i=ijoin(ijn)
44  k(i,1)=3
45  IF(ijn.NE.1) ip=ijoin(ijn-1)
46  IF(ijn.EQ.1) ip=ijoin(njoin)
47  IF(ijn.NE.njoin) in=ijoin(ijn+1)
48  IF(ijn.EQ.njoin) in=ijoin(1)
49  k(i,kcs)=mstu(5)*in
50  k(i,9-kcs)=mstu(5)*ip
51  IF(ijn.EQ.1.AND.kqs.NE.2) k(i,9-kcs)=0
52  IF(ijn.EQ.njoin.AND.kqs.NE.2) k(i,kcs)=0
53  110 CONTINUE
54 
55 C...Error exit: no action taken.
56  RETURN
57  120 CALL pyerrm(12,
58  &'(PYJOIN:) given entries can not be joined by one string')
59 
60  RETURN
61  END