Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyptdi.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyptdi.f
1 
2 
3 C*********************************************************************
4 
5 C...PYPTDI
6 C...Generates transverse momentum according to a Gaussian.
7 
8  SUBROUTINE pyptdi(KFL,PX,PY)
9 
10 C...Double precision and integer declarations.
11  IMPLICIT DOUBLE PRECISION(a-h, o-z)
12  IMPLICIT INTEGER(i-n)
13  INTEGER pyk,pychge,pycomp
14 C...Commonblocks.
15  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
16  SAVE /pydat1/
17 
18 C...Generate p_T and azimuthal angle, gives p_x and p_y.
19  kfla=iabs(kfl)
20  pt=parj(21)*sqrt(-log(max(1d-10,pyr(0))))
21  IF(parj(23).GT.pyr(0)) pt=parj(24)*pt
22  IF(mstj(91).EQ.1) pt=parj(22)*pt
23  IF(kfla.EQ.0.AND.mstj(13).LE.0) pt=0d0
24  phi=paru(2)*pyr(0)
25  px=pt*cos(phi)
26  py=pt*sin(phi)
27 
28  RETURN
29  END