From 7744441f79ffa59a5887f3df556fba506e26b16a Mon Sep 17 00:00:00 2001 From: Maxim Virta Date: Tue, 4 Aug 2026 12:47:41 +0200 Subject: [PATCH 1/6] [PWGCF] Added multiplicity axis for v02pt + linter fixes --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 176 ++++++++++---------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 6dd45ddd25c..583fe394a93 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -74,11 +74,10 @@ using namespace o2; using namespace o2::framework; using namespace analysis::genericframework; -#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; -static constexpr float LongArrayFloat[3][20] = {{1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {2.1, 2.2, 2.3, -2.1, -2.2, -2.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {3.1, 3.2, 3.3, -3.1, -3.2, -3.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}}; +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, (DEFAULT), (HELP)}; +static constexpr std::array, 20> LongArrayFloat = {{{{1.1, 2.1, 3.1}}, {{1.2, 2.2, 3.2}}, {{1.3, 2.3, 3.3}}, {{-1.1, -2.1, -3.1}}, {{-1.2, -2.2, -3.2}}, {{-1.3, -2.3, -3.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}}}; -namespace o2::analysis::gfw -{ +struct GFWMemberCache { std::vector ptbinning = {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}; float ptpoilow = 0.2, ptpoiup = 10.0; float ptreflow = 0.2, ptrefup = 3.0; @@ -93,7 +92,7 @@ float phiup = o2::constants::math::TwoPI; int nchbins = 300; float nchlow = 0; float nchup = 300; -std::vector centbinning(90); +std::vector centbinning{90}; int nBootstrap = 10; std::vector> etagapsPtPt; GFWRegions regions; @@ -101,7 +100,7 @@ GFWCorrConfigs configs; std::vector multGlobalCorrCutPars; std::vector multPVCorrCutPars; std::vector multGlobalPVCorrCutPars; -} // namespace o2::analysis::gfw +} gfwMemberCache; struct FlowGfwV02 { @@ -191,7 +190,7 @@ struct FlowGfwV02 { Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull", "refMid", "piP", "kaP", "prP"}, {-0.8, 0.5, -0.8, -0.4, 0.5, 0.5, 0.5}, {-0.5, 0.8, 0.8, 0.4, 0.8, 0.8, 0.8}, {0, 0, 0, 0, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}}, "Configurations for GFW regions"}; Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "piP {2} refN {-2}", "kaP {2} refN {-2}", "prP {2} refN {-2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}", "refFull {2 -2}"}, {"ChGap22", "PiGap22", "KaGap22", "PrGap22", "ChFull22", "nchCh", "nchPi", "nchKa", "nchPr", "v02ptCh", "v02ptPi", "v02ptKa", "v02ptPr"}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {15, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, "Configurations for each correlation to calculate"}; - Configurable> nSigmas{"nSigmas", {LongArrayFloat[0], 6, 3, {"UpCut_pi", "UpCut_ka", "UpCut_pr", "LowCut_pi", "LowCut_ka", "LowCut_pr"}, {"TPC", "TOF", "ITS"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"}; + Configurable> nSigmas{"nSigmas", {LongArrayFloat.front().data(), 6, 3, {"UpCut_pi", "UpCut_ka", "UpCut_pr", "LowCut_pi", "LowCut_ka", "LowCut_pr"}, {"TPC", "TOF", "ITS"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"}; struct : ConfigurableGroup { Configurable cfgZvtxMax{"cfgZvtxMax", 10.0f, "Maximum primary vertex cut applied for the events."}; @@ -205,10 +204,10 @@ struct FlowGfwV02 { o2::framework::expressions::Filter trackFilter = (aod::track::pt > cfgTrackCuts.cfgPtMin) && (aod::track::pt < cfgTrackCuts.cfgPtMax) && nabs(aod::track::eta) < cfgTrackCuts.cfgEtaMax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::itsChi2NCl < cfgTrackCuts.cfgChi2PrITSCls) && (aod::track::tpcChi2NCl < cfgTrackCuts.cfgChi2PrTPCCls) && nabs(aod::track::dcaZ) < cfgTrackCuts.cfgDCAz; // Connect to ccdb - Service ccdb; + Service ccdb{}; struct Config { - TH1D* mEfficiency[4] = {nullptr, nullptr, nullptr, nullptr}; + std::array mEfficiency{nullptr, nullptr, nullptr, nullptr}; GFWWeights* mAcceptance; bool correctionsLoaded = false; } cfg{}; @@ -347,78 +346,78 @@ struct FlowGfwV02 { registry.addClone("QA_PID/before/", "QA_PID/after/"); } - o2::analysis::gfw::regions.SetNames(cfgRegions->GetNames()); - o2::analysis::gfw::regions.SetEtaMin(cfgRegions->GetEtaMin()); - o2::analysis::gfw::regions.SetEtaMax(cfgRegions->GetEtaMax()); - o2::analysis::gfw::regions.SetpTDifs(cfgRegions->GetpTDifs()); - o2::analysis::gfw::regions.SetBitmasks(cfgRegions->GetBitmasks()); - o2::analysis::gfw::configs.SetCorrs(cfgCorrConfig->GetCorrs()); - o2::analysis::gfw::configs.SetHeads(cfgCorrConfig->GetHeads()); - o2::analysis::gfw::configs.SetpTDifs(cfgCorrConfig->GetpTDifs()); - o2::analysis::gfw::configs.SetpTCorrMasks(cfgCorrConfig->GetpTCorrMasks()); - o2::analysis::gfw::regions.Print(); - o2::analysis::gfw::configs.Print(); - o2::analysis::gfw::ptbinning = cfgGFWBinning->GetPtBinning(); - o2::analysis::gfw::ptpoilow = cfgGFWBinning->GetPtPOImin(); - o2::analysis::gfw::ptpoiup = cfgGFWBinning->GetPtPOImax(); - o2::analysis::gfw::ptreflow = cfgGFWBinning->GetPtRefMin(); - o2::analysis::gfw::ptrefup = cfgGFWBinning->GetPtRefMax(); - o2::analysis::gfw::ptlow = cfgTrackCuts.cfgPtMin; - o2::analysis::gfw::ptup = cfgTrackCuts.cfgPtMax; - o2::analysis::gfw::etabins = cfgGFWBinning->GetEtaBins(); - o2::analysis::gfw::vtxZbins = cfgGFWBinning->GetVtxZbins(); - o2::analysis::gfw::phibins = cfgGFWBinning->GetPhiBins(); - o2::analysis::gfw::philow = 0.0f; - o2::analysis::gfw::phiup = o2::constants::math::TwoPI; - o2::analysis::gfw::nchbins = cfgGFWBinning->GetNchBins(); - o2::analysis::gfw::nchlow = cfgGFWBinning->GetNchMin(); - o2::analysis::gfw::nchup = cfgGFWBinning->GetNchMax(); - o2::analysis::gfw::centbinning = cfgGFWBinning->GetCentBinning(); + gfwMemberCache.regions.SetNames(cfgRegions->GetNames()); + gfwMemberCache.regions.SetEtaMin(cfgRegions->GetEtaMin()); + gfwMemberCache.regions.SetEtaMax(cfgRegions->GetEtaMax()); + gfwMemberCache.regions.SetpTDifs(cfgRegions->GetpTDifs()); + gfwMemberCache.regions.SetBitmasks(cfgRegions->GetBitmasks()); + gfwMemberCache.configs.SetCorrs(cfgCorrConfig->GetCorrs()); + gfwMemberCache.configs.SetHeads(cfgCorrConfig->GetHeads()); + gfwMemberCache.configs.SetpTDifs(cfgCorrConfig->GetpTDifs()); + gfwMemberCache.configs.SetpTCorrMasks(cfgCorrConfig->GetpTCorrMasks()); + gfwMemberCache.regions.Print(); + gfwMemberCache.configs.Print(); + gfwMemberCache.ptbinning = cfgGFWBinning->GetPtBinning(); + gfwMemberCache.ptpoilow = cfgGFWBinning->GetPtPOImin(); + gfwMemberCache.ptpoiup = cfgGFWBinning->GetPtPOImax(); + gfwMemberCache.ptreflow = cfgGFWBinning->GetPtRefMin(); + gfwMemberCache.ptrefup = cfgGFWBinning->GetPtRefMax(); + gfwMemberCache.ptlow = cfgTrackCuts.cfgPtMin; + gfwMemberCache.ptup = cfgTrackCuts.cfgPtMax; + gfwMemberCache.etabins = cfgGFWBinning->GetEtaBins(); + gfwMemberCache.vtxZbins = cfgGFWBinning->GetVtxZbins(); + gfwMemberCache.phibins = cfgGFWBinning->GetPhiBins(); + gfwMemberCache.philow = 0.0f; + gfwMemberCache.phiup = o2::constants::math::TwoPI; + gfwMemberCache.nchbins = cfgGFWBinning->GetNchBins(); + gfwMemberCache.nchlow = cfgGFWBinning->GetNchMin(); + gfwMemberCache.nchup = cfgGFWBinning->GetNchMax(); + gfwMemberCache.centbinning = cfgGFWBinning->GetCentBinning(); cfgGFWBinning->Print(); - o2::analysis::gfw::multGlobalCorrCutPars = cfgMultCorrCuts.cfgMultGlobalCutPars; - o2::analysis::gfw::multPVCorrCutPars = cfgMultCorrCuts.cfgMultPVCutPars; - o2::analysis::gfw::multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars; + gfwMemberCache.multGlobalCorrCutPars = cfgMultCorrCuts.cfgMultGlobalCutPars; + gfwMemberCache.multPVCorrCutPars = cfgMultCorrCuts.cfgMultPVCutPars; + gfwMemberCache.multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars; // Initialise pt spectra histograms for different particles - pidStates.hPtMid[PidCharged] = std::make_unique("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidPions] = std::make_unique("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidKaons] = std::make_unique("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidProtons] = std::make_unique("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidCharged] = std::make_unique("hPtMid_charged", "hPtMid_charged", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtMid[PidPions] = std::make_unique("hPtMid_pions", "hPtMid_pions", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtMid[PidKaons] = std::make_unique("hPtMid_kaons", "hPtMid_kaons", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtMid[PidProtons] = std::make_unique("hPtMid_protons", "hPtMid_protons", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); pidStates.hPtMid[PidCharged]->SetDirectory(nullptr); pidStates.hPtMid[PidPions]->SetDirectory(nullptr); pidStates.hPtMid[PidKaons]->SetDirectory(nullptr); pidStates.hPtMid[PidProtons]->SetDirectory(nullptr); - pidStates.hPtForward[PidCharged] = std::make_unique("hPtForward_charged", "hPtForward_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtForward[PidPions] = std::make_unique("hPtForward_pions", "hPtForward_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtForward[PidKaons] = std::make_unique("hPtForward_kaons", "hPtForward_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtForward[PidProtons] = std::make_unique("hPtForward_protons", "hPtForward_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtForward[PidCharged] = std::make_unique("hPtForward_charged", "hPtForward_charged", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtForward[PidPions] = std::make_unique("hPtForward_pions", "hPtForward_pions", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtForward[PidKaons] = std::make_unique("hPtForward_kaons", "hPtForward_kaons", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtForward[PidProtons] = std::make_unique("hPtForward_protons", "hPtForward_protons", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); pidStates.hPtForward[PidCharged]->SetDirectory(nullptr); pidStates.hPtForward[PidPions]->SetDirectory(nullptr); pidStates.hPtForward[PidKaons]->SetDirectory(nullptr); pidStates.hPtForward[PidProtons]->SetDirectory(nullptr); - pidStates.hPtBackward[PidCharged] = std::make_unique("hPtBackward_charged", "hPtBackward_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtBackward[PidPions] = std::make_unique("hPtBackward_pions", "hPtBackward_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtBackward[PidKaons] = std::make_unique("hPtBackward_kaons", "hPtBackward_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtBackward[PidProtons] = std::make_unique("hPtBackward_protons", "hPtBackward_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtBackward[PidCharged] = std::make_unique("hPtBackward_charged", "hPtBackward_charged", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtBackward[PidPions] = std::make_unique("hPtBackward_pions", "hPtBackward_pions", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtBackward[PidKaons] = std::make_unique("hPtBackward_kaons", "hPtBackward_kaons", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); + pidStates.hPtBackward[PidProtons] = std::make_unique("hPtBackward_protons", "hPtBackward_protons", gfwMemberCache.ptbinning.size() - 1, gfwMemberCache.ptbinning.data()); pidStates.hPtBackward[PidCharged]->SetDirectory(nullptr); pidStates.hPtBackward[PidPions]->SetDirectory(nullptr); pidStates.hPtBackward[PidKaons]->SetDirectory(nullptr); pidStates.hPtBackward[PidProtons]->SetDirectory(nullptr); - AxisSpec phiAxis = {o2::analysis::gfw::phibins, o2::analysis::gfw::philow, o2::analysis::gfw::phiup, "#phi"}; - AxisSpec etaAxis = {o2::analysis::gfw::etabins, -cfgTrackCuts.cfgEtaMax, cfgTrackCuts.cfgEtaMax, "#eta"}; - AxisSpec vtxAxis = {o2::analysis::gfw::vtxZbins, -cfgEventCuts.cfgZvtxMax, cfgEventCuts.cfgZvtxMax, "Vtx_{z} (cm)"}; - AxisSpec ptAxis = {o2::analysis::gfw::ptbinning, "#it{p}_{T} GeV/#it{c}"}; + AxisSpec phiAxis = {gfwMemberCache.phibins, gfwMemberCache.philow, gfwMemberCache.phiup, "#phi"}; + AxisSpec etaAxis = {gfwMemberCache.etabins, -cfgTrackCuts.cfgEtaMax, cfgTrackCuts.cfgEtaMax, "#eta"}; + AxisSpec vtxAxis = {gfwMemberCache.vtxZbins, -cfgEventCuts.cfgZvtxMax, cfgEventCuts.cfgZvtxMax, "Vtx_{z} (cm)"}; + AxisSpec ptAxis = {gfwMemberCache.ptbinning, "#it{p}_{T} GeV/#it{c}"}; std::string sCentralityEstimator = "FT0C centrality (%)"; - AxisSpec centAxis = {o2::analysis::gfw::centbinning, sCentralityEstimator.c_str()}; + AxisSpec centAxis = {gfwMemberCache.centbinning, sCentralityEstimator.c_str()}; std::vector nchbinning; - int nchskip = (o2::analysis::gfw::nchup - o2::analysis::gfw::nchlow) / o2::analysis::gfw::nchbins; - for (int i = 0; i <= o2::analysis::gfw::nchbins; ++i) { - nchbinning.push_back(nchskip * i + o2::analysis::gfw::nchlow + 0.5); + int nchskip = (gfwMemberCache.nchup - gfwMemberCache.nchlow) / gfwMemberCache.nchbins; + for (int i = 0; i <= gfwMemberCache.nchbins; ++i) { + nchbinning.push_back(nchskip * i + gfwMemberCache.nchlow + 0.5); } AxisSpec nchAxis = {nchbinning, "N_{ch}"}; AxisSpec t0cAxis = {1000, 0, 10000, "N_{ch} (T0C)"}; @@ -427,9 +426,9 @@ struct FlowGfwV02 { AxisSpec multpvAxis = {600, 0, 600, "N_{ch} (PV)"}; AxisSpec dcaZAxis = {200, -2, 2, "DCA_{z} (cm)"}; AxisSpec dcaXYAxis = {200, -0.5, 0.5, "DCA_{xy} (cm)"}; - AxisSpec bsAxis = {o2::analysis::gfw::nBootstrap, -0.5, o2::analysis::gfw::nBootstrap - 0.5, "Bootstrap Index"}; + AxisSpec bsAxis = {gfwMemberCache.nBootstrap, -0.5, gfwMemberCache.nBootstrap - 0.5, "Bootstrap Index"}; - registry.add("v02pt", "", {HistType::kTProfile2D, {ptAxis, centAxis}}); + registry.add("v02pt", "", {HistType::kTProfile3D, {ptAxis, centAxis, nchAxis}}); registry.add("nchMid", "", {HistType::kTProfile3D, {ptAxis, centAxis, nchAxis}}); registry.add("v02centmult", "", {HistType::kTProfile2D, {centAxis, nchAxis}}); @@ -452,15 +451,15 @@ struct FlowGfwV02 { int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); ccdb->setCreatedNotAfter(now); - int ptbins = o2::analysis::gfw::ptbinning.size() - 1; - fSecondAxis = std::make_unique(ptbins, &o2::analysis::gfw::ptbinning[0]); + int ptbins = gfwMemberCache.ptbinning.size() - 1; + fSecondAxis = std::make_unique(ptbins, gfwMemberCache.ptbinning.data()); // QA histograms registry.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); registry.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAxis, dcaZAxis}}); registry.add("trackQA/before/nch_pt", "#it{p}_{T} vs multiplicity; N_{ch}; #it{p}_{T}", {HistType::kTH2D, {nchAxis, ptAxis}}); - registry.add("trackQA/after/pt_ref", "", {HistType::kTH1D, {{100, o2::analysis::gfw::ptreflow, o2::analysis::gfw::ptrefup}}}); - registry.add("trackQA/after/pt_poi", "", {HistType::kTH1D, {{100, o2::analysis::gfw::ptpoilow, o2::analysis::gfw::ptpoiup}}}); + registry.add("trackQA/after/pt_ref", "", {HistType::kTH1D, {{100, gfwMemberCache.ptreflow, gfwMemberCache.ptrefup}}}); + registry.add("trackQA/after/pt_poi", "", {HistType::kTH1D, {{100, gfwMemberCache.ptpoilow, gfwMemberCache.ptpoiup}}}); registry.add("trackQA/before/chi2prTPCcls", "#chi^{2}/cluster for the TPC track segment; #chi^{2}/TPC cluster", {HistType::kTH1D, {{100, 0., 5.}}}); registry.add("trackQA/before/chi2prITScls", "#chi^{2}/cluster for the ITS track; #chi^{2}/ITS cluster", {HistType::kTH1D, {{100, 0., 50.}}}); registry.add("trackQA/before/nTPCClusters", "Number of found TPC clusters; TPC N_{cls}; Counts", {HistType::kTH1D, {{100, 40, 180}}}); @@ -505,13 +504,13 @@ struct FlowGfwV02 { registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kMultCuts, "after Mult cuts"); registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTrackCent, "has track + within cent"); - if (o2::analysis::gfw::regions.GetSize() < 0) + if (gfwMemberCache.regions.GetSize() < 0) LOGF(error, "Configuration contains vectors of different size - check the GFWRegions configurable"); - for (auto i(0); i < o2::analysis::gfw::regions.GetSize(); ++i) { - fGFW->AddRegion(o2::analysis::gfw::regions.GetNames()[i], o2::analysis::gfw::regions.GetEtaMin()[i], o2::analysis::gfw::regions.GetEtaMax()[i], (o2::analysis::gfw::regions.GetpTDifs()[i]) ? ptbins + 1 : 1, o2::analysis::gfw::regions.GetBitmasks()[i]); + for (auto i(0); i < gfwMemberCache.regions.GetSize(); ++i) { + fGFW->AddRegion(gfwMemberCache.regions.GetNames()[i], gfwMemberCache.regions.GetEtaMin()[i], gfwMemberCache.regions.GetEtaMax()[i], (gfwMemberCache.regions.GetpTDifs()[i]) ? ptbins + 1 : 1, gfwMemberCache.regions.GetBitmasks()[i]); } - for (auto i = 0; i < o2::analysis::gfw::configs.GetSize(); ++i) { - corrconfigs.push_back(fGFW->GetCorrelatorConfig(o2::analysis::gfw::configs.GetCorrs()[i], o2::analysis::gfw::configs.GetHeads()[i], o2::analysis::gfw::configs.GetpTDifs()[i])); + for (auto i = 0; i < gfwMemberCache.configs.GetSize(); ++i) { + corrconfigs.push_back(fGFW->GetCorrelatorConfig(gfwMemberCache.configs.GetCorrs()[i], gfwMemberCache.configs.GetHeads()[i], gfwMemberCache.configs.GetpTDifs()[i])); } if (corrconfigs.empty()) LOGF(error, "Configuration contains vectors of different size - check the GFWCorrConfig configurable"); @@ -554,15 +553,15 @@ struct FlowGfwV02 { if (cfgUseAdditionalEventCut) { fMultPVCutLow = std::make_unique("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); - fMultPVCutLow->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); + fMultPVCutLow->SetParameters(gfwMemberCache.multPVCorrCutPars.data()); fMultPVCutHigh = std::make_unique("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); - fMultPVCutHigh->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); + fMultPVCutHigh->SetParameters(gfwMemberCache.multPVCorrCutPars.data()); fMultCutLow = std::make_unique("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); - fMultCutLow->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); + fMultCutLow->SetParameters(gfwMemberCache.multGlobalCorrCutPars.data()); fMultCutHigh = std::make_unique("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); - fMultCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); + fMultCutHigh->SetParameters(gfwMemberCache.multGlobalCorrCutPars.data()); fMultPVGlobalCutHigh = std::make_unique("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); - fMultPVGlobalCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalPVCorrCutPars[0])); + fMultPVGlobalCutHigh->SetParameters(gfwMemberCache.multGlobalPVCorrCutPars.data()); } // Set DCAxy cut fPtDepDCAxy = std::make_unique("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); @@ -812,7 +811,7 @@ struct FlowGfwV02 { } auto multNTracksPV = collision.multNTracksPV(); - if (vtxz > o2::analysis::gfw::vtxZup || vtxz < o2::analysis::gfw::vtxZlow) + if (vtxz > gfwMemberCache.vtxZup || vtxz < gfwMemberCache.vtxZlow) return 0; if (cfgMultCut) { @@ -881,11 +880,11 @@ struct FlowGfwV02 { ebyeWeight *= pidStates.hPtMid[PidCharged]->Integral(); } double ptFraction = 0; - double threshhold = 1.01; + 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(); - if (std::abs(val) < threshhold) + if (std::abs(val) < threshold) fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val * ptFraction, ebyeWeight, rndm); } } @@ -898,7 +897,7 @@ struct FlowGfwV02 { double ptMeanBackward = pidStates.hPtBackward[PidCharged]->GetMean(); double ptFractionForward = 0.; double ptFractionBackward = 0.; - int bootstrap = fRndm->Integer(o2::analysis::gfw::nBootstrap); + int bootstrap = fRndm->Integer(gfwMemberCache.nBootstrap); for (int pid = 0; pid < PidTotal; pid++) { int normIndex = (cfgNormalizeByCharged) ? PidCharged : pid; for (int i = 1; i <= fSecondAxis->GetNbins(); i++) { @@ -971,8 +970,9 @@ struct FlowGfwV02 { double ptFraction = 0; if (pidStates.hPtMid[PidCharged]->Integral() > 0) { ptFraction = pidStates.hPtMid[PidCharged]->GetBinContent(i) / pidStates.hPtMid[PidCharged]->Integral(); - if (std::abs(val) < 1) - registry.fill(HIST("v02pt"), fSecondAxis->GetBinCenter(i), centmult, val * ptFraction, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0); + 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); } } @@ -998,7 +998,7 @@ struct FlowGfwV02 { float vtxz = collision.posZ(); if (tracks.size() < 1) return; - if (xaxis.centrality >= 0 && (xaxis.centrality < o2::analysis::gfw::centbinning.front() || xaxis.centrality > o2::analysis::gfw::centbinning.back())) + if (xaxis.centrality >= 0 && (xaxis.centrality < gfwMemberCache.centbinning.front() || xaxis.centrality > gfwMemberCache.centbinning.back())) return; if (xaxis.multiplicity < cfgFixedMultMin || xaxis.multiplicity > cfgFixedMultMax) return; @@ -1068,13 +1068,13 @@ struct FlowGfwV02 { template void fillAcceptedTracks(TTrack track, AcceptedTracks& acceptedTracks) { - if (posRegionIndex >= 0 && track.eta() > o2::analysis::gfw::regions.GetEtaMin()[posRegionIndex] && track.eta() < o2::analysis::gfw::regions.GetEtaMax()[posRegionIndex]) + if (posRegionIndex >= 0 && track.eta() > gfwMemberCache.regions.GetEtaMin()[posRegionIndex] && track.eta() < gfwMemberCache.regions.GetEtaMax()[posRegionIndex]) ++acceptedTracks.nPos; - if (negRegionIndex >= 0 && track.eta() > o2::analysis::gfw::regions.GetEtaMin()[negRegionIndex] && track.eta() < o2::analysis::gfw::regions.GetEtaMax()[negRegionIndex]) + if (negRegionIndex >= 0 && track.eta() > gfwMemberCache.regions.GetEtaMin()[negRegionIndex] && track.eta() < gfwMemberCache.regions.GetEtaMax()[negRegionIndex]) ++acceptedTracks.nNeg; - if (fullRegionIndex >= 0 && track.eta() > o2::analysis::gfw::regions.GetEtaMin()[fullRegionIndex] && track.eta() < o2::analysis::gfw::regions.GetEtaMax()[fullRegionIndex]) + if (fullRegionIndex >= 0 && track.eta() > gfwMemberCache.regions.GetEtaMin()[fullRegionIndex] && track.eta() < gfwMemberCache.regions.GetEtaMax()[fullRegionIndex]) ++acceptedTracks.nFull; - if (midRegionIndex >= 0 && track.eta() > o2::analysis::gfw::regions.GetEtaMin()[midRegionIndex] && track.eta() < o2::analysis::gfw::regions.GetEtaMax()[midRegionIndex]) + if (midRegionIndex >= 0 && track.eta() > gfwMemberCache.regions.GetEtaMin()[midRegionIndex] && track.eta() < gfwMemberCache.regions.GetEtaMax()[midRegionIndex]) ++acceptedTracks.nMid; } @@ -1140,8 +1140,8 @@ struct FlowGfwV02 { { int pidInd = getNsigmaPID(track); - bool withinPtRef = (track.pt() > o2::analysis::gfw::ptreflow && track.pt() < o2::analysis::gfw::ptrefup); - bool withinPtPOI = (track.pt() > o2::analysis::gfw::ptpoilow && track.pt() < o2::analysis::gfw::ptpoiup); + bool withinPtRef = (track.pt() > gfwMemberCache.ptreflow && track.pt() < gfwMemberCache.ptrefup); + bool withinPtPOI = (track.pt() > gfwMemberCache.ptpoilow && track.pt() < gfwMemberCache.ptpoiup); if (!withinPtPOI && !withinPtRef) return; From ce02c546766a01146d86e1354ba677e61b2d5a4b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 4 Aug 2026 10:48:48 +0000 Subject: [PATCH 2/6] Please consider the following formatting changes --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 44 ++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 583fe394a93..cb4ae79275a 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -78,28 +78,28 @@ using namespace analysis::genericframework; static constexpr std::array, 20> LongArrayFloat = {{{{1.1, 2.1, 3.1}}, {{1.2, 2.2, 3.2}}, {{1.3, 2.3, 3.3}}, {{-1.1, -2.1, -3.1}}, {{-1.2, -2.2, -3.2}}, {{-1.3, -2.3, -3.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}}}; struct GFWMemberCache { -std::vector ptbinning = {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}; -float ptpoilow = 0.2, ptpoiup = 10.0; -float ptreflow = 0.2, ptrefup = 3.0; -float ptlow = 0.2, ptup = 10.0; -int etabins = 16; -float etalow = -0.8, etaup = 0.8; -int vtxZbins = 40; -float vtxZlow = -10.0, vtxZup = 10.0; -int phibins = 72; -float philow = 0.0; -float phiup = o2::constants::math::TwoPI; -int nchbins = 300; -float nchlow = 0; -float nchup = 300; -std::vector centbinning{90}; -int nBootstrap = 10; -std::vector> etagapsPtPt; -GFWRegions regions; -GFWCorrConfigs configs; -std::vector multGlobalCorrCutPars; -std::vector multPVCorrCutPars; -std::vector multGlobalPVCorrCutPars; + std::vector ptbinning = {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}; + float ptpoilow = 0.2, ptpoiup = 10.0; + float ptreflow = 0.2, ptrefup = 3.0; + float ptlow = 0.2, ptup = 10.0; + int etabins = 16; + float etalow = -0.8, etaup = 0.8; + int vtxZbins = 40; + float vtxZlow = -10.0, vtxZup = 10.0; + int phibins = 72; + float philow = 0.0; + float phiup = o2::constants::math::TwoPI; + int nchbins = 300; + float nchlow = 0; + float nchup = 300; + std::vector centbinning{90}; + int nBootstrap = 10; + std::vector> etagapsPtPt; + GFWRegions regions; + GFWCorrConfigs configs; + std::vector multGlobalCorrCutPars; + std::vector multPVCorrCutPars; + std::vector multGlobalPVCorrCutPars; } gfwMemberCache; struct FlowGfwV02 { From bf40b5799a5160313ddc428f46fda5306d0cab82 Mon Sep 17 00:00:00 2001 From: Maxim Virta Date: Tue, 4 Aug 2026 13:35:51 +0200 Subject: [PATCH 3/6] Linter fix --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 46 ++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index cb4ae79275a..e55380fcd5a 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -78,28 +78,28 @@ using namespace analysis::genericframework; static constexpr std::array, 20> LongArrayFloat = {{{{1.1, 2.1, 3.1}}, {{1.2, 2.2, 3.2}}, {{1.3, 2.3, 3.3}}, {{-1.1, -2.1, -3.1}}, {{-1.2, -2.2, -3.2}}, {{-1.3, -2.3, -3.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}}}; struct GFWMemberCache { - std::vector ptbinning = {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}; - float ptpoilow = 0.2, ptpoiup = 10.0; - float ptreflow = 0.2, ptrefup = 3.0; - float ptlow = 0.2, ptup = 10.0; - int etabins = 16; - float etalow = -0.8, etaup = 0.8; - int vtxZbins = 40; - float vtxZlow = -10.0, vtxZup = 10.0; - int phibins = 72; - float philow = 0.0; - float phiup = o2::constants::math::TwoPI; - int nchbins = 300; - float nchlow = 0; - float nchup = 300; - std::vector centbinning{90}; - int nBootstrap = 10; - std::vector> etagapsPtPt; - GFWRegions regions; - GFWCorrConfigs configs; - std::vector multGlobalCorrCutPars; - std::vector multPVCorrCutPars; - std::vector multGlobalPVCorrCutPars; +std::vector ptbinning = {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}; +float ptpoilow = 0.2, ptpoiup = 10.0; +float ptreflow = 0.2, ptrefup = 3.0; +float ptlow = 0.2, ptup = 10.0; +int etabins = 16; +float etalow = -0.8, etaup = 0.8; +int vtxZbins = 40; +float vtxZlow = -10.0, vtxZup = 10.0; +int phibins = 72; +float philow = 0.0; +float phiup = o2::constants::math::TwoPI; +int nchbins = 300; +float nchlow = 0; +float nchup = 300; +std::vector centbinning{90}; +int nBootstrap = 10; +std::vector> etagapsPtPt; +GFWRegions regions; +GFWCorrConfigs configs; +std::vector multGlobalCorrCutPars; +std::vector multPVCorrCutPars; +std::vector multGlobalPVCorrCutPars; } gfwMemberCache; struct FlowGfwV02 { @@ -208,7 +208,7 @@ struct FlowGfwV02 { struct Config { std::array mEfficiency{nullptr, nullptr, nullptr, nullptr}; - GFWWeights* mAcceptance; + GFWWeights* mAcceptance = nullptr; bool correctionsLoaded = false; } cfg{}; From aa555399996ca6e8edcd5df2abf61e8653b96418 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 4 Aug 2026 11:36:38 +0000 Subject: [PATCH 4/6] Please consider the following formatting changes --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 44 ++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index e55380fcd5a..e5d82521989 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -78,28 +78,28 @@ using namespace analysis::genericframework; static constexpr std::array, 20> LongArrayFloat = {{{{1.1, 2.1, 3.1}}, {{1.2, 2.2, 3.2}}, {{1.3, 2.3, 3.3}}, {{-1.1, -2.1, -3.1}}, {{-1.2, -2.2, -3.2}}, {{-1.3, -2.3, -3.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}}}; struct GFWMemberCache { -std::vector ptbinning = {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}; -float ptpoilow = 0.2, ptpoiup = 10.0; -float ptreflow = 0.2, ptrefup = 3.0; -float ptlow = 0.2, ptup = 10.0; -int etabins = 16; -float etalow = -0.8, etaup = 0.8; -int vtxZbins = 40; -float vtxZlow = -10.0, vtxZup = 10.0; -int phibins = 72; -float philow = 0.0; -float phiup = o2::constants::math::TwoPI; -int nchbins = 300; -float nchlow = 0; -float nchup = 300; -std::vector centbinning{90}; -int nBootstrap = 10; -std::vector> etagapsPtPt; -GFWRegions regions; -GFWCorrConfigs configs; -std::vector multGlobalCorrCutPars; -std::vector multPVCorrCutPars; -std::vector multGlobalPVCorrCutPars; + std::vector ptbinning = {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}; + float ptpoilow = 0.2, ptpoiup = 10.0; + float ptreflow = 0.2, ptrefup = 3.0; + float ptlow = 0.2, ptup = 10.0; + int etabins = 16; + float etalow = -0.8, etaup = 0.8; + int vtxZbins = 40; + float vtxZlow = -10.0, vtxZup = 10.0; + int phibins = 72; + float philow = 0.0; + float phiup = o2::constants::math::TwoPI; + int nchbins = 300; + float nchlow = 0; + float nchup = 300; + std::vector centbinning{90}; + int nBootstrap = 10; + std::vector> etagapsPtPt; + GFWRegions regions; + GFWCorrConfigs configs; + std::vector multGlobalCorrCutPars; + std::vector multPVCorrCutPars; + std::vector multGlobalPVCorrCutPars; } gfwMemberCache; struct FlowGfwV02 { From 78b4a08217e59211593c4e74514c28a4027a371b Mon Sep 17 00:00:00 2001 From: Maxim Virta Date: Tue, 4 Aug 2026 17:04:03 +0200 Subject: [PATCH 5/6] Linter fixes --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 160 +++++++++----------- 1 file changed, 71 insertions(+), 89 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index e5d82521989..8d323ff9274 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -74,36 +74,46 @@ using namespace o2; using namespace o2::framework; using namespace analysis::genericframework; -#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, (DEFAULT), (HELP)}; +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, (DEFAULT), (HELP)}; // NOLINT(bugprone-macro-parentheses) static constexpr std::array, 20> LongArrayFloat = {{{{1.1, 2.1, 3.1}}, {{1.2, 2.2, 3.2}}, {{1.3, 2.3, 3.3}}, {{-1.1, -2.1, -3.1}}, {{-1.2, -2.2, -3.2}}, {{-1.3, -2.3, -3.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}, {{1.3, 1.3, 1.3}}, {{-1.1, -1.1, -1.1}}, {{-1.2, -1.2, -1.2}}, {{-1.3, -1.3, -1.3}}, {{1.1, 1.1, 1.1}}, {{1.2, 1.2, 1.2}}}}; -struct GFWMemberCache { - std::vector ptbinning = {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}; - float ptpoilow = 0.2, ptpoiup = 10.0; - float ptreflow = 0.2, ptrefup = 3.0; - float ptlow = 0.2, ptup = 10.0; - int etabins = 16; - float etalow = -0.8, etaup = 0.8; - int vtxZbins = 40; - float vtxZlow = -10.0, vtxZup = 10.0; - int phibins = 72; - float philow = 0.0; - float phiup = o2::constants::math::TwoPI; - int nchbins = 300; - float nchlow = 0; - float nchup = 300; - std::vector centbinning{90}; - int nBootstrap = 10; - std::vector> etagapsPtPt; - GFWRegions regions; - GFWCorrConfigs configs; - std::vector multGlobalCorrCutPars; - std::vector multPVCorrCutPars; - std::vector multGlobalPVCorrCutPars; -} gfwMemberCache; +template +auto projectMatrix(Array2D const& mat, std::array& array1, std::array& array2, std::array& array3) +{ + for (auto j = 0; j < static_cast(mat.rows); ++j) { + array1[j] = mat(j, 0); + array2[j] = mat(j, 1); + array3[j] = mat(j, 2); + } +} struct FlowGfwV02 { + struct GFWMemberCache { + std::vector ptbinning = {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}; + float ptpoilow = 0.2, ptpoiup = 10.0; + float ptreflow = 0.2, ptrefup = 3.0; + float ptlow = 0.2, ptup = 10.0; + int etabins = 16; + float etalow = -0.8, etaup = 0.8; + int vtxZbins = 40; + float vtxZlow = -10.0, vtxZup = 10.0; + int phibins = 72; + float philow = 0.0; + float phiup = o2::constants::math::TwoPI; + int nchbins = 300; + float nchlow = 0; + float nchup = 300; + std::vector centbinning{90}; + int nBootstrap = 10; + std::vector> etagapsPtPt; + GFWRegions regions; + GFWCorrConfigs configs; + std::vector multGlobalCorrCutPars; + std::vector multPVCorrCutPars; + std::vector multGlobalPVCorrCutPars; + } gfwMemberCache; + O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgMpar, int, 4, "Highest order of pt-pt correlations") O2_DEFINE_CONFIGURABLE(cfgCentEstimator, int, 0, "0:FT0C; 1:FT0CVariant1; 2:FT0M; 3:FT0A") @@ -295,35 +305,11 @@ struct FlowGfwV02 { IndKaonLow, IndProtonLow }; - enum DetectorType { - kTPC = 0, - kTOF, - kITS - }; void init(InitContext const&) { - pidStates.tpcNsigmaCut[IndPionUp] = nSigmas->getData()[IndPionUp][kTPC]; - pidStates.tpcNsigmaCut[IndKaonUp] = nSigmas->getData()[IndKaonUp][kTPC]; - pidStates.tpcNsigmaCut[IndProtonUp] = nSigmas->getData()[IndProtonUp][kTPC]; - pidStates.tpcNsigmaCut[IndPionLow] = nSigmas->getData()[IndPionLow][kTPC]; - pidStates.tpcNsigmaCut[IndKaonLow] = nSigmas->getData()[IndKaonLow][kTPC]; - pidStates.tpcNsigmaCut[IndProtonLow] = nSigmas->getData()[IndProtonLow][kTPC]; - - pidStates.tofNsigmaCut[IndPionUp] = nSigmas->getData()[IndPionUp][kTOF]; - pidStates.tofNsigmaCut[IndKaonUp] = nSigmas->getData()[IndKaonUp][kTOF]; - pidStates.tofNsigmaCut[IndProtonUp] = nSigmas->getData()[IndProtonUp][kTOF]; - pidStates.tofNsigmaCut[IndPionLow] = nSigmas->getData()[IndPionLow][kTOF]; - pidStates.tofNsigmaCut[IndKaonLow] = nSigmas->getData()[IndKaonLow][kTOF]; - pidStates.tofNsigmaCut[IndProtonLow] = nSigmas->getData()[IndProtonLow][kTOF]; - - pidStates.itsNsigmaCut[IndPionUp] = nSigmas->getData()[IndPionUp][kITS]; - pidStates.itsNsigmaCut[IndKaonUp] = nSigmas->getData()[IndKaonUp][kITS]; - pidStates.itsNsigmaCut[IndProtonUp] = nSigmas->getData()[IndProtonUp][kITS]; - pidStates.itsNsigmaCut[IndPionLow] = nSigmas->getData()[IndPionLow][kITS]; - pidStates.itsNsigmaCut[IndKaonLow] = nSigmas->getData()[IndKaonLow][kITS]; - pidStates.itsNsigmaCut[IndProtonLow] = nSigmas->getData()[IndProtonLow][kITS]; + projectMatrix(nSigmas->getData(), pidStates.tpcNsigmaCut, pidStates.tofNsigmaCut, pidStates.itsNsigmaCut); if (cfgGetNsigmaQA) { if (cfgUseItsPID) { @@ -415,7 +401,7 @@ struct FlowGfwV02 { AxisSpec centAxis = {gfwMemberCache.centbinning, sCentralityEstimator.c_str()}; std::vector nchbinning; - int nchskip = (gfwMemberCache.nchup - gfwMemberCache.nchlow) / gfwMemberCache.nchbins; + const double nchskip = (gfwMemberCache.nchup - gfwMemberCache.nchlow) / static_cast(gfwMemberCache.nchbins); for (int i = 0; i <= gfwMemberCache.nchbins; ++i) { nchbinning.push_back(nchskip * i + gfwMemberCache.nchlow + 0.5); } @@ -507,15 +493,15 @@ struct FlowGfwV02 { if (gfwMemberCache.regions.GetSize() < 0) LOGF(error, "Configuration contains vectors of different size - check the GFWRegions configurable"); for (auto i(0); i < gfwMemberCache.regions.GetSize(); ++i) { - fGFW->AddRegion(gfwMemberCache.regions.GetNames()[i], gfwMemberCache.regions.GetEtaMin()[i], gfwMemberCache.regions.GetEtaMax()[i], (gfwMemberCache.regions.GetpTDifs()[i]) ? ptbins + 1 : 1, gfwMemberCache.regions.GetBitmasks()[i]); + fGFW->AddRegion(gfwMemberCache.regions.GetNames()[i], gfwMemberCache.regions.GetEtaMin()[i], gfwMemberCache.regions.GetEtaMax()[i], (gfwMemberCache.regions.GetpTDifs()[i] != 0) ? ptbins + 1 : 1, gfwMemberCache.regions.GetBitmasks()[i]); } for (auto i = 0; i < gfwMemberCache.configs.GetSize(); ++i) { - corrconfigs.push_back(fGFW->GetCorrelatorConfig(gfwMemberCache.configs.GetCorrs()[i], gfwMemberCache.configs.GetHeads()[i], gfwMemberCache.configs.GetpTDifs()[i])); + corrconfigs.push_back(fGFW->GetCorrelatorConfig(gfwMemberCache.configs.GetCorrs()[i], gfwMemberCache.configs.GetHeads()[i], gfwMemberCache.configs.GetpTDifs()[i] != 0)); } if (corrconfigs.empty()) LOGF(error, "Configuration contains vectors of different size - check the GFWCorrConfig configurable"); fGFW->CreateRegions(); - TObjArray* oba = new TObjArray(); + auto* oba = new TObjArray(); oba->SetOwner(kTRUE); addConfigObjectsToObjArray(oba, corrconfigs); LOGF(info, "Number of correlators: %d", oba->GetEntries()); @@ -524,7 +510,7 @@ struct FlowGfwV02 { fFC->Initialize(oba, centAxis, cfgNbootstrap); delete oba; - if (cfgConsistentEventFlag) { + if (cfgConsistentEventFlag != 0) { posRegionIndex = [&]() { auto begin = cfgRegions->GetNames().begin(); auto end = cfgRegions->GetNames().end(); @@ -568,7 +554,7 @@ struct FlowGfwV02 { fPtDepDCAxy->SetParameter(0, cfgTrackCuts.cfgDCAxyNSigma); } - static constexpr std::string_view FillTimeName[] = {"before/", "after/"}; + static constexpr std::array FillTimeName = {"before/", "after/"}; enum QAFillTime { kBefore, kAfter @@ -581,7 +567,7 @@ struct FlowGfwV02 { std::string suffix = "_ptDiff"; for (auto i = 0; i < fSecondAxis->GetNbins(); ++i) { std::string index = Form("_pt_%i", i + 1); - oba->Add(new TNamed(it->Head.c_str() + index, it->Head.c_str() + suffix)); + oba->Add(new TNamed(it->Head + index, it->Head + suffix)); } } else { oba->Add(new TNamed(it->Head.c_str(), it->Head.c_str())); @@ -590,7 +576,7 @@ struct FlowGfwV02 { } template - int getNsigmaPID(TTrack track) + int getNsigmaPID(TTrack const& track) { // Computing Nsigma arrays for pion, kaon, and protons std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; @@ -601,7 +587,7 @@ struct FlowGfwV02 { std::array nSigmaToUse = cfgUseItsPID ? nSigmaITS : nSigmaTPC; // Choose which nSigma to use: TPC or ITS std::array detectorNsigmaCut = cfgUseItsPID ? pidStates.itsNsigmaCut : pidStates.tpcNsigmaCut; // Choose which nSigma to use: TPC or ITS - bool isPion, isKaon, isProton; + bool isPion = false, isKaon = false, isProton = false; bool isDetectedPion = nSigmaToUse[IndPionUp] < detectorNsigmaCut[IndPionUp] && nSigmaToUse[IndPionUp] > detectorNsigmaCut[IndPionLow]; bool isDetectedKaon = nSigmaToUse[IndKaonUp] < detectorNsigmaCut[IndKaonUp] && nSigmaToUse[IndKaonUp] > detectorNsigmaCut[IndKaonLow]; bool isDetectedProton = nSigmaToUse[IndProtonUp] < detectorNsigmaCut[IndProtonUp] && nSigmaToUse[IndProtonUp] > detectorNsigmaCut[IndProtonLow]; @@ -612,7 +598,8 @@ struct FlowGfwV02 { if (track.pt() > cfgTofPtCut && !track.hasTOF()) { return -1; - } else if (track.pt() > cfgTofPtCut && track.hasTOF()) { + } + if (track.pt() > cfgTofPtCut && track.hasTOF()) { isPion = isTofPion && isDetectedPion; isKaon = isTofKaon && isDetectedKaon; isProton = isTofProton && isDetectedProton; @@ -660,9 +647,9 @@ struct FlowGfwV02 { cfg.mEfficiency[i] = ccdb->getForTimeStamp(cfgEfficiency.value + pidStrings[i], timestamp); if (cfg.mEfficiency[i] == nullptr) { - LOGF(fatal, "Could not load PID efficiency histogram from %s", cfgEfficiency.value + pidStrings[i].c_str()); + LOGF(fatal, "Could not load PID efficiency histogram from %s", (cfgEfficiency.value + pidStrings[i]).c_str()); } - LOGF(info, "Loaded PID efficiency histogram from %s (%p)", cfgEfficiency.value + pidStrings[i].c_str(), static_cast(cfg.mEfficiency[i])); + LOGF(info, "Loaded PID efficiency histogram from %s (%p)", (cfgEfficiency.value + pidStrings[i]).c_str(), static_cast(cfg.mEfficiency[i])); } } cfg.correctionsLoaded = true; @@ -682,7 +669,7 @@ struct FlowGfwV02 { } template - double getJTrackAcceptance(TTrack track) + double getJTrackAcceptance(TTrack const& track) { double wacc = 1; if constexpr (requires { track.weightNUA(); }) @@ -691,7 +678,7 @@ struct FlowGfwV02 { } template - double getJTrackEfficiency(TTrack track) + double getJTrackEfficiency(TTrack const& track) { double eff = 1.; if constexpr (requires { track.weightEff(); }) @@ -700,7 +687,7 @@ struct FlowGfwV02 { } template - double getAcceptance(TTrack track, const double& vtxz) + double getAcceptance(TTrack const& track, const double& vtxz) { double wacc = 1; if (cfg.mAcceptance) @@ -709,19 +696,18 @@ struct FlowGfwV02 { } template - double getEfficiency(TTrack track, const int& pid = PidCharged) + double getEfficiency(TTrack const& track, const int& pid = PidCharged) { double eff = 1.; if (cfg.mEfficiency[pid]) eff = cfg.mEfficiency[pid]->GetBinContent(cfg.mEfficiency[pid]->FindBin(track.pt())); if (eff == 0) return -1.; - else - return 1. / eff; + return 1. / eff; } template - bool eventSelected(TCollision collision, const int& multTrk, const float& centrality) + bool eventSelected(TCollision const& collision, const int& multTrk, const float& centrality) { if (cfgEventCutFlags.cfgTVXinTRD) { if (collision.alias_bit(kTVXinTRD)) { @@ -838,11 +824,11 @@ struct FlowGfwV02 { int getPIDIndex(const std::string& corrconfig) { - if (boost::ifind_first(corrconfig, "pi")) + if (!boost::ifind_first(corrconfig, "pi").empty()) return PidPions; - if (boost::ifind_first(corrconfig, "ka")) + if (!boost::ifind_first(corrconfig, "ka").empty()) return PidKaons; - if (boost::ifind_first(corrconfig, "pr")) + if (!boost::ifind_first(corrconfig, "pr").empty()) return PidProtons; return PidCharged; } @@ -864,7 +850,7 @@ struct FlowGfwV02 { } // Fill pt profiles for different particles - int pidInd = getPIDIndex(corrconfigs.at(l_ind).Head.c_str()); + int pidInd = getPIDIndex(corrconfigs.at(l_ind).Head); auto dnx = fGFW->Calculate(corrconfigs.at(0), 0, kTRUE).real(); if (dnx == 0) @@ -977,7 +963,6 @@ struct FlowGfwV02 { } } registry.fill(HIST("v02centmult"), centmult, multiplicity, val); - return; } struct XAxis { @@ -993,7 +978,7 @@ struct FlowGfwV02 { }; template - void processCollision(TCollision collision, TTracks tracks, const XAxis& xaxis, const int& run) + void processCollision(TCollision const& collision, TTracks const& tracks, const XAxis& xaxis, const int& run) { float vtxz = collision.posZ(); if (tracks.size() < 1) @@ -1019,7 +1004,7 @@ struct FlowGfwV02 { float lRandom = fRndm->Rndm(); // Loop over tracks and check if they are accepted - AcceptedTracks acceptedTracks{0, 0, 0, 0}; + AcceptedTracks acceptedTracks{.nPos = 0, .nNeg = 0, .nFull = 0, .nMid = 0}; for (const auto& track : tracks) { processTrack(track, vtxz, xaxis.multiplicity, run, acceptedTracks); if (track.eta() > cfgSubeventCuts.cfgEtaSubCMin && track.eta() < cfgSubeventCuts.cfgEtaSubCMax) @@ -1066,7 +1051,7 @@ struct FlowGfwV02 { } template - void fillAcceptedTracks(TTrack track, AcceptedTracks& acceptedTracks) + void fillAcceptedTracks(TTrack const& track, AcceptedTracks& acceptedTracks) { if (posRegionIndex >= 0 && track.eta() > gfwMemberCache.regions.GetEtaMin()[posRegionIndex] && track.eta() < gfwMemberCache.regions.GetEtaMax()[posRegionIndex]) ++acceptedTracks.nPos; @@ -1079,7 +1064,7 @@ struct FlowGfwV02 { } template - bool trackSelected(TTrack track) + bool trackSelected(TTrack const& track) { if (cfgTrackCuts.cfgDCAxyNSigma && (std::fabs(track.dcaXY()) > fPtDepDCAxy->Eval(track.pt()))) return false; @@ -1087,7 +1072,7 @@ struct FlowGfwV02 { } template - float getCentrality(TCollision collision) + float getCentrality(TCollision const& collision) { switch (cfgCentEstimator) { case kCentFT0C: @@ -1136,7 +1121,7 @@ struct FlowGfwV02 { } template - inline void fillGFW(TTrack track, const double& vtxz) + inline void fillGFW(TTrack const& track, const double& vtxz) { int pidInd = getNsigmaPID(track); @@ -1161,11 +1146,10 @@ struct FlowGfwV02 { fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidKaons + 1); if (withinPtPOI && pidInd == PidProtons) fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidProtons + 1); - return; } template - inline void fillPidQA(TTrack track, const int& pid) + inline void fillPidQA(TTrack const& track, const int& pid) { // Fill Nsigma QA if (!cfgUseItsPID) { @@ -1229,7 +1213,7 @@ struct FlowGfwV02 { } template - inline void fillTrackQA(TTrack track, const float vtxz) + inline void fillTrackQA(TTrack const& track, const float vtxz) { double wacc = getAcceptance(track, vtxz); registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("phi_eta_vtxZ"), track.phi(), track.eta(), vtxz, (ft == kAfter) ? wacc : 1.0); @@ -1246,10 +1230,9 @@ struct FlowGfwV02 { registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_ref"), track.pt()); registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_poi"), track.pt()); } - return; } template - inline void fillEventQA(TCollision collision, XAxis xaxis) + inline void fillEventQA(TCollision const& collision, XAxis xaxis) { if constexpr (framework::has_type_v) { registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), xaxis.multiplicity); @@ -1265,7 +1248,6 @@ struct FlowGfwV02 { registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multT0A"), collision.multFT0A(), xaxis.multiplicity); registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multV0A"), collision.multFV0A(), xaxis.multiplicity); registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); - return; } double getTimeSinceStartOfFill(uint64_t, int) { return 0.0; } @@ -1286,7 +1268,7 @@ struct FlowGfwV02 { registry.fill(HIST("eventQA/eventSel"), kSel8); registry.fill(HIST("eventQA/eventSel"), kOccupancy); // Add occupancy selection later - const XAxis xaxis{getCentrality(collision), tracks.size()}; + const XAxis xaxis{.centrality = getCentrality(collision), .multiplicity = static_cast(tracks.size())}; if (cfgFillQA) { fillEventQA(collision, xaxis); registry.fill(HIST("eventQA/before/centrality"), xaxis.centrality); @@ -1311,7 +1293,7 @@ struct FlowGfwV02 { LOGF(info, "run = %d", run); } loadCorrections(run); - const XAxis xaxis{collision.multiplicity(), tracks.size()}; + const XAxis xaxis{.centrality = collision.multiplicity(), .multiplicity = static_cast(tracks.size())}; registry.fill(HIST("eventQA/after/centrality"), xaxis.centrality); registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); @@ -1326,7 +1308,7 @@ struct FlowGfwV02 { lastRun = run; LOGF(info, "run = %d", run); } - const XAxis xaxis{collision.multiplicity(), tracks.size()}; + const XAxis xaxis{.centrality = collision.multiplicity(), .multiplicity = static_cast(tracks.size())}; registry.fill(HIST("eventQA/after/centrality"), xaxis.centrality); registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); // processCollision(collision, tracks, xaxis, run); From ce898265e8c052de44836424724bfd50bab962c2 Mon Sep 17 00:00:00 2001 From: Maxim Virta Date: Tue, 4 Aug 2026 17:30:51 +0200 Subject: [PATCH 6/6] Linter fixes --- PWGCF/GenericFramework/Tasks/flowGfwV02.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 8d323ff9274..a0df917d6a0 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -106,7 +106,6 @@ struct FlowGfwV02 { float nchup = 300; std::vector centbinning{90}; int nBootstrap = 10; - std::vector> etagapsPtPt; GFWRegions regions; GFWCorrConfigs configs; std::vector multGlobalCorrCutPars;