  Present-day and next-generation accelerators, particularly for applications
in driving wakefield-based schemes, require longitudinal beam shaping and
attendant longitudinal characterization for experimental optimization. Here we
present a diagnostic method which reconstructs the longitudinal beam profile at
the location of a wakefield-generating source. The methods presented derive the
longitudinal profile of a charged particle beam solely from measurement of the
time-resolved centroid energy change due to wakefield effects. The
reconstruction technique is based on a deconvolution algorithm that is fully
generalizable to any analytically or numerically calculable Green's function
for the wakefield excitation mechanism. This method is shown to yield precise
features in the longitudinal current distribution reconstruction. We
demonstrate the accuracy and efficacy of this technique using simulations and
experimental examples, in both plasmas and dielectric structures, and compare
to the experimentally measured longitudinal beam parameters as available. The
limits of resolution and applicability to relevant scenarios are also examined.
