	function efromm(vm,ptsq)
c	this calculates the energy of the detected particle given the mass**2
c	of x, vm and the ptsq of the detected particle.
c
	include '/u1/gcf/e350/crystal/cb/beam'
	include '/u1/gcf/e350/crystal/cb/clouds'
	include '/u1/gcf/e350/crystal/cb/efm'
c
	a=s(ibm)
	d=vm-cond(ibm)
	b=cona(ibm)*d
	c=.25*d**2+pbm2(ibm)*ptsq+conc(ibm)
	efromm=(-b+sqrt(b*b-4.*a*c))*.5/a
	return
	end
