Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
py1ent.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file py1ent.f
1 
2 C*********************************************************************
3 
4 C...PY1ENT
5 C...Stores one parton/particle in commonblock PYJETS.
6 
7  SUBROUTINE py1ent(IP,KF,PE,THE,PHI)
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/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
15  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
16  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
17  SAVE /pyjets/,/pydat1/,/pydat2/
18 
19 C...Standard checks.
20  mstu(28)=0
21  IF(mstu(12).NE.12345) CALL pylist(0)
22  ipa=max(1,iabs(ip))
23  IF(ipa.GT.mstu(4)) CALL pyerrm(21,
24  &'(PY1ENT:) writing outside PYJETS memory')
25  kc=pycomp(kf)
26  IF(kc.EQ.0) CALL pyerrm(12,'(PY1ENT:) unknown flavour code')
27 
28 C...Find mass. Reset K, P and V vectors.
29  pm=0d0
30  IF(mstu(10).EQ.1) pm=p(ipa,5)
31  IF(mstu(10).GE.2) pm=pymass(kf)
32  DO 100 j=1,5
33  k(ipa,j)=0
34  p(ipa,j)=0d0
35  v(ipa,j)=0d0
36  100 CONTINUE
37 
38 C...Store parton/particle in K and P vectors.
39  k(ipa,1)=1
40  IF(ip.LT.0) k(ipa,1)=2
41  k(ipa,2)=kf
42  p(ipa,5)=pm
43  p(ipa,4)=max(pe,pm)
44  pa=sqrt(p(ipa,4)**2-p(ipa,5)**2)
45  p(ipa,1)=pa*sin(the)*cos(phi)
46  p(ipa,2)=pa*sin(the)*sin(phi)
47  p(ipa,3)=pa*cos(the)
48 
49 C...Set N. Optionally fragment/decay.
50  n=ipa
51  IF(ip.EQ.0) CALL pyexec
52 
53  RETURN
54  END