C=======================================================================
C
C  Bank Name : PJET
C  Author    : Chip Stewart
C  Date      :  7-NOV-1989 18:10:09.84
C  Modified  : Brent May, Andy Milder    Version 3 - added word 13
C  Date      : 13-NOV-1992
C  Version   : 3.0
C  Tree description : ISA_TREE
C
C  Bank description : PARTON JET BANK
C      PJET is constructed by applying a jet algorithm (CONE or
C      OPENING ANGLE) to either Partons given in the ISAQ bank
C      or Paricles given in the ISP1 bank.
C
C     LQ     Q/IQ
C-----------------------------------------------------------------------
C     +2          Down   link to SPARE
C     -1          Down   link to PJPT
C      0          Next   link to
C     +1          Up     link to PJHD
C     +2          Origin link to PJHD
C.......................................................................
C             -5         Bank number
C             -4         Bank name, 'PJET'
C             -3         NL = 2
C             -2         NS = 2
C             -1         ND = 13
C              0         Status
C             +1     I   NV = 3 Version Number
C              2     F   Et ( =Pt in version NV=1 )
C              3     F   Px
C              4     F   Py
C              5     F   Pz
C              6     F   E
C              7     F   mass
C              8     F   phi
C              9     F   theta
C             10     F   eta
C             11     I   CLASS - (eg. for mapping PJET with RECO )
C             12     I   NEXT
C             13     F   Merging/Splitting flag (version 3)
C=======================================================================
C
C  Definitions:
C  -----------
C
C  E  - Sum(Ei) over all the Partons/Particles included in the jet.
C
C  Px - Sum(Pxi).
C  Py - Sum(Pyi).
C  Pz - Sum(Pzi).
C
C  Et - Sum[Ei*sin(Thetai)]
C
C  Comment: In version NV=1 word 2 was Pt = SQRT ( Px**2 + Py**2 )
C
C  Mass - SQRT [ E**2 - ( Px**2 + Py**2 + Pz**2 )]
C
C  For Theta, Phi and Eta the following code was used
C  to calculate them from Px,Py,Pz
C
C  PARAMETER( SMALL = 1.0E-5 )
C  Phi=ATAN2(Py,Px+SMALL)   ;   IF(Phi.LT.0) Phi=Phi+TWOPI
C  Theta=ACOS((Pz+SMALL)/(SQRT(Px*Px+Py*Py+Pz*Pz)+SMALL))
C  Eta=-ALOG(TAN(Theta/2.)+SMALL)
C
C
C  For Cone Algorithms word 13 equals to:
C  =0 means no merging or splitting was done
C  =1 means jet is the result of combining two jets
C  =2 means jet is the result of splitting ( not a perfect cone )
C  =3 means jet is the result of both combining and splitting