function eff_of_e, energy
;+
; value = EFF_OF_E(Energy)
;
;return the value of the row (designated by INDEX) of the matrix SM_HXT 
;evaluated at ENERGY with the elements of each row given at EM
;Interpolation is linear unless INTERP_TYPE is set.
;
; Common:
;	common effcom, sm_hxt, em, index, interp_type
;
;-

common effcom, sm_hxt, em, index, interp_type

if keyword_set(interp_type) then begin
	
	ans = exp(interpol( alog(sm_hxt(*,index) > 1e-15), alog(em), $
			alog(energy) ) )
endif else begin $
	
	ans = interpol( sm_hxt(*,index), em, energy)
endelse

return, ans
end
