I have a collection o histograms, some generated with mc@nlo. While doing a simple ABCD for the estimation of QCD, we subtract all of the MC processes from the Data histogram. However, the problem is that we end up with a histogram which has a negative SumOfWeights() but the bin contents are positive. Is there a function which allows to change the SumOfWeights of a histogram ? Any alternative solution to cure this ?
You can use hist->GetSumw2() and set its elements.
Note, though, that a negative sumw2 means that this is not a sumw2 anymore! I.e. I’d claim that there’s no point in calculating this; you might as well call hist->Sumw2(false).