Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion PWGCF/Femto/Core/particleCleaner.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifndef PWGCF_FEMTO_CORE_PARTICLECLEANER_H_
#define PWGCF_FEMTO_CORE_PARTICLECLEANER_H_

#include <CommonConstants/MathConstants.h>
#include <Framework/Configurable.h>

#include <string>
Expand All @@ -34,6 +35,18 @@ struct ConfParticleCleaner : o2::framework::ConfigurableGroup {
o2::framework::Configurable<bool> rejectParticleWithoutMcPartonicMother{"rejectParticleWithoutMcPartonicMother", false, "If true, particles which have no associated partonic mother are rejected"};
o2::framework::Configurable<std::vector<int>> requiredMotherPdgCodes{"requiredMotherPdgCodes", {}, "Only consider particles whose mothers have one of the supplied pdg codes (including the sign!)"};
o2::framework::Configurable<std::vector<int>> 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<float> 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<float> 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<float> 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<float> 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<float> 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<float> 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<std::vector<int>> requiredPartonicMotherPdgCodes{"requiredPartonicMotherPdgCodes", {}, "Only consider particles whose partonic mothers have one of the supplied pdg codes (including the sign!)"};
o2::framework::Configurable<std::vector<int>> rejectPartonicMotherPdgCodes{"rejectPartonicMotherPdgCodes", {}, "Only consider particles whose partonic mothers do not have one of the supplied pdg codes (including the sign!)"};
};
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -159,6 +179,7 @@ class ParticleCleaner

bool hasMotherWithRequiredPdgCode = true;
bool hasMotherWithRejectedPdgCode = false;
bool motherKinematicsOk = true;

bool hasPartonicMotherWithRequiredPdgCode = true;
bool hasPartonicMotherWithRejectedPdgCode = false;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -240,7 +270,8 @@ class ParticleCleaner
}
}

return hasRequiredPdgCode && !hasRejectedPdgCode &&
return motherKinematicsOk &&
hasRequiredPdgCode && !hasRejectedPdgCode &&
hasMotherWithRequiredPdgCode && !hasMotherWithRejectedPdgCode &&
hasPartonicMotherWithRequiredPdgCode && !hasPartonicMotherWithRejectedPdgCode;
}
Expand All @@ -254,6 +285,12 @@ class ParticleCleaner
std::vector<int> mRejectedPdgCodes;
std::vector<int> mRequiredMotherPdgCodes;
std::vector<int> 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<int> mRequiredPartonicMotherPdgCodes;
std::vector<int> mRejectedPartonicMotherPdgCodes;
};
Expand Down
Loading