Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
luchge.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file luchge.f
1 
2 C*********************************************************************
3 
4  FUNCTION luchge(KF)
5 
6 C...Purpose: to give three times the charge for a particle/parton.
7  common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
8  SAVE /ludat2/
9 
10 C...Initial values. Simple case of direct readout.
11  luchge=0
12  kfa=iabs(kf)
13  kc=lucomp(kfa)
14  IF(kc.EQ.0) THEN
15  ELSEIF(kfa.LE.100.OR.kc.LE.80.OR.kc.GT.100) THEN
16  luchge=kchg(kc,1)
17 
18 C...Construction from quark content for heavy meson, diquark, baryon.
19  ELSEIF(mod(kfa/1000,10).EQ.0) THEN
20  luchge=(kchg(mod(kfa/100,10),1)-kchg(mod(kfa/10,10),1))*
21  & (-1)**mod(kfa/100,10)
22  ELSEIF(mod(kfa/10,10).EQ.0) THEN
23  luchge=kchg(mod(kfa/1000,10),1)+kchg(mod(kfa/100,10),1)
24  ELSE
25  luchge=kchg(mod(kfa/1000,10),1)+kchg(mod(kfa/100,10),1)+
26  & kchg(mod(kfa/10,10),1)
27  ENDIF
28 
29 C...Add on correct sign.
30  luchge=luchge*isign(1,kf)
31 
32  RETURN
33  END