Skip to content

Commit ec3b1e6

Browse files
committed
Feat: add rapidity cut for mother particles
1 parent 5f49ba7 commit ec3b1e6

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

‎PWGCF/Femto/Core/femtoUtils.h‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ float itsSignal(T const& track)
8282
return static_cast<float>(signal);
8383
};
8484

85+
// Delta(1232) baryons: no kXxx enum entry exists for these in TPDGCode.h (only the raw codes used
86+
// internally by TDatabasePDG's particle-table construction) and no mass constant exists in
87+
// PhysicsConstants.h either, so both the codes and the mass are hardcoded here, same as kRho770_0/
88+
// kRho770Plus below.
89+
constexpr int kDeltaMinus1232 = 1114;
90+
constexpr int kDelta01232 = 2114;
91+
constexpr int kDeltaPlus1232 = 2214;
92+
constexpr int kDeltaPlusPlus1232 = 2224;
93+
8594
inline double getPdgMass(int pdgCode)
8695
{
8796
// use this function instead of TDatabasePDG to return masses defined in the PhysicsConstants.h header
@@ -149,6 +158,12 @@ inline double getPdgMass(int pdgCode)
149158
case o2::constants::physics::kEta:
150159
mass = o2::constants::physics::MassEta;
151160
break;
161+
case kDeltaMinus1232:
162+
case kDelta01232:
163+
case kDeltaPlus1232:
164+
case kDeltaPlusPlus1232:
165+
mass = 1.232; // not defined in O2?
166+
break;
152167
default:
153168
LOG(warn) << "PDG code " << pdgCode << " is not suppored. Return 0... ";
154169
}

‎PWGCF/Femto/Core/particleCleaner.h‎

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

19+
#include "PWGCF/Femto/Core/femtoUtils.h"
20+
21+
#include "Common/Core/RecoDecay.h"
22+
1923
#include <CommonConstants/MathConstants.h>
2024
#include <Framework/Configurable.h>
2125

@@ -45,6 +49,11 @@ struct ConfParticleCleaner : o2::framework::ConfigurableGroup {
4549
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"};
4650
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"};
4751
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"};
4857
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"};
4958
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."};
5059
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
135144
mMotherEtaMax = confMpc.motherEtaMax.value;
136145
mMotherPhiMin = confMpc.motherPhiMin.value;
137146
mMotherPhiMax = confMpc.motherPhiMax.value;
147+
mMotherRapidityMin = confMpc.motherRapidityMin.value;
148+
mMotherRapidityMax = confMpc.motherRapidityMax.value;
138149

139150
mRequiredPartonicMotherPdgCodes = confMpc.requiredPartonicMotherPdgCodes.value;
140151
mRejectedPartonicMotherPdgCodes = confMpc.rejectPartonicMotherPdgCodes.value;
@@ -231,14 +242,23 @@ class ParticleCleaner
231242
}
232243
}
233244

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)
235246
// requiredMotherPdgCodes/rejectMotherPdgCodes entry it matched above -- see the comment on
236247
// ConfParticleCleaner's motherPtMin et al.
237248
if (!(mother.pt() > mMotherPtMin && mother.pt() < mMotherPtMax &&
238249
mother.eta() > mMotherEtaMin && mother.eta() < mMotherEtaMax &&
239250
mother.phi() > mMotherPhiMin && mother.phi() < mMotherPhiMax)) {
240251
motherKinematicsOk = false;
241252
}
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+
}
242262
}
243263

244264
// MC partonic mother — same idea, via mcParticle
@@ -291,6 +311,8 @@ class ParticleCleaner
291311
float mMotherEtaMax = 1e6f;
292312
float mMotherPhiMin = 0.f;
293313
float mMotherPhiMax = 1.f * o2::constants::math::TwoPI;
314+
float mMotherRapidityMin = -1e6f;
315+
float mMotherRapidityMax = 1e6f;
294316
std::vector<int> mRequiredPartonicMotherPdgCodes;
295317
std::vector<int> mRejectedPartonicMotherPdgCodes;
296318
};

0 commit comments

Comments
 (0)