Adding macros to create Calibration objects
[u/mrichter/AliRoot.git] / HIJING / hijing1_36 / atrobo.F
CommitLineData
e74335a4 1* $Id$
2
3
4C
5C*******************************************************************
6C make boost and rotation to entries from IMIN to IMAX
7C*******************************************************************
8 SUBROUTINE ATROBO(THE,PHI,BEX,BEY,BEZ,IMIN,IMAX,IERROR)
bc676b8e 9#define BLANKET_SAVE
e74335a4 10#include "lujets_hijing.inc"
11 DIMENSION ROT(3,3),PV(3)
12 DOUBLE PRECISION DP(4),DBEX,DBEY,DBEZ,DGA,DGA2,DBEP,DGABEP
13 SAVE
14 IERROR=0
15
16 IF(IMIN.LE.0 .OR. IMAX.GT.N .OR. IMIN.GT.IMAX) RETURN
17
18 IF(THE**2+PHI**2.GT.1E-20) THEN
19C...ROTATE (TYPICALLY FROM Z AXIS TO DIRECTION THETA,PHI)
20 ROT(1,1)=COS(THE)*COS(PHI)
21 ROT(1,2)=-SIN(PHI)
22 ROT(1,3)=SIN(THE)*COS(PHI)
23 ROT(2,1)=COS(THE)*SIN(PHI)
24 ROT(2,2)=COS(PHI)
25 ROT(2,3)=SIN(THE)*SIN(PHI)
26 ROT(3,1)=-SIN(THE)
27 ROT(3,2)=0.
28 ROT(3,3)=COS(THE)
29 DO 120 I=IMIN,IMAX
30C************** IF(MOD(K(I,1)/10000,10).GE.6) GOTO 120
31 DO 100 J=1,3
32 100 PV(J)=P(I,J)
33 DO 110 J=1,3
34 110 P(I,J)=ROT(J,1)*PV(1)+ROT(J,2)*PV(2)
35 & +ROT(J,3)*PV(3)
36 120 CONTINUE
37 ENDIF
38
39 IF(BEX**2+BEY**2+BEZ**2.GT.1E-20) THEN
40C...LORENTZ BOOST (TYPICALLY FROM REST TO MOMENTUM/ENERGY=BETA)
41 DBEX=BEX
42 DBEY=BEY
43 DBEZ=BEZ
44 DGA2=1D0-DBEX**2-DBEY**2-DBEZ**2
45 IF(DGA2.LE.0D0) THEN
46 IERROR=1
47 RETURN
48 ENDIF
49 DGA=1D0/DSQRT(DGA2)
50 DO 140 I=IMIN,IMAX
51C************* IF(MOD(K(I,1)/10000,10).GE.6) GOTO 140
52 DO 130 J=1,4
53130 DP(J)=P(I,J)
54 DBEP=DBEX*DP(1)+DBEY*DP(2)+DBEZ*DP(3)
55 DGABEP=DGA*(DGA*DBEP/(1D0+DGA)+DP(4))
56 P(I,1)=DP(1)+DGABEP*DBEX
57 P(I,2)=DP(2)+DGABEP*DBEY
58 P(I,3)=DP(3)+DGABEP*DBEZ
59 P(I,4)=DGA*(DP(4)+DBEP)
60140 CONTINUE
61 ENDIF
62
63 RETURN
64 END