From 5aeb2cb2f9e16ee5d3dd8ab85dfbb773b9043d93 Mon Sep 17 00:00:00 2001 From: Anton Riedel Date: Tue, 10 Nov 2026 22:30:57 +0100 Subject: [PATCH] Feat: add kinematic cuts on mother particles --- PWGCF/Femto/Core/particleCleaner.h | 39 +++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index f284385cce9..cf354ffdcb6 100644 --- a/PWGCF/Femto/Core/particleCleaner.h +++ b/PWGCF/Femto/Core/particleCleaner.h @@ -16,6 +16,7 @@ #ifndef PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ #define PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ +#include #include #include @@ -34,6 +35,18 @@ struct ConfParticleCleaner : o2::framework::ConfigurableGroup { o2::framework::Configurable rejectParticleWithoutMcPartonicMother{"rejectParticleWithoutMcPartonicMother", false, "If true, particles which have no associated partonic mother are rejected"}; o2::framework::Configurable> requiredMotherPdgCodes{"requiredMotherPdgCodes", {}, "Only consider particles whose mothers have one of the supplied pdg codes (including the sign!)"}; o2::framework::Configurable> rejectMotherPdgCodes{"rejectMotherPdgCodes", {}, "Only consider particles whose mothers do not have one of the supplied pdg codes (including the sign!)"}; + // Kinematic window on the mother itself (e.g. to select on the Delta++'s own pt/eta/phi, not + // just its pdg code). There is only ONE window here, not one per entry in + // requiredMotherPdgCodes/rejectMotherPdgCodes above: whichever mother pdg code ends up being + // allowed by those two lists, this same pt/eta/phi range is what its kinematics are checked + // against -- the window does not vary per pdg code. Defaults are wide open (no-op) like every + // other kinematic window in this codebase, so setting these has no effect unless narrowed. + o2::framework::Configurable motherPtMin{"motherPtMin", 0.f, "Minimum pT of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched"}; + o2::framework::Configurable motherPtMax{"motherPtMax", 1e6f, "Maximum pT of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched"}; + o2::framework::Configurable motherEtaMin{"motherEtaMin", -1e6f, "Minimum eta of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched"}; + o2::framework::Configurable motherEtaMax{"motherEtaMax", 1e6f, "Maximum eta of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched"}; + o2::framework::Configurable motherPhiMin{"motherPhiMin", 0.f, "Minimum phi of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched"}; + o2::framework::Configurable motherPhiMax{"motherPhiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched -- not one window per pdg code."}; o2::framework::Configurable> requiredPartonicMotherPdgCodes{"requiredPartonicMotherPdgCodes", {}, "Only consider particles whose partonic mothers have one of the supplied pdg codes (including the sign!)"}; o2::framework::Configurable> rejectPartonicMotherPdgCodes{"rejectPartonicMotherPdgCodes", {}, "Only consider particles whose partonic mothers do not have one of the supplied pdg codes (including the sign!)"}; }; @@ -116,6 +129,13 @@ class ParticleCleaner mRequiredMotherPdgCodes = confMpc.requiredMotherPdgCodes.value; mRejectedMotherPdgCodes = confMpc.rejectMotherPdgCodes.value; + mMotherPtMin = confMpc.motherPtMin.value; + mMotherPtMax = confMpc.motherPtMax.value; + mMotherEtaMin = confMpc.motherEtaMin.value; + mMotherEtaMax = confMpc.motherEtaMax.value; + mMotherPhiMin = confMpc.motherPhiMin.value; + mMotherPhiMax = confMpc.motherPhiMax.value; + mRequiredPartonicMotherPdgCodes = confMpc.requiredPartonicMotherPdgCodes.value; mRejectedPartonicMotherPdgCodes = confMpc.rejectPartonicMotherPdgCodes.value; } @@ -159,6 +179,7 @@ class ParticleCleaner bool hasMotherWithRequiredPdgCode = true; bool hasMotherWithRejectedPdgCode = false; + bool motherKinematicsOk = true; bool hasPartonicMotherWithRequiredPdgCode = true; bool hasPartonicMotherWithRejectedPdgCode = false; @@ -209,6 +230,15 @@ class ParticleCleaner } } } + + // One shared pt/eta/phi window, applied to the mother regardless of which (if any) + // requiredMotherPdgCodes/rejectMotherPdgCodes entry it matched above -- see the comment on + // ConfParticleCleaner's motherPtMin et al. + if (!(mother.pt() > mMotherPtMin && mother.pt() < mMotherPtMax && + mother.eta() > mMotherEtaMin && mother.eta() < mMotherEtaMax && + mother.phi() > mMotherPhiMin && mother.phi() < mMotherPhiMax)) { + motherKinematicsOk = false; + } } // MC partonic mother — same idea, via mcParticle @@ -240,7 +270,8 @@ class ParticleCleaner } } - return hasRequiredPdgCode && !hasRejectedPdgCode && + return motherKinematicsOk && + hasRequiredPdgCode && !hasRejectedPdgCode && hasMotherWithRequiredPdgCode && !hasMotherWithRejectedPdgCode && hasPartonicMotherWithRequiredPdgCode && !hasPartonicMotherWithRejectedPdgCode; } @@ -254,6 +285,12 @@ class ParticleCleaner std::vector mRejectedPdgCodes; std::vector mRequiredMotherPdgCodes; std::vector mRejectedMotherPdgCodes; + float mMotherPtMin = 0.f; + float mMotherPtMax = 1e6f; + float mMotherEtaMin = -1e6f; + float mMotherEtaMax = 1e6f; + float mMotherPhiMin = 0.f; + float mMotherPhiMax = 1.f * o2::constants::math::TwoPI; std::vector mRequiredPartonicMotherPdgCodes; std::vector mRejectedPartonicMotherPdgCodes; };