*
* $Id$
*
* $Log$
*
*CMZ :  3.00/00 28/01/2002  18.13.21  by  Unknown
*CMZ :  2.01/00 05/04/2000  14.35.18  by  Marialuigia Ambriola
*CMZ :  2.00/00 03/03/2000  15.39.05  by  Francesco Cafagna
*CMZ :  1.00/02 13/02/96  18.40.55  by  Francesco Cafagna
*-- Author :    Francesco Cafagna   12/02/96
      SUBROUTINE GUTRAK
************************************************************************
*                                                                      *
* User subroutine called for each track                                *
*                                                                      *
* Called by: GTREVE                                                    *
* Author: Francesco Cafagna, 12/02/96 16.16.17                         *
*                                                                      *
************************************************************************
*
* User action
*
#include "gckine.inc"
#include "gptotr.inc"
#include "gcunit.inc"
C # Set the tuning parameter for TR
      REAL PG2,PGXD,PGYD,PGZD,PGP
      ALFATR=-9999.
      TROK=.FALSE.
      PGXD = PVERT(1)
      PGYD = PVERT(2)
      PGZD = PVERT(3)
      PG2 = PGXD**2+PGYD**2+PGZD**2
      IF(PG2.GE.0.) THEN
         PGP    = SQRT(PG2)
         IF(PGP.LT.40.) THEN
            ALFATR=0.65
            TROK=.TRUE.
         ELSE
            ALFATR=0.69
            TROK=.TRUE.
         ENDIF
      ELSE
         WRITE(CHMAIL,10000)ALFATR
         CALL GMAIL(1,0)
c         PRINT*,'GUTRAK error: ALFATR not set',ALFATR
c         PRINT*,'GUTRAK error: momento=',PG2,PVERT(1),PVERT(2),PVERT(3)
      ENDIF
      CALL GPUTRA(1)
*
      CALL GTRACK
*
* User action
*
      CALL GPUTRA(2)
*
10000 FORMAT('GUTRAK error: ALFATR not set=',F10.3)
      END
