From 265ae68cb8e8879a54eb8293e7ba499392328791 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Mon, 10 Nov 2025 20:19:26 +0100 Subject: [PATCH 1/3] Fix linter warning --- PWGCF/DataModel/SPTableZDC.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index a6bbae827c6..7eac2e0c352 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -10,6 +10,10 @@ // or submit itself to any jurisdiction. /// \file SPTableZDC.h +/// \author Noor Koster +/// \since 11/2024 +/// \brief Table to hold Q-vectors and neccesary information for the ZDC q-vector calibration. + #ifndef PWGCF_DATAMODEL_SPTABLEZDC_H_ #define PWGCF_DATAMODEL_SPTABLEZDC_H_ From 538bdaeead776c4cee18dc065fa68847bda9f7ea Mon Sep 17 00:00:00 2001 From: cnkoster Date: Mon, 10 Nov 2025 20:19:55 +0100 Subject: [PATCH 2/3] Fix memory leak in vector --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 86 +++++++++++------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index dbba6da0ece..8dd8cedd520 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -64,6 +64,7 @@ using namespace o2::framework::expressions; using namespace o2::aod::track; using namespace o2::aod::evsel; using namespace o2::aod::rctsel; +using namespace o2::constants::math; namespace o2::analysis::qvectortask { @@ -217,8 +218,8 @@ struct ZdcQVectors { std::vector sides = {"A", "C"}; std::vector capCOORDS = {"X", "Y"}; - AxisSpec axisPsiA = {100, -M_PI, M_PI, "#Psi_{1} ZNA"}; - AxisSpec axisPsiC = {100, -M_PI, M_PI, "#Psi_{1} ZNC"}; + AxisSpec axisPsiA = {100, -PI, PI, "#Psi_{1} ZNA"}; + AxisSpec axisPsiC = {100, -PI, PI, "#Psi_{1} ZNC"}; // This is the only histogram that is AL~WA~YS filled. registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); @@ -258,7 +259,7 @@ struct ZdcQVectors { if (cfgFillHistRegistry) { registry.add(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {axisPsiA, axisCent10}); registry.add(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {axisPsiC, axisCent10}); - registry.add(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -M_PI, M_PI}, axisCent10}); + registry.add(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -PI, PI}, axisCent10}); for (const auto& side : sides) { registry.add(Form("QA/before/hZN%s_Qx_vs_Qy", side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); } @@ -375,30 +376,6 @@ struct ZdcQVectors { { registry.fill(HIST("hEventCount"), evSel); // FT0C is the default centrality estimator - auto cent = collision.centFT0C(); - cents.push_back(collision.centFT0C()); - - if (cfgFT0Cvariant1) { - if (cfgUseSecondCent) - cent = collision.centFT0CVariant1(); - cents.push_back(collision.centFT0CVariant1()); - } - if (cfgFT0M) { - if (cfgUseSecondCent) - cent = collision.centFT0M(); - cents.push_back(collision.centFT0M()); - } - if (cfgFV0A) { - if (cfgUseSecondCent) - cent = collision.centFV0A(); - cents.push_back(collision.centFV0A()); - } - if (cfgNGlobal) { - if (cfgUseSecondCent) - cent = collision.centNGlobal(); - cents.push_back(collision.centNGlobal()); - } - centrality = cent; if (!cfgFillCutAnalysis || cfgFillNothing) return; @@ -407,16 +384,16 @@ struct ZdcQVectors { registry.get(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", runnumber), evSel, collision.posY()); registry.get(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", runnumber), evSel, collision.posZ()); - registry.get(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNA(), 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[0], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[1], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[2], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[3], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNC(), 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[0], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[1], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[2], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[3], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(centrality, evSel, zdcBC.energyCommonZNA(), 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[0], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[1], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[2], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[3], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(centrality, evSel, zdcBC.energyCommonZNC(), 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[0], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[1], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[2], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[3], 1); } template @@ -677,17 +654,36 @@ struct ZdcQVectors { isSelected = true; + std::vector centralities; + auto cent = collision.centFT0C(); - if (cfgFT0Cvariant1) - cent = collision.centFT0CVariant1(); - if (cfgFT0M) - cent = collision.centFT0M(); - if (cfgFV0A) - cent = collision.centFV0A(); - if (cfgNGlobal) - cent = collision.centNGlobal(); + centrality = cent; + + centralities.push_back(collision.centFT0C()); + + if (cfgFT0Cvariant1){ + centralities.push_back(collision.centFT0CVariant1()); + if (cfgUseSecondCent) + cent = collision.centFT0CVariant1(); + } + if (cfgFT0M){ + centralities.push_back(collision.centFT0M()); + if (cfgUseSecondCent) + cent = collision.centFT0M(); + } + if (cfgFV0A){ + centralities.push_back(collision.centFV0A()); + if (cfgUseSecondCent) + cent = collision.centFV0A(); + } + if (cfgNGlobal){ + centralities.push_back(collision.centNGlobal()); + if (cfgUseSecondCent) + cent = collision.centNGlobal(); + } v = {collision.posX(), collision.posY(), collision.posZ()}; + cents = centralities; const auto& foundBC = collision.foundBC_as(); runnumber = foundBC.runNumber(); From bb60b09c79d7443778fa4658953c950b3c67c487 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 10 Nov 2025 21:17:03 +0000 Subject: [PATCH 3/3] Please consider the following formatting changes --- PWGCF/DataModel/SPTableZDC.h | 3 +-- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index 7eac2e0c352..6e732ee562e 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -12,8 +12,7 @@ /// \file SPTableZDC.h /// \author Noor Koster /// \since 11/2024 -/// \brief Table to hold Q-vectors and neccesary information for the ZDC q-vector calibration. - +/// \brief Table to hold Q-vectors and neccesary information for the ZDC q-vector calibration. #ifndef PWGCF_DATAMODEL_SPTABLEZDC_H_ #define PWGCF_DATAMODEL_SPTABLEZDC_H_ diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 8dd8cedd520..64ae1362838 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -661,22 +661,22 @@ struct ZdcQVectors { centralities.push_back(collision.centFT0C()); - if (cfgFT0Cvariant1){ + if (cfgFT0Cvariant1) { centralities.push_back(collision.centFT0CVariant1()); if (cfgUseSecondCent) cent = collision.centFT0CVariant1(); } - if (cfgFT0M){ + if (cfgFT0M) { centralities.push_back(collision.centFT0M()); if (cfgUseSecondCent) cent = collision.centFT0M(); } - if (cfgFV0A){ + if (cfgFV0A) { centralities.push_back(collision.centFV0A()); if (cfgUseSecondCent) cent = collision.centFV0A(); } - if (cfgNGlobal){ + if (cfgNGlobal) { centralities.push_back(collision.centNGlobal()); if (cfgUseSecondCent) cent = collision.centNGlobal();