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
89 changes: 84 additions & 5 deletions PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"

#include "TDatabasePDG.h"

Check failure on line 45 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include "TPDGCode.h"

#include <cstdint>
Expand Down Expand Up @@ -179,9 +179,10 @@
Configurable<float> track_nClsItsMin{"track_NclsItsMin", 0.f, "Minimum number of ITS clusters for the V0 daughters"};
Configurable<float> track_nClsTpcMin{"track_NclsTpcMin", 100.f, "Minimum number of TPC clusters for the V0 daughters"};
Configurable<float> track_nClsTpcMaxShared{"track_NclsTpcMaxShared", 5.f, "Maximum number of shared TPC clusters for the V0 daughters"};
Configurable<float> track_etaMax{"etaMax", 0.8f, "Maximum eta"};
Configurable<float> track_tpcChi2Min{"track_tpcChi2Min", 0.5f, "Minimum TPC chi2 per cluster"};

// Configurable<float> v0setting_etaMaxV0{"etaMaxV0", 0.8f, "Maximum eta for the V0 daughters"};
Configurable<float> v0setting_etaMaxV0dau{"etaMaxV0dau", 0.8f, "Maximum eta for the V0 daughters"};
Configurable<float> v0setting_dcaV0daughters{"v0setting_dcaV0daughters", 0.5f, "DCA between the V0 daughters"};
Configurable<float> v0setting_dcaV0toPV{"v0setting_dcaV0fromPV", 1.f, "DCA of the V0 to the primary vertex"};
Configurable<float> v0setting_dcaDaughtersToPV{"v0setting_dcaDaughtersToPV", 1.f, "DCA of the daughters to the primary vertex"};
Expand Down Expand Up @@ -232,7 +233,8 @@
{"he3_selections", "He3 track selection; selection; counts", {HistType::kTH1F, {{He3Selections::kHe3All, -0.5, static_cast<double>(He3Selections::kHe3All) - 0.5}}}},
{"v0_type", "Selected V0; particle; counts", {HistType::kTH1F, {{V0Type::V0TypeAll, -0.5, static_cast<double>(V0Type::V0TypeAll) - 0.5}}}},
{"radiusV0", "Decay radius (xy) V0; radius (cm); counts", {HistType::kTH1F, {{100, 0., 100.}}}},
{"massLambda", "#Lambda invariant mass; signed #it{p} (GeV/#it{c}); m (GeV/#it{c}^{2})", {HistType::kTH2F, {{100, -5.f, 5.f}, {50, 1.08f, 1.18f}}}},
{"massLambda", "#Lambda invariant mass; signed #it{p} (GeV/#it{c}); m (GeV/#it{c}^{2})", {HistType::kTH2F, {{100, -5.f, 5.f}, {200, 1.08f, 1.18f}}}},
{"massLambdaMc", "#Lambda invariant mass (MC); signed #it{p} (GeV/#it{c}); m (GeV/#it{c}^{2})", {HistType::kTH2F, {{100, -5.f, 5.f}, {200, 1.08f, 1.18f}}}},
{"Lambda_vs_K0s", "Mass #Lambda vs K^{0}_s; m_{K^{0}_{s}} (GeV/#it{c}^{2}); m_{#Lambda} (GeV/#it{c}^{2})", {HistType::kTH2F, {{50, 0.f, 1.f}, {70, 0.6f, 2.f}}}},
{"armenteros_plot_before_selections", "Armenteros-Podolanski plot; #alpha; q_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -1.f, 1.f}, {100, 0.f, 0.3f}}}},
{"armenteros_plot", "Armenteros-Podolanski plot; #alpha; q_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -1.f, 1.f}, {100, 0.f, 0.3f}}}},
Expand All @@ -243,7 +245,8 @@
{"photon_conversion_position_layer", "Photon conversion position (ITS layers); x (cm); y (cm)", {HistType::kTH2F, {{100, -5.f, 5.f}, {100, -5.f, 5.f}}}},
{"casc_dca_daughter_pairs", "DCA (xy) for cascade daughter pairs; DCAxy (cm); counts", {HistType::kTH1F, {{100, -0.1, 0.1}}}},
{"Xi_vs_Omega", "Mass Xi vs Omega; mass Omega (GeV/#it{c}^{2}); mass Xi (GeV/#it{c}^{2})", {HistType::kTH2F, {{50, 1.f, 2.f}, {50, 1.f, 2.f}}}},
{"massOmega", "Mass #Omega; signed #it{p}_{T} (GeV/#it{c}); mass (GeV/#it{c}^{2})", {HistType::kTH2F, {{100, -5.f, 5.f}, {100, 1.62f, 1.72f}}}},
{"massOmega", "Mass #Omega; signed #it{p}_{T} (GeV/#it{c}); mass (GeV/#it{c}^{2})", {HistType::kTH2F, {{100, -5.f, 5.f}, {400, 1.62f, 1.72f}}}},
{"massOmegaMc", "Mass #Omega (MC); signed #it{p}_{T} (GeV/#it{c}); mass (GeV/#it{c}^{2})", {HistType::kTH2F, {{100, -5.f, 5.f}, {400, 1.62f, 1.72f}}}},
{"massOmegaWithBkg", "Mass Omega with Background; mass Omega (GeV/#it{c}^{2}); counts", {HistType::kTH1F, {{100, 1.62f, 1.72f}}}},
{"nSigmaTPCEl", "nSigma TPC Electron; signed #it{p} (GeV/#it{c}); n#sigma_{TPC} e", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {60, -2.0f, 2.0f}}}},
{"nSigmaTPCPi", "nSigma TPC Pion; signed #it{p} (GeV/#it{c}); n#sigma_{TPC} #pi", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {60, -3.0f, 3.0f}}}},
Expand Down Expand Up @@ -389,14 +392,16 @@
template <typename T>
bool qualityTrackSelection(const T& track)
{
if (std::abs(track.eta()) > v0setting_etaMaxV0dau) {
if (std::abs(track.eta()) > track_etaMax) {
return false;
}
if (track.itsNCls() < track_nClsItsMin ||
track.tpcNClsFound() < track_nClsTpcMin ||
track.tpcNClsCrossedRows() < track_nClsTpcMin ||
track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable() ||
track.tpcNClsShared() > track_nClsTpcMaxShared) {
track.tpcNClsShared() > track_nClsTpcMaxShared ||
track.tpcChi2NCl() < track_tpcChi2Min ||
track.tpcChi2NCl() > 4.0f) {
return false;
}
return true;
Expand Down Expand Up @@ -556,6 +561,64 @@
return massV0;
}

template <typename McPart>
void fillMcHistogramsV0(const float massLambda, const float massAntiLambda,
const std::array<float, 3>& momMother,
const McPart& posDaughter, const McPart& negDaughter)
{
if ((std::abs(posDaughter.pdgCode()) != 2212 && std::abs(posDaughter.pdgCode()) != 211) ||

Check failure on line 569 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(std::abs(negDaughter.pdgCode()) != 2212 && std::abs(negDaughter.pdgCode()) != 211)) {

Check failure on line 570 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return;
}

int motherPdgCode = 0;
for (const auto& posMother : posDaughter.template mothers_as<aod::McParticles>()) {
for (const auto& negMother : negDaughter.template mothers_as<aod::McParticles>()) {
if (negMother.globalIndex() == posMother.globalIndex()) {
motherPdgCode = posMother.pdgCode();
}
}
}

if (motherPdgCode == 3122) {

Check failure on line 583 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
m_hAnalysis.fill(HIST("massLambdaMc"), std::hypot(momMother[0], momMother[1], momMother[2]), massLambda);
} else if (motherPdgCode == -3122) {

Check failure on line 585 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
m_hAnalysis.fill(HIST("massLambdaMc"), std::hypot(momMother[0], momMother[1], momMother[2]) * -1.f, massAntiLambda);
}
}

template <typename McPart>
void fillMcHistogramsCascade(const float massOmega,
const std::array<float, 3>& momMother,
const McPart& bachelorDaughter, const McPart& posV0Daughter)
{
McPart v0Daughter;
for (const auto& iterV0Daughter : posV0Daughter.template mothers_as<aod::McParticles>()) {
if (std::abs(iterV0Daughter.pdgCode()) != 3122) {

Check failure on line 597 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
}
v0Daughter = iterV0Daughter;
}
if (std::abs(bachelorDaughter.pdgCode()) != 321) {

Check failure on line 602 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return;
}

int motherPdgCode = 0;
for (const auto& bachelorMother : bachelorDaughter.template mothers_as<aod::McParticles>()) {
for (const auto& v0Mother : v0Daughter.template mothers_as<aod::McParticles>()) {
if (v0Mother.globalIndex() == bachelorMother.globalIndex()) {
motherPdgCode = bachelorMother.pdgCode();
}
}
}

if (motherPdgCode == 3334) {

Check failure on line 615 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
m_hAnalysis.fill(HIST("massOmegaMc"), std::hypot(momMother[0], momMother[1], momMother[2]), massOmega);
} else if (motherPdgCode == -3334) {

Check failure on line 617 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
m_hAnalysis.fill(HIST("massOmegaMc"), std::hypot(momMother[0], momMother[1], momMother[2]) * -1.f, massOmega);
}
}

template <bool isMC = false>
void fillTable(const Candidate& candidate)
{
Expand Down Expand Up @@ -587,9 +650,16 @@
template <typename T>
bool nucleiTrackSelection(const T& track)
{
if (std::abs(track.eta()) > track_etaMax) {
return false;
}
if (track.tpcNClsFound() < 90) {
return false;
}
if ((track.tpcChi2NCl() > 4.0f) ||
(track.tpcChi2NCl() < track_tpcChi2Min)) {
return false;
}
return true;
}

Expand Down Expand Up @@ -837,6 +907,8 @@

candidatePos.pdgCode = posMcParticle.pdgCode();
candidateNeg.pdgCode = negMcParticle.pdgCode();

fillMcHistogramsV0(massLambdaV0, massAntiLambdaV0, momMother, posMcParticle, negMcParticle);
}

fillTable<isMC>(candidatePos);
Expand Down Expand Up @@ -929,6 +1001,13 @@

m_ClusterStudiesTableMc(
mcParticle.pdgCode()); // pdgCode_K

auto posV0Daughter = v0Track.posTrack_as<Track>();
if (!posV0Daughter.has_mcParticle()) {
return;
}
auto mcPosParticleV0 = posV0Daughter.mcParticle();
fillMcHistogramsCascade(massOmega, momMother, mcParticle, mcPosParticleV0);
}

m_hAnalysis.fill(HIST("isPositive"), bachelorTrack.p() > 0);
Expand Down Expand Up @@ -1111,7 +1190,7 @@

if (setting_fillV0 || setting_fillK) {
m_v0TrackParCovs.clear();
for (auto& v0 : v0Table_thisCollision) {

Check failure on line 1193 in PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
fillV0Cand</*isMC*/ false>(PV, v0, tracks);
}
}
Expand Down
Loading