From eced43334f4c841e5c0d71d0172dacc4ec3ab430 Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Mon, 15 Jun 2026 14:49:17 +0200 Subject: [PATCH 1/2] Add event weight configuration --- PWGCF/Flow/Tasks/flowTask.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index b3e57cdb226..380d9bc6c4b 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -76,6 +76,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::genericframework; +using namespace o2::analysis::genericframework::eventweight; using namespace o2::aod::rctsel; #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; @@ -158,6 +159,7 @@ struct FlowTask { O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") O2_DEFINE_CONFIGURABLE(cfgEfficiencyForNch, std::string, "", "CCDB path to efficiency object, only for Nch correction") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") + O2_DEFINE_CONFIGURABLE(cfgUserPtVnEvWeightEnabled, bool, false, "0: use unity weight; 1: use multiplicity weight") O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode") O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 0, "Flag to select consistent events - 0: off, 1: v2{2} gap calculable, 2: v2{4} full calculable, 4: v2{4} gap calculable, 8: v2{4} 3sub calculable") Configurable> cfgConsistentEventVector{"cfgConsistentEventVector", std::vector{-0.8, -0.5, -0.4, 0.4, 0.5, 0.8}, "eta regions: left(min,max), mid(min,max), right(min,max)"}; @@ -659,6 +661,10 @@ struct FlowTask { gfwConfigs.Print(); fFCpt->setUseCentralMoments(cfgUseCentralMoments); fFCpt->setUseGapMethod(true); + if (!cfgUserPtVnEvWeightEnabled) + fFCpt->setEventWeight(EventWeight::UnityWeight); + else + fFCpt->setEventWeight(EventWeight::TupleWeight); fFCpt->initialise(axisIndependent, cfgMpar, gfwConfigs, cfgNbootstrap); if (cfgEtaGapPtPtEnabled) { for (int i = 0; i < 4; ++i) { // o2-linter: disable=magic-number (maximum of 4 subevents) @@ -677,6 +683,10 @@ struct FlowTask { if (doprocessMCGen) { fFCptgen->setUseCentralMoments(cfgUseCentralMoments); fFCptgen->setUseGapMethod(true); + if (!cfgUserPtVnEvWeightEnabled) + fFCptgen->setEventWeight(EventWeight::UnityWeight); + else + fFCptgen->setEventWeight(EventWeight::TupleWeight); fFCptgen->initialise(axisIndependent, cfgMpar, gfwConfigs, cfgNbootstrap); if (cfgEtaGapPtPtEnabled) fFCptgen->initialiseSubevent(axisIndependent, cfgMpar, etagapsPtPt.size(), cfgNbootstrap); From 1f08fdab3683b6a19780293a538e5d861ef24aa6 Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:33:47 +0200 Subject: [PATCH 2/2] Fix event weight configuration reference --- PWGCF/Flow/Tasks/flowTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index 380d9bc6c4b..b07b1cf9074 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -661,7 +661,7 @@ struct FlowTask { gfwConfigs.Print(); fFCpt->setUseCentralMoments(cfgUseCentralMoments); fFCpt->setUseGapMethod(true); - if (!cfgUserPtVnEvWeightEnabled) + if (!cfgUserIO.cfgUserPtVnEvWeightEnabled) fFCpt->setEventWeight(EventWeight::UnityWeight); else fFCpt->setEventWeight(EventWeight::TupleWeight); @@ -683,7 +683,7 @@ struct FlowTask { if (doprocessMCGen) { fFCptgen->setUseCentralMoments(cfgUseCentralMoments); fFCptgen->setUseGapMethod(true); - if (!cfgUserPtVnEvWeightEnabled) + if (!cfgUserIO.cfgUserPtVnEvWeightEnabled) fFCptgen->setEventWeight(EventWeight::UnityWeight); else fFCptgen->setEventWeight(EventWeight::TupleWeight);