EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lflav.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file lflav.F
1 C **********************************************************************
2 
3  SUBROUTINE lflav(IFL,IFLR)
4 
5  IMPLICIT NONE
6 
7 C...Choose flavour of struck quark and the
8 C...corresponding flavour of the target remnant jet.
9 
10 *
11 * to avoid variable conflictions, a second keep element is necessary
12 * with the same common block name (see LPTOU2)
13 *
14  COMMON /leptou/ cut(14),lst(40),parl(30),
15  & x,y,w2,q2,u
16  REAL cut,parl,x,y,w2,q2,u
17  INTEGER lst
18  SAVE /leptou/
19 
20  COMMON /linter/ pari(50),ewqc(2,2,8),qc(8),zl(2,4),zq(2,8),pq(17)
21  REAL pari,ewqc,qc,zl,zq,pq
22  SAVE /linter/
23 
24  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
25  INTEGER mstu,mstj
26  REAL paru,parj
27  SAVE /ludat1/
28 
29  COMMON /lflmix/ cabibo(4,4)
30  REAL cabibo
31  dimension pdf(-6:6)
32 
33  INTEGER ifl,iflr,nfl,i,ifla,j1,m1,m2,j,iflra,j2
34  REAL r,psub,amifl,amiflr,amu,ulmass,rlu,usea,dsea,pdf
35 
36  lst(21)=0
37  IF(lst(24).EQ.3) THEN
38  nfl=lst(13)
39  ELSE
40  nfl=lst(12)
41  ENDIF
42 
43  20 r=rlu(0)*pq(17)
44  psub=0.
45  DO 30 i=1,2*nfl
46  ifl=i
47  psub=psub+pq(i)
48  IF(r.LE.psub) goto 40
49  30 CONTINUE
50  40 CONTINUE
51  IF(ifl.GT.nfl) ifl=nfl-ifl
52  lst(25)=ifl
53  iflr=-ifl
54 
55  IF(lst(23).EQ.2) THEN
56 C...Weak charged current, change the flavour of the struck
57 C...quark using generalized Cabibbo mixing matrix.
58  ifla=iabs(ifl)
59  j1=(ifla+1)/2
60  m1=mod(ifla,2)
61  m2=mod(ifla+1,2)
62  r=rlu(0)
63  psub=0.
64  DO 100 j=1,4
65  j2=j
66  psub=psub+cabibo(m1*j2+m2*j1,m2*j2+m1*j1)
67  IF(r.LT.psub) goto 200
68  100 CONTINUE
69  200 ifl=2*j2-m2
70  IF(lst(25).LT.0) ifl=-ifl
71  ENDIF
72 
73  ifla=iabs(ifl)
74  iflra=iabs(iflr)
75  IF(ifla.GE.4.OR.iflra.GE.4) THEN
76 C...Threshold function for heavy quarks of flavour IFLA and IFLRA.
77  mstj(93)=1
78  amu=ulmass(1)
79  mstj(93)=1
80  amifl=ulmass(ifla)
81  mstj(93)=1
82  amiflr=ulmass(iflra)
83  IF(1.-(.938+amifl+amiflr+2.*amu)**2/w2.LT.rlu(0))
84  & goto(20,999,999) lst(24)
85  ENDIF
86 
87 C...Remnant flavour taken care of later for qqbar event and ME+PS case
88  IF(lst(24).EQ.3) RETURN
89  IF(lst(8).GT.10.AND.mod(lst(8),10).NE.9) RETURN
90 
91 C...With LST(14)=0/1(default) baryon production from the target remnant
92 C...is excluded/included.
93  IF(lst(14).EQ.0) RETURN
94 C-GI-021119...For u and d quarks, choose if valence or sea quark.
95  CALL lystfu(2212,x,q2,pdf)
96  usea=0.
97  dsea=0.
98  IF(pdf(2).GT.0.) usea=pdf(-2)/pdf(2)
99  IF(pdf(1).GT.0.) dsea=pdf(-1)/pdf(1)
100  IF(iflr.EQ.-2) THEN
101  IF(lst(22).EQ.1.AND.rlu(0).GT.usea) THEN
102  iflr=2101
103  IF(rlu(0).GT.parl(4)) iflr=2103
104  ELSEIF(lst(22).EQ.2.AND.rlu(0).GT.dsea) THEN
105  iflr=1103
106  ENDIF
107  ELSEIF(iflr.EQ.-1) THEN
108  IF(lst(22).EQ.1.AND.rlu(0).GT.dsea) THEN
109  iflr=2203
110  ELSEIF(lst(22).EQ.2.AND.rlu(0).GT.usea) THEN
111  iflr=2101
112  IF(rlu(0).GT.parl(4)) iflr=2103
113  ENDIF
114  ENDIF
115  RETURN
116 
117  999 lst(21)=6
118  RETURN
119  END
120 
121 C **********************************************************************
122