I have a very simple query about setting error using SetBinError() method.
I have a histogram filled like h->Fill(x,w); where "w" is the weight for each entry. After filling "h" I decide to apply different scales to each bin and set new content as (scale_i * x) for each bin "i". In this case how I should get and set the correct error (using SetBinError() method) for each bin in the new histogram?
Thanks for your prompt reply. Yes I have seen this earlier but not sure I fully understand. I am aware that h->Fill() will take care error properly if declared h->Sumw2(), but here i am making a new histogram by ->SetBinContent() method.
I am applying a different scale to each bin to my “h” histogram to get a new histogram like this:
h->Fill(x, w); // then stored in a root file
// later I do this
h_new->SetBinContent(i, h->GetBinContent(i) * scale[i]); // i is for each bin scale is different for each i
h_new->SetBinError(???);