From 475e966bba24a27c73e77c773433954e3168e0af Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Wed, 17 Sep 2025 22:14:48 +0200 Subject: [PATCH 1/7] Address linter warnings --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index 09a468e3880..e84af4da54e 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -52,6 +52,8 @@ #include "ReconstructionDataFormats/PID.h" #include "ReconstructionDataFormats/Track.h" +#include +#include #include #include #include From f51d13aaa70683013ec16e74684d2be366889443 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Wed, 17 Sep 2025 22:15:24 +0200 Subject: [PATCH 2/7] Address linter warnings --- PWGLF/Utils/strangenessBuilderModule.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PWGLF/Utils/strangenessBuilderModule.h b/PWGLF/Utils/strangenessBuilderModule.h index e49ed71f14b..d706a7fe690 100644 --- a/PWGLF/Utils/strangenessBuilderModule.h +++ b/PWGLF/Utils/strangenessBuilderModule.h @@ -13,12 +13,12 @@ /// \brief strangeness builder module /// \author ALICE -// simple checkers, but ensure 8 bit integers -#define BITSET(var, nbit) ((var) |= (static_cast(1) << static_cast(nbit))) - #ifndef PWGLF_UTILS_STRANGENESSBUILDERMODULE_H_ #define PWGLF_UTILS_STRANGENESSBUILDERMODULE_H_ +// simple checkers, but ensure 8 bit integers +#define BITSET(var, nbit) ((var) |= (static_cast(1) << static_cast(nbit))) + #include "TableHelper.h" #include "PWGLF/DataModel/LFStrangenessTables.h" @@ -34,6 +34,7 @@ #include "Framework/HistogramRegistry.h" #include "Framework/HistogramSpec.h" +#include #include #include #include @@ -531,7 +532,8 @@ class BuilderModule nEnabledTables = 0; - TString listOfRequestors[nTables]; + const int nTablesConst = nTables; // silence warning + TString listOfRequestors[nTablesConst]; for (int i = 0; i < nTables; i++) { int f = baseOpts.enabledTables->get(tableNames[i].c_str(), "enable"); if (f == 1) { From 322f99661bc586d6145a95e5b4123307341f294c Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Wed, 17 Sep 2025 22:19:08 +0200 Subject: [PATCH 3/7] Please consider the following formatting changes (#482) --- PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx | 4 ++-- PWGLF/Utils/strangenessBuilderModule.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx index e84af4da54e..d665eb6756c 100644 --- a/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx +++ b/PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx @@ -52,14 +52,14 @@ #include "ReconstructionDataFormats/PID.h" #include "ReconstructionDataFormats/Track.h" -#include -#include #include #include #include #include #include +#include #include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGLF/Utils/strangenessBuilderModule.h b/PWGLF/Utils/strangenessBuilderModule.h index d706a7fe690..85a24052992 100644 --- a/PWGLF/Utils/strangenessBuilderModule.h +++ b/PWGLF/Utils/strangenessBuilderModule.h @@ -34,12 +34,12 @@ #include "Framework/HistogramRegistry.h" #include "Framework/HistogramSpec.h" -#include #include #include #include #include #include +#include //__________________________________________ // strangeness builder module From 746ed625ef885a5fb5ababd69befb085fb01b0e9 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Thu, 18 Sep 2025 13:18:35 +0200 Subject: [PATCH 4/7] PDG to PDG_t --- PWGLF/Utils/strangenessBuilderModule.h | 70 +++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/PWGLF/Utils/strangenessBuilderModule.h b/PWGLF/Utils/strangenessBuilderModule.h index 85a24052992..661303813b7 100644 --- a/PWGLF/Utils/strangenessBuilderModule.h +++ b/PWGLF/Utils/strangenessBuilderModule.h @@ -34,12 +34,12 @@ #include "Framework/HistogramRegistry.h" #include "Framework/HistogramSpec.h" +#include #include #include #include #include #include -#include //__________________________________________ // strangeness builder module @@ -532,7 +532,7 @@ class BuilderModule nEnabledTables = 0; - const int nTablesConst = nTables; // silence warning + constexpr int nTablesConst = nTables; // silence warning TString listOfRequestors[nTablesConst]; for (int i = 0; i < nTables; i++) { int f = baseOpts.enabledTables->get(tableNames[i].c_str(), "enable"); @@ -988,10 +988,10 @@ class BuilderModule bool trackIsInteresting = false; if ( - (originParticle.pdgCode() == 310 && v0BuilderOpts.mc_addGeneratedK0Short.value > 0) || - (originParticle.pdgCode() == 3122 && v0BuilderOpts.mc_addGeneratedLambda.value > 0) || - (originParticle.pdgCode() == -3122 && v0BuilderOpts.mc_addGeneratedAntiLambda.value > 0) || - (originParticle.pdgCode() == 22 && v0BuilderOpts.mc_addGeneratedGamma.value > 0)) { + (originParticle.pdgCode() == PDG_t::kK0Short && v0BuilderOpts.mc_addGeneratedK0Short.value > 0) || + (originParticle.pdgCode() == PDG_t::kLambda0 && v0BuilderOpts.mc_addGeneratedLambda.value > 0) || + (originParticle.pdgCode() == PDG_t::kLambda0Bar && v0BuilderOpts.mc_addGeneratedAntiLambda.value > 0) || + (originParticle.pdgCode() == PDG_t::kGamma && v0BuilderOpts.mc_addGeneratedGamma.value > 0)) { trackIsInteresting = true; } if (!trackIsInteresting) { @@ -1041,7 +1041,7 @@ class BuilderModule currentV0Entry.pdgCode = positiveTrackIndex.pdgCode; currentV0Entry.particleId = positiveTrackIndex.originId; currentV0Entry.isCollinearV0 = false; - if (v0BuilderOpts.mc_addGeneratedGammaMakeCollinear.value && currentV0Entry.pdgCode == 22) { + if (v0BuilderOpts.mc_addGeneratedGammaMakeCollinear.value && currentV0Entry.pdgCode == PDG_t::kGamma) { currentV0Entry.isCollinearV0 = true; } currentV0Entry.found = false; @@ -1063,7 +1063,7 @@ class BuilderModule currentV0Entry.pdgCode = positiveTrackIndex.pdgCode; currentV0Entry.particleId = positiveTrackIndex.originId; currentV0Entry.isCollinearV0 = false; - if (v0BuilderOpts.mc_addGeneratedGammaMakeCollinear.value && currentV0Entry.pdgCode == 22) { + if (v0BuilderOpts.mc_addGeneratedGammaMakeCollinear.value && currentV0Entry.pdgCode == PDG_t::kGamma) { currentV0Entry.isCollinearV0 = true; } currentV0Entry.found = false; @@ -1139,10 +1139,10 @@ class BuilderModule bool trackIsInteresting = false; if ( - (originParticle.pdgCode() == 3312 && cascadeBuilderOpts.mc_addGeneratedXiMinus.value > 0) || - (originParticle.pdgCode() == -3312 && cascadeBuilderOpts.mc_addGeneratedXiPlus.value > 0) || - (originParticle.pdgCode() == 3334 && cascadeBuilderOpts.mc_addGeneratedOmegaMinus.value > 0) || - (originParticle.pdgCode() == -3334 && cascadeBuilderOpts.mc_addGeneratedOmegaPlus.value > 0)) { + (originParticle.pdgCode() == PDG_t::kXiMinus && cascadeBuilderOpts.mc_addGeneratedXiMinus.value > 0) || + (originParticle.pdgCode() == PDG_t::kXiPlusBar && cascadeBuilderOpts.mc_addGeneratedXiPlus.value > 0) || + (originParticle.pdgCode() == PDG_t::kOmegaMinus && cascadeBuilderOpts.mc_addGeneratedOmegaMinus.value > 0) || + (originParticle.pdgCode() == PDG_t::kOmegaPlusBar && cascadeBuilderOpts.mc_addGeneratedOmegaPlus.value > 0)) { trackIsInteresting = true; } if (!trackIsInteresting) { @@ -1162,7 +1162,7 @@ class BuilderModule for (size_t v0i = 0; v0i < v0List.size(); v0i++) { auto v0 = v0List[sorted_v0[v0i]]; - if (std::abs(v0.pdgCode) != 3122) { + if (std::abs(v0.pdgCode) != PDG_t::kLambda0) { continue; // this V0 isn't a lambda, can't come from a cascade: skip } if (v0.particleId < 0) { @@ -1184,7 +1184,7 @@ class BuilderModule } auto v0OriginParticle = mcParticles.rawIteratorAt(v0OriginParticleIndex); - if (std::abs(v0OriginParticle.pdgCode()) != 3312 && std::abs(v0OriginParticle.pdgCode()) != 3334) { + if (std::abs(v0OriginParticle.pdgCode()) != PDG_t::kXiMinus && std::abs(v0OriginParticle.pdgCode()) != PDG_t::kOmegaMinus) { continue; // this V0 does not come from any particle of interest, don't try } for (const auto& bachelorTrackIndex : bachelorTrackArray) { @@ -1695,10 +1695,10 @@ class BuilderModule continue; // skip secondary MC V0s if ( - (v0BuilderOpts.mc_addGeneratedK0Short && mcParticle.pdgCode() == 310) || - (v0BuilderOpts.mc_addGeneratedLambda && mcParticle.pdgCode() == 3122) || - (v0BuilderOpts.mc_addGeneratedAntiLambda && mcParticle.pdgCode() == -3122) || - (v0BuilderOpts.mc_addGeneratedGamma && mcParticle.pdgCode() == 22)) { + (v0BuilderOpts.mc_addGeneratedK0Short && mcParticle.pdgCode() == PDG_t::kK0Short) || + (v0BuilderOpts.mc_addGeneratedLambda && mcParticle.pdgCode() == PDG_t::kLambda0) || + (v0BuilderOpts.mc_addGeneratedAntiLambda && mcParticle.pdgCode() == PDG_t::kLambda0Bar) || + (v0BuilderOpts.mc_addGeneratedGamma && mcParticle.pdgCode() == PDG_t::kGamma)) { thisInfo.pdgCode = mcParticle.pdgCode(); thisInfo.isPhysicalPrimary = mcParticle.isPhysicalPrimary(); thisInfo.label = mcParticle.globalIndex(); @@ -1721,7 +1721,7 @@ class BuilderModule auto const& daughters = mcParticle.template daughters_as(); for (const auto& dau : daughters) { - if (dau.getProcess() != 4) + if (dau.getProcess() != TMCProcess::kPDecay) continue; if (dau.pdgCode() > 0) { @@ -2139,13 +2139,13 @@ class BuilderModule bool bbTag = false; if (bachTrack.has_mcParticle()) { auto bachelorParticle = bachTrack.template mcParticle_as(); - if (bachelorParticle.pdgCode() == 211) { // pi+, look for antiproton in negative prong + if (bachelorParticle.pdgCode() == PDG_t::kPiPlus) { // pi+, look for antiproton in negative prong if (negTrack.has_mcParticle()) { auto baryonParticle = negTrack.template mcParticle_as(); - if (baryonParticle.has_mothers() && bachelorParticle.has_mothers() && baryonParticle.pdgCode() == -2212) { + if (baryonParticle.has_mothers() && bachelorParticle.has_mothers() && baryonParticle.pdgCode() == PDG_t::kProtonBar) { for (const auto& baryonMother : baryonParticle.template mothers_as()) { for (const auto& pionMother : bachelorParticle.template mothers_as()) { - if (baryonMother.globalIndex() == pionMother.globalIndex() && baryonMother.pdgCode() == -3122) { + if (baryonMother.globalIndex() == pionMother.globalIndex() && baryonMother.pdgCode() == PDG_t::kLambda0Bar) { bbTag = true; } } @@ -2153,13 +2153,13 @@ class BuilderModule } } } // end if-pion - if (bachelorParticle.pdgCode() == -211) { // pi-, look for proton in positive prong + if (bachelorParticle.pdgCode() == PDG_t::kPiMinus) { // pi-, look for proton in positive prong if (posTrack.has_mcParticle()) { auto baryonParticle = posTrack.template mcParticle_as(); - if (baryonParticle.has_mothers() && bachelorParticle.has_mothers() && baryonParticle.pdgCode() == 2212) { + if (baryonParticle.has_mothers() && bachelorParticle.has_mothers() && baryonParticle.pdgCode() == PDG_t::kProton) { for (const auto& baryonMother : baryonParticle.template mothers_as()) { for (const auto& pionMother : bachelorParticle.template mothers_as()) { - if (baryonMother.globalIndex() == pionMother.globalIndex() && baryonMother.pdgCode() == 3122) { + if (baryonMother.globalIndex() == pionMother.globalIndex() && baryonMother.pdgCode() == PDG_t::kLambda0) { bbTag = true; } } @@ -2209,10 +2209,10 @@ class BuilderModule continue; // skip secondary MC cascades if ( - (cascadeBuilderOpts.mc_addGeneratedXiMinus && mcParticle.pdgCode() == 3312) || - (cascadeBuilderOpts.mc_addGeneratedXiPlus && mcParticle.pdgCode() == -3312) || - (cascadeBuilderOpts.mc_addGeneratedOmegaMinus && mcParticle.pdgCode() == 3334) || - (cascadeBuilderOpts.mc_addGeneratedOmegaPlus && mcParticle.pdgCode() == -3334)) { + (cascadeBuilderOpts.mc_addGeneratedXiMinus && mcParticle.pdgCode() == PDG_t::kXiMinus) || + (cascadeBuilderOpts.mc_addGeneratedXiPlus && mcParticle.pdgCode() == PDG_t::kXiPlusBar) || + (cascadeBuilderOpts.mc_addGeneratedOmegaMinus && mcParticle.pdgCode() == PDG_t::kOmegaMinus) || + (cascadeBuilderOpts.mc_addGeneratedOmegaPlus && mcParticle.pdgCode() == PDG_t::kOmegaPlusBar)) { thisCascInfo.pdgCode = mcParticle.pdgCode(); thisCascInfo.isPhysicalPrimary = mcParticle.isPhysicalPrimary(); @@ -2240,11 +2240,11 @@ class BuilderModule thisCascInfo.xyz[2] = dau.vz(); thisCascInfo.mcParticleBachelor = dau.globalIndex(); } - if (std::abs(dau.pdgCode()) == 2212) { + if (std::abs(dau.pdgCode()) == PDG_t::kProton) { thisCascInfo.pdgCodeV0 = dau.pdgCode(); for (const auto& v0Dau : dau.template daughters_as()) { - if (v0Dau.getProcess() != 4) + if (v0Dau.getProcess() != TMCProcess::kPDecay) continue; if (v0Dau.pdgCode() > 0) { @@ -2478,10 +2478,10 @@ class BuilderModule interlinks.cascadeToTraCascCores.push_back(products.tracascdata.lastIndex()); } if (baseOpts.mEnabledTables[kCascCovs]) { - std::array traCovMat = {0.}; + std::array traCovMat = {0.}; strangeTrackParCov.getCovXYZPxPyPzGlo(traCovMat); - float traCovMatArray[21]; - for (int ii = 0; ii < 21; ii++) { + float traCovMatArray[o2::track::kLabCovMatSize]; + for (int ii = 0; ii < o2::track::kLabCovMatSize; ii++) { traCovMatArray[ii] = traCovMat[ii]; } products.tracasccovs(traCovMatArray); @@ -2514,7 +2514,7 @@ class BuilderModule auto const& motherList = part.template mothers_as(); if (motherList.size() == 1) { for (const auto& mother : motherList) { - if (std::abs(part.pdgCode()) == 13 && treatPiToMuDecays) { + if (std::abs(part.pdgCode()) == PDG_t::kMuonMinus && treatPiToMuDecays) { // muon decay, de-ref mother twice if (mother.has_mothers()) { auto grandMotherList = mother.template mothers_as(); From 1024ac5bf402f34768574bd648262874c9f62b6f Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Thu, 18 Sep 2025 13:19:25 +0200 Subject: [PATCH 5/7] Please consider the following formatting changes (#483) --- PWGLF/Utils/strangenessBuilderModule.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Utils/strangenessBuilderModule.h b/PWGLF/Utils/strangenessBuilderModule.h index 661303813b7..d5379d866c8 100644 --- a/PWGLF/Utils/strangenessBuilderModule.h +++ b/PWGLF/Utils/strangenessBuilderModule.h @@ -34,12 +34,12 @@ #include "Framework/HistogramRegistry.h" #include "Framework/HistogramSpec.h" -#include #include #include #include #include #include +#include //__________________________________________ // strangeness builder module From 0f2af812e465dc3e4b0fbcc80978b35f89ece806 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Thu, 18 Sep 2025 13:25:53 +0200 Subject: [PATCH 6/7] Change var name --- PWGLF/Utils/strangenessBuilderModule.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Utils/strangenessBuilderModule.h b/PWGLF/Utils/strangenessBuilderModule.h index d5379d866c8..c20809c98bc 100644 --- a/PWGLF/Utils/strangenessBuilderModule.h +++ b/PWGLF/Utils/strangenessBuilderModule.h @@ -532,8 +532,8 @@ class BuilderModule nEnabledTables = 0; - constexpr int nTablesConst = nTables; // silence warning - TString listOfRequestors[nTablesConst]; + constexpr int kTablesConst = nTables; // silence warning + TString listOfRequestors[kTablesConst]; for (int i = 0; i < nTables; i++) { int f = baseOpts.enabledTables->get(tableNames[i].c_str(), "enable"); if (f == 1) { From 407a3991386fdb18b9946ae96bf962f807fae160 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Thu, 18 Sep 2025 13:31:19 +0200 Subject: [PATCH 7/7] Further PDG, TMCProcess --- PWGLF/Utils/strangenessBuilderModule.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Utils/strangenessBuilderModule.h b/PWGLF/Utils/strangenessBuilderModule.h index c20809c98bc..7319e29c04e 100644 --- a/PWGLF/Utils/strangenessBuilderModule.h +++ b/PWGLF/Utils/strangenessBuilderModule.h @@ -2227,10 +2227,10 @@ class BuilderModule if (mcParticle.has_daughters()) { auto const& daughters = mcParticle.template daughters_as(); for (const auto& dau : daughters) { - if (dau.getProcess() != 4) // check whether the daughter comes from a decay + if (dau.getProcess() != TMCProcess::kPDecay) // check whether the daughter comes from a decay continue; - if (std::abs(dau.pdgCode()) == 211 || std::abs(dau.pdgCode()) == 321) { + if (std::abs(dau.pdgCode()) == PDG_t::kPiPlus || std::abs(dau.pdgCode()) == PDG_t::kKPlus) { thisCascInfo.pdgCodeBachelor = dau.pdgCode(); thisCascInfo.bachP[0] = dau.px(); thisCascInfo.bachP[1] = dau.py();