EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lurobo.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file lurobo.f
1 
2 C*********************************************************************
3 
4  SUBROUTINE lurobo(THE,PHI,BEX,BEY,BEZ)
5 
6 C...Purpose: to perform rotations and boosts.
7  IMPLICIT DOUBLE PRECISION(d)
8  common/lujets/n,k(9000,5),p(9000,5),v(9000,5)
9  SAVE /lujets/
10  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
11  SAVE /ludat1/
12  dimension rot(3,3),pr(3),vr(3),dp(4),dv(4)
13 
14 C...Find range of rotation/boost. Convert boost to double precision.
15  imin=1
16  IF(mstu(1).GT.0) imin=mstu(1)
17  imax=n
18  IF(mstu(2).GT.0) imax=mstu(2)
19  dbx=bex
20  dby=bey
21  dbz=bez
22  goto 100
23 
24 C...Entry for specific range and double precision boost.
25  entry ludbrb(imi,ima,the,phi,dbex,dbey,dbez)
26  imin=imi
27  IF(imin.LE.0) imin=1
28  imax=ima
29  IF(imax.LE.0) imax=n
30  dbx=dbex
31  dby=dbey
32  dbz=dbez
33 
34 C...Check range of rotation/boost.
35  100 IF(imin.GT.mstu(4).OR.imax.GT.mstu(4)) THEN
36  CALL luerrm(11,'(LUROBO:) range outside LUJETS memory')
37  RETURN
38  ENDIF
39 
40 C...Rotate, typically from z axis to direction (theta,phi).
41  IF(the**2+phi**2.GT.1e-20) THEN
42  rot(1,1)=cos(the)*cos(phi)
43  rot(1,2)=-sin(phi)
44  rot(1,3)=sin(the)*cos(phi)
45  rot(2,1)=cos(the)*sin(phi)
46  rot(2,2)=cos(phi)
47  rot(2,3)=sin(the)*sin(phi)
48  rot(3,1)=-sin(the)
49  rot(3,2)=0.
50  rot(3,3)=cos(the)
51  DO 130 i=imin,imax
52  IF(k(i,1).LE.0) goto 130
53  DO 110 j=1,3
54  pr(j)=p(i,j)
55  110 vr(j)=v(i,j)
56  DO 120 j=1,3
57  p(i,j)=rot(j,1)*pr(1)+rot(j,2)*pr(2)+rot(j,3)*pr(3)
58  120 v(i,j)=rot(j,1)*vr(1)+rot(j,2)*vr(2)+rot(j,3)*vr(3)
59  130 CONTINUE
60  ENDIF
61 
62 C...Boost, typically from rest to momentum/energy=beta.
63  IF(dbx**2+dby**2+dbz**2.GT.1e-20) THEN
64  db=sqrt(dbx**2+dby**2+dbz**2)
65  IF(db.GT.0.99999999d0) THEN
66 C...Rescale boost vector if too close to unity.
67  CALL luerrm(3,'(LUROBO:) boost vector too large')
68  dbx=dbx*(0.99999999d0/db)
69  dby=dby*(0.99999999d0/db)
70  dbz=dbz*(0.99999999d0/db)
71  db=0.99999999d0
72  ENDIF
73  dga=1d0/sqrt(1d0-db**2)
74  DO 150 i=imin,imax
75  IF(k(i,1).LE.0) goto 150
76  DO 140 j=1,4
77  dp(j)=p(i,j)
78  140 dv(j)=v(i,j)
79  dbp=dbx*dp(1)+dby*dp(2)+dbz*dp(3)
80  dgabp=dga*(dga*dbp/(1d0+dga)+dp(4))
81  p(i,1)=dp(1)+dgabp*dbx
82  p(i,2)=dp(2)+dgabp*dby
83  p(i,3)=dp(3)+dgabp*dbz
84  p(i,4)=dga*(dp(4)+dbp)
85  dbv=dbx*dv(1)+dby*dv(2)+dbz*dv(3)
86  dgabv=dga*(dga*dbv/(1d0+dga)+dv(4))
87  v(i,1)=dv(1)+dgabv*dbx
88  v(i,2)=dv(2)+dgabv*dby
89  v(i,3)=dv(3)+dgabv*dbz
90  v(i,4)=dga*(dv(4)+dbv)
91  150 CONTINUE
92  ENDIF
93 
94  RETURN
95  END