Well, I made a mistake my explaining my issue.
After plotting the original histogram , I need to divide the total input in one bin (Y value) over the (X) value rather than the scaling factor.
Can you describe a bit more. I don’t really get your idea.
Do you mean, for example, you have a histogram of 4 bins, ranging from 0 to 4, and the bins are:
[0-1] [1-2] [2-3] [3-4]
And let assume that the 3rd bins, [2-4], has the content of 5 (y=5).
The what do you want to do with it? divide the content by 2 so you will get y = 2.5?
Then you may try the SetBinContent function (together with GetBinContent)
It looks like this:
// Get number of bins
int n_bins = hist -> GetNbinsX( );
for ( int i=1; i<=n_bins; i++ )
{
// read the bin content, aka y value
float bcont = hist->GetBinContent( i );
// determine the x value of the bin, here I use the central x.
// here x_max and x_min is the maximum/minimum value on the x axis.
float bval = ( i-0.5 )( x_max-x_min ) / n_bins;
// then modify the bin content, be careful that bval may be zero in some cases
hist -> SetBinContent( i, bcont/bval );
}