All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
pxtry.f
Go to the documentation of this file.
1 CDECK ID>, PXTRY.
2 ******............................................................******
3  SUBROUTINE pxtry(COSR,NTRAK,PU,PP,OAXIS,NAXIS,PNEW,NEWLIS,OK)
4 ******............................................................******
5 *
6  IMPLICIT NONE
7  INTEGER mxtrak
8  parameter(mxtrak=200)
9  INTEGER ntrak
10  REAL cosr,pu(3,mxtrak),pp(4,mxtrak),oaxis(3)
11  LOGICAL ok
12  LOGICAL newlis(mxtrak)
13  REAL naxis(3),pnew(4)
14 *** Finds all particles in cone of size COSR about OAXIS direction.
15 *** Calculates 4-momentum sum of all particles in cone (PNEW) , and
16 *** returns this as new jet axis NAXIS (Both unit Vectors)
17  INTEGER n,mu
18  REAL cosval,normsq,norm
19 *
20  ok = .false.
21  DO 100 mu=1,4
22  pnew(mu)=0.0
23 100 CONTINUE
24  DO 110 n=1,ntrak
25  cosval=0.0
26  DO 120 mu=1,3
27  cosval=cosval+oaxis(mu)*pu(mu,n)
28 120 CONTINUE
29  IF (cosval.GE.cosr)THEN
30  newlis(n) = .true.
31  ok = .true.
32  DO 130 mu=1,4
33  pnew(mu) = pnew(mu) + pp(mu,n)
34 130 CONTINUE
35  ELSE
36  newlis(n)=.false.
37  ENDIF
38 110 CONTINUE
39 *** If there are particles in the cone, calc new jet axis
40  IF (ok) THEN
41  normsq = 0.0
42  DO 140 mu = 1,3
43  normsq = normsq + pnew(mu)**2
44 140 CONTINUE
45  norm = sqrt(normsq)
46  DO 150 mu=1,3
47  naxis(mu) = pnew(mu)/norm
48 150 CONTINUE
49  ENDIF
50  RETURN
51  END
subroutine pxtry(COSR, NTRAK, PU, PP, OAXIS, NAXIS, PNEW, NEWLIS, OK)
Definition: pxtry.f:3