      REAL FUNCTION TOTE(XDUMMY)
C
C     Filename:  TOTE.FOR
C
C     Calculation of total energy-loss in detector A, B, C, D, E in MeV
C     (sum of dE/dx in detectors A, B, C, D, and E)
C     by ADC channel number (A/B/C/D/EPHA) and amplifier channel
C     (A/B/C/D/ECHN=0 -> low channel/high amplification,
C      A/B/C/D/ECHN=1 -> high channel/low amplification)
C
C     H. Sierks, University of Kiel, 08 Nov 1994
C
      REAL
     +ID      ,
     +IND     ,DEPTH   ,COINC   ,ASEG    ,BSEG    ,APHA    ,
     +ACHN    ,BPHA    ,BCHN    ,CPHA    ,CCHN    ,DPHA    ,
     +DCHN    ,EPHA    ,ECHN     
      COMMON/PAWIDN/IDNEVT,VIDN1,VIDN2,VIDN3,VIDN(10),
     +ID      ,
     +IND     ,DEPTH   ,COINC   ,ASEG    ,BSEG    ,APHA    ,
     +ACHN    ,BPHA    ,BCHN    ,CPHA    ,CCHN    ,DPHA    ,
     +DCHN    ,EPHA    ,ECHN     
*
      if (achn.eq.0.) then
        tote=3.0*apha/1023.
      else
        tote=30.0*apha/1023.
      endif
      if (bchn.eq.0.) then
        tote=tote+3.0*bpha/1023.
      else
        tote=tote+45.0*bpha/1023.
      endif
      if (cchn.eq.0.) then
        tote=tote+16.07*cpha/1023.
      else
        tote=tote+166.7*cpha/1023.
      endif
      if (dchn.eq.0.) then
        tote=tote+20.0*dpha/1023.
      else
        tote=tote+225.0*dpha/1023.
      endif
      if (echn.eq.0.) then
        tote=tote+20.0*epha/1023.
      else
        tote=tote+225.0*epha/1023.
      endif

      END
