Skip to content

Commit 5b19637

Browse files
cnkosteralibuild
andauthored
[PWGCF] FlowSP: fix linter warning and memory issue (#13769)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent ac188d9 commit 5b19637

File tree

2 files changed

+44
-45
lines changed

2 files changed

+44
-45
lines changed

PWGCF/DataModel/SPTableZDC.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file SPTableZDC.h
13+
/// \author Noor Koster
14+
/// \since 11/2024
15+
/// \brief Table to hold Q-vectors and neccesary information for the ZDC q-vector calibration.
1316

1417
#ifndef PWGCF_DATAMODEL_SPTABLEZDC_H_
1518
#define PWGCF_DATAMODEL_SPTABLEZDC_H_

PWGCF/Flow/TableProducer/zdcQVectors.cxx

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ using namespace o2::framework::expressions;
6464
using namespace o2::aod::track;
6565
using namespace o2::aod::evsel;
6666
using namespace o2::aod::rctsel;
67+
using namespace o2::constants::math;
6768

6869
namespace o2::analysis::qvectortask
6970
{
@@ -217,8 +218,8 @@ struct ZdcQVectors {
217218
std::vector<const char*> sides = {"A", "C"};
218219
std::vector<const char*> capCOORDS = {"X", "Y"};
219220

220-
AxisSpec axisPsiA = {100, -M_PI, M_PI, "#Psi_{1} ZNA"};
221-
AxisSpec axisPsiC = {100, -M_PI, M_PI, "#Psi_{1} ZNC"};
221+
AxisSpec axisPsiA = {100, -PI, PI, "#Psi_{1} ZNA"};
222+
AxisSpec axisPsiC = {100, -PI, PI, "#Psi_{1} ZNC"};
222223

223224
// This is the only histogram that is AL~WA~YS filled.
224225
registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}});
@@ -258,7 +259,7 @@ struct ZdcQVectors {
258259
if (cfgFillHistRegistry) {
259260
registry.add<TH2>(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {axisPsiA, axisCent10});
260261
registry.add<TH2>(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {axisPsiC, axisCent10});
261-
registry.add<TH2>(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -M_PI, M_PI}, axisCent10});
262+
registry.add<TH2>(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -PI, PI}, axisCent10});
262263
for (const auto& side : sides) {
263264
registry.add<TH2>(Form("QA/before/hZN%s_Qx_vs_Qy", side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ});
264265
}
@@ -375,30 +376,6 @@ struct ZdcQVectors {
375376
{
376377
registry.fill(HIST("hEventCount"), evSel);
377378
// FT0C is the default centrality estimator
378-
auto cent = collision.centFT0C();
379-
cents.push_back(collision.centFT0C());
380-
381-
if (cfgFT0Cvariant1) {
382-
if (cfgUseSecondCent)
383-
cent = collision.centFT0CVariant1();
384-
cents.push_back(collision.centFT0CVariant1());
385-
}
386-
if (cfgFT0M) {
387-
if (cfgUseSecondCent)
388-
cent = collision.centFT0M();
389-
cents.push_back(collision.centFT0M());
390-
}
391-
if (cfgFV0A) {
392-
if (cfgUseSecondCent)
393-
cent = collision.centFV0A();
394-
cents.push_back(collision.centFV0A());
395-
}
396-
if (cfgNGlobal) {
397-
if (cfgUseSecondCent)
398-
cent = collision.centNGlobal();
399-
cents.push_back(collision.centNGlobal());
400-
}
401-
centrality = cent;
402379

403380
if (!cfgFillCutAnalysis || cfgFillNothing)
404381
return;
@@ -407,16 +384,16 @@ struct ZdcQVectors {
407384
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", runnumber), evSel, collision.posY());
408385
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", runnumber), evSel, collision.posZ());
409386

410-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNA(), 1);
411-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[0], 1);
412-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[1], 1);
413-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[2], 1);
414-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[3], 1);
415-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNC(), 1);
416-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[0], 1);
417-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[1], 1);
418-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[2], 1);
419-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[3], 1);
387+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(centrality, evSel, zdcBC.energyCommonZNA(), 1);
388+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[0], 1);
389+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[1], 1);
390+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[2], 1);
391+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[3], 1);
392+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(centrality, evSel, zdcBC.energyCommonZNC(), 1);
393+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[0], 1);
394+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[1], 1);
395+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[2], 1);
396+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[3], 1);
420397
}
421398

422399
template <typename TCollision, typename TBunchCrossing>
@@ -677,17 +654,36 @@ struct ZdcQVectors {
677654

678655
isSelected = true;
679656

657+
std::vector<float> centralities;
658+
680659
auto cent = collision.centFT0C();
681-
if (cfgFT0Cvariant1)
682-
cent = collision.centFT0CVariant1();
683-
if (cfgFT0M)
684-
cent = collision.centFT0M();
685-
if (cfgFV0A)
686-
cent = collision.centFV0A();
687-
if (cfgNGlobal)
688-
cent = collision.centNGlobal();
660+
centrality = cent;
661+
662+
centralities.push_back(collision.centFT0C());
663+
664+
if (cfgFT0Cvariant1) {
665+
centralities.push_back(collision.centFT0CVariant1());
666+
if (cfgUseSecondCent)
667+
cent = collision.centFT0CVariant1();
668+
}
669+
if (cfgFT0M) {
670+
centralities.push_back(collision.centFT0M());
671+
if (cfgUseSecondCent)
672+
cent = collision.centFT0M();
673+
}
674+
if (cfgFV0A) {
675+
centralities.push_back(collision.centFV0A());
676+
if (cfgUseSecondCent)
677+
cent = collision.centFV0A();
678+
}
679+
if (cfgNGlobal) {
680+
centralities.push_back(collision.centNGlobal());
681+
if (cfgUseSecondCent)
682+
cent = collision.centNGlobal();
683+
}
689684

690685
v = {collision.posX(), collision.posY(), collision.posZ()};
686+
cents = centralities;
691687

692688
const auto& foundBC = collision.foundBC_as<BCsRun3>();
693689
runnumber = foundBC.runNumber();

0 commit comments

Comments
 (0)