~maddevelopers/mg5amcnlo/2.9.4

« back to all changes in this revision

Viewing changes to vendor/StdHEP/src/stdhep/stdfixmass.F

pass to v2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine stdfixmass
 
2
 
 
3
C... force particles to lie on the mass shell
 
4
C    assume that phep(5) is the correct mass
 
5
C    ignore particles which have already decayed
 
6
 
 
7
      IMPLICIT NONE
 
8
 
 
9
#include "stdhep.inc"
 
10
#include "stdlun.inc"
 
11
 
 
12
      integer i
 
13
      double precision msq,p4,newp,oldp,newroot,ms
 
14
 
 
15
      do i=1,nhep
 
16
        if( isthep(i) .eq. 1 ) then
 
17
          msq = phep(4,i)**2-phep(1,i)**2-phep(2,i)**2-phep(3,i)**2
 
18
          p4 = phep(4,i)**2+phep(5,i)**2-msq
 
19
          if(p4.lt.0.d0)then
 
20
            p4 = phep(5,i)**2+phep(1,i)**2+phep(2,i)**2+phep(3,i)**2
 
21
          endif
 
22
          phep(4,i) = sqrt(p4)
 
23
        endif
 
24
      enddo
 
25
      return
 
26
      end