From 500d2679a4c315f82573ad599b8b4e57cb28acdf Mon Sep 17 00:00:00 2001 From: GiorgioAlbertoLucia Date: Tue, 18 Nov 2025 16:16:57 +0100 Subject: [PATCH 1/2] added checks on mcprocess --- PWGLF/DataModel/LFSlimNucleiTables.h | 2 ++ PWGLF/TableProducer/QC/nucleiQC.cxx | 43 ++++++++++++++++------------ PWGLF/Utils/nucleiUtils.h | 3 ++ 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/PWGLF/DataModel/LFSlimNucleiTables.h b/PWGLF/DataModel/LFSlimNucleiTables.h index 5f14cf5ab46..6a8725aa876 100644 --- a/PWGLF/DataModel/LFSlimNucleiTables.h +++ b/PWGLF/DataModel/LFSlimNucleiTables.h @@ -54,6 +54,7 @@ DECLARE_SOA_COLUMN(PDGcode, pdgCode, int); DECLARE_SOA_COLUMN(MotherPDGcode, MotherpdgCode, int); DECLARE_SOA_COLUMN(MotherDecRad, motherDecRad, float); DECLARE_SOA_COLUMN(AbsoDecL, absoDecL, float); +DECLARE_SOA_COLUMN(McProcess, mcProcess, uint64_t); } // namespace NucleiTableNS @@ -197,6 +198,7 @@ DECLARE_SOA_TABLE(NucleiTableRed, "AOD", "NUCLEITABLERED", NucleiTableNS::DCAxy, NucleiTableNS::DCAz, NucleiTableNS::Flags, + NucleiTableNS::McProcess, NucleiTableNS::PDGcode, NucleiTableNS::MotherPDGcode); diff --git a/PWGLF/TableProducer/QC/nucleiQC.cxx b/PWGLF/TableProducer/QC/nucleiQC.cxx index b35082367a7..6cc77d2be5f 100644 --- a/PWGLF/TableProducer/QC/nucleiQC.cxx +++ b/PWGLF/TableProducer/QC/nucleiQC.cxx @@ -22,9 +22,9 @@ #include "Common/Core/PID/PIDTOF.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -52,6 +52,7 @@ #include "Math/Vector4D.h" #include "TRandom3.h" +#include "TMCProcess.h" #include #include @@ -222,27 +223,31 @@ struct nucleiQC { void fillNucleusFlagsPdgsMc(const Tparticle& particle, nuclei::SlimCandidate& candidate) { candidate.pdgCode = particle.pdgCode(); + candidate.mcProcess = particle.getProcess(); - if (particle.isPhysicalPrimary()) { - candidate.flags |= nuclei::Flags::kIsPhysicalPrimary; - - // heavy flavour mother - // if (particle.has_mothers()) { - // for (const auto& motherparticle : particle.mothers_as()) { - // if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) { - // flags |= kIsSecondaryFromWeakDecay; - // motherPdgCode = motherparticle.pdgCode(); - // break; - // } - // } - //} - - } else if (particle.has_mothers()) { - candidate.flags |= nuclei::Flags::kIsSecondaryFromWeakDecay; + if (particle.has_mothers()) { for (const auto& motherparticle : particle.template mothers_as()) { candidate.motherPdgCode = motherparticle.pdgCode(); } + } + if (particle.isPhysicalPrimary()) { + candidate.flags |= nuclei::Flags::kIsPhysicalPrimary; + + ///< heavy flavour mother + /*if (particle.has_mothers()) { + for (const auto& motherparticle : particle.mothers_as()) { + if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) { + flags |= kIsSecondaryFromWeakDecay; + motherPdgCode = motherparticle.pdgCode(); + break; + } + } + }*/ + + } else if (particle.getProcess() == TMCProcess::kPDecay) { + ///< assuming that strong decays are included in the previous step + candidate.flags |= nuclei::Flags::kIsSecondaryFromWeakDecay; } else { candidate.flags |= nuclei::Flags::kIsSecondaryFromMaterial; } @@ -329,7 +334,8 @@ struct nucleiQC { .ptGenerated = 0.f, // to be filled for mc .etaGenerated = 0.f, .phiGenerated = 0.f, - .centrality = nuclei::getCentrality(collision, cfgCentralityEstimator)}; + .centrality = nuclei::getCentrality(collision, cfgCentralityEstimator), + .mcProcess = TMCProcess::kPNoProcess}; fillDcaInformation(collision, track, candidate); fillNucleusFlagsPdgs(iSpecies, collision, track, candidate); @@ -486,6 +492,7 @@ struct nucleiQC { candidate.DCAxy, candidate.DCAz, candidate.flags, + candidate.mcProcess, candidate.pdgCode, candidate.motherPdgCode); } diff --git a/PWGLF/Utils/nucleiUtils.h b/PWGLF/Utils/nucleiUtils.h index 9f98c60e69a..66cc1cb7318 100644 --- a/PWGLF/Utils/nucleiUtils.h +++ b/PWGLF/Utils/nucleiUtils.h @@ -24,6 +24,8 @@ #include "Framework/HistogramRegistry.h" #include "Framework/HistogramSpec.h" +#include "TMCProcess.h" + #include #include #include @@ -103,6 +105,7 @@ struct SlimCandidate { float etaGenerated = -999.f; float phiGenerated = -999.f; float centrality = -1.f; + uint64_t mcProcess = TMCProcess::kPNoProcess; }; enum Species { From 3eb8a8cba0868774b35f24bd34936332fff3127b Mon Sep 17 00:00:00 2001 From: GiorgioAlbertoLucia Date: Tue, 18 Nov 2025 16:18:17 +0100 Subject: [PATCH 2/2] clang format --- PWGLF/TableProducer/QC/nucleiQC.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/QC/nucleiQC.cxx b/PWGLF/TableProducer/QC/nucleiQC.cxx index 6cc77d2be5f..0c329807f5e 100644 --- a/PWGLF/TableProducer/QC/nucleiQC.cxx +++ b/PWGLF/TableProducer/QC/nucleiQC.cxx @@ -22,9 +22,9 @@ #include "Common/Core/PID/PIDTOF.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -51,8 +51,8 @@ #include "ReconstructionDataFormats/Track.h" #include "Math/Vector4D.h" -#include "TRandom3.h" #include "TMCProcess.h" +#include "TRandom3.h" #include #include