From d5186a7a05c6b07e0f914efbe3b9d3ab553af649 Mon Sep 17 00:00:00 2001 From: Luzhiyongg <71517277+Luzhiyongg@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:52:24 +0100 Subject: [PATCH 1/4] add run-by-run NUA output --- PWGCF/Flow/Tasks/flowTask.cxx | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index bf36bfb11de..ad27459aa06 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -100,6 +100,7 @@ struct FlowTask { O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 30, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, false, "Fill and output NUA weights") O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeightsRefPt, bool, false, "NUA weights are filled in ref pt bins") + O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeightsRunbyRun, bool, false, "NUA weights are filled run-by-run") O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode") @@ -198,6 +199,9 @@ struct FlowTask { std::vector corrconfigsPtVn; TAxis* fPtAxis; TRandom3* fRndm = new TRandom3(0); + int lastRunNumber = -1; + std::vector runNumbers; + std::map> th3sPerRun; // map of TH3 histograms for all runs enum CentEstimators { kCentFT0C = 0, kCentFT0CVariant1, @@ -478,7 +482,7 @@ struct FlowTask { gfwConfigs.SetCorrs(cfgUserPtVnCorrConfig->GetCorrs()); gfwConfigs.SetHeads(cfgUserPtVnCorrConfig->GetHeads()); gfwConfigs.SetpTDifs(cfgUserPtVnCorrConfig->GetpTDifs()); - // Mask 1: vn-[pT], 2: vn-[pT^2], 4: vn-[pT^3] + // Mask 1: vn-[pT], 3: vn-[pT^2], 7: vn-[pT^3], 15: vn-[pT^4] gfwConfigs.SetpTCorrMasks(cfgUserPtVnCorrConfig->GetpTCorrMasks()); gfwConfigs.Print(); fFCpt->setUseCentralMoments(cfgUseCentralMoments); @@ -545,6 +549,13 @@ struct FlowTask { } } + void createOutputObjectsForRun(int runNumber) + { + const AxisSpec axisPhi{60, 0.0, constants::math::TwoPI, "#varphi"}; + std::shared_ptr histPhiEtaVtxz = registry.add(Form("%d/hPhiEtaVtxz", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {axisPhi, {64, -1.6, 1.6}, {40, -10, 10}}}); + th3sPerRun.insert(std::make_pair(runNumber, histPhiEtaVtxz)); + } + template void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) { @@ -874,6 +885,20 @@ struct FlowTask { return; } } + if (cfgOutputNUAWeightsRunbyRun && currentRunNumber != lastRunNumber) { + lastRunNumber = currentRunNumber; + if (std::find(runNumbers.begin(), runNumbers.end(), currentRunNumber) == runNumbers.end()) { + // if run number is not in the preconfigured list, create new output histograms for this run + createOutputObjectsForRun(currentRunNumber); + runNumbers.push_back(currentRunNumber); + } + + if (th3sPerRun.find(currentRunNumber) == th3sPerRun.end()) { + LOGF(fatal, "RunNumber %d not found in th3sPerRun", currentRunNumber); + return; + } + } + registry.fill(HIST("hEventCount"), 2.5); if (!cfgUseSmallMemory) { registry.fill(HIST("BeforeCut_globalTracks_centT0C"), collision.centFT0C(), tracks.size()); @@ -975,10 +1000,15 @@ struct FlowTask { bool withinEtaGap08 = (std::abs(track.eta()) < cfgEtaPtPt); if (cfgOutputNUAWeights) { if (cfgOutputNUAWeightsRefPt) { - if (withinPtRef) + if (withinPtRef) { fWeights->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0); + if (cfgOutputNUAWeightsRunbyRun) + th3sPerRun[currentRunNumber]->Fill(track.phi(), track.eta(), collision.posZ()); + } } else { fWeights->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0); + if (cfgOutputNUAWeightsRunbyRun) + th3sPerRun[currentRunNumber]->Fill(track.phi(), track.eta(), collision.posZ()); } } if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz)) From 7ac4a724e4d3fb4504ca60e7de685d4c8634b7ee Mon Sep 17 00:00:00 2001 From: Luzhiyongg <71517277+Luzhiyongg@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:57:20 +0100 Subject: [PATCH 2/4] clang format --- PWGCF/Flow/Tasks/flowTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index ad27459aa06..b4c2033aad6 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -201,7 +201,7 @@ struct FlowTask { TRandom3* fRndm = new TRandom3(0); int lastRunNumber = -1; std::vector runNumbers; - std::map> th3sPerRun; // map of TH3 histograms for all runs + std::map> th3sPerRun; // map of TH3 histograms for all runs enum CentEstimators { kCentFT0C = 0, kCentFT0CVariant1, From 8b9791035efa98db5fbe7fa0986af82eeee27d75 Mon Sep 17 00:00:00 2001 From: Luzhiyongg <71517277+Luzhiyongg@users.noreply.github.com> Date: Tue, 28 Oct 2025 14:14:40 +0100 Subject: [PATCH 3/4] megalinter fix --- PWGCF/Flow/Tasks/flowTask.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index b4c2033aad6..c110ff5f764 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -49,6 +49,8 @@ #include #include #include +#include +#include using namespace o2; using namespace o2::framework; From 72a1812b5c85b88adca108aed06a509e626394e9 Mon Sep 17 00:00:00 2001 From: Luzhiyongg <71517277+Luzhiyongg@users.noreply.github.com> Date: Tue, 28 Oct 2025 14:17:56 +0100 Subject: [PATCH 4/4] clang format --- 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 c110ff5f764..f24c5a0f9fe 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -45,12 +45,12 @@ #include #include +#include #include #include #include -#include -#include #include +#include using namespace o2; using namespace o2::framework;