Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pymass.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pymass.f
1 
2 C*********************************************************************
3 
4 C...PYMASS
5 C...Gives the mass of a particle/parton.
6 
7  FUNCTION pymass(KF)
8 
9 C...Double precision and integer declarations.
10  IMPLICIT DOUBLE PRECISION(a-h, o-z)
11  IMPLICIT INTEGER(i-n)
12  INTEGER pyk,pychge,pycomp
13 C...Commonblocks.
14  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
15  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
16  SAVE /pydat1/,/pydat2/
17 
18 C...Reset variables. Compressed code. Special case for popcorn diquarks.
19  pymass=0d0
20  kfa=iabs(kf)
21  kc=pycomp(kf)
22  IF(kc.EQ.0) THEN
23  mstj(93)=0
24  RETURN
25  ENDIF
26 
27 C...Guarantee use of constituent masses for internal checks.
28  IF((mstj(93).EQ.1.OR.mstj(93).EQ.2).AND.
29  &(kfa.LE.10.OR.mod(kfa/10,10).EQ.0)) THEN
30  IF(kfa.LE.5) THEN
31  pymass=parf(100+kfa)
32  IF(mstj(93).EQ.2) pymass=max(0d0,pymass-parf(121))
33  ELSEIF(kfa.LE.10) THEN
34  pymass=pmas(kfa,1)
35  ELSEIF(mstj(93).EQ.1) THEN
36  pymass=parf(100+mod(kfa/1000,10))+parf(100+mod(kfa/100,10))
37  ELSE
38  pymass=max(0d0,pmas(kc,1)-parf(122)-2d0*parf(112)/3d0)
39  ENDIF
40 
41 C...Other masses can be read directly off table.
42  ELSE
43  pymass=pmas(kc,1)
44  ENDIF
45 
46 C...Optional mass broadening according to truncated Breit-Wigner
47 C...(either in m or in m^2).
48  IF(mstj(24).GE.1.AND.pmas(kc,2).GT.1d-4) THEN
49  IF(mstj(24).EQ.1.OR.(mstj(24).EQ.2.AND.kfa.GT.100)) THEN
50  pymass=pymass+0.5d0*pmas(kc,2)*tan((2d0*pyr(0)-1d0)*
51  & atan(2d0*pmas(kc,3)/pmas(kc,2)))
52  ELSE
53  pm0=pymass
54  pmlow=atan((max(0d0,pm0-pmas(kc,3))**2-pm0**2)/
55  & (pm0*pmas(kc,2)))
56  pmupp=atan(((pm0+pmas(kc,3))**2-pm0**2)/(pm0*pmas(kc,2)))
57  pymass=sqrt(max(0d0,pm0**2+pm0*pmas(kc,2)*tan(pmlow+
58  & (pmupp-pmlow)*pyr(0))))
59  ENDIF
60  ENDIF
61  mstj(93)=0
62 
63  RETURN
64  END