Protection in function PAWT added.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Dec 2009 14:40:18 +0000 (14:40 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Dec 2009 14:40:18 +0000 (14:40 +0000)
HIJING/hipyset1_35/ludecy_hijing.F

index c17835d..800dac8 100644 (file)
@@ -1,7 +1,16 @@
 * $Id$
     
 C*********************************************************************  
-    
+
+      FUNCTION PAWT(A,B,C)
+      IF(((A**2-(B+C)**2)*(A**2-(B-C)**2)).GT.0) THEN
+         PAWT = SQRT((A**2-(B+C)**2)*(A**2-(B-C)**2))/(2.*A)
+      ELSE
+         PAWT = 0
+      ENDIF
+      RETURN
+      END
+
       SUBROUTINE LUDECY_HIJING(IP) 
     
 C...Purpose: to handle the decay of unstable particles. 
@@ -15,7 +24,7 @@ C...Purpose: to handle the decay of unstable particles.
     
 C...Functions: momentum in two-particle decays, four-product and    
 C...matrix element times phase space in weak decays.    
-      PAWT(A,B,C)=SQRT((A**2-(B+C)**2)*(A**2-(B-C)**2))/(2.*A)  
+
       FOUR(I,J)=P(I,4)*P(J,4)-P(I,1)*P(J,1)-P(I,2)*P(J,2)-P(I,3)*P(J,3) 
       HMEPS(HA)=((1.-HRQ-HA)**2+3.*HA*(1.+HRQ-HA))* 
      &SQRT((1.-HRQ-HA)**2-4.*HRQ*HA)