Suppose I have produced a histogram called A.
Now getting the center bins from A, I will perform an operation for example: “each data point (from the center bins) - 1”, then using the new results to fill a new histogram B.
What is the proper way to complete the above operations in ROOT
Hi,
Here is some simple code to get content from histogram histA and fill histogram histB:
for (int i = 1; i <= histA->GetNbinsX(); i++) {
double x = histA->GetXaxis()->GetBinCenter(i);
double cont = histB->GetBinContent(i);
// set now content in histogram b using contend of histogram A as weight
histB->Fill( x, cont);
}