COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cgeqm.f
Go to the documentation of this file.
1  subroutine cgeqm(p1, p2, q, icon)
2 ! get equivalent mass and 4 momentum of two particles
3 ! p1: type ptcl. Input. particle 1
4 ! p2: type ptcl. Input. particle 2
5 ! q: type ptcl. Output. equivalent particle 4 momentum
6 ! and mass are given
7 ! icon: integer. Output. if m^2 <0, icon=1, else icon=0
8 ! if icon =1, m becomes the m^2.
9 !
10  implicit none
11 !---- include '../Zptcl.h'
12 #include "Zptcl.h"
13  type(ptcl):: p1, p2
14  type(ptcl):: q
15  integer icon
16 !
17 ! equivalent mass
18  q%mass = p1%mass**2 + p2%mass**2 + 2* (p1%fm%p(4) * p2%fm%p(4)
19  * - (p1%fm%p(1) * p2%fm%p(1) + p1%fm%p(2) * p2%fm%p(2) +
20  * p1%fm%p(3) * p2%fm%p(3)))
21  if(q%mass .ge. 0.d0) then
22  q%mass = sqrt(q%mass)
23  icon = 0
24  else
25  icon = 1
26  endif
27 !
28  q%fm%p(1) = p1%fm%p(1) + p2%fm%p(1)
29  q%fm%p(2) = p1%fm%p(2) + p2%fm%p(2)
30  q%fm%p(3) = p1%fm%p(3) + p2%fm%p(3)
31  q%fm%p(4) = p1%fm%p(4) + p2%fm%p(4)
32  end
33  subroutine cgeqm2(p1, p2, q, icon)
34  ! if p1/p2 is nucleus, /n energy is used
35  ! to get q
36 #include "Zptcl.h"
37 #include "Zcode.h"
38  type(ptcl):: p1, p2
39  type(ptcl):: q
40  integer icon
41 
42  type(ptcl):: pp1, pp2
43  if( p1%code == kgnuc ) then
44  call cmkptc(6, -1, 1, pp1)
45  pp1%fm%p(1:4) = p1%fm%p(1:4)/p1%subcode
46  else
47  pp1 = p1
48  endif
49 
50 
51  if( p2%code == kgnuc ) then
52  call cmkptc(6,-1,1, pp2)
53  pp2%fm%p(1:4) = p2%fm%p(1:4)/p2%subcode
54  else
55  pp2 = p2
56  endif
57 
58  call cgeqm(pp1, pp2, q, icon)
59  end
60 
61 
62 
max ptcl codes in the kgnuc
Definition: Zcode.h:2
subroutine cgeqm(p1, p2, q, icon)
Definition: cgeqm.f:2
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine cmkptc(code, subcode, charge, p)
Definition: cmkptc.f:15
Definition: Zptcl.h:75
subroutine cgeqm2(p1, p2, q, icon)
Definition: cgeqm.f:34