      IMPLICIT NONE	
      
      INTEGER NPLANES, NTRKMAX

      PARAMETER (NTRKMAX=50)    !ncloyz_max*ncloxz_max)
      PARAMETER (NPLANES=6)    !ncloyz_max*ncloxz_max)

c     EVENT block:
*     -----------------------------------------------------------
      logical good2             !flag to mark good or noise events
      integer nev2              !level2 event number

c     CPU block (only for ground data):
*     -----------------------------------------------------------
      integer pkt_type          !CPU packet type identifier. see http://people.roma2.infn.it/~cpu/HB_list.txt
c     0x12 --> calibration board 0                  
c     0x13 --> calibration board 1              
c     0x10 --> event                            
c     0x30 --> full event for calib special     
c     0x83 --> tracker ALARM (control register) 
      integer pkt_num           !CPU packet number
      integer obt               !CPU on-board time
      integer which_calib       !calibration file identifier. see DW_DATE_NUM_calib.txt file


*     -----------------------------------------------------------
*     Common to store TRACK info
*     All the variables have a dimention equal to the number of
*     found tracks
*     -----------------------------------------------------------
c     TRACK PARAMETERS      
      integer ntrk              !# identified tracks
      real al                !track state vector
      integer xgood          !mask of used planes
      integer ygood          !*
      real xm                !measured points
      real ym                !*
      real zm                !*
      real resx              !spatial resolution
      real resy              !*
      real chi2              !chi2
      real xv               !calculated points
      real yv                !*
      real zv                !*
      real axv               !calculated angles (deg)
      real ayv               !*
*     -----------------------------------------------------------
*     Common to store SINGLET info
*     (clusters not associated with any track) 
*     -----------------------------------------------------------
      integer nclsx             !# unassociated clusters per plane X views
      integer nclsy             !     "            "      "   "    Y views

      common/trklev2/good2,nev2,      
     $     pkt_type,pkt_num,obt,which_calib,
     $     ntrk
     $     ,xm(nplanes,NTRKMAX)
     $     ,ym(nplanes,NTRKMAX)
     $     ,zm(nplanes,NTRKMAX)
     $     ,resx(nplanes,NTRKMAX)
     $     ,resy(nplanes,NTRKMAX)
     $     ,al(5,NTRKMAX)
     $     ,chi2(NTRKMAX)
     $     ,xgood(nplanes,NTRKMAX)
     $     ,ygood(nplanes,NTRKMAX)
     $     ,xv(nplanes,NTRKMAX)
     $     ,yv(nplanes,NTRKMAX)
     $     ,zv(nplanes,NTRKMAX)
     $     ,axv(nplanes,NTRKMAX)
     $     ,ayv(nplanes,NTRKMAX)
     $     ,nclsx(nplanes),nclsy(nplanes)
      SAVE /trklev2/

