More volume overlaps corrected
[u/mrichter/AliRoot.git] / ISAJET / code / logx.F
CommitLineData
0795afa3 1#include "isajet/pilot.h"
2 LOGICAL FUNCTION LOGX(IERR)
3C
4C SET AND CHECK LIMITS FOR JET FEYNMAN X
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
16 HALFPI=PI/2.
17 LOGX=.TRUE.
18C
19 DO 40 I=1,NJET
20 FIXXJ(I)=.FALSE.
21 IF(FIXYJ(I).AND.(FIXP(I).OR.FIXPT(I)))FIXXJ(I)=.TRUE.
22 IF(FIXXJ(I)) GOTO 40
23C
24 IF(XJMIN(I).LT.UNDEF.AND.XJMAX(I).LT.UNDEF) THEN
25 XJMAX(I)=1.0
26 XJMIN(I)=-1.0
27 ENDIF
28C
29 IF(XJMAX(I).LT.UNDEF) FIXXJ(I)=.TRUE.
30 IF(FIXXJ(I)) XJMAX(I)=XJMIN(I)
31C
32 IF(.NOT.FIXXJ(I)) THEN
33 IF(THMIN(I).LT.HALFPI) X1=PMAX(I)*COS(THMIN(I))/HALFE
34 IF(THMIN(I).GE.HALFPI) X1=PMIN(I)*COS(THMIN(I))/HALFE
35 IF(THMAX(I).GT.HALFPI) X2=PMAX(I)*COS(THMAX(I))/HALFE
36 IF(THMAX(I).LT.HALFPI) X2=PMIN(I)*COS(THMAX(I))/HALFE
37 IF(X1.LT.XJMAX(I)) XJMAX(I)=X1
38 IF(X2.GT.XJMIN(I)) XJMIN(I)=X2
39 ELSE
40C
41 XJ(I)=XJMIN(I)
42C
43 IF(FIXP(I)) THEN
44 CTH(I)=XJ(I)*HALFE/P(I)
45 IF(ABS(CTH(I)).LE.1.0) THEN
46 STH(I)=SQRT(1.-CTH(I)**2)
47 TH(I)=ATAN2(STH(I),CTH(I))
48 YJ(I)=-ALOG(TAN(TH(I)/2.))
49 FIXYJ(I)=.TRUE.
50 PT(I)=P(I)*STH(I)
51 FIXPT(I)=.TRUE.
52 YJMIN(I)=YJ(I)
53 YJMAX(I)=YJ(I)
54 PTMIN(I)=PT(I)
55 PTMAX(I)=PT(I)
56 ELSE
57 LOGX=.FALSE.
58 CALL LOGERR(5,I,IERR)
59 ENDIF
60 ENDIF
61C
62 IF(FIXPT(I)) THEN
63 TH(I)=ATAN(PT(I)/XJ(I)/HALFE)
64 FIXYJ(I)=.TRUE.
65 YJ(I)=-ALOG(TAN(TH(I)/2.))
66 CTH(I)=COS(TH(I))
67 STH(I)=SIN(TH(I))
68 P(I)=PT(I)/STH(I)
69 FIXP(I)=.TRUE.
70 YJMIN(I)=YJ(I)
71 YJMAX(I)=YJ(I)
72 PMAX(I)=P(I)
73 PMIN(I)=P(I)
74 ENDIF
75C
76 IF(FIXYJ(I)) THEN
77 FIXPT(I)=.TRUE.
78 P(I)=XJ(I)*HALFE/CTH(I)
79 PT(I)=P(I)*STH(I)
80 FIXP(I)=.TRUE.
81 PTMIN(I)=PT(I)
82 PTMAX(I)=PT(I)
83 PMAX(I)=P(I)
84 PMIN(I)=P(I)
85 ENDIF
86C
87 ENDIF
88C
89 40 CONTINUE
90C
91 RETURN
92 END