|
16 | 16 | #ifndef PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ |
17 | 17 | #define PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ |
18 | 18 |
|
| 19 | +#include "PWGCF/Femto/Core/femtoUtils.h" |
| 20 | + |
| 21 | +#include "Common/Core/RecoDecay.h" |
| 22 | + |
19 | 23 | #include <CommonConstants/MathConstants.h> |
20 | 24 | #include <Framework/Configurable.h> |
21 | 25 |
|
@@ -45,6 +49,11 @@ struct ConfParticleCleaner : o2::framework::ConfigurableGroup { |
45 | 49 | 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 | 50 | 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 | 51 | 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"}; |
| 52 | + // Rapidity cut on the mother. FMcMothers has no mass column, so the mass is looked up from |
| 53 | + // PdgCode via utils::getPdgMass() (the same lookup pairHistManager.h uses for kstar/Q3) and |
| 54 | + // combined with the mother's pt/eta to get y -- see RecoDecay::y(pt, eta, m). |
| 55 | + o2::framework::Configurable<float> motherRapidityMin{"motherRapidityMin", -1e6f, "Minimum rapidity of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched"}; |
| 56 | + o2::framework::Configurable<float> motherRapidityMax{"motherRapidityMax", 1e6f, "Maximum rapidity of the mother. One shared window applies regardless of which requiredMotherPdgCodes/rejectMotherPdgCodes entry the mother's own pdg code matched"}; |
48 | 57 | 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 | 58 | 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."}; |
50 | 59 | o2::framework::Configurable<std::vector<int>> requiredPartonicMotherPdgCodes{"requiredPartonicMotherPdgCodes", {}, "Only consider particles whose partonic mothers have one of the supplied pdg codes (including the sign!)"}; |
@@ -135,6 +144,8 @@ class ParticleCleaner |
135 | 144 | mMotherEtaMax = confMpc.motherEtaMax.value; |
136 | 145 | mMotherPhiMin = confMpc.motherPhiMin.value; |
137 | 146 | mMotherPhiMax = confMpc.motherPhiMax.value; |
| 147 | + mMotherRapidityMin = confMpc.motherRapidityMin.value; |
| 148 | + mMotherRapidityMax = confMpc.motherRapidityMax.value; |
138 | 149 |
|
139 | 150 | mRequiredPartonicMotherPdgCodes = confMpc.requiredPartonicMotherPdgCodes.value; |
140 | 151 | mRejectedPartonicMotherPdgCodes = confMpc.rejectPartonicMotherPdgCodes.value; |
@@ -231,14 +242,23 @@ class ParticleCleaner |
231 | 242 | } |
232 | 243 | } |
233 | 244 |
|
234 | | - // One shared pt/eta/phi window, applied to the mother regardless of which (if any) |
| 245 | + // One shared pt/eta/phi/rapidity window, applied to the mother regardless of which (if any) |
235 | 246 | // requiredMotherPdgCodes/rejectMotherPdgCodes entry it matched above -- see the comment on |
236 | 247 | // ConfParticleCleaner's motherPtMin et al. |
237 | 248 | if (!(mother.pt() > mMotherPtMin && mother.pt() < mMotherPtMax && |
238 | 249 | mother.eta() > mMotherEtaMin && mother.eta() < mMotherEtaMax && |
239 | 250 | mother.phi() > mMotherPhiMin && mother.phi() < mMotherPhiMax)) { |
240 | 251 | motherKinematicsOk = false; |
241 | 252 | } |
| 253 | + |
| 254 | + // rapidity needs the mother's mass, which FMcMothers does not store directly -- look it up |
| 255 | + // from its pdg code (same mechanism as the kstar/Q3 mass lookup in pairHistManager.h) |
| 256 | + if (mMotherRapidityMin > -1e6f || mMotherRapidityMax < 1e6f) { |
| 257 | + double motherRapidity = RecoDecay::y(mother.pt(), mother.eta(), utils::getPdgMass(mother.pdgCode())); |
| 258 | + if (!(motherRapidity > mMotherRapidityMin && motherRapidity < mMotherRapidityMax)) { |
| 259 | + motherKinematicsOk = false; |
| 260 | + } |
| 261 | + } |
242 | 262 | } |
243 | 263 |
|
244 | 264 | // MC partonic mother — same idea, via mcParticle |
@@ -291,6 +311,8 @@ class ParticleCleaner |
291 | 311 | float mMotherEtaMax = 1e6f; |
292 | 312 | float mMotherPhiMin = 0.f; |
293 | 313 | float mMotherPhiMax = 1.f * o2::constants::math::TwoPI; |
| 314 | + float mMotherRapidityMin = -1e6f; |
| 315 | + float mMotherRapidityMax = 1e6f; |
294 | 316 | std::vector<int> mRequiredPartonicMotherPdgCodes; |
295 | 317 | std::vector<int> mRejectedPartonicMotherPdgCodes; |
296 | 318 | }; |
|
0 commit comments