Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pykfin.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pykfin.f
1 
2 C***************************************************************
3 
4 C...PYKFIN
5 C...Precalculates a set of diquark and popcorn weights.
6 
7  SUBROUTINE pykfin
8 
9 C...Double precision and integer declarations.
10  IMPLICIT DOUBLE PRECISION(a-h, o-z)
11  IMPLICIT INTEGER(i-n)
12  INTEGER pyk,pychge,pycomp
13 C...Commonblocks.
14  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
15  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
16  SAVE /pydat1/,/pydat2/
17 
18  dimension su6(12),su6m(7),qbb(7),qbm(7),dmb(14)
19 
20 
21  mstu(123)=1
22 C..Diquark indices for dimensional variables
23  iud1=1
24  iuu1=2
25  ius0=3
26  isu0=4
27  ius1=5
28  isu1=6
29  iss1=7
30 
31 C.. *** SU(6) factors **
32 C..Modify with decuplet- (and Sigma/Lambda-) suppression.
33  parf(146)=1d0
34  IF(mstj(12).GE.5) parf(146)=3d0*parj(18)/(2d0*parj(18)+1d0)
35  IF(parj(18).LT.1d0-1d-5.AND.mstj(12).LT.5) CALL pyerrm(9,
36  & '(PYKFIN:) PARJ(18)<1 combined with 0<MSTJ(12)<5 option')
37  DO 100 i=1,6
38  su6(i)=parf(60+i)
39  su6(6+i)=su6(i)*4*parf(146)/(3*parf(146)+1)
40  100 CONTINUE
41  su6(8)=su6(2)*4/(3*parf(146)+1)
42  su6(6)=su6(6)*(3+parf(146))/(3*parf(146)+1)
43  DO 110 i=1,6
44  su6(i)=su6(i)+parj(18)*parf(70+i)
45  su6(6+i)=su6(6+i)+parj(18)*parf(70+i)
46  110 CONTINUE
47 
48 C..SU(6)max q q' s,c,b
49  su6mud =max(su6(1) , su6(8) )
50  su6m(iud1)=max(su6(5) , su6(12))
51  su6m(isu0)=max(su6(7) ,su6(2),su6mud )
52  su6m(iuu1)=max(su6(3) ,su6(4),su6(10))
53  su6m(isu1)=max(su6(11),su6(6),su6m(iud1))
54  su6m(ius0)=su6m(isu0)
55  su6m(iss1)=su6m(iuu1)
56  su6m(ius1)=su6m(isu1)
57 
58 C..Store SU(6)max, in order UD0,UD1,US0,US1,QQ1
59  parf(141)=su6mud
60  parf(142)=su6m(iud1)
61  parf(143)=su6m(isu0)
62  parf(144)=su6m(isu1)
63  parf(145)=su6m(iss1)
64 
65 C..diquark SU(6) survival =
66 C..sum over quark (quark tunnel weight)*(SU(6)).
67  pud0=(2d0*su6(1)+parj(2)*su6(8))
68  dmb(isu0)=(su6(7)+su6(2)+parj(2)*su6(1))/pud0
69  dmb(ius0)=dmb(isu0)
70  dmb(iss1)=(2d0*su6(4)+parj(2)*su6(3))/pud0
71  dmb(iuu1)=(su6(3)+su6(4)+parj(2)*su6(10))/pud0
72  dmb(isu1)=(su6(11)+su6(6)+parj(2)*su6(5))/pud0
73  dmb(ius1)=dmb(isu1)
74  dmb(iud1)=(2d0*su6(5)+parj(2)*su6(12))/pud0
75 
76 C.. *** Tunneling factors for Diquark production***
77 C.. T: half a curtain pair = sqrt(curtain pair factor)
78  IF(mstj(12).GE.5) THEN
79  pmud0=pymass(2101)
80  pmud1=pymass(2103)-pmud0
81  pmus0=pymass(3201)-pmud0
82  pmus1=pymass(3203)-pmus0-pmud0
83  pmss1=pymass(3303)-pmus0-pmud0
84  qbb(isu0)=exp(-(parj(9)+parj(8))*pmus0-parj(9)*parf(191))
85  qbb(ius0)=exp(-parj(8)*pmus0)
86  qbb(iss1)=exp(-(parj(9)+parj(8))*pmss1)*qbb(isu0)
87  qbb(iuu1)=exp(-parj(8)*pmud1)
88  qbb(isu1)=exp(-(parj(9)+parj(8))*pmus1)*qbb(isu0)
89  qbb(ius1)=exp(-parj(8)*pmus1)*qbb(ius0)
90  qbb(iud1)=qbb(iuu1)
91  ELSE
92  par2m=sqrt(parj(2))
93  par3m=sqrt(parj(3))
94  par4m=sqrt(parj(4))
95  qbb(isu0)=par2m*par3m
96  qbb(ius0)=par3m
97  qbb(iss1)=par2m*parj(3)*par4m
98  qbb(iuu1)=par4m
99  qbb(isu1)=par4m*qbb(isu0)
100  qbb(ius1)=par4m*qbb(ius0)
101  qbb(iud1)=par4m
102  ENDIF
103 
104 C.. tau: spin*(vertex factor)*(T = half-curtain factor)
105  qbm(isu0)=qbb(isu0)
106  qbm(ius0)=parj(2)*qbb(ius0)
107  qbm(iss1)=parj(2)*6d0*qbb(iss1)
108  qbm(iuu1)=6d0*qbb(iuu1)
109  qbm(isu1)=3d0*qbb(isu1)
110  qbm(ius1)=parj(2)*3d0*qbb(ius1)
111  qbm(iud1)=3d0*qbb(iud1)
112 
113 C.. Combine T and tau to diquark weight for q-> B+B+..
114  DO 120 i=1,7
115  qbb(i)=qbb(i)*qbm(i)
116  120 CONTINUE
117 
118  IF(mstj(12).GE.5)THEN
119 C..New version: tau for rank 0 diquark.
120  dmb(7+isu0)=exp(-parj(10)*pmus0)
121  dmb(7+ius0)=parj(2)*dmb(7+isu0)
122  dmb(7+iss1)=6d0*parj(2)*exp(-parj(10)*pmss1)*dmb(7+isu0)
123  dmb(7+iuu1)=6d0*exp(-parj(10)*pmud1)
124  dmb(7+isu1)=3d0*exp(-parj(10)*pmus1)*dmb(7+isu0)
125  dmb(7+ius1)=parj(2)*dmb(7+isu1)
126  dmb(7+iud1)=dmb(7+iuu1)/2d0
127 
128 C..New version: curtain flavour ratios.
129 C.. s/u for q->B+M+...
130 C.. s/u for rank 0 diquark: su -> ...M+B+...
131 C.. Q/q for heavy rank 0 diquark: Qu -> ...M+B+...
132  wu=1d0+qbm(iud1)+qbm(ius0)+qbm(ius1)+qbm(iuu1)
133  parf(135)=(2d0*(qbm(isu0)+qbm(isu1))+qbm(iss1))/wu
134  wu=1d0+dmb(7+iud1)+dmb(7+ius0)+dmb(7+ius1)+dmb(7+iuu1)
135  parf(136)=(2d0*(dmb(7+isu0)+dmb(7+isu1))+dmb(7+iss1))/wu
136  parf(137)=(dmb(7+isu0)+dmb(7+isu1))*
137  & (2d0+dmb(7+iss1)/(2d0*dmb(7+isu1)))/wu
138  ELSE
139 C..Old version: reset unused rank 0 diquark weights and
140 C.. unused diquark SU(6) survival weights
141  DO 130 i=1,7
142  IF(mstj(12).LT.3) dmb(i)=1d0
143  dmb(7+i)=1d0
144  130 CONTINUE
145 
146 C..Old version: Shuffle PARJ(7) into tau
147  qbm(ius0)=qbm(ius0)*parj(7)
148  qbm(iss1)=qbm(iss1)*parj(7)
149  qbm(ius1)=qbm(ius1)*parj(7)
150 
151 C..Old version: curtain flavour ratios.
152 C.. s/u for q->B+M+...
153 C.. s/u for rank 0 diquark: su -> ...M+B+...
154 C.. Q/q for heavy rank 0 diquark: Qu -> ...M+B+...
155  wu=1d0+qbm(iud1)+qbm(ius0)+qbm(ius1)+qbm(iuu1)
156  parf(135)=(2d0*(qbm(isu0)+qbm(isu1))+qbm(iss1))/wu
157  parf(136)=parf(135)*parj(6)*qbm(isu0)/qbm(ius0)
158  parf(137)=(1d0+qbm(iud1))*(2d0+qbm(ius0))/wu
159  ENDIF
160 
161 C..Combine diquark SU(6) survival, SU(6)max, tau and T into factors for:
162 C.. rank0 D->M+B+..; D->M+B+..; q->B+M+..; q->B+B..
163  DO 140 i=1,7
164  dmb(7+i)=dmb(7+i)*dmb(i)
165  dmb(i)=dmb(i)*qbm(i)
166  qbm(i)=qbm(i)*su6m(i)/su6mud
167  qbb(i)=qbb(i)*su6m(i)/su6mud
168  140 CONTINUE
169 
170 C.. *** Popcorn factors ***
171 
172  IF(mstj(12).LT.5)THEN
173 C.. Old version: Resulting popcorn weights.
174  parf(138)=parj(6)
175  ws=parf(135)*parf(138)
176  wq=wu*parj(5)/3d0
177  parf(132)=wq*qbm(iud1)/qbb(iud1)
178  parf(133)=wq*
179  & (qbm(ius1)/qbb(ius1)+ws*qbm(isu1)/qbb(isu1))/2d0
180  parf(134)=wq*ws*qbm(iss1)/qbb(iss1)
181  parf(131)=wq*(1d0+qbm(iud1)+qbm(iuu1)+qbm(ius0)+qbm(ius1)+
182  & ws*(qbm(isu0)+qbm(isu1)+qbm(iss1)/2d0))/
183  & (1d0+qbb(iud1)+qbb(iuu1)+
184  & 2d0*(qbb(ius0)+qbb(ius1))+qbb(iss1)/2d0)
185  ELSE
186 C..New version: Store weights for popcorn mesons,
187 C..get prel. popcorn weights.
188  DO 150 ipos=201,1400
189  parf(ipos)=0d0
190  150 CONTINUE
191  DO 160 i=138,140
192  parf(i)=0d0
193  160 CONTINUE
194  ipos=200
195  parf(193)=parj(8)
196  DO 240 mr=0,7,7
197  IF(mr.EQ.7) parf(193)=parj(10)
198  sqwt=2d0*(dmb(mr+ius0)+dmb(mr+ius1))/
199  & (1d0+dmb(mr+iud1)+dmb(mr+iuu1))
200  qqwt=dmb(mr+iuu1)/(1d0+dmb(mr+iud1)+dmb(mr+iuu1))
201  DO 230 nmes=0,1
202  IF(nmes.EQ.1) sqwt=parj(2)
203  DO 220 kfqpop=1,4
204  IF(mr.EQ.0.AND.kfqpop.GT.3) goto 220
205  IF(nmes.EQ.0.AND.kfqpop.GE.3)THEN
206  sqwt=dmb(mr+iss1)/(dmb(mr+isu0)+dmb(mr+isu1))
207  qqwt=0.5d0
208  IF(mr.EQ.0) parf(193)=parj(8)+parj(9)
209  IF(kfqpop.EQ.4) sqwt=sqwt*(1d0/dmb(7+isu1)+1d0)/2d0
210  ENDIF
211  DO 210 kfqold =1,5
212  IF(mr.EQ.0.AND.kfqold.GT.3) goto 210
213  IF(nmes.EQ.1) THEN
214  IF(mr.EQ.0.AND.kfqpop.EQ.1) goto 210
215  IF(mr.EQ.7.AND.kfqpop.NE.1) goto 210
216  ENDIF
217  wttot=0d0
218  wtfail=0d0
219  DO 190 kmul=0,5
220  pjwt=parj(12+kmul)
221  IF(kmul.EQ.0) pjwt=1d0-parj(14)
222  IF(kmul.EQ.1) pjwt=1d0-parj(15)-parj(16)-parj(17)
223  IF(pjwt.LE.0d0) goto 190
224  IF(pjwt.GT.1d0) pjwt=1d0
225  imes=5*kmul
226  imix=2*kfqold+10*kmul
227  kfj=2*kmul+1
228  IF(kmul.EQ.2) kfj=10003
229  IF(kmul.EQ.3) kfj=10001
230  IF(kmul.EQ.4) kfj=20003
231  IF(kmul.EQ.5) kfj=5
232  DO 180 kfqver =1,3
233  kfla=max(kfqold,kfqver)
234  kflb=min(kfqold,kfqver)
235  swt=parj(11+kfla/3+kfla/4)
236  IF(kmul.EQ.0.OR.kmul.EQ.2) swt=1d0-swt
237  swt=swt*pjwt
238  qwt=sqwt/(2d0+sqwt)
239  IF(kfqver.LT.3)THEN
240  IF(kfqver.EQ.kfqpop) qwt=(1d0-qwt)*qqwt
241  IF(kfqver.NE.kfqpop) qwt=(1d0-qwt)*(1d0-qqwt)
242  ENDIF
243  IF(kfqver.NE.kfqold)THEN
244  imes=imes+1
245  kfm=100*kfla+10*kflb+kfj
246  pmm=pmas(pycomp(kfm),1)-pmas(pycomp(kfm),3)
247  parf(ipos+imes)=qwt*swt*exp(-parf(193)*pmm)
248  wttot=wttot+parf(ipos+imes)
249  ELSE
250  DO 170 id=3,5
251  IF(id.EQ.3) dwt=1d0-parf(imix-1)
252  IF(id.EQ.4) dwt=parf(imix-1)-parf(imix)
253  IF(id.EQ.5) dwt=parf(imix)
254  kfm=110*(id-2)+kfj
255  pmm=pmas(pycomp(kfm),1)-pmas(pycomp(kfm),3)
256  parf(ipos+5*kmul+id)=qwt*swt*dwt*exp(-parf(193)*pmm)
257  IF(kmul.EQ.0.AND.id.GT.3) THEN
258  wtfail=wtfail+qwt*swt*dwt*(1d0-parj(21+id))
259  parf(ipos+5*kmul+id)=
260  & parf(ipos+5*kmul+id)*parj(21+id)
261  ENDIF
262  wttot=wttot+parf(ipos+5*kmul+id)
263  170 CONTINUE
264  ENDIF
265  180 CONTINUE
266  190 CONTINUE
267  DO 200 imes=1,30
268  parf(ipos+imes)=parf(ipos+imes)/(1d0-wtfail)
269  200 CONTINUE
270  IF(mr.EQ.7) parf(140)=
271  & max(parf(140),wttot/(1d0-wtfail))
272  IF(mr.EQ.0) parf(139-kfqpop/3)=
273  & max(parf(139-kfqpop/3),wttot/(1d0-wtfail))
274  ipos=ipos+30
275  210 CONTINUE
276  220 CONTINUE
277  230 CONTINUE
278  240 CONTINUE
279  IF(parf(139).GT.1d-10) parf(138)=parf(138)/parf(139)
280  mstu(121)=0
281 
282  ENDIF
283 
284 C..Recombine diquark weights to flavour and spin ratios
285  parf(151)=(2d0*(qbb(isu0)+qbb(isu1))+qbb(iss1))/
286  & (1d0+qbb(iud1)+qbb(iuu1)+qbb(ius0)+qbb(ius1))
287  parf(152)=2d0*(qbb(ius0)+qbb(ius1))/(1d0+qbb(iud1)+qbb(iuu1))
288  parf(153)=qbb(iss1)/(qbb(isu0)+qbb(isu1))
289  parf(154)=qbb(iuu1)/(1d0+qbb(iud1)+qbb(iuu1))
290  parf(155)=qbb(isu1)/qbb(isu0)
291  parf(156)=qbb(ius1)/qbb(ius0)
292  parf(157)=qbb(iud1)
293 
294  parf(161)=(2d0*(qbm(isu0)+qbm(isu1))+qbm(iss1))/
295  & (1d0+qbm(iud1)+qbm(iuu1)+qbm(ius0)+qbm(ius1))
296  parf(162)=2d0*(qbm(ius0)+qbm(ius1))/(1d0+qbm(iud1)+qbm(iuu1))
297  parf(163)=qbm(iss1)/(qbm(isu0)+qbm(isu1))
298  parf(164)=qbm(iuu1)/(1d0+qbm(iud1)+qbm(iuu1))
299  parf(165)=qbm(isu1)/qbm(isu0)
300  parf(166)=qbm(ius1)/qbm(ius0)
301  parf(167)=qbm(iud1)
302 
303  parf(171)=(2d0*(dmb(isu0)+dmb(isu1))+dmb(iss1))/
304  & (1d0+dmb(iud1)+dmb(iuu1)+dmb(ius0)+dmb(ius1))
305  parf(172)=2d0*(dmb(ius0)+dmb(ius1))/(1d0+dmb(iud1)+dmb(iuu1))
306  parf(173)=dmb(iss1)/(dmb(isu0)+dmb(isu1))
307  parf(174)=dmb(iuu1)/(1d0+dmb(iud1)+dmb(iuu1))
308  parf(175)=dmb(isu1)/dmb(isu0)
309  parf(176)=dmb(ius1)/dmb(ius0)
310  parf(177)=dmb(iud1)
311 
312  parf(185)=dmb(7+isu1)/dmb(7+isu0)
313  parf(186)=dmb(7+ius1)/dmb(7+ius0)
314  parf(187)=dmb(7+iud1)
315 
316  RETURN
317  END