COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cyeta.f
Go to the documentation of this file.
1 ! *********************************************
2 ! get rapidity and psude-rapidity from
3 ! /ptcl/ data.
4  subroutine cyeta(p, y, eta)
5 ! *********************************************
6  implicit none
7 !---- include '../Zptcl.h'
8 #include "Zptcl.h"
9  type(ptcl):: p
10  real*8 y, eta
11 !
12  real*8 pp, e, pt2, tm2, cost, sint, absp, tanh
13  pp=p%fm%p(3)
14  e=p%fm%p(4)
15  pt2=p%fm%p(1)**2 + p%fm%p(2)**2
16  tm2=pt2 + p%mass**2
17  if(pp .ge. 0.d0) then
18  y=log( (e+pp)**2/tm2 ) /2
19  else
20  y=log( tm2/(e-pp)**2 ) /2
21  endif
22  absp = sqrt(pt2 + pp**2)
23  cost=pp/absp
24  if(abs(cost) .gt. .99 ) then
25  sint=sqrt(pt2) / absp
26  else
27  sint=sqrt(1.d0-cost**2)
28  endif
29  if(cost .gt. 0.d0) then
30  tanh=sint/(1.d0+cost)
31  else
32  tanh=(1.d0 - cost)/sint
33  endif
34  if(tanh .le. 0.0) then
35  if( cost .gt. 0.) then
36  eta = 20.
37  else
38  eta = -20.
39  endif
40  else
41  eta=-log(tanh)
42  endif
43  end
44 
45 
46 
47 
48 
49 
50 
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
Definition: Zptcl.h:75
subroutine cyeta(p, y, eta)
Definition: cyeta.f:5