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
49 changes: 42 additions & 7 deletions PWGLF/Tasks/Resonances/lambda1405analysis.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/Tasks/Resonances/lambda1405analysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -15,6 +15,7 @@

#include "PWGLF/DataModel/LFKinkDecayTables.h"

#include "Common/Core/PID/PIDTOF.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponse.h"

Expand All @@ -26,11 +27,11 @@
using namespace o2::framework;
using namespace o2::framework::expressions;

using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCPi>;
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCPi, aod::pidTOFFullPi>;
using CollisionsFull = soa::Join<aod::Collisions, aod::EvSel>;
using CollisionsFullMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels>;

struct lambda1405candidate {

Check failure on line 34 in PWGLF/Tasks/Resonances/lambda1405analysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
// Columns for Lambda(1405) candidate
float mass = -1; // Invariant mass of the Lambda(1405) candidate
float sigmaMass = -1; // Invariant mass of the Sigma candidate
Expand All @@ -39,19 +40,20 @@
float sigmaPt = -1; // pT of the Sigma daughter
float piPt = -1; // pT of the pion daughter
float nSigmaTPCPi = -1; // Number of sigmas for the pion candidate
float nSigmaTOFPi = -1; // Number of sigmas for the pion candidate using TOF
int piFromSigmaID = 0; // ID of the pion from Sigma decay in MC
int sigmaID = 0; // ID of the Sigma candidate in MC
int piID = 0; // ID of the pion candidate in MC
};

struct lambda1405analysis {

Check failure on line 49 in PWGLF/Tasks/Resonances/lambda1405analysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
int lambda1405PdgCode = 102132; // PDG code for Lambda(1405)

Check failure on line 50 in PWGLF/Tasks/Resonances/lambda1405analysis.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.
lambda1405candidate lambda1405Cand; // Lambda(1405) candidate structure
// Histograms are defined with HistogramRegistry
HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
HistogramRegistry rLambda1405{"lambda1405", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
// Configurable for event selection
Configurable<float> cutzvertex{"cutZVertex", 10.0f, "Accepted z-vertex range (cm)"};

Check failure on line 56 in PWGLF/Tasks/Resonances/lambda1405analysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> cutEtaDaught{"cutEtaDaughter", 0.8f, "Eta cut for daughter tracks"};
Configurable<float> cutDCAtoPVSigma{"cutDCAtoPVSigma", 0.1f, "Max DCA to primary vertex for Sigma candidates (cm)"};
Configurable<float> cutDCAtoPVPiFromSigma{"cutDCAtoPVPiFromSigma", 2., "Min DCA to primary vertex for pion from Sigma candidates (cm)"};
Expand All @@ -61,14 +63,18 @@
Configurable<float> cutNITSClusPi{"cutNITSClusPi", 5, "Minimum number of ITS clusters for pion candidate"};
Configurable<float> cutNTPCClusPi{"cutNTPCClusPi", 90, "Minimum number of TPC clusters for pion candidate"};
Configurable<float> cutNSigmaPi{"cutNSigmaPi", 3, "NSigmaTPCPion"};
Configurable<float> cutNSigmaPiTOF{"cutNSigmaPiTOF", 3, "NSigmaTOFPion"};

Configurable<bool> doLSBkg{"doLikeSignBkg", false, "Use like-sign background"};
Configurable<bool> useTOF{"useTOF", false, "Use TOF for PID for pion candidates"};

Preslice<aod::KinkCands> mKinkPerCol = aod::track::collisionId;
Preslice<aod::TracksIU> mPerColTracks = aod::track::collisionId;

void init(InitContext const&)
{
// Axes
const AxisSpec ptAxis{50, -5, 5, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec ptAxis{100, -10, 10, "#it{p}_{T} (GeV/#it{c})"};
const AxisSpec ptPiAxis{50, -2, 2, "#it{p}_{T}^{#pi} (GeV/#it{c})"};
const AxisSpec ptResolutionAxis{100, -0.5, 0.5, "#it{p}_{T}^{rec} - #it{p}_{T}^{gen} (GeV/#it{c})"};
const AxisSpec massAxis{100, 1.3, 1.5, "m (GeV/#it{c}^{2})"};
Expand All @@ -82,6 +88,7 @@
rLambda1405.add("h2PtMassSigma", "h2PtMassSigma", {HistType::kTH2F, {ptAxis, sigmaMassAxis}});
rLambda1405.add("h2SigmaMassVsMass", "h2SigmaMassVsMass", {HistType::kTH2F, {massAxis, sigmaMassAxis}});
rLambda1405.add("h2PtPiNSigma", "h2PtPiNSigma", {HistType::kTH2F, {ptPiAxis, nSigmaPiAxis}});
rLambda1405.add("h2PtPiNSigmaTOF", "h2PtPiNSigmaTOF", {HistType::kTH2F, {ptPiAxis, nSigmaPiAxis}});

if (doprocessMC) {
// Add MC histograms if needed
Expand All @@ -97,10 +104,23 @@
if (std::abs(candidate.tpcNSigmaPi()) > cutNSigmaPi || candidate.tpcNClsFound() < cutNTPCClusPi || std::abs(candidate.eta()) > cutEtaDaught) {
return false;
}
if (!piFromSigma && candidate.itsNCls() < cutNITSClusPi) {
if (piFromSigma) {
return true;
}

if (candidate.itsNCls() < cutNITSClusPi) {
return false;
}

if (useTOF && !candidate.hasTOF()) {
return false;
}
return true;

if (useTOF && std::abs(candidate.tofNSigmaPi()) > cutNSigmaPiTOF) {
return false;
}

return true; // Track is selected
}

bool selectCandidate(aod::KinkCands::iterator const& sigmaCand, TracksFull const& tracks)
Expand All @@ -118,14 +138,23 @@
}
rLambda1405.fill(HIST("h2PtMassSigmaBeforeCuts"), sigmaCand.mothSign() * sigmaCand.ptMoth(), sigmaCand.mSigmaMinus());
for (const auto& piTrack : tracks) {
if (piTrack.sign() == sigmaCand.mothSign() || !selectPiTrack(piTrack, false)) {
continue; // Skip if the pion has the same sign as the Sigma or does not pass selection
if (!doLSBkg) {
if (piTrack.sign() == sigmaCand.mothSign()) {
continue;
}
} else {
if (piTrack.sign() != sigmaCand.mothSign()) {
continue;
}
}
if (!selectPiTrack(piTrack, false)) {
continue;
}
auto sigmaMom = std::array{sigmaCand.pxMoth(), sigmaCand.pyMoth(), sigmaCand.pzMoth()};
auto piMom = std::array{piTrack.px(), piTrack.py(), piTrack.pz()};
float pt = std::hypot(sigmaMom[0] + piMom[0], sigmaMom[1] + piMom[1]);
float invMass = RecoDecay::m(std::array{sigmaMom, piMom}, std::array{o2::constants::physics::MassSigmaMinus, o2::constants::physics::MassPiPlus});
if (invMass < 1.3 || invMass > 1.5) {

Check failure on line 157 in PWGLF/Tasks/Resonances/lambda1405analysis.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;
}
lambda1405Cand.piFromSigmaID = piKinkTrack.globalIndex();
Expand All @@ -138,6 +167,11 @@
lambda1405Cand.sigmaPt = sigmaCand.ptMoth();
lambda1405Cand.piPt = piTrack.pt();
lambda1405Cand.nSigmaTPCPi = piTrack.tpcNSigmaPi();
if (useTOF) {
lambda1405Cand.nSigmaTOFPi = piTrack.tofNSigmaPi();
} else {
lambda1405Cand.nSigmaTOFPi = -999; // Not used if TOF is not enabled
}
return true; // Candidate is selected
}
return false; // No valid pion track found
Expand All @@ -154,7 +188,8 @@
rLambda1405.fill(HIST("h2PtMass"), lambda1405Cand.sigmaSign * lambda1405Cand.pt, lambda1405Cand.mass);
rLambda1405.fill(HIST("h2PtMassSigma"), lambda1405Cand.sigmaSign * lambda1405Cand.sigmaPt, lambda1405Cand.sigmaMass);
rLambda1405.fill(HIST("h2SigmaMassVsMass"), lambda1405Cand.mass, lambda1405Cand.sigmaMass);
rLambda1405.fill(HIST("h2PtPiNSigma"), lambda1405Cand.piPt, lambda1405Cand.nSigmaTPCPi);
rLambda1405.fill(HIST("h2PtPiNSigma"), lambda1405Cand.sigmaSign * lambda1405Cand.piPt, lambda1405Cand.nSigmaTPCPi);
rLambda1405.fill(HIST("h2PtPiNSigmaTOF"), lambda1405Cand.sigmaSign * lambda1405Cand.piPt, lambda1405Cand.nSigmaTOFPi);
}
}
}
Expand All @@ -181,7 +216,7 @@
auto mcTrackPiKink = mcLabPiKink.mcParticle_as<aod::McParticles>();
auto mcTrackSigma = mcLabSigma.mcParticle_as<aod::McParticles>();
auto mcTrackPi = mcLabPi.mcParticle_as<aod::McParticles>();
if (std::abs(mcTrackPiKink.pdgCode()) != 211 || std::abs(mcTrackSigma.pdgCode()) != 3122 || std::abs(mcTrackPi.pdgCode()) != 211) {

Check failure on line 219 in PWGLF/Tasks/Resonances/lambda1405analysis.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.

Check failure on line 219 in PWGLF/Tasks/Resonances/lambda1405analysis.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; // Skip if not a valid pion or Sigma candidate
}
if (!mcTrackPiKink.has_mothers() || !mcTrackSigma.has_mothers() || !mcTrackPi.has_mothers()) {
Expand Down Expand Up @@ -235,7 +270,7 @@
// Check if the Lambda(1405) has a Sigma daughter
bool hasSigmaDaughter = false;
for (const auto& daughter : mcPart.daughters_as<aod::McParticles>()) {
if (std::abs(daughter.pdgCode()) == 3122) { // Sigma PDG code

Check failure on line 273 in PWGLF/Tasks/Resonances/lambda1405analysis.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.

Check failure on line 273 in PWGLF/Tasks/Resonances/lambda1405analysis.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.
hasSigmaDaughter = true;
break; // Found a Sigma daughter, exit loop
}
Expand Down
Loading