More volume overlaps corrected
[u/mrichter/AliRoot.git] / ISAJET / code / logyth.F
CommitLineData
0795afa3 1#include "isajet/pilot.h"
2 LOGICAL FUNCTION LOGYTH(IERR)
3C
4C SET AND CHECK LIMITS FOR JET Y AND THETA
5C
6#include "isajet/itapes.inc"
7#include "isajet/jetlim.inc"
8#include "isajet/primar.inc"
9#include "isajet/jetpar.inc"
10#include "isajet/const.inc"
11#include "isajet/dylim.inc"
12#include "isajet/keys.inc"
13#include "isajet/q1q2.inc"
14 DATA UNDEF/-.9E9/
15C
16C INVERSE HYPERBOLIC COSINE FUNCTION
17 ACOSH(X)=ALOG(X+SQRT(X**2-1.0))
18C INVERSE HYPERBOLIC SINE FUNCTION
19 ASINH(X)=ALOG(X+SQRT(X**2+1.0))
20C
21 HALFPI=PI/2.
22 LOGYTH=.TRUE.
23C
24 DO 30 I=1,NJET
25 FIXYJ(I)=.FALSE.
26C
27 IF(FIXP(I).AND.FIXPT(I)) THEN
28 STH(I)=PT(I)/P(I)
29 CTHS(1,I)=SQRT(1.-STH(I)**2)
30 CTHS(2,I)=-CTHS(1,I)
31 THS(1,I)=ATAN2(STH(I),CTHS(1,I))
32 THS(2,I)=ATAN2(STH(I),CTHS(2,I))
33 YJS(1,I)=-ALOG(TAN(THS(1,I)/2.))
34 YJS(2,I)=-ALOG(TAN(THS(2,I)/2.))
35 XJS(1,I)=P(I)*CTHS(1,I)/HALFE
36 XJS(2,I)=P(I)*CTHS(2,I)/HALFE
37 YJMAX(I)=YJS(2,I)
38 THMAX(I)=THS(1,I)
39 THMIN(I)=THS(2,I)
40 IF(YJMIN(I).EQ.YJMAX(I)) FIXYJ(I)=.TRUE.
41 ENDIF
42C
43C
44 IF(YJMIN(I).LT.UNDEF.AND.YJMAX(I).LT.UNDEF) THEN
45C
46 IF(THMIN(I).LT.UNDEF.AND.THMAX(I).LT.UNDEF) THEN
47 YJMAX(I)=ACOSH(HALFE/PTMIN(I))
48 YJMIN(I)=-YJMAX(I)
49 THMIN(I)=2.*ATAN(EXP(-YJMAX(I)))
50 THMAX(I)=2.*ATAN(EXP(-YJMIN(I)))
51 ENDIF
52C
53 IF(THMAX(I).LT.UNDEF) FIXYJ(I)=.TRUE.
54 IF(THMIN(I).LT.UNDEF) THMIN(I)=.001
55 IF(FIXYJ(I)) THMAX(I)=THMIN(I)
56 YJMIN(I)=-ALOG(TAN(THMAX(I)/2.))
57 YJMAX(I)=-ALOG(TAN(THMIN(I)/2.))
58 THMIN(I)=2.*ATAN(EXP(-YJMAX(I)))
59 THMAX(I)=2.*ATAN(EXP(-YJMIN(I)))
60 ENDIF
61C
62C
63 IF(YJMAX(I).LT.UNDEF) FIXYJ(I)=.TRUE.
64 IF(YJMIN(I).LT.UNDEF) YJMIN(I)=-YJMAX(I)
65 IF(FIXYJ(I)) YJMAX(I)=YJMIN(I)
66 THMIN(I)=2.*ATAN(EXP(-YJMAX(I)))
67 THMAX(I)=2.*ATAN(EXP(-YJMIN(I)))
68C
69 IF(FIXYJ(I)) THEN
70 YJ(I)=YJMIN(I)
71 TH(I)=THMIN(I)
72 STH(I)=SIN(TH(I))
73 CTH(I)=COS(TH(I))
74 IF(FIXPT(I)) P(I)=PT(I)/STH(I)
75 IF(FIXP(I)) PT(I)=P(I)*STH(I)
76C
77 IF((FIXP(I).OR.FIXPT(I))) THEN
78 XJ(I)=P(I)*CTH(I)/HALFE
79 XJMIN(I)=XJ(I)
80 XJMAX(I)=XJ(I)
81 ENDIF
82C
83 ENDIF
84C
85C CHECK PT LIMITS WITH P AND THETA LIMITS
86 IF(.NOT.FIXPT(I)) THEN
87 THETA1=AMIN1(THMIN(I),PI-THMAX(I))
88 THETA2=HALFPI
89 IF(THMAX(I).LT.HALFPI) THETA2=THMAX(I)
90 IF(THMIN(I).GT.HALFPI) THETA2=THMIN(I)
91 PT1=PMIN(I)*SIN(THETA1)
92 PTMIN(I)=AMAX1(PTMIN(I),PT1)
93 PT2=PMAX(I)*SIN(THETA2)
94 PTMAX(I)=AMIN1(PTMAX(I),PT2)
95 ENDIF
96C
97 30 CONTINUE
98C
99 RETURN
100 END