Adding macros to create Calibration objects
[u/mrichter/AliRoot.git] / HIJING / hijing1_36 / fjetrig.F
1 * $Id$
2 C
3 C
4 C
5         FUNCTION FJETRIG(X,WGT)
6         IMPLICIT REAL*8(A-H,O-Z)
7 #define BLANKET_SAVE
8 #include "hiparnt.inc"
9         DIMENSION X(10)
10         SAVE
11         PTMIN=ABS(HIPR1(10))-0.25
12         PTMIN=MAX(PTMIN,DBLE(HIPR1(8)))
13         AM2=0.D0
14         IF(IHPR2(3).EQ.3) THEN
15            AM2=HIPR1(7)**2
16            PTMIN=MAX(0.0,HIPR1(10))
17         ENDIF
18         PTMAX=ABS(HIPR1(10))+0.25
19         IF(HIPR1(10).LE.0.0) PTMAX=HINT1(1)/2.0-AM2
20         IF(PTMAX.LE.PTMIN) PTMAX=PTMIN+0.25
21         PT2=(PTMAX**2-PTMIN**2)*X(1)+PTMIN**2
22         AMT2=PT2+AM2
23         XT=2.0*DSQRT(AMT2)/HINT1(1)
24         YMX1=DLOG(1.0/XT+DSQRT(1.0/XT**2-1.0))
25         Y1=2.0*YMX1*X(2)-YMX1
26         YMX2=DLOG(2.0/XT-DEXP(Y1))
27         YMN2=DLOG(2.0/XT-DEXP(-Y1))
28         Y2=(YMX2+YMN2)*X(3)-YMN2
29         IF(IHPR2(3).EQ.3) THEN
30            GTRIG=2.0*GHVQ(Y1,Y2,AMT2)
31         ELSE IF(IHPR2(3).EQ.2) THEN
32            GTRIG=2.0*GPHOTON(Y1,Y2,PT2)
33         ELSE
34            GTRIG=G(Y1,Y2,PT2)
35         ENDIF
36         FJETRIG=2.0*YMX1*(YMX2+YMN2)*(PTMAX**2-PTMIN**2)
37      &          *GTRIG/2.0
38         RETURN
39         END