Skip to content

Commit 7dc6a47

Browse files
authored
[PWGCF] fix potential division by zero in registry filling in flowGfwNonflow.cxx (#17000)
1 parent ed2a819 commit 7dc6a47

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

PWGCF/GenericFramework/Tasks/flowGfwNonflow.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,10 @@ struct FlowGfwNonflow {
756756
std::string histName = "inverseN";
757757
histName += head;
758758
const int m = corrOrder - '0';
759-
recipNHistograms.at(histName)->Fill(centmult, 1. / std::pow(multiplicity, m - 1), dnx);
759+
double multPower = std::pow(multiplicity, m - 1);
760+
if (multPower != 0) {
761+
recipNHistograms.at(histName)->Fill(centmult, 1. / multPower, dnx);
762+
}
760763
auto val = fGFW->Calculate(corrconfigs.at(l_ind), 0, false).real() / dnx;
761764
if (std::abs(val) < 1) {
762765
fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, cfgUseMultiplicityFlowWeights ? dnx : 1.0, rndm);

0 commit comments

Comments
 (0)