Skip to content

Commit 5aeb2cb

Browse files
committed
Feat: add kinematic cuts on mother particles
1 parent a6b6fb6 commit 5aeb2cb

1 file changed

Lines changed: 38 additions & 1 deletion

File tree

‎PWGCF/Femto/Core/particleCleaner.h‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#ifndef PWGCF_FEMTO_CORE_PARTICLECLEANER_H_
1717
#define PWGCF_FEMTO_CORE_PARTICLECLEANER_H_
1818

19+
#include <CommonConstants/MathConstants.h>
1920
#include <Framework/Configurable.h>
2021

2122
#include <string>
@@ -34,6 +35,18 @@ struct ConfParticleCleaner : o2::framework::ConfigurableGroup {
3435
o2::framework::Configurable<bool> rejectParticleWithoutMcPartonicMother{"rejectParticleWithoutMcPartonicMother", false, "If true, particles which have no associated partonic mother are rejected"};
3536
o2::framework::Configurable<std::vector<int>> requiredMotherPdgCodes{"requiredMotherPdgCodes", {}, "Only consider particles whose mothers have one of the supplied pdg codes (including the sign!)"};
3637
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!)"};
38+
// Kinematic window on the mother itself (e.g. to select on the Delta++'s own pt/eta/phi, not
39+
// just its pdg code). There is only ONE window here, not one per entry in
40+
// requiredMotherPdgCodes/rejectMotherPdgCodes above: whichever mother pdg code ends up being
41+
// allowed by those two lists, this same pt/eta/phi range is what its kinematics are checked
42+
// against -- the window does not vary per pdg code. Defaults are wide open (no-op) like every
43+
// other kinematic window in this codebase, so setting these has no effect unless narrowed.
44+
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"};
45+
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"};
46+
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"};
47+
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"};
48+
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"};
49+
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."};
3750
o2::framework::Configurable<std::vector<int>> requiredPartonicMotherPdgCodes{"requiredPartonicMotherPdgCodes", {}, "Only consider particles whose partonic mothers have one of the supplied pdg codes (including the sign!)"};
3851
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!)"};
3952
};
@@ -116,6 +129,13 @@ class ParticleCleaner
116129
mRequiredMotherPdgCodes = confMpc.requiredMotherPdgCodes.value;
117130
mRejectedMotherPdgCodes = confMpc.rejectMotherPdgCodes.value;
118131

132+
mMotherPtMin = confMpc.motherPtMin.value;
133+
mMotherPtMax = confMpc.motherPtMax.value;
134+
mMotherEtaMin = confMpc.motherEtaMin.value;
135+
mMotherEtaMax = confMpc.motherEtaMax.value;
136+
mMotherPhiMin = confMpc.motherPhiMin.value;
137+
mMotherPhiMax = confMpc.motherPhiMax.value;
138+
119139
mRequiredPartonicMotherPdgCodes = confMpc.requiredPartonicMotherPdgCodes.value;
120140
mRejectedPartonicMotherPdgCodes = confMpc.rejectPartonicMotherPdgCodes.value;
121141
}
@@ -159,6 +179,7 @@ class ParticleCleaner
159179

160180
bool hasMotherWithRequiredPdgCode = true;
161181
bool hasMotherWithRejectedPdgCode = false;
182+
bool motherKinematicsOk = true;
162183

163184
bool hasPartonicMotherWithRequiredPdgCode = true;
164185
bool hasPartonicMotherWithRejectedPdgCode = false;
@@ -209,6 +230,15 @@ class ParticleCleaner
209230
}
210231
}
211232
}
233+
234+
// One shared pt/eta/phi window, applied to the mother regardless of which (if any)
235+
// requiredMotherPdgCodes/rejectMotherPdgCodes entry it matched above -- see the comment on
236+
// ConfParticleCleaner's motherPtMin et al.
237+
if (!(mother.pt() > mMotherPtMin && mother.pt() < mMotherPtMax &&
238+
mother.eta() > mMotherEtaMin && mother.eta() < mMotherEtaMax &&
239+
mother.phi() > mMotherPhiMin && mother.phi() < mMotherPhiMax)) {
240+
motherKinematicsOk = false;
241+
}
212242
}
213243

214244
// MC partonic mother — same idea, via mcParticle
@@ -240,7 +270,8 @@ class ParticleCleaner
240270
}
241271
}
242272

243-
return hasRequiredPdgCode && !hasRejectedPdgCode &&
273+
return motherKinematicsOk &&
274+
hasRequiredPdgCode && !hasRejectedPdgCode &&
244275
hasMotherWithRequiredPdgCode && !hasMotherWithRejectedPdgCode &&
245276
hasPartonicMotherWithRequiredPdgCode && !hasPartonicMotherWithRejectedPdgCode;
246277
}
@@ -254,6 +285,12 @@ class ParticleCleaner
254285
std::vector<int> mRejectedPdgCodes;
255286
std::vector<int> mRequiredMotherPdgCodes;
256287
std::vector<int> mRejectedMotherPdgCodes;
288+
float mMotherPtMin = 0.f;
289+
float mMotherPtMax = 1e6f;
290+
float mMotherEtaMin = -1e6f;
291+
float mMotherEtaMax = 1e6f;
292+
float mMotherPhiMin = 0.f;
293+
float mMotherPhiMax = 1.f * o2::constants::math::TwoPI;
257294
std::vector<int> mRequiredPartonicMotherPdgCodes;
258295
std::vector<int> mRejectedPartonicMotherPdgCodes;
259296
};

0 commit comments

Comments
 (0)