Skip to content

Commit cc33590

Browse files
authored
[PWGLF] Compute feeddown matrix for Lambda/AntiLambda (#16057)
1 parent 7039e34 commit cc33590

1 file changed

Lines changed: 72 additions & 7 deletions

File tree

PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "PWGLF/DataModel/mcCentrality.h"
2727

2828
#include "Common/CCDB/EventSelectionParams.h"
29+
#include "Common/Core/RecoDecay.h"
2930
#include "Common/Core/Zorro.h"
3031
#include "Common/Core/ZorroSummary.h"
3132
#include "Common/DataModel/Centrality.h"
@@ -128,6 +129,7 @@ struct StrangenessInJetsIons {
128129
Configurable<bool> cfgSkimmedProcessing{"cfgSkimmedProcessing", false, "Enable processing of skimmed data"};
129130
Configurable<std::string> triggerName{"triggerName", "fOmega", "Software trigger name"};
130131
Configurable<int> centrEstimator{"centrEstimator", 1, "Select centrality estimator. Options: 0 = FT0C, 1 = FT0M. CCDB objects available only for FT0M."};
132+
Configurable<bool> calculateFeeddownMatrix{"calculateFeeddownMatrix", true, "Fill feeddown matrix for Lambda if MC"};
131133

132134
// Event selection
133135
Configurable<bool> requireNoSameBunchPileup{"requireNoSameBunchPileup", true, "Require kNoSameBunchPileup selection"};
@@ -239,8 +241,8 @@ struct StrangenessInJetsIons {
239241
}
240242
AxisSpec multAxis = {multBinning, multAxTitle};
241243

242-
const AxisSpec ptAxis{100, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"};
243-
const AxisSpec ptJetAxis{101, 0.0, 100.0, "#it{p}_{T,jet} (GeV/#it{c})"};
244+
const AxisSpec ptAxis{500, 0.0, 50.0, "#it{p}_{T} (GeV/#it{c})"};
245+
const AxisSpec ptJetAxis{100, 0.0, 100.0, "#it{p}_{T,jet} (GeV/#it{c})"};
244246
const AxisSpec numJets{21, -0.5, 20.5, "Number of jets per collision"};
245247
const AxisSpec invMassK0sAxis{200, 0.44, 0.56, "m_{#pi#pi} (GeV/#it{c}^{2})"};
246248
const AxisSpec invMassLambdaAxis{200, 1.09, 1.14, "m_{p#pi} (GeV/#it{c}^{2})"};
@@ -372,6 +374,12 @@ struct StrangenessInJetsIons {
372374
registryMC.add("AntiLambda_generated_w_reco_MB", "AntiLambda_generated_w_reco_MB", HistType::kTH2F, {multAxis, ptAxis});
373375
// -----
374376
}
377+
378+
if (particleOfInterestDict[ParticleOfInterest::kCascades] || calculateFeeddownMatrix) {
379+
registryMC.add("XiPos_generated_MB", "XiPos_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
380+
registryMC.add("XiNeg_generated_MB", "XiNeg_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
381+
}
382+
375383
if (particleOfInterestDict[ParticleOfInterest::kCascades]) {
376384
registryMC.add("XiPos_generated_jet", "XiPos_generated_jet", HistType::kTH2F, {multAxis, ptAxis});
377385
registryMC.add("XiPos_generated_ue", "XiPos_generated_ue", HistType::kTH2F, {multAxis, ptAxis});
@@ -383,8 +391,6 @@ struct StrangenessInJetsIons {
383391
registryMC.add("OmegaNeg_generated_ue", "OmegaNeg_generated_ue", HistType::kTH2F, {multAxis, ptAxis});
384392

385393
// Histograms for the full event (without jets)
386-
registryMC.add("XiPos_generated_MB", "XiPos_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
387-
registryMC.add("XiNeg_generated_MB", "XiNeg_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
388394
registryMC.add("OmegaPos_generated_MB", "OmegaPos_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
389395
registryMC.add("OmegaNeg_generated_MB", "OmegaNeg_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
390396
}
@@ -526,6 +532,13 @@ struct StrangenessInJetsIons {
526532
registryMC.add("ProtonPos_reconstructed_MB", "ProtonPos_reconstructed_MB", HistType::kTH2F, {multAxis, ptAxisLongLived});
527533
registryMC.add("ProtonNeg_reconstructed_MB", "ProtonNeg_reconstructed_MB", HistType::kTH2F, {multAxis, ptAxisLongLived});
528534
}
535+
536+
if (calculateFeeddownMatrix) {
537+
registryMC.add("h3dLambdaFeeddown", "h3dLambdaFeeddown", kTH3D, {multAxis, ptAxis, ptAxis});
538+
registryMC.add("h3dLambdaFeeddownFromXi0", "h3dLambdaFeeddownFromXi0", kTH3D, {multAxis, ptAxis, ptAxis});
539+
registryMC.add("h3dAntiLambdaFeeddown", "h3dAntiLambdaFeeddown", kTH3D, {multAxis, ptAxis, ptAxis});
540+
registryMC.add("h3dAntiLambdaFeeddownFromXi0", "h3dAntiLambdaFeeddownFromXi0", kTH3D, {multAxis, ptAxis, ptAxis});
541+
}
529542
}
530543
}
531544

@@ -1205,12 +1218,12 @@ struct StrangenessInJetsIons {
12051218
}
12061219
break;
12071220
case kXiMinus:
1208-
if (particleOfInterestDict[ParticleOfInterest::kCascades]) {
1221+
if (particleOfInterestDict[ParticleOfInterest::kCascades] || calculateFeeddownMatrix) {
12091222
registryMC.fill(HIST("XiNeg_generated_MB"), genMultiplicity, particle.pt());
12101223
}
12111224
break;
12121225
case kXiPlusBar:
1213-
if (particleOfInterestDict[ParticleOfInterest::kCascades]) {
1226+
if (particleOfInterestDict[ParticleOfInterest::kCascades] || calculateFeeddownMatrix) {
12141227
registryMC.fill(HIST("XiPos_generated_MB"), genMultiplicity, particle.pt());
12151228
}
12161229
break;
@@ -1296,6 +1309,9 @@ struct StrangenessInJetsIons {
12961309
// Vertex position vector
12971310
TVector3 vtxPos(collision.posX(), collision.posY(), collision.posZ());
12981311

1312+
bool passedLambda = false; // true if Lambda selections are passed
1313+
bool passedAntiLambda = false; // true if AntiLambda selections are passed
1314+
12991315
// K0s
13001316
if (passedK0ShortSelection(v0, pos, neg, vtxPos) &&
13011317
motherPos.pdgCode() == kK0Short &&
@@ -1307,12 +1323,19 @@ struct StrangenessInJetsIons {
13071323
motherPos.pdgCode() == kLambda0 &&
13081324
passedRapidityCut(v0.yLambda(), configV0.rapidityMax)) {
13091325
registryMC.fill(HIST("Lambda_reconstructed_MB_incl"), multiplicity, v0.pt());
1326+
passedLambda = true;
13101327
}
13111328
// AntiLambda
13121329
if (passedAntiLambdaSelection(v0, pos, neg, vtxPos) &&
13131330
motherPos.pdgCode() == kLambda0Bar &&
13141331
passedRapidityCut(v0.yLambda(), configV0.rapidityMax)) {
13151332
registryMC.fill(HIST("AntiLambda_reconstructed_MB_incl"), multiplicity, v0.pt());
1333+
passedAntiLambda = true;
1334+
}
1335+
1336+
if (calculateFeeddownMatrix) {
1337+
double ptGen = motherPos.pt();
1338+
fillFeeddownMatrix(v0, ptGen, multiplicity, passedLambda, passedAntiLambda);
13161339
}
13171340

13181341
if (!motherPos.isPhysicalPrimary())
@@ -1459,6 +1482,48 @@ struct StrangenessInJetsIons {
14591482
}
14601483
}
14611484

1485+
template <typename TV0>
1486+
void fillFeeddownMatrix(TV0 v0, float pt, float centrality, bool passedLambda, bool passedAntiLambda)
1487+
// Fill feeddown matrix for Lambdas or AntiLambdas
1488+
// Adapted from: PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx
1489+
{
1490+
if (!v0.has_mcMotherParticle())
1491+
return; // does not have mother particle in record, skip
1492+
1493+
auto v0mother = v0.mcMotherParticle();
1494+
float rapidityXi = 999.;
1495+
if (std::abs(v0mother.pdgCode()) == PDG_t::kXiMinus)
1496+
rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXiMinus);
1497+
if (std::abs(v0mother.pdgCode()) == o2::constants::physics::Pdg::kXi0)
1498+
rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXi0);
1499+
1500+
if (std::fabs(rapidityXi) > 0.5f)
1501+
return; // not a valid mother rapidity (PDG selection is later)
1502+
1503+
// __________________________________________
1504+
if (passedLambda) {
1505+
if (v0mother.isPhysicalPrimary()) {
1506+
if (v0mother.pdgCode() == PDG_t::kXiMinus) {
1507+
registryMC.fill(HIST("h3dLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
1508+
}
1509+
if (v0mother.pdgCode() == PDG_t::kXiMinus || v0mother.pdgCode() == o2::constants::physics::Pdg::kXi0) {
1510+
registryMC.fill(HIST("h3dLambdaFeeddownFromXi0"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
1511+
}
1512+
}
1513+
}
1514+
1515+
if (passedAntiLambda) {
1516+
if (v0mother.isPhysicalPrimary()) {
1517+
if (v0mother.pdgCode() == PDG_t::kXiPlusBar) {
1518+
registryMC.fill(HIST("h3dAntiLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
1519+
}
1520+
if (v0mother.pdgCode() == PDG_t::kXiPlusBar || v0mother.pdgCode() == -o2::constants::physics::Pdg::kXi0) {
1521+
registryMC.fill(HIST("h3dAntiLambdaFeeddownFromXi0"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
1522+
}
1523+
}
1524+
}
1525+
}
1526+
14621527
// Process data
14631528
void processData(SelCollisions::iterator const& collision, aod::V0Datas const& fullV0s,
14641529
aod::CascDataExt const& Cascades, DaughterTracks const& tracks,
@@ -2095,7 +2160,7 @@ struct StrangenessInJetsIons {
20952160
// Reconstructed MC events
20962161
void processMCreconstructed(SimCollisions const& collisions,
20972162
soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::McCentFT0Cs> const&,
2098-
DaughterTracksMC const& mcTracks, aod::V0Datas const& fullV0s,
2163+
DaughterTracksMC const& mcTracks, soa::Join<aod::V0Datas, aod::McV0Labels> const& fullV0s,
20992164
aod::CascDataExt const& Cascades, aod::McParticles const& mcParticles)
21002165
{
21012166
// Define per-event containers

0 commit comments

Comments
 (0)