]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/PHOTOS/phocha.F
AliDecayer realisation for the EvtGen code and EvtGen itself.
[u/mrichter/AliRoot.git] / TEvtGen / PHOTOS / phocha.F
CommitLineData
da0e9ce3 1 FUNCTION PHOCHA(IDHEP)
2C.----------------------------------------------------------------------
3C.
4C. PHOTOS: PHOton radiation in decays CHArge determination
5C.
6C. Purpose: Calculate the charge of particle with code IDHEP. The
7C. code of the particle is defined by the Particle Data
8C. Group in Phys. Lett. B204 (1988) 1.
9C.
10C. Input Parameter: IDHEP
11C.
12C. Output Parameter: Funtion value = charge of particle with code
13C. IDHEP
14C.
15C. Author(s): E. Barberio and B. van Eijk Created at: 29/11/89
16C. Last update: 02/01/90
17C.
18C.----------------------------------------------------------------------
19 IMPLICIT NONE
20 REAL*8 PHOCHA
21 INTEGER IDHEP,IDABS,Q1,Q2,Q3
22C--
23C-- Array 'CHARGE' contains the charge of the first 101 particles ac-
24C-- cording to the PDG particle code... (0 is added for convenience)
25 REAL*8 CHARGE(0:100)
26 DATA CHARGE/ 0.D0,
27 &-0.3333333333D0, 0.6666666667D0, -0.3333333333D0, 0.6666666667D0,
28 &-0.3333333333D0, 0.6666666667D0, -0.3333333333D0, 0.6666666667D0,
29 & 2*0.D0, -1.D0, 0.D0, -1.D0, 0.D0, -1.D0, 0.D0, -1.D0, 6*0.D0,
30 & 1.D0, 12*0.D0, 1.D0, 63*0.D0/
31 IDABS=ABS(IDHEP)
32 IF (IDABS.LE.100) THEN
33C--
34C-- Charge of quark, lepton, boson etc....
35 PHOCHA = CHARGE(IDABS)
36 ELSE
37C--
38C-- Check on particle build out of quarks, unpack its code...
39 Q3=MOD(IDABS/1000,10)
40 Q2=MOD(IDABS/100,10)
41 Q1=MOD(IDABS/10,10)
42 IF (Q3.EQ.0) THEN
43C--
44C-- ...meson...
45 IF(MOD(Q2,2).EQ.0) THEN
46 PHOCHA=CHARGE(Q2)-CHARGE(Q1)
47 ELSE
48 PHOCHA=CHARGE(Q1)-CHARGE(Q2)
49 ENDIF
50 ELSE
51C--
52C-- ...diquarks or baryon.
53 PHOCHA=CHARGE(Q1)+CHARGE(Q2)+CHARGE(Q3)
54 ENDIF
55 ENDIF
56C--
57C-- Find the sign of the charge...
58 IF (IDHEP.LT.0.D0) PHOCHA=-PHOCHA
59 IF (PHOCHA**2.lt.1d-6) PHOCHA=0.D0
60 RETURN
61 END