Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:08

0001  
0002 C*********************************************************************
0003  
0004 C...PY2ENT
0005 C...Stores two partons/particles in their CM frame,
0006 C...with the first along the +z axis.
0007  
0008       SUBROUTINE PY2ENT(IP,KF1,KF2,PECM)
0009  
0010 C...Double precision and integer declarations.
0011       IMPLICIT DOUBLE PRECISION(A-H, O-Z)
0012       IMPLICIT INTEGER(I-N)
0013       INTEGER PYK,PYCHGE,PYCOMP
0014 C...Commonblocks.
0015       COMMON/PYJETS/N,NPAD,K(4000,5),P(4000,5),V(4000,5)
0016       COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
0017       COMMON/PYDAT2/KCHG(500,4),PMAS(500,4),PARF(2000),VCKM(4,4)
0018       SAVE /PYJETS/,/PYDAT1/,/PYDAT2/
0019  
0020 C...Standard checks.
0021       MSTU(28)=0
0022       IF(MSTU(12).NE.12345) CALL PYLIST(0)
0023       IPA=MAX(1,IABS(IP))
0024       IF(IPA.GT.MSTU(4)-1) CALL PYERRM(21,
0025      &'(PY2ENT:) writing outside PYJETS memory')
0026       KC1=PYCOMP(KF1)
0027       KC2=PYCOMP(KF2)
0028       IF(KC1.EQ.0.OR.KC2.EQ.0) CALL PYERRM(12,
0029      &'(PY2ENT:) unknown flavour code')
0030  
0031 C...Find masses. Reset K, P and V vectors.
0032       PM1=0D0
0033       IF(MSTU(10).EQ.1) PM1=P(IPA,5)
0034       IF(MSTU(10).GE.2) PM1=PYMASS(KF1)
0035       PM2=0D0
0036       IF(MSTU(10).EQ.1) PM2=P(IPA+1,5)
0037       IF(MSTU(10).GE.2) PM2=PYMASS(KF2)
0038       DO 110 I=IPA,IPA+1
0039         DO 100 J=1,5
0040           K(I,J)=0
0041           P(I,J)=0D0
0042           V(I,J)=0D0
0043   100   CONTINUE
0044   110 CONTINUE
0045  
0046 C...Check flavours.
0047       KQ1=KCHG(KC1,2)*ISIGN(1,KF1)
0048       KQ2=KCHG(KC2,2)*ISIGN(1,KF2)
0049       IF(MSTU(19).EQ.1) THEN
0050         MSTU(19)=0
0051       ELSE
0052         IF(KQ1+KQ2.NE.0.AND.KQ1+KQ2.NE.4) CALL PYERRM(2,
0053      &  '(PY2ENT:) unphysical flavour combination')
0054       ENDIF
0055       K(IPA,2)=KF1
0056       K(IPA+1,2)=KF2
0057  
0058 C...Store partons/particles in K vectors for normal case.
0059       IF(IP.GE.0) THEN
0060         K(IPA,1)=1
0061         IF(KQ1.NE.0.AND.KQ2.NE.0) K(IPA,1)=2
0062         K(IPA+1,1)=1
0063  
0064 C...Store partons in K vectors for parton shower evolution.
0065       ELSE
0066         K(IPA,1)=3
0067         K(IPA+1,1)=3
0068         K(IPA,4)=MSTU(5)*(IPA+1)
0069         K(IPA,5)=K(IPA,4)
0070         K(IPA+1,4)=MSTU(5)*IPA
0071         K(IPA+1,5)=K(IPA+1,4)
0072       ENDIF
0073  
0074 C...Check kinematics and store partons/particles in P vectors.
0075       IF(PECM.LE.PM1+PM2) CALL PYERRM(13,
0076      &'(PY2ENT:) energy smaller than sum of masses')
0077       PA=SQRT(MAX(0D0,(PECM**2-PM1**2-PM2**2)**2-(2D0*PM1*PM2)**2))/
0078      &(2D0*PECM)
0079       P(IPA,3)=PA
0080       P(IPA,4)=SQRT(PM1**2+PA**2)
0081       P(IPA,5)=PM1
0082       P(IPA+1,3)=-PA
0083       P(IPA+1,4)=SQRT(PM2**2+PA**2)
0084       P(IPA+1,5)=PM2
0085  
0086 C...Set N. Optionally fragment/decay.
0087       N=IPA+1
0088       IF(IP.EQ.0) CALL PYEXEC
0089  
0090       RETURN
0091       END