COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cresetMom.f
Go to the documentation of this file.
1  subroutine cresetmom(aTrack)
2 ! Assum the case where the direction cos has been changed
3 ! and the directionof vector p should be changed.
4 ! (see cresetMombyEDir)
5  implicit none
6 
7 #include "Ztrack.h"
8  type(track)::aTrack ! input/output.
9 !
10  real*8 p
11  call cpxyzp(atrack%p%fm, p)
12  atrack%p%fm%p(1) = p * atrack%vec%w%r(1)
13  atrack%p%fm%p(2) = p * atrack%vec%w%r(2)
14  atrack%p%fm%p(3) = p * atrack%vec%w%r(3)
15 
16  end subroutine cresetmom
17 
18  subroutine cresetmombyedir(aTrack)
19 ! Assume the case where the direction cos is correctly given
20 ! and E has beeen changed, Vec p should not be used.
21 
22 ! If E< mass, E is reset to mass. and vec p becomes 0.
23  implicit none
24 #include "Ztrack.h"
25  type(track)::aTrack ! input/output.
26  real(8)::pabs
27  pabs = atrack%p%fm%p(4)**2 - atrack%p%mass**2
28  if( pabs <= 0. ) then
29  atrack%p%fm%p(4) = atrack%p%mass
30  pabs = 0.
31  else
32  pabs = sqrt(pabs)
33  endif
34  atrack%p%fm%p(1:3) = atrack%vec%w%r(1:3)*pabs
35  end subroutine cresetmombyedir
subroutine cresetmom(aTrack)
Definition: cresetMom.f:2
subroutine cpxyzp(po, pabs)
Definition: cpxyzp.f:3
Definition: Ztrack.h:44
subroutine cresetmombyedir(aTrack)
Definition: cresetMom.f:19