From f0185fcdac056e3a84775eb700324c83e991b867 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sun, 10 May 2026 01:07:50 +0530 Subject: [PATCH 1/6] Added Lambda1520 to particle list Updated particle selection criteria and removed unused code. --- PWGLF/Tasks/QC/mcParticlePrediction.cxx | 36 +++++-------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/PWGLF/Tasks/QC/mcParticlePrediction.cxx b/PWGLF/Tasks/QC/mcParticlePrediction.cxx index 2f506ba14e5..57fc6d88ab3 100644 --- a/PWGLF/Tasks/QC/mcParticlePrediction.cxx +++ b/PWGLF/Tasks/QC/mcParticlePrediction.cxx @@ -57,7 +57,7 @@ using namespace o2::pwglf; // Particles static const std::vector parameterNames{"Enable"}; static constexpr int nParameters = 1; -static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; +static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; bool enabledParticlesArray[PIDExtended::NIDsTot]; // Estimators @@ -180,7 +180,6 @@ struct mcParticlePrediction { "Estimators enabled"}; Configurable selectInelGt0{"selectInelGt0", true, "Select only inelastic events"}; Configurable selectPrimaries{"selectPrimaries", true, "Select only primary particles"}; - Configurable rapidityCut{"rapidityCut", 0.5, "Select only particles within |y| < cut"}; Configurable requireCoincidenceEstimators{"requireCoincidenceEstimators", false, "Asks for a coincidence when two estimators are used"}; Configurable discardkIsGoodZvtxFT0vsPV{"discardkIsGoodZvtxFT0vsPV", false, "Select only collisions with matching BC and MC BC"}; Configurable discardMismatchedBCs{"discardMismatchedBCs", false, "Select only collisions with matching BC and MC BC"}; @@ -494,9 +493,9 @@ struct mcParticlePrediction { continue; } - // if (!particle.isPhysicalPrimary()) { - // continue; - // } + if (!particle.isPhysicalPrimary()) { + continue; + } TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode()); if (p) { @@ -507,28 +506,7 @@ struct mcParticlePrediction { } } - if (std::abs(particle.y()) >= rapidityCut) { - continue; - } - - // Check if particle has daughters (not a final state particle) - auto daughters = particle.daughters_as(); - bool isValid = false; - - if (daughters.size() > 0) { - isValid = true; - for (const auto& daughter : daughters) { - if (!daughter.isPhysicalPrimary()) { - isValid = false; - break; - } - } - } else { - // Final state particle - check if particle itself is physical primary - isValid = particle.isPhysicalPrimary(); - } - - if (!isValid) { + if (std::abs(particle.y()) > 0.5) { continue; } @@ -694,10 +672,10 @@ struct mcParticlePrediction { float nMultRecoMCBC[Estimators::nEstimators] = {0}; if (mcBC.has_ft0()) { const auto& ft0 = mcBC.ft0(); - for (const auto& amplitude : ft0.amplitudeA()) { + for (auto amplitude : ft0.amplitudeA()) { nMultRecoMCBC[Estimators::FT0A] += amplitude; } - for (const auto& amplitude : ft0.amplitudeC()) { + for (auto amplitude : ft0.amplitudeC()) { nMultRecoMCBC[Estimators::FT0C] += amplitude; } nMultRecoMCBC[Estimators::FT0AC] = nMultRecoMCBC[Estimators::FT0A] + nMultRecoMCBC[Estimators::FT0C]; From 755db7721f168e93e237218fc257d94b6fca22b5 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sun, 10 May 2026 01:08:41 +0530 Subject: [PATCH 2/6] Add Lambda1520 ID and update NIDsTot --- PWGLF/Utils/mcParticle.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PWGLF/Utils/mcParticle.h b/PWGLF/Utils/mcParticle.h index 657e696ec9a..745fcd94fbf 100644 --- a/PWGLF/Utils/mcParticle.h +++ b/PWGLF/Utils/mcParticle.h @@ -134,7 +134,8 @@ class PIDExtended static constexpr ID KstarPM = PIDCounts + 40; static constexpr ID Kshort = PIDCounts + 41; static constexpr ID Xi1530 = PIDCounts + 42; - static constexpr ID NIDsTot = PIDCounts + 43; + static constexpr ID Lambda1520 = PIDCounts + 43; + static constexpr ID NIDsTot = PIDCounts + 44; static constexpr const char* sNames[NIDsTot + 1] = { o2::track::pid_constants::sNames[Electron], // Electron @@ -199,6 +200,7 @@ class PIDExtended "KstarPM", // KstarPM "Kshort", // Kshort "Xi1530", // Xi1530 + "Lambda1520", // Lambda1520 nullptr}; static std::vector arrayNames() @@ -341,6 +343,8 @@ class PIDExtended return Kshort; case 3324: return Xi1530; + case 3124: + return Lambda1520; default: LOG(debug) << "Cannot identify particle with PDG code " << particle.pdgCode(); break; From 103d5de141866eca6703734ae66fd6e982fc02b8 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sun, 10 May 2026 01:13:39 +0530 Subject: [PATCH 3/6] Added Lambda1520 to the particle list From 93d2810ec4eef0860f5062e55f3c8ed82bb96530 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sun, 10 May 2026 01:16:01 +0530 Subject: [PATCH 4/6] Update defaultParticles initialization in mcParticlePrediction --- PWGLF/Tasks/QC/mcParticlePrediction.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/QC/mcParticlePrediction.cxx b/PWGLF/Tasks/QC/mcParticlePrediction.cxx index 57fc6d88ab3..8f379f525c3 100644 --- a/PWGLF/Tasks/QC/mcParticlePrediction.cxx +++ b/PWGLF/Tasks/QC/mcParticlePrediction.cxx @@ -57,7 +57,7 @@ using namespace o2::pwglf; // Particles static const std::vector parameterNames{"Enable"}; static constexpr int nParameters = 1; -static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; +static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; bool enabledParticlesArray[PIDExtended::NIDsTot]; // Estimators From 02504234a86f836ca35d6284ef3057775d545525 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sun, 10 May 2026 01:18:14 +0530 Subject: [PATCH 5/6] added Lambda1520 to particle list Updated particle filtering logic and added rapidity cut parameter. --- PWGLF/Tasks/QC/mcParticlePrediction.cxx | 36 ++++++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/QC/mcParticlePrediction.cxx b/PWGLF/Tasks/QC/mcParticlePrediction.cxx index 8f379f525c3..4f243ccbf21 100644 --- a/PWGLF/Tasks/QC/mcParticlePrediction.cxx +++ b/PWGLF/Tasks/QC/mcParticlePrediction.cxx @@ -57,7 +57,7 @@ using namespace o2::pwglf; // Particles static const std::vector parameterNames{"Enable"}; static constexpr int nParameters = 1; -static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; +static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; bool enabledParticlesArray[PIDExtended::NIDsTot]; // Estimators @@ -180,6 +180,7 @@ struct mcParticlePrediction { "Estimators enabled"}; Configurable selectInelGt0{"selectInelGt0", true, "Select only inelastic events"}; Configurable selectPrimaries{"selectPrimaries", true, "Select only primary particles"}; + Configurable rapidityCut{"rapidityCut", 0.5, "Select only particles within |y| < cut"}; Configurable requireCoincidenceEstimators{"requireCoincidenceEstimators", false, "Asks for a coincidence when two estimators are used"}; Configurable discardkIsGoodZvtxFT0vsPV{"discardkIsGoodZvtxFT0vsPV", false, "Select only collisions with matching BC and MC BC"}; Configurable discardMismatchedBCs{"discardMismatchedBCs", false, "Select only collisions with matching BC and MC BC"}; @@ -493,9 +494,9 @@ struct mcParticlePrediction { continue; } - if (!particle.isPhysicalPrimary()) { - continue; - } + // if (!particle.isPhysicalPrimary()) { + // continue; + // } TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode()); if (p) { @@ -506,7 +507,28 @@ struct mcParticlePrediction { } } - if (std::abs(particle.y()) > 0.5) { + if (std::abs(particle.y()) >= rapidityCut) { + continue; + } + + // Check if particle has daughters (not a final state particle) + auto daughters = particle.daughters_as(); + bool isValid = false; + + if (daughters.size() > 0) { + isValid = true; + for (const auto& daughter : daughters) { + if (!daughter.isPhysicalPrimary()) { + isValid = false; + break; + } + } + } else { + // Final state particle - check if particle itself is physical primary + isValid = particle.isPhysicalPrimary(); + } + + if (!isValid) { continue; } @@ -672,10 +694,10 @@ struct mcParticlePrediction { float nMultRecoMCBC[Estimators::nEstimators] = {0}; if (mcBC.has_ft0()) { const auto& ft0 = mcBC.ft0(); - for (auto amplitude : ft0.amplitudeA()) { + for (const auto& amplitude : ft0.amplitudeA()) { nMultRecoMCBC[Estimators::FT0A] += amplitude; } - for (auto amplitude : ft0.amplitudeC()) { + for (const auto& amplitude : ft0.amplitudeC()) { nMultRecoMCBC[Estimators::FT0C] += amplitude; } nMultRecoMCBC[Estimators::FT0AC] = nMultRecoMCBC[Estimators::FT0A] + nMultRecoMCBC[Estimators::FT0C]; From 7591c4700b40d386119d70b3abca253136ffc382 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sun, 10 May 2026 01:52:16 +0530 Subject: [PATCH 6/6] fix linter issues --- PWGLF/Tasks/QC/mcParticlePrediction.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/QC/mcParticlePrediction.cxx b/PWGLF/Tasks/QC/mcParticlePrediction.cxx index 4f243ccbf21..c190fe5a525 100644 --- a/PWGLF/Tasks/QC/mcParticlePrediction.cxx +++ b/PWGLF/Tasks/QC/mcParticlePrediction.cxx @@ -158,7 +158,7 @@ std::array, Estimators::nEstimators> hvertexPosZ; std::array, PIDExtended::NIDsTot>, Estimators::nEstimators> hpt; std::array, PIDExtended::NIDsTot>, Estimators::nEstimators> hyield; -struct mcParticlePrediction { +struct McParticlePrediction { // Histograms HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -195,6 +195,8 @@ struct mcParticlePrediction { Configurable enableVsEta05Histograms{"enableVsEta05Histograms", true, "Enables the correlation between ETA05 and other estimators"}; Configurable enableVsEta08Histograms{"enableVsEta08Histograms", true, "Enables the correlation between ETA08 and other estimators"}; Configurable enableVsImpactParameterHistograms{"enableVsImpactParameterHistograms", true, "Enables the correlation between impact parameter and other estimators"}; + Configurable cfgEvtZvtxCut{"cfgEvtZvtxCut", 10.0f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable chargetolerance{"chargetolerance", 1e-3, "Tolerance to consider a particle as charged based on its charge"}; Service pdgDB; o2::pwglf::ParticleCounter mCounter; @@ -456,7 +458,7 @@ struct mcParticlePrediction { } histos.fill(HIST("collisions/generated"), 1); - if (std::abs(mcCollision.posZ()) > 10.f) { + if (std::abs(mcCollision.posZ()) > cfgEvtZvtxCut) { return; } histos.fill(HIST("collisions/generated"), 2); @@ -500,7 +502,7 @@ struct mcParticlePrediction { TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode()); if (p) { - if (std::abs(p->Charge()) > 1e-3) { + if (std::abs(p->Charge()) > chargetolerance) { histos.fill(HIST("particles/eta/charged"), particle.eta()); } else { histos.fill(HIST("particles/eta/neutral"), particle.eta()); @@ -721,7 +723,7 @@ struct mcParticlePrediction { hestimatorsRecoEvVsBCId[i]->Fill(foundBCid, nMultReco[i]); } } - PROCESS_SWITCH(mcParticlePrediction, processReco, "Process the reco info", true); + PROCESS_SWITCH(McParticlePrediction, processReco, "Process the reco info", true); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; }