From 3663480b2991cbd99d9ffd3f88a00f0d091b3b7a Mon Sep 17 00:00:00 2001 From: gianniliveraro Date: Sun, 7 Dec 2025 12:16:23 -0300 Subject: [PATCH 1/4] Minor changes in sigma0 tasks --- PWGLF/DataModel/LFSigmaTables.h | 12 ++-- .../Strangeness/sigma0builder.cxx | 4 +- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 57 ++++++++++++------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/PWGLF/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 5f7307c3010..393ed3a36b9 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -481,14 +481,16 @@ namespace sigma0Gen { DECLARE_SOA_COLUMN(IsSigma0, isSigma0, bool); // true: sigma0, false: antisigma0 DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); -DECLARE_SOA_COLUMN(Sigma0MCPt, sigma0MCPt, float); // MC pT +DECLARE_SOA_COLUMN(MCPt, mcpt, float); // MC pT +DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y } // namespace sigma0Gen DECLARE_SOA_TABLE(Sigma0Gens, "AOD", "SIGMA0GENS", sigma0Gen::IsSigma0, sigma0Gen::ProducedByGenerator, - sigma0Gen::Sigma0MCPt); + sigma0Gen::MCPt, + sigma0Gen::MCY); DECLARE_SOA_TABLE(SigmaCollRef, "AOD", "SIGMACOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraCollisionId); @@ -859,12 +861,14 @@ DECLARE_SOA_TABLE(Pi0CollRef, "AOD", "PI0COLLREF", //! optional table to refer b namespace pi0Gen { DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); -DECLARE_SOA_COLUMN(Pi0MCPt, pi0MCPt, float); // MC pT +DECLARE_SOA_COLUMN(MCPt, mcpt, float); // MC pT +DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y } // namespace pi0Gen DECLARE_SOA_TABLE(Pi0Gens, "AOD", "PI0GENS", pi0Gen::ProducedByGenerator, - pi0Gen::Pi0MCPt); + pi0Gen::MCPt, + pi0Gen::MCY); DECLARE_SOA_TABLE(Pi0GenCollRef, "AOD", "PI0GENCOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraMCCollisionId); diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index 033b5d46b15..5335235327a 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -1259,13 +1259,13 @@ struct sigma0builder { // Fill tables // Pi0 if (fillPi0Tables && MCGenInfo.IsPi0) { - pi0Gens(MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt); // optional table to store generated pi0 candidates. Be careful, this is a large table! + pi0Gens(MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt, mcParticle.y()); // optional table to store generated pi0 candidates. Be careful, this is a large table! pi0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table } // Sigma0/ASigma0 if (fillSigma0Tables && (MCGenInfo.IsSigma0 || MCGenInfo.IsAntiSigma0)) { - sigma0Gens(MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt); + sigma0Gens(MCGenInfo.IsSigma0, MCGenInfo.IsProducedByGenerator, MCGenInfo.MCPt, mcParticle.y()); sigma0GenCollRefs(MCGenInfo.MCCollId); // link to stramccollision table } } diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 9d826448de9..ff7d057c693 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -59,7 +59,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using MCSigma0s = soa::Join; +using MCSigma0s = soa::Join; using Sigma0s = soa::Join; static const std::vector PhotonSels = {"NoSel", "V0Type", "DCADauToPV", @@ -124,7 +124,13 @@ struct sigmaanalysis { } eventSelections; // Generated Sigma0s - Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."}; + struct : ConfigurableGroup { + std::string prefix = "genSelections"; // JSON group name + Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."}; + Configurable mc_rapidityMin{"mc_rapidityMin", -0.5, "Min generated particle rapidity"}; + Configurable mc_rapidityMax{"mc_rapidityMax", 0.5, "Max generated particle rapidity"}; + } genSelections; + // QA Configurable fdoSigma0QA{"doSigma0QA", false, "if true, perform Sigma0 QA analysis. Only works with MC."}; @@ -545,7 +551,8 @@ struct sigmaanalysis { histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - } else { // Pi0 specific + } + if (doprocessPi0GeneratedRun3) { // Pi0 specific histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenPi0VsMultMC", "h2dGenPi0VsMultMC", kTH2D, {axisNch, axisPt}); @@ -813,8 +820,12 @@ struct sigmaanalysis { continue; } + // Rapidity selection + if ((genParticle.mcy() < genSelections.mc_rapidityMin) || (genParticle.mcy() > genSelections.mc_rapidityMax)) + continue; + // Selection on the source (generator/transport) - if (!genParticle.producedByGenerator() && mc_keepOnlyFromGenerator) + if (!genParticle.producedByGenerator() && genSelections.mc_keepOnlyFromGenerator) continue; // Select corresponding mc collision && Basic event selection @@ -834,33 +845,35 @@ struct sigmaanalysis { //______________________________________________________________________________ // Generated Sigma0 processing - if constexpr (requires { genParticle.sigma0MCPt(); }) { + if constexpr (requires { genParticle.isSigma0(); }) { + if (doprocessGeneratedRun3) { - float ptmc = genParticle.sigma0MCPt(); + float ptmc = genParticle.mcpt(); - if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { - auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); - centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { + auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); + centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); - if (genParticle.isSigma0()) - histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + if (genParticle.isSigma0()) + histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); - else - histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); - } + else + histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } - if (genParticle.isSigma0()) { - histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc); - histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); - } else { - histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc); - histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + if (genParticle.isSigma0()) { + histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc); + histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + } else { + histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc); + histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + } } } //______________________________________________________________________________ // Generated Pi0 processing - if constexpr (requires { genParticle.pi0MCPt(); }) { - float ptmc = genParticle.pi0MCPt(); + if (doprocessPi0GeneratedRun3) { + float ptmc = genParticle.mcpt(); if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); From 6ca187f5ebf43d50c737d0e836c0b3d91c5b9331 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 7 Dec 2025 15:23:49 +0000 Subject: [PATCH 2/4] Please consider the following formatting changes --- PWGLF/DataModel/LFSigmaTables.h | 4 ++-- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/PWGLF/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 393ed3a36b9..521759750a7 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -482,7 +482,7 @@ namespace sigma0Gen DECLARE_SOA_COLUMN(IsSigma0, isSigma0, bool); // true: sigma0, false: antisigma0 DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); DECLARE_SOA_COLUMN(MCPt, mcpt, float); // MC pT -DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y +DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y } // namespace sigma0Gen @@ -862,7 +862,7 @@ namespace pi0Gen { DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); DECLARE_SOA_COLUMN(MCPt, mcpt, float); // MC pT -DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y +DECLARE_SOA_COLUMN(MCY, mcy, float); // MC Y } // namespace pi0Gen DECLARE_SOA_TABLE(Pi0Gens, "AOD", "PI0GENS", diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index ff7d057c693..8ab16f7f787 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -130,7 +130,6 @@ struct sigmaanalysis { Configurable mc_rapidityMin{"mc_rapidityMin", -0.5, "Min generated particle rapidity"}; Configurable mc_rapidityMax{"mc_rapidityMax", 0.5, "Max generated particle rapidity"}; } genSelections; - // QA Configurable fdoSigma0QA{"doSigma0QA", false, "if true, perform Sigma0 QA analysis. Only works with MC."}; @@ -550,8 +549,7 @@ struct sigmaanalysis { histos.add("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt", "h2dGenAntiSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - - } + } if (doprocessPi0GeneratedRun3) { // Pi0 specific histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt}); From f2003e7203bb32bc1f1edf58ab67ee8d0d581131 Mon Sep 17 00:00:00 2001 From: gianniliveraro Date: Sun, 7 Dec 2025 12:39:47 -0300 Subject: [PATCH 3/4] Megalinter happiness --- .../TableProducer/Strangeness/sigma0builder.cxx | 2 ++ PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index 5335235327a..d2a1641d263 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -1961,3 +1962,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } + diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 8ab16f7f787..aa61093a98d 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -49,6 +49,8 @@ #include #include +#include +#include #include #include #include @@ -130,6 +132,7 @@ struct sigmaanalysis { Configurable mc_rapidityMin{"mc_rapidityMin", -0.5, "Min generated particle rapidity"}; Configurable mc_rapidityMax{"mc_rapidityMax", 0.5, "Max generated particle rapidity"}; } genSelections; + // QA Configurable fdoSigma0QA{"doSigma0QA", false, "if true, perform Sigma0 QA analysis. Only works with MC."}; @@ -549,7 +552,8 @@ struct sigmaanalysis { histos.add("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt", "h2dGenAntiSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - } + + } if (doprocessPi0GeneratedRun3) { // Pi0 specific histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt}); @@ -1221,7 +1225,7 @@ struct sigmaanalysis { "TPCTOFPID", "DCADauToPV", "Mass"}; if (PDGRequired == 22) { - if constexpr (selection_index >= 0 && selection_index < (int)std::size(PhotonSelsLocal)) { + if constexpr (selection_index >= 0 && selection_index < static_cast(std::size(PhotonSelsLocal))) { histos.fill(HIST("Selection/Photon/hCandidateSel"), selection_index); histos.fill(HIST("Selection/Photon/h2d") + HIST(PhotonSelsLocal[selection_index]), sigma.photonPt(), sigma.photonMass()); histos.fill(HIST("Selection/Sigma0/h2dPhoton") + HIST(PhotonSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass()); @@ -1229,7 +1233,7 @@ struct sigmaanalysis { } if (PDGRequired == 3122) { - if constexpr (selection_index >= 0 && selection_index < (int)std::size(LambdaSelsLocal)) { + if constexpr (selection_index >= 0 && selection_index < static_cast(std::size(LambdaSelsLocal))) { histos.fill(HIST("Selection/Lambda/hCandidateSel"), selection_index); histos.fill(HIST("Selection/Lambda/h2d") + HIST(LambdaSelsLocal[selection_index]), sigma.lambdaPt(), sigma.lambdaMass()); histos.fill(HIST("Selection/Sigma0/h2dLambda") + HIST(LambdaSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass()); @@ -1263,9 +1267,8 @@ struct sigmaanalysis { auto sigma0mc = fullSigma0s.rawIteratorAt(sigma0Index[mcid]); histos.fill(HIST("Sigma0QA/hDuplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed - if (sigma0mc.isSigma0()) { - } - histos.fill(HIST("Sigma0QA/hSigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed + if (sigma0mc.isSigma0()) + histos.fill(HIST("Sigma0QA/hSigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed if (sigma0mc.isAntiSigma0()) histos.fill(HIST("Sigma0QA/hASigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed @@ -1730,3 +1733,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } + From db1bb86a981cd5c219185ce61d303617a4237d7a Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 7 Dec 2025 15:40:31 +0000 Subject: [PATCH 4/4] Please consider the following formatting changes --- PWGLF/TableProducer/Strangeness/sigma0builder.cxx | 3 +-- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index d2a1641d263..dcbf8f8f31c 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -51,11 +51,11 @@ #include #include -#include #include #include #include #include +#include using namespace o2; using namespace o2::framework; @@ -1962,4 +1962,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } - diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index aa61093a98d..3b6bd0b0730 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -49,12 +49,12 @@ #include #include -#include -#include #include #include #include #include +#include +#include using namespace o2; using namespace o2::framework; @@ -132,7 +132,6 @@ struct sigmaanalysis { Configurable mc_rapidityMin{"mc_rapidityMin", -0.5, "Min generated particle rapidity"}; Configurable mc_rapidityMax{"mc_rapidityMax", 0.5, "Max generated particle rapidity"}; } genSelections; - // QA Configurable fdoSigma0QA{"doSigma0QA", false, "if true, perform Sigma0 QA analysis. Only works with MC."}; @@ -552,8 +551,7 @@ struct sigmaanalysis { histos.add("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt", "h2dGenAntiSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - - } + } if (doprocessPi0GeneratedRun3) { // Pi0 specific histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt}); @@ -1267,7 +1265,7 @@ struct sigmaanalysis { auto sigma0mc = fullSigma0s.rawIteratorAt(sigma0Index[mcid]); histos.fill(HIST("Sigma0QA/hDuplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed - if (sigma0mc.isSigma0()) + if (sigma0mc.isSigma0()) histos.fill(HIST("Sigma0QA/hSigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed if (sigma0mc.isAntiSigma0()) @@ -1733,4 +1731,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } -