Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
py4jtw.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file py4jtw.f
1 
2 C*********************************************************************
3 
4 C...PY4JTW
5 C...Auxiliary to PY4JET, to evaluate weight of configuration.
6 
7  FUNCTION py4jtw(IA1,IA2,IA3,IA4)
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/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
15  SAVE /pyjets/
16 
17 C...First case: when both original partons radiate.
18 C...IA1 /= 0: N+1 -> IA1 + IA2, N+2 -> IA3 + IA4.
19  IF(ia1.NE.0) THEN
20  DO 100 j=1,4
21  p(n+1,j)=p(ia1,j)+p(ia2,j)
22  p(n+2,j)=p(ia3,j)+p(ia4,j)
23  100 CONTINUE
24  p(n+1,5)=sqrt(max(0d0,p(n+1,4)**2-p(n+1,1)**2-p(n+1,2)**2-
25  & p(n+1,3)**2))
26  p(n+2,5)=sqrt(max(0d0,p(n+2,4)**2-p(n+2,1)**2-p(n+2,2)**2-
27  & p(n+2,3)**2))
28  z1=p(ia1,4)/p(n+1,4)
29  wt1=(4d0/3d0)*((1d0+z1**2)/(1d0-z1))/(p(n+1,5)**2-p(ia1,5)**2)
30  z2=p(ia3,4)/p(n+2,4)
31  wt2=(4d0/3d0)*((1d0+z2**2)/(1d0-z2))/(p(n+2,5)**2-p(ia3,5)**2)
32 
33 C...Second case: when one original parton radiates to three.
34 C...IA1 = 0: N+1 -> IA2 + N+2, N+2 -> IA3 + IA4.
35  ELSE
36  DO 110 j=1,4
37  p(n+2,j)=p(ia3,j)+p(ia4,j)
38  p(n+1,j)=p(n+2,j)+p(ia2,j)
39  110 CONTINUE
40  p(n+1,5)=sqrt(max(0d0,p(n+1,4)**2-p(n+1,1)**2-p(n+1,2)**2-
41  & p(n+1,3)**2))
42  p(n+2,5)=sqrt(max(0d0,p(n+2,4)**2-p(n+2,1)**2-p(n+2,2)**2-
43  & p(n+2,3)**2))
44  IF(k(ia2,2).EQ.21) THEN
45  z1=p(n+2,4)/p(n+1,4)
46  wt1=(4d0/3d0)*((1d0+z1**2)/(1d0-z1))/(p(n+1,5)**2-
47  & p(ia3,5)**2)
48  ELSE
49  z1=p(ia2,4)/p(n+1,4)
50  wt1=(4d0/3d0)*((1d0+z1**2)/(1d0-z1))/(p(n+1,5)**2-
51  & p(ia2,5)**2)
52  ENDIF
53  z2=p(ia3,4)/p(n+2,4)
54  IF(k(ia2,2).EQ.21) THEN
55  wt2=(4d0/3d0)*((1d0+z2**2)/(1d0-z2))/(p(n+2,5)**2-
56  & p(ia3,5)**2)
57  ELSEIF(k(ia3,2).EQ.21) THEN
58  wt2=3d0*((1d0-z2*(1d0-z2))**2/(z2*(1d0-z2)))/p(n+2,5)**2
59  ELSE
60  wt2=0.5d0*(z2**2+(1d0-z2)**2)
61  ENDIF
62  ENDIF
63 
64 C...Total weight.
65  py4jtw=wt1*wt2
66 
67  RETURN
68  END