Hi - is there a method available in TH1 that allows you to delete the structure created by Sumw2()? TH1::Reset() seems to leave the structure there, so if you reaccumulate the histos, the errors will not be calculated the same as if you had created a new histogram. Thanks. (I’m using 4.00/08, btw).



I have added a new method
TArrayD* TH1::GetSumw2

To delete the structure created by h->Sumw2, simply do

Now in CVS



I think, it’s better to modify TH1::Reset to call Set(0), not to use GetSumw2()->Set(0) :slight_smile:

Reset is to set bin contents and errors to 0.
I prefer not to pollute a frequently used function like Reset with an option
that will be very rarely used.


Sorry I know that this post is a little bit “old”, but as my knowledge the situation is still the same…

Wouldn’t be better to have a Sumw2(Bool_t create=kTRUE) usable as Sumw2() as now or as Sumw2(kTRUE) to create the structure or as Sumw2(kFALSE) to disactivate the “feature” and calling h->GetSumw2()->Set(0) to destroy the structure?!