*  
* $Id: fkdedx.F,v 1.1.1.1 2005-07-11 15:15:48 aplin Exp $
*  
* $Log: not supported by cvs2svn $
* Revision 1.1.1.1  2005/06/18 10:05:34  gaede
* Initial local version
*
* Revision 1.1  2005/06/13 16:14:18  aplin
* *** empty log message ***
*
* Revision 1.1.1.1  2003/05/23 13:17:55  hvogt
* Brahms V308
*
*  
**********************************************************************
      SUBROUTINE FKDEDX(P,M,DEDX,DSURDP)
**********************************************************************
*  For a particle of momentum P and mass M, this routine gives the
*  expected dedx (DEDX) in M.I. units and its derivative with respect
*  to P (DSURDP)
**********************************************************************
#include "include/fksave.inc"
      REAL LOGETA,M
      PARAMETER (NPAS=139)
      DIMENSION ALOETA(0:NPAS),DEDXTR(0:NPAS)
      DATA ALOETA /
     +  -0.64,-0.60,-0.56,-0.52,-0.48,-0.44,-0.40,-0.36,-0.32,-0.28
     + ,-0.24,-0.20,-0.16,-0.12,-0.08,-0.04, 0.00, 0.04, 0.08, 0.12
     + , 0.16, 0.20, 0.24, 0.28, 0.32, 0.36, 0.40, 0.44, 0.48, 0.52
     + , 0.56, 0.60, 0.64, 0.68, 0.72, 0.76, 0.80, 0.84, 0.88, 0.92
     + , 0.96, 1.00, 1.04, 1.08, 1.12, 1.16, 1.20, 1.24, 1.28, 1.32
     + , 1.36, 1.40, 1.44, 1.48, 1.52, 1.56, 1.60, 1.64, 1.68, 1.72
     + , 1.76, 1.80, 1.84, 1.88, 1.92, 1.96, 2.00, 2.04, 2.08, 2.12
     + , 2.16, 2.20, 2.24, 2.28, 2.32, 2.36, 2.40, 2.44, 2.48, 2.52
     + , 2.56, 2.60, 2.64, 2.68, 2.72, 2.76, 2.80, 2.84, 2.88, 2.92
     + , 2.96, 3.00, 3.04, 3.08, 3.12, 3.16, 3.20, 3.24, 3.28, 3.32
     + , 3.36, 3.40, 3.44, 3.48, 3.52, 3.56, 3.60, 3.64, 3.68, 3.72
     + , 3.76, 3.80, 3.84, 3.88, 3.92, 3.96, 4.00, 4.04, 4.08, 4.12
     + , 4.16, 4.20, 4.24, 4.28, 4.32, 4.36, 4.40, 4.44, 4.48, 4.52
     + , 4.56, 4.60, 4.64, 4.68, 4.72, 4.76, 4.80, 4.84, 4.88, 4.92 /
      DATA DEDXTR /
     + 13.61,11.84,10.24, 8.82,7.590,6.530,5.625,4.856,4.206,3.656,
     + 3.194,2.805,2.479,2.206,1.978,1.788,1.630,1.500,1.392,1.304,
     + 1.232,1.174,1.128,1.091,1.063,1.041,1.025,1.013,1.006,1.002,
     + 1.000,1.001,1.003,1.007,1.012,1.019,1.026,1.034,1.043,1.052,
     + 1.061,1.071,1.081,1.092,1.102,1.113,1.124,1.135,1.146,1.157,
     + 1.168,1.179,1.190,1.201,1.212,1.222,1.233,1.243,1.252,1.262,
     + 1.272,1.281,1.290,1.300,1.309,1.318,1.327,1.336,1.345,1.355,
     + 1.364,1.373,1.382,1.391,1.400,1.409,1.418,1.426,1.434,1.442,
     + 1.450,1.457,1.464,1.471,1.477,1.482,1.487,1.492,1.496,1.500,
     + 1.503,1.505,1.507,1.509,1.510,1.512,1.513,1.514,1.515,1.516,
     + 1.517,1.518,1.519,1.519,1.520,1.521,1.521,1.521,1.522,1.522,
     + 1.523,1.523,1.523,1.524,1.524,1.524,1.524,1.525,1.525,1.525,
     + 1.525,1.525,1.525,1.525,1.526,1.526,1.526,1.526,1.526,1.526,
     + 1.526,1.526,1.526,1.526,1.526,1.526,1.526,1.526,1.526,1.526 /
*
      DATA IPASS / 0 /
      IF(IPASS.EQ.0) THEN
         IPASS = 1
         DLOETA = (ALOETA(NPAS)-ALOETA(0))/FLOAT(NPAS)
         FACTOR = DLOETA * ALOG(10.)
      ENDIF
*
      LOGETA = ALOG10(P/M)
      IF(LOGETA.LT.ALOETA(1)) THEN
         J = 0
      ELSE IF(LOGETA.GT.ALOETA(NPAS-1)) THEN
         J = NPAS - 1
      ELSE
         J = INT( (LOGETA-ALOETA(0))/DLOETA )
      ENDIF
      DEDX   = DEDXTR(J)
     +     + (DEDXTR(J+1)-DEDXTR(J))*(LOGETA-ALOETA(J))/DLOETA
      DSURDP = (DEDXTR(J+1)-DEDXTR(J)) / FACTOR / P
*
      END
