Hi,
I have a histogram with (that includes errors) and I would like to copy the contents of this histogram to a new one. The new histogram is different to the old only in the bin length, I want my new histogram to have the same bin number, bin content and bin errors, but bin length=1.
So I did the following
for (int kk=1; kk<pt2->GetBinsX(); kk++) {
TH1 *constbinning = new TH1("constbinning","",size_xbins,0,5);
constbinning->SetBinContent(kk,pt2->GetBinContent(kk);
constbinning->SetBinError(kk,pt2->GetBinError(kk);
}
So I have two questions:
-
When I run I get the warning “Warning in TH1::SetBinContent: this method must be overridden!” which I saw that has to do with Sumw2(), (but I haven’t called this method) , where does this warning come from?
-
Is it right to copy the histogram errors like this, or I have to use constbinning->Sumw2() after the declaration of the histo?
Thanks!