      REAL FUNCTION BDE(XDUMMY)
C
C     Filename:  BDE.FOR
C
C     Calculation of energy-loss in detector B (BDE) in MeV
C     by ADC channel number (BPHA) and amplifier channel
C     (BCHN=0 -> low channel/high amplification,
C      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 (bchn.eq.0.) then
        bde=3.0*bpha/1023.
      else
        bde=45.0*bpha/1023.
      endif

      END
