Change scale of a TH1F (energy calibration)

Hi,

I used this trick in a similar situation:

const int nbins = h1->GetXaxis()->GetNbins();
double new_bins[nbins+1];
for(int i=0; i < nbins; i++){
new_bins[i] = transform_function( h1-> GetBinLowEdge(i+1) );
}

h1->Set(nbins, new_bins);

This will of course result in uneven binwidths if your transoformation is not linear, but does not require rebinning, etc.

Cheers!