]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/shaker/luchge.f
Corrections thanks to A.Angelis
[u/mrichter/AliRoot.git] / PHOS / shaker / luchge.f
1 *CMZ :          17/07/98  15.44.33  by  Federico Carminati
2 *-- Author :
3 C*********************************************************************
4
5       FUNCTION LUCHGE(KF)
6
7 C...Purpose: to give three times the charge for a particle/parton.
8 *KEEP,LUDAT2.
9       COMMON /LUDAT2/ KCHG(500,3),PMAS(500,4),PARF(2000),VCKM(4,4)
10       SAVE /LUDAT2/
11 *KEND.
12
13 C...Initial values. Simple case of direct readout.
14       LUCHGE=0
15       KFA=IABS(KF)
16       KC=LUCOMP(KFA)
17       IF(KC.EQ.0) THEN
18       ELSEIF(KFA.LE.100.OR.KC.LE.80.OR.KC.GT.100) THEN
19         LUCHGE=KCHG(KC,1)
20
21 C...Construction from quark content for heavy meson, diquark, baryon.
22       ELSEIF(MOD(KFA/1000,10).EQ.0) THEN
23         LUCHGE=(KCHG(MOD(KFA/100,10),1)-KCHG(MOD(KFA/10,10),1))*
24      &  (-1)**MOD(KFA/100,10)
25       ELSEIF(MOD(KFA/10,10).EQ.0) THEN
26         LUCHGE=KCHG(MOD(KFA/1000,10),1)+KCHG(MOD(KFA/100,10),1)
27       ELSE
28         LUCHGE=KCHG(MOD(KFA/1000,10),1)+KCHG(MOD(KFA/100,10),1)+
29      &  KCHG(MOD(KFA/10,10),1)
30       ENDIF
31
32 C...Add on correct sign.
33       LUCHGE=LUCHGE*ISIGN(1,KF)
34
35       RETURN
36       END