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
79 changes: 72 additions & 7 deletions PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "PWGLF/DataModel/mcCentrality.h"

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

// Event selection
Configurable<bool> requireNoSameBunchPileup{"requireNoSameBunchPileup", true, "Require kNoSameBunchPileup selection"};
Expand Down Expand Up @@ -239,8 +241,8 @@
}
AxisSpec multAxis = {multBinning, multAxTitle};

const AxisSpec ptAxis{100, 0.0, 10.0, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec ptJetAxis{101, 0.0, 100.0, "#it{p}_{T,jet} (GeV/#it{c})"};
const AxisSpec ptAxis{500, 0.0, 50.0, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec ptJetAxis{100, 0.0, 100.0, "#it{p}_{T,jet} (GeV/#it{c})"};
const AxisSpec numJets{21, -0.5, 20.5, "Number of jets per collision"};
const AxisSpec invMassK0sAxis{200, 0.44, 0.56, "m_{#pi#pi} (GeV/#it{c}^{2})"};
const AxisSpec invMassLambdaAxis{200, 1.09, 1.14, "m_{p#pi} (GeV/#it{c}^{2})"};
Expand Down Expand Up @@ -372,6 +374,12 @@
registryMC.add("AntiLambda_generated_w_reco_MB", "AntiLambda_generated_w_reco_MB", HistType::kTH2F, {multAxis, ptAxis});
// -----
}

if (particleOfInterestDict[ParticleOfInterest::kCascades] || calculateFeeddownMatrix) {
registryMC.add("XiPos_generated_MB", "XiPos_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
registryMC.add("XiNeg_generated_MB", "XiNeg_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
}

if (particleOfInterestDict[ParticleOfInterest::kCascades]) {
registryMC.add("XiPos_generated_jet", "XiPos_generated_jet", HistType::kTH2F, {multAxis, ptAxis});
registryMC.add("XiPos_generated_ue", "XiPos_generated_ue", HistType::kTH2F, {multAxis, ptAxis});
Expand All @@ -383,8 +391,6 @@
registryMC.add("OmegaNeg_generated_ue", "OmegaNeg_generated_ue", HistType::kTH2F, {multAxis, ptAxis});

// Histograms for the full event (without jets)
registryMC.add("XiPos_generated_MB", "XiPos_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
registryMC.add("XiNeg_generated_MB", "XiNeg_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
registryMC.add("OmegaPos_generated_MB", "OmegaPos_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
registryMC.add("OmegaNeg_generated_MB", "OmegaNeg_generated_MB", HistType::kTH2F, {multAxis, ptAxis});
}
Expand Down Expand Up @@ -526,6 +532,13 @@
registryMC.add("ProtonPos_reconstructed_MB", "ProtonPos_reconstructed_MB", HistType::kTH2F, {multAxis, ptAxisLongLived});
registryMC.add("ProtonNeg_reconstructed_MB", "ProtonNeg_reconstructed_MB", HistType::kTH2F, {multAxis, ptAxisLongLived});
}

if (calculateFeeddownMatrix) {
registryMC.add("h3dLambdaFeeddown", "h3dLambdaFeeddown", kTH3D, {multAxis, ptAxis, ptAxis});
registryMC.add("h3dLambdaFeeddownFromXi0", "h3dLambdaFeeddownFromXi0", kTH3D, {multAxis, ptAxis, ptAxis});
registryMC.add("h3dAntiLambdaFeeddown", "h3dAntiLambdaFeeddown", kTH3D, {multAxis, ptAxis, ptAxis});
registryMC.add("h3dAntiLambdaFeeddownFromXi0", "h3dAntiLambdaFeeddownFromXi0", kTH3D, {multAxis, ptAxis, ptAxis});
}
}
}

Expand Down Expand Up @@ -1205,12 +1218,12 @@
}
break;
case kXiMinus:
if (particleOfInterestDict[ParticleOfInterest::kCascades]) {
if (particleOfInterestDict[ParticleOfInterest::kCascades] || calculateFeeddownMatrix) {
registryMC.fill(HIST("XiNeg_generated_MB"), genMultiplicity, particle.pt());
}
break;
case kXiPlusBar:
if (particleOfInterestDict[ParticleOfInterest::kCascades]) {
if (particleOfInterestDict[ParticleOfInterest::kCascades] || calculateFeeddownMatrix) {
registryMC.fill(HIST("XiPos_generated_MB"), genMultiplicity, particle.pt());
}
break;
Expand Down Expand Up @@ -1290,12 +1303,15 @@
if (motherPos != motherNeg)
continue;

if (std::abs(motherPos.eta()) > 0.8)

Check failure on line 1306 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;

// Vertex position vector
TVector3 vtxPos(collision.posX(), collision.posY(), collision.posZ());

bool passedLambda = false; // true if Lambda selections are passed
bool passedAntiLambda = false; // true if AntiLambda selections are passed

// K0s
if (passedK0ShortSelection(v0, pos, neg, vtxPos) &&
motherPos.pdgCode() == kK0Short &&
Expand All @@ -1307,12 +1323,19 @@
motherPos.pdgCode() == kLambda0 &&
passedRapidityCut(v0.yLambda(), configV0.rapidityMax)) {
registryMC.fill(HIST("Lambda_reconstructed_MB_incl"), multiplicity, v0.pt());
passedLambda = true;
}
// AntiLambda
if (passedAntiLambdaSelection(v0, pos, neg, vtxPos) &&
motherPos.pdgCode() == kLambda0Bar &&
passedRapidityCut(v0.yLambda(), configV0.rapidityMax)) {
registryMC.fill(HIST("AntiLambda_reconstructed_MB_incl"), multiplicity, v0.pt());
passedAntiLambda = true;
}

if (calculateFeeddownMatrix) {
double ptGen = motherPos.pt();
fillFeeddownMatrix(v0, ptGen, multiplicity, passedLambda, passedAntiLambda);
}

if (!motherPos.isPhysicalPrimary())
Expand Down Expand Up @@ -1379,7 +1402,7 @@
if (!motherBach.isPhysicalPrimary())
continue;

if (std::abs(motherPos.eta()) > 0.8)

Check failure on line 1405 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;

// Xi+
Expand Down Expand Up @@ -1417,7 +1440,7 @@
continue;
}

if (std::abs(mcParticle.eta()) > 0.8) {

Check failure on line 1443 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}

Expand Down Expand Up @@ -1459,6 +1482,48 @@
}
}

template <typename TV0>
void fillFeeddownMatrix(TV0 v0, float pt, float centrality, bool passedLambda, bool passedAntiLambda)
// Fill feeddown matrix for Lambdas or AntiLambdas
// Adapted from: PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx
{
if (!v0.has_mcMotherParticle())
return; // does not have mother particle in record, skip

auto v0mother = v0.mcMotherParticle();
float rapidityXi = 999.;
if (std::abs(v0mother.pdgCode()) == PDG_t::kXiMinus)
rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXiMinus);
if (std::abs(v0mother.pdgCode()) == o2::constants::physics::Pdg::kXi0)
rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXi0);

if (std::fabs(rapidityXi) > 0.5f)

Check failure on line 1500 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return; // not a valid mother rapidity (PDG selection is later)

// __________________________________________
if (passedLambda) {
if (v0mother.isPhysicalPrimary()) {
if (v0mother.pdgCode() == PDG_t::kXiMinus) {
registryMC.fill(HIST("h3dLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
}
if (v0mother.pdgCode() == PDG_t::kXiMinus || v0mother.pdgCode() == o2::constants::physics::Pdg::kXi0) {
registryMC.fill(HIST("h3dLambdaFeeddownFromXi0"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
}
}
}

if (passedAntiLambda) {
if (v0mother.isPhysicalPrimary()) {
if (v0mother.pdgCode() == PDG_t::kXiPlusBar) {
registryMC.fill(HIST("h3dAntiLambdaFeeddown"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
}
if (v0mother.pdgCode() == PDG_t::kXiPlusBar || v0mother.pdgCode() == -o2::constants::physics::Pdg::kXi0) {
registryMC.fill(HIST("h3dAntiLambdaFeeddownFromXi0"), centrality, pt, std::hypot(v0mother.px(), v0mother.py()));
}
}
}
}

// Process data
void processData(SelCollisions::iterator const& collision, aod::V0Datas const& fullV0s,
aod::CascDataExt const& Cascades, DaughterTracks const& tracks,
Expand Down Expand Up @@ -1819,7 +1884,7 @@
}
}

if (multiplicity == -999)

Check failure on line 1887 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue; */

// Clear containers at the start of the event loop
Expand Down Expand Up @@ -2095,7 +2160,7 @@
// Reconstructed MC events
void processMCreconstructed(SimCollisions const& collisions,
soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::McCentFT0Cs> const&,
DaughterTracksMC const& mcTracks, aod::V0Datas const& fullV0s,
DaughterTracksMC const& mcTracks, soa::Join<aod::V0Datas, aod::McV0Labels> const& fullV0s,
aod::CascDataExt const& Cascades, aod::McParticles const& mcParticles)
{
// Define per-event containers
Expand Down Expand Up @@ -2236,7 +2301,7 @@
// ------------------------------------------------
// --- Generated hadrons in reconstructed jets ----
for (const auto& particle : mcParticlesPerColl) {
if (!particle.isPhysicalPrimary() || std::abs(particle.eta()) > 0.8)

Check failure on line 2304 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;

int absPdg = std::abs(particle.pdgCode());
Expand Down
Loading