diff --git a/PWGCF/Femto/Core/femtoUtils.h b/PWGCF/Femto/Core/femtoUtils.h index c677f0b09e8..2eebdc973ee 100644 --- a/PWGCF/Femto/Core/femtoUtils.h +++ b/PWGCF/Femto/Core/femtoUtils.h @@ -91,6 +91,11 @@ constexpr int Delta01232 = 2114; constexpr int DeltaPlus1232 = 2214; constexpr int DeltaPlusPlus1232 = 2224; +// Xi(1530) baryons: same situation as Delta(1232) above -- no enum entry and no mass constant +// exists anywhere in O2, so both are hardcoded here. +constexpr int Xi01530 = 3324; +constexpr int XiMinus1530 = 3314; + inline double getPdgMass(int pdgCode) { // use this function instead of TDatabasePDG to return masses defined in the PhysicsConstants.h header @@ -125,6 +130,12 @@ inline double getPdgMass(int pdgCode) case o2::constants::physics::Pdg::kK0Star892: mass = o2::constants::physics::MassK0Star892; break; + case o2::constants::physics::Pdg::kKPlusStar892: + mass = o2::constants::physics::MassKPlusStar892; + break; + case o2::constants::physics::Pdg::kOmega: + mass = o2::constants::physics::MassOmega; + break; case o2::constants::physics::Pdg::kLambdaCPlus: mass = o2::constants::physics::MassLambdaCPlus; break; @@ -146,9 +157,15 @@ inline double getPdgMass(int pdgCode) case kSigmaPlus: mass = o2::constants::physics::MassSigmaPlus; break; + case kSigma0: + mass = o2::constants::physics::MassSigma0; + break; case kXiMinus: mass = o2::constants::physics::MassXiMinus; break; + case o2::constants::physics::Pdg::kXi0: + mass = o2::constants::physics::MassXi0; + break; case kOmegaMinus: mass = o2::constants::physics::MassOmegaMinus; break; @@ -158,12 +175,25 @@ inline double getPdgMass(int pdgCode) case o2::constants::physics::kEta: mass = o2::constants::physics::MassEta; break; + case kNeutron: + mass = o2::constants::physics::MassNeutron; + break; + case kK0: + mass = o2::constants::physics::MassK0; + break; + case kLambda1520: + mass = o2::constants::physics::MassLambda1520; + break; case DeltaMinus1232: case Delta01232: case DeltaPlus1232: case DeltaPlusPlus1232: mass = 1.232; // not defined in O2? break; + case Xi01530: + case XiMinus1530: + mass = 1.532; // not defined in O2? + break; default: LOG(warn) << "PDG code " << pdgCode << " is not suppored. Return 0... "; } diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index bcf0580a933..c613d9382c4 100644 --- a/PWGCF/Femto/Core/particleCleaner.h +++ b/PWGCF/Femto/Core/particleCleaner.h @@ -43,6 +43,9 @@ struct ConfParticleCleaner : o2::framework::ConfigurableGroup { // 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. + // activateMotherKinematics gates the whole check (default off), so it has zero cost -- no + // mass lookup, no rapidity computation -- unless explicitly turned on. + o2::framework::Configurable activateMotherKinematics{"activateMotherKinematics", false, "Activate the pt/eta/phi/rapidity kinematic cut on the mother"}; 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"}; @@ -133,6 +136,7 @@ class ParticleCleaner mRequiredMotherPdgCodes = confMpc.requiredMotherPdgCodes.value; mRejectedMotherPdgCodes = confMpc.rejectMotherPdgCodes.value; + mActivateMotherKinematics = confMpc.activateMotherKinematics.value; mMotherPtMin = confMpc.motherPtMin.value; mMotherPtMax = confMpc.motherPtMax.value; mMotherEtaMin = confMpc.motherEtaMin.value; @@ -237,14 +241,18 @@ class ParticleCleaner } } - // One shared pt/eta/phi window, applied to the mother regardless of which (if any) - // requiredMotherPdgCodes/rejectMotherPdgCodes entry it matched above - double motherRapidity = mother.y(utils::getPdgMass(mother.pdgCode())); - if (!(mother.pt() > mMotherPtMin && mother.pt() < mMotherPtMax && - mother.eta() > mMotherEtaMin && mother.eta() < mMotherEtaMax && - motherRapidity > mMotherRapidityMin && motherRapidity < mMotherRapidityMax && - mother.phi() > mMotherPhiMin && mother.phi() < mMotherPhiMax)) { - motherKinematicsOk = false; + // One shared pt/eta/phi/rapidity window, applied to the mother regardless of which (if + // any) requiredMotherPdgCodes/rejectMotherPdgCodes entry it matched above. Gated behind + // activateMotherKinematics so it costs nothing (no mass lookup, no rapidity computation) + // unless explicitly turned on. + if (mActivateMotherKinematics) { + double motherRapidity = mother.y(utils::getPdgMass(mother.pdgCode())); + if (!(mother.pt() > mMotherPtMin && mother.pt() < mMotherPtMax && + mother.eta() > mMotherEtaMin && mother.eta() < mMotherEtaMax && + motherRapidity > mMotherRapidityMin && motherRapidity < mMotherRapidityMax && + mother.phi() > mMotherPhiMin && mother.phi() < mMotherPhiMax)) { + motherKinematicsOk = false; + } } } @@ -292,6 +300,7 @@ class ParticleCleaner std::vector mRejectedPdgCodes; std::vector mRequiredMotherPdgCodes; std::vector mRejectedMotherPdgCodes; + bool mActivateMotherKinematics = false; float mMotherPtMin = 0.f; float mMotherPtMax = 1e6f; float mMotherEtaMin = -1e6f;