      DOUBLE PRECISION FUNCTION DSIG(PP,WGT)
C ****************************************************
C Generated by MadGraph II Version 3.0. Updated 02/19/04                
C     RETURNS DIFFERENTIAL CROSS SECTION
C     Input:
C             pp    4 momentum of external particles
C             wgt   weight from Monte Carlo
C     Output:
C             Amplitude squared and summed
C ****************************************************
      IMPLICIT NONE
C  
C CONSTANTS
C  
      include "genps.inc"
      DOUBLE PRECISION       CONV
      PARAMETER (CONV=389379.66*1000)  !CONV TO PICOBARNS
      REAL*8     PI
      PARAMETER (PI=3.1415926d0)
C  
C ARGUMENTS 
C  
      DOUBLE PRECISION PP(0:3,NEXTERNAL), WGT
C  
C LOCAL VARIABLES 
C  
      INTEGER I, ICROSS,ITYPE
      DOUBLE PRECISION P1(0:3,NEXTERNAL)
      DOUBLE PRECISION ALPHA_S,XNFN,Q2REN
      DOUBLE PRECISION u1,ub1,d1,db1,c1,cb1,s1,sb1,b1,bb1
      DOUBLE PRECISION u2,ub2,d2,db2,c2,cb2,s2,sb2,b2,bb2
      DOUBLE PRECISION g1,g2
      DOUBLE PRECISION XPQ(-6:6)
      DOUBLE PRECISION DSIGUU
C  
C EXTERNAL FUNCTIONS
C  
      LOGICAL PASSCUTS
      DOUBLE PRECISION ALPHAS2
C  
C GLOBAL VARIABLES
C  
      INTEGER                                      LPP(2)
      DOUBLE PRECISION     EBEAM(2), XBK(2), Q2FACT(2)
      COMMON /To_Collider/ EBEAM,    XBK,    Q2FACT, LPP
      INTEGER              IPROC
      DOUBLE PRECISION PD(0:MAXPROC)
      COMMON /SubProc/ PD, IPROC
      DOUBLE PRECISION Q2scal
      COMMON /to_scale/Q2scal
      include "coupl.inc"
C  
C DATA
C  
      DATA u1,ub1,d1,db1,c1,cb1,s1,sb1,b1,bb1,g1/11*1d0/
      DATA u2,ub2,d2,db2,c2,cb2,s2,sb2,b2,bb2,g2/11*1d0/
      DATA IPROC,ICROSS/1,1/
C ----------
C BEGIN CODE
C ----------
      DSIG = 0D0
      IF (PASSCUTS(PP)) THEN
         IF (ABS(LPP(1)) .EQ. 1) THEN
            CALL PFTOPDG(XBK(1),DSQRT(Q2FACT(1)),XPQ)
            g1 = xpq(0)
            d1 = xpq(1*LPP(1))
            u1 = xpq(2*LPP(1))
            s1 = xpq(3*LPP(1))
            c1 = xpq(4*LPP(1))
            b1 = xpq(5*LPP(1))
            db1= xpq(-1*LPP(1))
            ub1= xpq(-2*LPP(1))
            sb1= xpq(-3*LPP(1))
            cb1= xpq(-4*LPP(1))
            bb1= xpq(-5*LPP(1))
         ENDIF
         IF (ABS(LPP(2)) .EQ. 1) THEN
            CALL PFTOPDG(XBK(2),DSQRT(Q2FACT(2)),XPQ)
            g2 = xpq(0)
            d2 = xpq(1*LPP(2))
            u2 = xpq(2*LPP(2))
            s2 = xpq(3*LPP(2))
            c2 = xpq(4*LPP(2))
            b2 = xpq(5*LPP(2))
            db2= xpq(-1*LPP(2))
            ub2= xpq(-2*LPP(2))
            sb2= xpq(-3*LPP(2))
            cb2= xpq(-4*LPP(2))
            bb2= xpq(-5*LPP(2))
         ENDIF
         PD(0) = 0d0
         IPROC = 0
         IPROC=IPROC+1      ! s s~ -> d d~ z z                           
         PD(IPROC)=PD(IPROC-1) + s1 * sb2                                
          CALL SMATRIX(PP,DSIGUU)                                              
         If (dsiguu .lt. 1d199) then
             dsig = pd(IPROC) * conv * dsiguu
         else
             write(*,*) "Error in matrix element"
             dsiguu=0d0
             dsig = 0d0
         endif
         call unwgt(pp,pd(iproc)*conv*dsiguu*wgt)
      ENDIF
      END
