      REAL FUNCTION TOTB(XDUMMY)
C
C     Filename:  TOTB.FOR
C
C     Calculation of total energy-loss in detector A and B in MeV
C     (sum of dE/dx in detectors A and B)
C     by ADC channel number (A/BPHA) and amplifier channel
C     (A/BCHN=0 -> low channel/high amplification,
C      A/BCHN=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
        totb=3.0*apha/1023.
      else
        totb=30.0*apha/1023.
      endif
      if (bchn.eq.0.) then
        totb=totb+3.0*bpha/1023.
      else
        totb=totb+45.0*bpha/1023.
      endif

      END
