Skip to content

Commit 796762d

Browse files
author
MaximVirta
committed
[PWGCF] Event-by-event weights fixed
1 parent a4049f6 commit 796762d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PWGCF/GenericFramework/Tasks/flowGfwV02.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,18 @@ struct FlowGfwV02 {
530530
if (dnx == 0)
531531
continue;
532532
auto val = fGFW->Calculate(corrconfigs.at(0), 0, kFALSE).real() / dnx;
533+
double ebyeWeight = (cfgUseMultiplicityFlowWeights) ? dnx : 1.0;
533534
for (int i = 1; i <= fSecondAxis->GetNbins(); i++) {
534-
if (corrconfigs.at(l_ind).Head.find("nch") != std::string::npos)
535+
if (corrconfigs.at(l_ind).Head.find("nch") != std::string::npos) {
536+
ebyeWeight = 1.0;
535537
val = 1.0;
538+
}
536539
double ptFraction = 0;
537540
int normIndex = (cfgNormalizeByCharged) ? PidCharged : pidInd; // Configured to normalize by charged particles or the selected particle
538541
if (pidStates.hPtMid[normIndex]->Integral() > 0) {
539542
ptFraction = pidStates.hPtMid[pidInd]->GetBinContent(i) / pidStates.hPtMid[normIndex]->Integral();
540543
if (std::abs(val) < 1.01)
541-
fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm);
544+
fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, ebyeWeight, rndm);
542545
}
543546
}
544547
}

0 commit comments

Comments
 (0)