From 97b1554df0ede93bab479a80fb73d57c092e2d55 Mon Sep 17 00:00:00 2001 From: Maxim Virta Date: Wed, 19 Aug 2026 17:28:16 +0200 Subject: [PATCH 1/3] [PWGCF] Pt & frac weights added --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 100 ++++++++++++++------ 1 file changed, 72 insertions(+), 28 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 755a723bbc0..19b4ca44413 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -424,6 +424,12 @@ struct FlowGfwV02 { registry.add("analysis/charged/ptA", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); registry.add("analysis/charged/ptB", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); registry.add("analysis/charged/ptAB", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); + if (cfgUseMultiplicityFracWeights){ + registry.add("analysis/charged/nchA2pc", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}}); + registry.add("analysis/charged/nchB2pc", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}}); + registry.add("analysis/charged/ptA2pc", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); + registry.add("analysis/charged/ptB2pc", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); + } registry.addClone("analysis/charged/", "analysis/pion/"); registry.addClone("analysis/charged/", "analysis/kaon/"); @@ -888,6 +894,12 @@ struct FlowGfwV02 { if (!(pidStates.hPtForward[normIndex]->Integral() > 0) || !(pidStates.hPtBackward[normIndex]->Integral() > 0)) { continue; // Forward or backward pT distribution is not defined } + double WeightA = 1.0; + double WeightB = 1.0; + if (cfgUseMultiplicityFracWeights) { + WeightA = pidStates.hPtForward[PidCharged]->Integral(); + WeightB = pidStates.hPtBackward[PidCharged]->Integral(); + } for (int i = 1; i <= fSecondAxis->GetNbins(); i++) { ptFractionForward = pidStates.hPtForward[pid]->GetBinContent(i) / pidStates.hPtForward[normIndex]->Integral(); ptFractionBackward = pidStates.hPtBackward[pid]->GetBinContent(i) / pidStates.hPtBackward[normIndex]->Integral(); @@ -895,28 +907,44 @@ struct FlowGfwV02 { v0corrBA = ptFractionBackward * ptMeanForward; switch (pid) { case PidCharged: - registry.fill(HIST("analysis/charged/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB); - registry.fill(HIST("analysis/charged/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA); - registry.fill(HIST("analysis/charged/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward); - registry.fill(HIST("analysis/charged/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward); + registry.fill(HIST("analysis/charged/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB, WeightA * WeightB); + registry.fill(HIST("analysis/charged/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA, WeightA * WeightB); + registry.fill(HIST("analysis/charged/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA); + registry.fill(HIST("analysis/charged/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/charged/nchA2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA * WeightB); + registry.fill(HIST("analysis/charged/nchB2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightA * WeightB); + } break; case PidPions: - registry.fill(HIST("analysis/pion/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB); - registry.fill(HIST("analysis/pion/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA); - registry.fill(HIST("analysis/pion/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward); - registry.fill(HIST("analysis/pion/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward); + registry.fill(HIST("analysis/pion/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB, WeightA * WeightB); + registry.fill(HIST("analysis/pion/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA, WeightA * WeightB); + registry.fill(HIST("analysis/pion/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA); + registry.fill(HIST("analysis/pion/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/pion/nchA2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA * WeightB); + registry.fill(HIST("analysis/pion/nchB2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightA * WeightB); + } break; case PidKaons: - registry.fill(HIST("analysis/kaon/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB); - registry.fill(HIST("analysis/kaon/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA); - registry.fill(HIST("analysis/kaon/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward); - registry.fill(HIST("analysis/kaon/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward); + registry.fill(HIST("analysis/kaon/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB, WeightA * WeightB); + registry.fill(HIST("analysis/kaon/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA, WeightA * WeightB); + registry.fill(HIST("analysis/kaon/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA); + registry.fill(HIST("analysis/kaon/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/kaon/nchA2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA * WeightB); + registry.fill(HIST("analysis/kaon/nchB2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightA * WeightB); + } break; case PidProtons: - registry.fill(HIST("analysis/proton/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB); - registry.fill(HIST("analysis/proton/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA); - registry.fill(HIST("analysis/proton/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward); - registry.fill(HIST("analysis/proton/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward); + registry.fill(HIST("analysis/proton/v0AB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrAB, WeightA * WeightB); + registry.fill(HIST("analysis/proton/v0BA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, v0corrBA, WeightA * WeightB); + registry.fill(HIST("analysis/proton/nchA"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA); + registry.fill(HIST("analysis/proton/nchB"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/proton/nchA2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionForward, WeightA * WeightB); + registry.fill(HIST("analysis/proton/nchB2pc"), bootstrap, fSecondAxis->GetBinCenter(i), centmult, ptFractionBackward, WeightA * WeightB); + } break; default: break; @@ -924,24 +952,40 @@ struct FlowGfwV02 { } switch (pid) { case PidCharged: - registry.fill(HIST("analysis/charged/ptA"), bootstrap, centmult, multiplicity, ptMeanForward); - registry.fill(HIST("analysis/charged/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward); - registry.fill(HIST("analysis/charged/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward); + registry.fill(HIST("analysis/charged/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA); + registry.fill(HIST("analysis/charged/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/charged/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB); + registry.fill(HIST("analysis/charged/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB); + } + registry.fill(HIST("analysis/charged/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB); break; case PidPions: - registry.fill(HIST("analysis/pion/ptA"), bootstrap, centmult, multiplicity, ptMeanForward); - registry.fill(HIST("analysis/pion/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward); - registry.fill(HIST("analysis/pion/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward); + registry.fill(HIST("analysis/pion/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA); + registry.fill(HIST("analysis/pion/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/pion/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB); + registry.fill(HIST("analysis/pion/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB); + } + registry.fill(HIST("analysis/pion/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB); break; case PidKaons: - registry.fill(HIST("analysis/kaon/ptA"), bootstrap, centmult, multiplicity, ptMeanForward); - registry.fill(HIST("analysis/kaon/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward); - registry.fill(HIST("analysis/kaon/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward); + registry.fill(HIST("analysis/kaon/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA); + registry.fill(HIST("analysis/kaon/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/kaon/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB); + registry.fill(HIST("analysis/kaon/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB); + } + registry.fill(HIST("analysis/kaon/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB); break; case PidProtons: - registry.fill(HIST("analysis/proton/ptA"), bootstrap, centmult, multiplicity, ptMeanForward); - registry.fill(HIST("analysis/proton/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward); - registry.fill(HIST("analysis/proton/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward); + registry.fill(HIST("analysis/proton/ptA"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA); + registry.fill(HIST("analysis/proton/ptB"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightB); + if (cfgUseMultiplicityFracWeights) { + registry.fill(HIST("analysis/proton/ptA2pc"), bootstrap, centmult, multiplicity, ptMeanForward, WeightA * WeightB); + registry.fill(HIST("analysis/proton/ptB2pc"), bootstrap, centmult, multiplicity, ptMeanBackward, WeightA * WeightB); + } + registry.fill(HIST("analysis/proton/ptAB"), bootstrap, centmult, multiplicity, ptMeanForward * ptMeanBackward, WeightA * WeightB); break; default: break; From 4eace1d8bd15619aaa2ad6b3c5682a7cd6527b27 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 19 Aug 2026 15:32:39 +0000 Subject: [PATCH 2/3] Please consider the following formatting changes --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 19b4ca44413..5ead09642d1 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -424,7 +424,7 @@ struct FlowGfwV02 { registry.add("analysis/charged/ptA", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); registry.add("analysis/charged/ptB", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); registry.add("analysis/charged/ptAB", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); - if (cfgUseMultiplicityFracWeights){ + if (cfgUseMultiplicityFracWeights) { registry.add("analysis/charged/nchA2pc", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}}); registry.add("analysis/charged/nchB2pc", "", {HistType::kTProfile3D, {bsAxis, ptAxis, centAxis}}); registry.add("analysis/charged/ptA2pc", "", {HistType::kTProfile3D, {bsAxis, centAxis, nchAxis}}); From 028ac356364d3d00dfebbe9872c79ce1c2df7793 Mon Sep 17 00:00:00 2001 From: Maxim Virta Date: Thu, 20 Aug 2026 08:17:51 +0200 Subject: [PATCH 3/3] Threshhold variable fixed --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 5ead09642d1..cf8f332fb10 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -841,6 +841,7 @@ struct FlowGfwV02 { template void fillOutputContainers(const float& centmult, const int& multiplicity, const double& rndm, const int& /*run*/ = 0) { + double threshold = 1.01; for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) { if (!corrconfigs.at(l_ind).pTDif) { auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real(); @@ -848,7 +849,7 @@ struct FlowGfwV02 { continue; auto val = fGFW->Calculate(corrconfigs.at(l_ind), 0, kFALSE).real() / dnx; - if (std::abs(val) < 1) { + if (std::abs(val) < threshold) { fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); } continue; @@ -871,7 +872,6 @@ struct FlowGfwV02 { ebyeWeight *= pidStates.hPtMid[PidCharged]->Integral(); } double ptFraction = 0; - double threshold = 1.01; int normIndex = (cfgNormalizeByCharged) ? PidCharged : pidInd; // Configured to normalize by charged particles or the selected particle if (pidStates.hPtMid[normIndex]->Integral() > 0) { ptFraction = pidStates.hPtMid[pidInd]->GetBinContent(i) / pidStates.hPtMid[normIndex]->Integral(); @@ -1002,7 +1002,6 @@ struct FlowGfwV02 { double ptFraction = 0; if (pidStates.hPtMid[PidCharged]->Integral() > 0) { ptFraction = pidStates.hPtMid[PidCharged]->GetBinContent(i) / pidStates.hPtMid[PidCharged]->Integral(); - double threshold = 1.01; if (std::abs(val) < threshold) registry.fill(HIST("v02pt"), fSecondAxis->GetBinCenter(i), centmult, multiplicity, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0); registry.fill(HIST("nchMid"), fSecondAxis->GetBinCenter(i), centmult, multiplicity, ptFraction);