Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gheisha / atomas.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:20:59 cernlib
6* Geant
7*
8*
9#include "geant321/pilot.h"
10*CMZ : 3.21/02 29/03/94 15.41.38 by S.Giani
11*-- Author :
12 REAL FUNCTION ATOMAS(A,Z)
13C
14C *** DETERMINATION OF THE ATOMIC MASS ***
15C *** NVE 19-MAY-1988 CERN GENEVA ***
16C
17C ORIGIN : H.FESEFELDT (02-DEC-1986)
18C
19#include "geant321/s_consts.inc"
20C
21#if !defined(CERNLIB_SINGLE)
22 DOUBLE PRECISION AA,ZZ,MASS
23#endif
24C
25C --- GET ATOMIC (= ELECTRONS INCL.) MASSES (IN MEV) FROM RMASS ARRAY ---
26C --- ELECTRON ---
27 RMEL=RMASS(4)*1000.
28C --- PROTON ---
29 RMP=RMASS(14)*1000.
30C --- NEUTRON ---
31 RMN=RMASS(16)*1000.
32C --- DEUTERON ---
33 RMD=RMASS(30)*1000.+RMEL
34C --- ALPHA ---
35 RMA=RMASS(32)*1000.+2.*RMEL
36C
37 ATOMAS = 0.
38 AA = A * 1.D0
39 ZZ = Z * 1.D0
40 IA = IFIX(A + 0.5)
41 IF(IA.LT.1) RETURN
42 IZ = IFIX(Z + 0.5)
43 IF(IZ.LT.0) RETURN
44 IF(IZ.GT.IA) RETURN
45 IF(IA.GT.4) GOTO 50
46 MASS=0.D0
47 GOTO (10,20,50,40),IA
48 10 IF(IZ.EQ.0) MASS=RMN
49 IF(IZ.EQ.1) MASS=RMP+RMEL
50 GOTO 60
51 20 IF(IZ.NE.1) GOTO 50
52 MASS=RMD
53 GOTO 60
54 40 IF(IZ.NE.2) GOTO 50
55 MASS=RMA
56 GOTO 60
57 50 MASS=(AA-ZZ)*RMN + ZZ*RMP +ZZ*RMEL - 15.67*AA
58 * + 17.23*(AA**0.6666667) + 93.15*((AA/2.-ZZ)**2)/AA
59 * +0.6984523*ZZ**2/(AA**0.3333333)
60 IPP=MOD(IA-IZ,2)
61 IZZ=MOD(IZ,2)
62 IF(IPP.NE.IZZ) GOTO 60
63 MASS = MASS + (IPP+IZZ- 1)*12.00*(AA**(-0.5))
64 60 ATOMAS = MASS*0.001
65 RETURN
66 END