From b6a5b9c173166b868fba28f3aa65a439cbea5abf Mon Sep 17 00:00:00 2001 From: Zhiyong Lu <71517277+Luzhiyongg@users.noreply.github.com> Date: Sun, 18 Oct 2026 16:42:17 +0800 Subject: [PATCH 1/4] add manual ck calculations --- PWGCF/Flow/Tasks/flowTask.cxx | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index 447ceeaa5d6..d83a430ad91 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -243,6 +243,7 @@ struct FlowTask { std::vector nPt; // fraction of particles in each pT bin in one event std::vector> listNptV2; std::vector> listPtX; + O2_DEFINE_CONFIGURABLE(cfgManualCk, bool, false, "Produce pt-pt variance") } cfgAdditionObs; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, "pt axis for histograms"}; @@ -439,6 +440,13 @@ struct FlowTask { registry.add("hPtA_afterDptCut", "p_{T} distribution", {HistType::kTH1D, {axisPt}}); registry.add("hPtB_afterDptCut", "p_{T} distribution", {HistType::kTH1D, {axisPt}}); } + if (cfgAdditionObs.cfgManualCk) { + registry.add("ptpt_1sub1_1sub3_2pc", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("pt_1sub1_1pc", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("pt_1sub1_2pc", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("pt_1sub3_1pc", "", {HistType::kTProfile, {axisIndependent}}); + registry.add("pt_1sub3_2pc", "", {HistType::kTProfile, {axisIndependent}}); + } if (doprocessMCGen) { registry.add("MCGen/MChPhi", "#phi distribution", {HistType::kTH1D, {axisPhi}}); registry.add("MCGen/MChEta", "#eta distribution", {HistType::kTH1D, {axisEta}}); @@ -1289,6 +1297,10 @@ struct FlowTask { double weffEventWithinGap08 = 0., weffEventSquareWithinGap08 = 0.; double sumPtsquareWsquareWithinGap08 = 0., sumPtWsquareWithinGap08 = 0.; double nTracksCorrected = 0; + double mpt_sub1 = 0; + double mpt_sub1_weffEv = 0; + double mpt_sub3 = 0; + double mpt_sub3_weffEv = 0; int magnetfield = 0; float independent = cent; float nTracksUncorrected = 0; @@ -1405,6 +1417,16 @@ struct FlowTask { weffEventWithinGap08 += weff; weffEventSquareWithinGap08 += weff * weff; } + if (cfgAdditionObs.cfgManualCk) { + if (track.eta() >= etagapsPtPt[0].first && track.eta() <= etagapsPtPt[0].second) { + mpt_sub1 += weff * track.pt(); + mpt_sub1_weffEv += weff; + } + if (track.eta() >= etagapsPtPt[2].first && track.eta() <= etagapsPtPt[2].second) { + mpt_sub3 += weff * track.pt(); + mpt_sub3_weffEv += weff; + } + } } if (cfgUserIO.cfgConsistentEventFlag && consistentEventVector.size() == 6) { // o2-linter: disable=magic-number (size match) acceptedTracks.nFull += 1; @@ -1494,6 +1516,25 @@ struct FlowTask { weffEventDiffWithGap08); } + if (cfgAdditionObs.cfgManualCk) { + // 2pc event weight: + double ev2pc = mpt_sub1_weffEv * mpt_sub3_weffEv; + // manual pt-pt variance + if (mpt_sub1_weffEv) { + mpt_sub1 = mpt_sub1 / mpt_sub1_weffEv; + registry.fill(HIST("pt_1sub1_1pc"), independent, mpt_sub1, mpt_sub1_weffEv); + } + if (mpt_sub3_weffEv) { + mpt_sub3 = mpt_sub3 / mpt_sub3_weffEv; + registry.fill(HIST("pt_1sub3_1pc"), independent, mpt_sub3, mpt_sub3_weffEv); + } + if (mpt_sub1_weffEv && mpt_sub3_weffEv) { + registry.fill(HIST("ptpt_1sub1_1sub3_2pc"), independent, mpt_sub1 * mpt_sub3, ev2pc); + registry.fill(HIST("pt_1sub1_2pc"), independent, mpt_sub1, ev2pc); + registry.fill(HIST("pt_1sub3_2pc"), independent, mpt_sub3, ev2pc); + } + } + // v02 if (cfgAdditionObs.cfgV02Enabled && weffEventFrac > 0) { for (auto ipt = 0; ipt < fPtAxis->GetNbins(); ipt++) { From b259c6fad061ec01b5119002dfcfbe3a02aad06b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 18 Oct 2026 08:45:04 +0000 Subject: [PATCH 2/4] Please consider the following formatting changes --- 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 d83a430ad91..9a5d51dbdb1 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -1519,7 +1519,7 @@ struct FlowTask { if (cfgAdditionObs.cfgManualCk) { // 2pc event weight: double ev2pc = mpt_sub1_weffEv * mpt_sub3_weffEv; - // manual pt-pt variance + // manual pt-pt variance if (mpt_sub1_weffEv) { mpt_sub1 = mpt_sub1 / mpt_sub1_weffEv; registry.fill(HIST("pt_1sub1_1pc"), independent, mpt_sub1, mpt_sub1_weffEv); From f2be451f022f80cb733942131fa6318f261e1bc4 Mon Sep 17 00:00:00 2001 From: Zhiyong Lu <71517277+Luzhiyongg@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:04:46 +0800 Subject: [PATCH 3/4] fix megalinter --- PWGCF/Flow/Tasks/flowTask.cxx | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index 9a5d51dbdb1..20e640e8aae 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -288,7 +288,7 @@ struct FlowTask { std::vector corrconfigs; GFWCorrConfigs gfwConfigs; std::vector corrconfigsPtVn; - TAxis* fPtAxis; + TAxis* fPtAxis = nullptr; TRandom3* fRndm = new TRandom3(0); std::vector> etagapsPtPt; std::vector>> bootstrapArray; @@ -325,15 +325,15 @@ struct FlowTask { double mMinSeconds{-1.}; std::unordered_map gHadronicRate; ctpRateFetcher mRateFetcher; - TH2* gCurrentHadronicRate; + TH2* gCurrentHadronicRate = nullptr; RCTFlagsChecker rctChecker{"CBT"}; // phi-EP correction std::vector funcEff; - TH1D* hFindPtBin; - TF1* funcV2; - TF1* funcV3; - TF1* funcV4; + TH1D* hFindPtBin = nullptr; + TF1* funcV2 = nullptr; + TF1* funcV3 = nullptr; + TF1* funcV4 = nullptr; void init(InitContext const&) { @@ -918,30 +918,30 @@ struct FlowTask { if (cfgUserIO.cfgAcceptance.value.empty() == false) { mAcceptance = ccdb->getForTimeStamp(cfgUserIO.cfgAcceptance, timestamp); if (mAcceptance) - LOGF(info, "Loaded acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), (void*)mAcceptance); + LOGF(info, "Loaded acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), static_cast(mAcceptance)); else - LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), (void*)mAcceptance); + LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), static_cast(mAcceptance)); } if (cfgUserIO.cfgEfficiency.value.empty() == false) { mEfficiency = ccdb->getForTimeStamp(cfgUserIO.cfgEfficiency, timestamp); if (mEfficiency == nullptr) { LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgUserIO.cfgEfficiency.value.c_str()); } - LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiency.value.c_str(), (void*)mEfficiency); + LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiency.value.c_str(), static_cast(mEfficiency)); } if (cfgUserIO.cfgEfficiencyForNch.value.empty() == false) { mEfficiencyForNch = ccdb->getForTimeStamp(cfgUserIO.cfgEfficiencyForNch, timestamp); if (mEfficiencyForNch == nullptr) { LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgUserIO.cfgEfficiencyForNch.value.c_str()); } - LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiencyForNch.value.c_str(), (void*)mEfficiencyForNch); + LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiencyForNch.value.c_str(), static_cast(mEfficiencyForNch)); } if (cfgAdditionObs.cfgDptDisEnable && cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.empty() == false) { cfgAdditionObs.hEvAvgMeanPt = ccdb->getForTimeStamp(cfgAdditionObs.cfgDptDishEvAvgMeanPt, timestamp); if (cfgAdditionObs.hEvAvgMeanPt == nullptr) { LOGF(fatal, "Could not load mean pT histogram from %s", cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.c_str()); } - LOGF(info, "Loaded mean pT histogram from %s (%p)", cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.c_str(), (void*)cfgAdditionObs.hEvAvgMeanPt); + LOGF(info, "Loaded mean pT histogram from %s (%p)", cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.c_str(), static_cast(cfgAdditionObs.hEvAvgMeanPt)); } if (cfgAdditionObs.cfgDptDisEnable && cfgAdditionObs.cfgDptDisSelectionSwitch > kNoDptCut) { if (cfgAdditionObs.cfgDptDisCutLow.value.empty() == false) { @@ -949,14 +949,14 @@ struct FlowTask { if (cfgAdditionObs.fDptDisCutLow == nullptr) { LOGF(fatal, "Could not load dptDis low cut histogram from %s", cfgAdditionObs.cfgDptDisCutLow.value.c_str()); } - LOGF(info, "Loaded dptDis low cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutLow.value.c_str(), (void*)cfgAdditionObs.fDptDisCutLow); + LOGF(info, "Loaded dptDis low cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutLow.value.c_str(), static_cast(cfgAdditionObs.fDptDisCutLow)); } if (cfgAdditionObs.cfgDptDisCutHigh.value.empty() == false) { cfgAdditionObs.fDptDisCutHigh = ccdb->getForTimeStamp(cfgAdditionObs.cfgDptDisCutHigh, timestamp); if (cfgAdditionObs.fDptDisCutHigh == nullptr) { LOGF(fatal, "Could not load dptDis high cut histogram from %s", cfgAdditionObs.cfgDptDisCutHigh.value.c_str()); } - LOGF(info, "Loaded dptDis high cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutHigh.value.c_str(), (void*)cfgAdditionObs.fDptDisCutHigh); + LOGF(info, "Loaded dptDis high cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutHigh.value.c_str(), static_cast(cfgAdditionObs.fDptDisCutHigh)); } } correctionsLoaded = true; @@ -1499,13 +1499,12 @@ struct FlowTask { if (weffEvent) { registry.fill(HIST("hMeanPt"), independent, ptSum / weffEvent, weffEvent); } - if (weffEventWithinGap08) + if (weffEventWithinGap08) { registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEventWithinGap08, cfgUserIO.cfgUserPtVnEvWeightEnabled ? weffEventWithinGap08 : 1.); - if (weffEventWithinGap08) bootstrapArray[sampleIndex][kMeanPtWithinGap08]->Fill(independent, ptSum_Gap08 / weffEventWithinGap08, 1.0); // c22_gap8 * pt_withGap8 - if (weffEventWithinGap08) fillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEventWithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), independent); + } // PtVariance if (weffEventDiffWithGap08) { registry.fill(HIST("PtVariance_partA_WithinGap08"), independent, @@ -1610,9 +1609,8 @@ struct FlowTask { ptSum_Gap08 += mcParticle.pt(); count_Gap08 += 1.; } - } - if (withinPtRef) fGFW->Fill(mcParticle.eta(), fPtAxis->FindBin(mcParticle.pt()) - 1, mcParticle.phi(), 1., 1); + } if (withinPtPOI) fGFW->Fill(mcParticle.eta(), fPtAxis->FindBin(mcParticle.pt()) - 1, mcParticle.phi(), 1., 2); if (withinPtPOI && withinPtRef) From a9141c3accb2a730f411180a01f6b6cd54e53213 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 18 Oct 2026 09:05:24 +0000 Subject: [PATCH 4/4] Please consider the following formatting changes --- 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 20e640e8aae..ec583bdabd8 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -1502,7 +1502,7 @@ struct FlowTask { if (weffEventWithinGap08) { registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEventWithinGap08, cfgUserIO.cfgUserPtVnEvWeightEnabled ? weffEventWithinGap08 : 1.); bootstrapArray[sampleIndex][kMeanPtWithinGap08]->Fill(independent, ptSum_Gap08 / weffEventWithinGap08, 1.0); - // c22_gap8 * pt_withGap8 + // c22_gap8 * pt_withGap8 fillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEventWithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), independent); } // PtVariance @@ -1610,7 +1610,7 @@ struct FlowTask { count_Gap08 += 1.; } fGFW->Fill(mcParticle.eta(), fPtAxis->FindBin(mcParticle.pt()) - 1, mcParticle.phi(), 1., 1); - } + } if (withinPtPOI) fGFW->Fill(mcParticle.eta(), fPtAxis->FindBin(mcParticle.pt()) - 1, mcParticle.phi(), 1., 2); if (withinPtPOI && withinPtRef)