COSMOS v7.655  COSMOSv7655
(AirShowerMC)
clorep.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine clorep (j, gb, q, p)
 

Function/Subroutine Documentation

◆ clorep()

subroutine clorep ( integer  j,
type(fmom gb,
type(ptcl q,
type(ptcl p 
)

Definition at line 88 of file clorep.f.

References capplyrot4(), cgetrotmat4(), cinvrotmat4(), cmultrotmat4(), d0, and g.

Referenced by cbst0(), cibst1(), and cloreb().

88  implicit none
89 !---- include '../Zptcl.h'
90 #include "Zptcl.h"
91 
92  type(fmom):: gb
93  type(ptcl):: q, p
94 !
95  real*8 rm(4, 4), rmy(4, 4), rmyi(4, 4), rmz(4, 4),
96  * rmzi(4, 4), rmi(4, 4), gmin/1.e4/, g
97  real*8 fai1, fai2, tmp, gbq, a
98  type(fmom):: agb
99  type(ptcl):: qt
100 
101 #ifdef USESAVE
102  save agb
103 #endif
104 
105  integer jsv/0/, i, j
106  save rm, rmi, jsv
107 !
108  p = q
109  gbq = 0.d0
110  do i=1, 3
111  gbq=gbq + gb%p(i)*q%fm%p(i)
112  enddo
113 !
114  g = gb%p(4)
115  a=1.d0/(1.d0+g)
116  if(gbq .ge. 0.d0 .or. g .lt. gmin) then
117 ! if(gbq .ge. 0.d0 ) then
118  do i=1, 3
119  p%fm%p(i) = q%fm%p(i) +
120  * gb%p(i)*(q%fm%p(4) + a*gbq)
121  enddo
122  p%fm%p(4) = g*q%fm%p(4) + gbq
123 ! j=1, but matrix is not computed
124  if(j .eq.1) jsv=0
125  else
126 ! rotate the axes by atan(beta(y)/beta(x)) around z,
127 ! then rotate the axes by atan(beta/beta(z))
128 ! around y, then the orignal z axis coincide with
129 ! beta. apply lorentz trans. there and re-rotate
130 ! matrix for z-axis
131  if(j .eq. 1 .or. jsv .eq. 0) then
132  if(gb%p(2) .eq. 0. .and. gb%p(1) .eq. 0.) then
133  fai1=0.
134  else
135  fai1= atan2(gb%p(2), gb%p(1))
136  endif
137  call cgetrotmat4(3, fai1, rmz)
138 ! matrix for y-axis
139  tmp=gb%p(1)**2 + gb%p(2)**2
140  agb%p(3)= sqrt(tmp + gb%p(3)**2)
141  agb%p(4)=g
142  if(tmp .eq. 0. and. gb%p(3) .eq. 0.) then
143  fai2 = 0.
144  else
145  fai2= atan2(sqrt(tmp), gb%p(3))
146  endif
147  call cgetrotmat4(2, fai2, rmy)
148 ! combined rotaion matrix
149  call cmultrotmat4(rmy, rmz, rm)
150  endif
151 ! do combined rotaion
152  qt = q
153  call capplyrot4(rm, q%fm, qt%fm)
154  qt%fm%p(4)=q%fm%p(4)
155 ! ////////////
156 ! call ctestOnShell('q before rot', q)
157 ! call ctestOnShell('qt after rot', qt)
158 ! ////////////////
159 
160 ! lorentz trans. along beta
161  call clorez(agb, qt, qt)
162 ! /////////
163 ! call ctestOnShell('after lorez', qt)
164 ! /////////////
165 ! re-rotate; get inverse rotation matrix
166  if(j .eq. 1 .or. jsv .eq. 0) then
167  call cinvrotmat4(rmz, rmzi)
168  call cinvrotmat4(rmy, rmyi)
169  call cmultrotmat4(rmzi, rmyi, rmi)
170  endif
171  call capplyrot4(rmi, qt%fm, p%fm)
172  p%fm%p(4) = qt%fm%p(4)
173 ! ////////////
174 ! call ctestOnShell('after rot', p)
175 ! ////////////////
176  jsv=1
177  endif
subroutine cmultrotmat4(a, b, c)
Definition: cgetRotMat4.f:131
nodes i
subroutine cinvrotmat4(rm, rmn)
Definition: cgetRotMat4.f:110
subroutine cgetrotmat4(m, ang, rm)
Definition: cgetRotMat4.f:79
Definition: Zptcl.h:72
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine capplyrot4(a, v, vn)
Definition: cgetRotMat4.f:148
real(4), save a
Definition: cNRLAtmos.f:20
dE dx *! Nuc Int sampling table g
Definition: cblkMuInt.h:130
Definition: Zptcl.h:75
Here is the call graph for this function:
Here is the caller graph for this function: