Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pydcyk.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pydcyk.f
1 
2 
3 C*********************************************************************
4 
5 C...PYDCYK
6 C...Handles flavour production in the decay of unstable particles
7 C...and small string clusters.
8 
9  SUBROUTINE pydcyk(KFL1,KFL2,KFL3,KF)
10 
11 C...Double precision and integer declarations.
12  IMPLICIT DOUBLE PRECISION(a-h, o-z)
13  IMPLICIT INTEGER(i-n)
14  INTEGER pyk,pychge,pycomp
15 C...Commonblocks.
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 /pydat1/,/pydat2/
19 
20 
21 C.. Call PYKFDI directly if no popcorn option is on
22  IF(mstj(12).LT.2) THEN
23  CALL pykfdi(kfl1,kfl2,kfl3,kf)
24  mstu(124)=kfl3
25  RETURN
26  ENDIF
27 
28  kfl3=0
29  kf=0
30  IF(kfl1.EQ.0) RETURN
31  kf1a=iabs(kfl1)
32  kf2a=iabs(kfl2)
33 
34  nsto=130
35  nmax=min(mstu(125),10)
36 
37 C.. Identify rank 0 cluster qq
38  irank=1
39  IF(kf1a.GT.10.AND.kf1a.LT.10000) irank=0
40 
41  IF(kf2a.GT.0)THEN
42 C.. Join jets: Fails if store not empty
43  IF(mstu(121).GT.0) THEN
44  mstu(121)=0
45  RETURN
46  ENDIF
47  CALL pykfdi(kfl1,kfl2,kfl3,kf)
48  ELSEIF(kf1a.GT.10.AND.mstu(121).GT.0)THEN
49 C.. Pick popcorn meson from store, return same qq, decrease store
50  kf=mstu(nsto+mstu(121))
51  kfl3=-kfl1
52  mstu(121)=mstu(121)-1
53  ELSE
54 C.. Generate new flavour. Then done if no diquark is generated
55  100 CALL pykfdi(kfl1,0,kfl3,kf)
56  IF(mstu(121).EQ.-1) goto 100
57  mstu(124)=kfl3
58  IF(kf.EQ.0.OR.iabs(kfl3).LE.10) RETURN
59 
60 C.. Simple case if no dynamical popcorn suppressions are considered
61  IF(mstj(12).LT.4) THEN
62  IF(mstu(121).EQ.0) RETURN
63  nmes=1
64  kfprev=-kfl3
65  CALL pykfdi(kfprev,0,kfl3,kfm)
66 C.. Due to eta+eta' suppr., a qq->M+qq attempt might end as qq->B+q
67  IF(iabs(kfl3).LE.10)THEN
68  kfl3=-kfprev
69  RETURN
70  ENDIF
71  goto 120
72  ENDIF
73 
74 C test output qq against fake Gamma, then return if no popcorn.
75  gb=2d0
76  IF(irank.NE.0)THEN
77  CALL pyzdis(1,2103,5d0,z)
78  gb=5d0*(1d0-z)/z
79  IF(1d0-parf(192)**gb.LT.pyr(0)) THEN
80  mstu(121)=0
81  goto 100
82  ENDIF
83  ENDIF
84  IF(mstu(121).EQ.0) RETURN
85 
86 C..Set store size memory. Pick fake dynamical variables of qq.
87  nmes=mstu(121)
88  CALL pyptdi(1,px3,py3)
89  x=1d0
90  popm=0d0
91  g=gb
92  popg=gb
93 
94 C.. Pick next popcorn meson, test with fake dynamical variables
95  110 kfprev=-kfl3
96  px1=-px3
97  py1=-py3
98  CALL pykfdi(kfprev,0,kfl3,kfm)
99  IF(mstu(121).EQ.-1) goto 100
100  CALL pyptdi(kfl3,px3,py3)
101  pm=pymass(kfm)**2+(px1+px3)**2+(py1+py3)**2
102  CALL pyzdis(kfprev,kfl3,pm,z)
103  g=(1d0-z)*(g+pm/z)
104  x=(1d0-z)*x
105 
106  ptst=1d0
107  gtst=1d0
108  rtst=pyr(0)
109  IF(mstj(12).GT.4)THEN
110  popmn=sqrt((1d0-x)*(g/x-gb))
111  popm=popm+pmas(pycomp(kfm),1)-pmas(pycomp(kfm),3)
112  ptst=exp((popm-popmn)*parf(193))
113  popm=popmn
114  ENDIF
115  IF(irank.NE.0)THEN
116  popgn=x*gb
117  gtst=(1d0-parf(192)**popgn)/(1d0-parf(192)**popg)
118  popg=popgn
119  ENDIF
120  IF(rtst.GT.ptst*gtst)THEN
121  mstu(121)=0
122  IF(rtst.GT.ptst) mstu(121)=-1
123  goto 100
124  ENDIF
125 
126 C.. Store meson
127  120 IF(nmes.LE.nmax) mstu(nsto+mstu(121)+1)=kfm
128  IF(mstu(121).GT.0) goto 110
129 
130 C.. Test accepted system size. If OK set global popcorn size variable.
131  IF(nmes.GT.nmax)THEN
132  kf=0
133  kfl3=0
134  RETURN
135  ENDIF
136  mstu(121)=nmes
137  ENDIF
138 
139  RETURN
140  END