Skip to content

Commit 925c580

Browse files
authored
Fix bug in weight filling (#14461)
1 parent 5b28f57 commit 925c580

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Framework/Core/src/StepTHn.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,15 @@ void StepTHn::Fill(int iStep, int nParams, double positionAndWeight[])
441441
if (weight != 1.) {
442442
// initialize with already filled entries (which have been filled with weight == 1), in this case mSumw2 := mValues
443443
if (!mSumw2[iStep]) {
444-
mSumw2[iStep] = createArray();
444+
mSumw2[iStep] = createArray(mValues[iStep]);
445445
LOGF(info, "Created sumw2 container for step %d", iStep);
446446
}
447447
}
448448

449449
// TODO probably slow; add StepTHnT::add ?
450450
mValues[iStep]->SetAt(mValues[iStep]->GetAt(bin) + weight, bin);
451451
if (mSumw2[iStep]) {
452-
mSumw2[iStep]->SetAt(mSumw2[iStep]->GetAt(bin) + weight, bin);
452+
mSumw2[iStep]->SetAt(mSumw2[iStep]->GetAt(bin) + weight * weight, bin);
453453
}
454454
}
455455

0 commit comments

Comments
 (0)