COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cadjm.f
Go to the documentation of this file.
1 ! *****************************************************
2 ! *
3 ! * cadjm: adjust momentum when energy has changed
4 ! * or mass has changed.
5 ! * but keep the direction of \vec p unchanged
6 ! ***************************************************
7 ! call cadjm(p, q)
8 !
9 ! p: /ptcl/ Input. 4 momeuntum and mass must be given.
10 ! q: /ptcl/ Output. Momentum of p is adjusted and stored in q
11 ! q can be p.
12 !
13  subroutine cadjm(p, q)
14 !---- include '../Zptcl.h'
15 #include "Zptcl.h"
16  type(ptcl):: p, q
17 !
18  real*8 pabs, cpabs, r
19 ! |p| from 3 momentum
20  call cpxyzp(p%fm, pabs)
21 ! true |p|
22  cpabs = p%fm%p(4)**2 - p%mass**2
23  if(cpabs .gt. 0.d0 .and. pabs .gt. 0.d0) then
24  cpabs = sqrt(cpabs)
25  r = cpabs/pabs
26  q%fm%p(1) = p%fm%p(1) * r
27  q%fm%p(2) = p%fm%p(2) * r
28  q%fm%p(3) = p%fm%p(3) * r
29  else
30  q%fm%p(1) =0.
31  q%fm%p(2) =0.
32  q%fm%p(3) =0.
33  endif
34  q%fm%p(4) = p%fm%p(4)
35  q%mass = p%mass
36  end
subroutine cpxyzp(po, pabs)
Definition: cpxyzp.f:3
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine cadjm(p, q)
Definition: cadjm.f:14
Definition: Zptcl.h:75