]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HERWIG/jimmy/jimmy/jmkern.F
Mip-track matching improved. Now Last point of HMPID stored and track re-fitted.
[u/mrichter/AliRoot.git] / HERWIG / jimmy / jimmy / jmkern.F
1 *-- Author : JRF/JMB
2       DOUBLE PRECISION FUNCTION JMKERN( NDIM, V )
3 C -------------------------------------------------------------
4 C   Purpose: The kernel for the integral over PT,X1,X2
5 C            The integral goes from pt2tmp -> ptmax2.
6 C            When using this function in the initialsation,
7 C            pt2tmp == ptmin**2 and ptmax2 = the kinematic limit.
8 C            Otherwise they are the pt2 of the current
9 C            hard scatter and of the last, respectively.
10 C -------------------------------------------------------------
11
12 #include "herwig65.inc"
13 #include "jimmy.inc"
14
15
16       INTEGER NDIM
17       DOUBLE PRECISION PT2, PT2TMP, PTMAX2, V(NDIM)
18       DOUBLE PRECISION JMXS1, FAC1, FAC2
19       DOUBLE PRECISION FAC3, LX1, LX2, LPT2
20       DOUBLE PRECISION X1,X2,JMS
21
22 c     Beam-beam centre-of-mass energy.
23       JMS = 2.D0*(EBEAM1*EBEAM2+PBEAM1*PBEAM2)
24
25       IF (FN_TYPE.NE.101) THEN
26         WRITE(JMOUT,8902) 'JMKERN:THIS SHOULD NEVER HAPPEN!'
27         RETURN
28       ENDIF
29
30       PT2TMP = PTJIM**2
31 C     (This value is never used
32 C     - it is always greater than the kinematic limit)
33       PTMAX2 = JMS/4.D0 - RMASS(1)**2
34
35 C     Define region of integration
36       FAC1 = -DLOG( 4.D0*PT2TMP/(YGAMMA*JMS) )
37       IF ( FAC1 .LE. 0.D0 ) THEN
38         JMKERN = 0.D0
39         GOTO 8900
40       ENDIF
41
42       IF (JMBUG.GT.2) THEN
43         write(JMOUT,8902) 'v(1),ygamma,jms,pt2tmp,fac1'
44         write(JMOUT,*) v(1),ygamma,jms,pt2tmp
45      &     ,fac1
46       ENDIF
47
48       LX1 = DLOG( 4.D0*PT2TMP/(YGAMMA*JMS)) +V(1)*FAC1
49       X1 = DEXP( LX1 )
50       IF ( X1 .GE. ONE ) THEN
51         JMKERN = 0.D0
52         GOTO 8900
53       ENDIF
54
55       FAC2 = -DLOG( 4.D0*PT2TMP/(YGAMMA*X1*JMS) )
56       IF ( FAC2 .LE. 0.D0 ) THEN
57         JMKERN = 0.D0
58         GOTO 8900
59       ENDIF
60
61       LX2 = DLOG( 4.D0*PT2TMP/(YGAMMA*JMS*X1) ) + V(2)*FAC2
62       X2 = DEXP( LX2 )
63       IF ( X2 .GE. 1.D0 ) THEN
64         JMKERN = 0.D0
65         GOTO 8900
66       ENDIF
67
68       IF (NDIM.EQ.3) THEN
69         PTMAX2 = MIN(JMS*YGAMMA*X1*X2/4.D0,PTMAX2)
70         FAC3 = DLOG( PTMAX2 ) - DLOG( PT2TMP )
71         IF ( FAC3 .LE. SMALL ) THEN
72           JMKERN = 0.D0
73           GOTO 8900
74         ENDIF
75
76         LPT2 = DLOG( PT2TMP ) + V(3)*FAC3
77         PT2  = DEXP( LPT2 )
78         IF (JMBUG.GT.2) THEN
79           write(JMOUT,8902) 'lx1,x1,lx2,x2,pt2'
80           write(JMOUT,*) lx1,x1,lx2,x2,pt2
81         ENDIF
82         JMKERN = X1*X2*PT2*FAC1*FAC2*FAC3*
83      &      PHAD * JMXS1(X1,X2,PT2,0,0)
84
85         IF (JMBUG.GT.2) THEN
86           write(JMOUT,8902) 'JMKERN,X1,X2,PT2,FAC1,FAC2,FAC3,PHAD'
87           write(JMOUT,*) JMKERN,X1,X2,PT2,FAC1,FAC2,FAC3,PHAD
88         ENDIF
89
90         IF ( JMKERN .LE. 0.D-30 ) JMKERN = 0.D0
91
92       ELSE
93
94          WRITE(JMOUT,8902) 'JMKERN ERROR'
95
96       ENDIF
97
98  8900 CONTINUE
99
100       IF (JMBUG.GT.2) THEN
101         WRITE(JMOUT,8901) JMKERN,X1,X2,PT2
102       ENDIF
103  8901 FORMAT
104      & (1X,'XS=',F12.6,' X1=',F10.8,' X2=',F10.8,' PT2=',F10.3)
105  8902 FORMAT(A)
106       RETURN
107       END