Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid calling Sumw2 if it was already called #2408

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Modules/Common/include/Common/TH1Ratio.inl
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,16 @@ void TH1Ratio<T>::Sumw2(Bool_t flag)
if (!mHistoNum || !mHistoDen) {
return;
}

mSumw2Enabled = flag;
mHistoNum->Sumw2(flag);
mHistoDen->Sumw2(flag);
T::Sumw2(flag);
if (!flag || !mHistoNum->GetSumw2N()) { // call only if Sumw2 was not called before or if false flag is passed just to reset structures
mHistoNum->Sumw2(flag);
}
if (!flag || !mHistoDen->GetSumw2N()) {
mHistoDen->Sumw2(flag);
}
if (!flag || !T::GetSumw2N()) {
T::Sumw2(flag);
}
}

} // namespace o2::quality_control_modules::common
Loading