Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion PWGLF/DataModel/LFSigmaProtonTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ DECLARE_SOA_COLUMN(NSigmaTOFPr, nSigmaTOFPr, float); //! Number of sigmas for th
DECLARE_SOA_COLUMN(SigmaPDG, sigmaPDG, int); //! PDG code of the Sigma daughter
DECLARE_SOA_COLUMN(DaughterPDG, daughterPDG, int); //! PDG code of the kink daughter
DECLARE_SOA_COLUMN(PrPDG, prPDG, int); //! PDG code of the proton candidate
DECLARE_SOA_COLUMN(SigmaGenPt, sigmaGenPt, float); //! Generated pT of the Sigma candidate
DECLARE_SOA_COLUMN(PrGenPt, prGenPt, float); //! Generated pT of the proton candidate
DECLARE_SOA_COLUMN(GenKStar, genKStar, float); //! Generated k* of the Sigma-Proton pair

} // namespace sigmaproton

Expand All @@ -60,7 +63,8 @@ DECLARE_SOA_TABLE(SigmaProtonMCCands, "AOD", "SIGMAPROTONMCCANDS",
kinkcand::PxDaug, kinkcand::PyDaug, kinkcand::PzDaug, sigmaproton::SigmaDecRad, sigmaproton::SigmaCosPA,
sigmaproton::ChargePr, sigmaproton::PxPr, sigmaproton::PyPr, sigmaproton::PzPr,
sigmaproton::NSigmaTPCPr, sigmaproton::NSigmaTOFPr,
sigmaproton::SigmaPDG, sigmaproton::DaughterPDG, sigmaproton::PrPDG);
sigmaproton::SigmaPDG, sigmaproton::DaughterPDG, sigmaproton::PrPDG,
sigmaproton::SigmaGenPt, sigmaproton::PrGenPt, sigmaproton::GenKStar);

} // namespace o2::aod

Expand Down
66 changes: 58 additions & 8 deletions PWGLF/TableProducer/Strangeness/sigmaProtonCorr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,26 @@ struct sigmaProtonCorrTask {
return 0.5 * trackRelK.P();
}

float getKStar(float sigmaPx, float sigmaPy, float sigmaPz, float pxPr, float pyPr, float pzPr)
{
TLorentzVector part1; // Sigma
TLorentzVector part2; // Proton
part1.SetXYZM(sigmaPx, sigmaPy, sigmaPz, o2::constants::physics::MassSigmaMinus);
part2.SetXYZM(pxPr, pyPr, pzPr, o2::constants::physics::MassProton);
trackSum = part1 + part2;
const float beta = trackSum.Beta();
const float betax = beta * std::cos(trackSum.Phi()) * std::sin(trackSum.Theta());
const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta());
const float betaz = beta * std::cos(trackSum.Theta());
PartOneCMS.SetXYZM(part1.Px(), part1.Py(), part1.Pz(), part1.M());
PartTwoCMS.SetXYZM(part2.Px(), part2.Py(), part2.Pz(), part2.M());
const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz);
PartOneCMS = boostPRF(PartOneCMS);
PartTwoCMS = boostPRF(PartTwoCMS);
trackRelK = PartOneCMS - PartTwoCMS;
return 0.5 * trackRelK.P();
}

template <typename Ttrack>
bool selectPrTrack(const Ttrack& candidate)
{
Expand Down Expand Up @@ -410,9 +430,22 @@ struct sigmaProtonCorrTask {
auto mcLabelSigma = tracks.rawIteratorAt(candidate.sigmaID);
auto mcLabelSigmaDau = tracks.rawIteratorAt(candidate.kinkDauID);
auto mcLabelPr = tracks.rawIteratorAt(candidate.prID);
auto pdgSigma = mcLabelSigma.has_mcParticle() ? mcLabelSigma.mcParticle_as<aod::McParticles>().pdgCode() : -999;
auto pdgSigmaDau = mcLabelSigmaDau.has_mcParticle() ? mcLabelSigmaDau.mcParticle_as<aod::McParticles>().pdgCode() : -999;
auto pdgPr = mcLabelPr.has_mcParticle() ? mcLabelPr.mcParticle_as<aod::McParticles>().pdgCode() : -999;

if (!mcLabelSigma.has_mcParticle() || !mcLabelSigmaDau.has_mcParticle() || !mcLabelPr.has_mcParticle()) {
continue; // Skip candidates where MC truth is not available
}

auto mcPartSigma = mcLabelSigma.mcParticle_as<aod::McParticles>();
auto mcPartSigmaDau = mcLabelSigmaDau.mcParticle_as<aod::McParticles>();
auto mcPartPr = mcLabelPr.mcParticle_as<aod::McParticles>();
auto pdgSigma = mcPartSigma.pdgCode();
auto pdgSigmaDau = mcLabelSigmaDau.has_mcParticle() ? mcPartSigmaDau.pdgCode() : -999;
auto pdgPr = mcLabelPr.has_mcParticle() ? mcPartPr.pdgCode() : -999;

float sigmaPtGen = std::hypot(mcPartSigma.px(), mcPartSigma.py());
float prPtGen = std::hypot(mcPartPr.px(), mcPartPr.py());
float kStarGen = getKStar(mcPartSigma.px(), mcPartSigma.py(), mcPartSigma.pz(), mcPartPr.px(), mcPartPr.py(), mcPartPr.pz());

outputDataTableMC(candidate.sigmaCharge,
candidate.sigmaPx,
candidate.sigmaPy,
Expand All @@ -430,7 +463,10 @@ struct sigmaProtonCorrTask {
candidate.nSigmaTOFPr,
pdgSigma,
pdgSigmaDau,
pdgPr);
pdgPr,
sigmaPtGen,
prPtGen,
kStarGen);
}
}
}
Expand Down Expand Up @@ -462,9 +498,20 @@ struct sigmaProtonCorrTask {
auto mcLabelSigma = tracks.rawIteratorAt(candidate.sigmaID);
auto mcLabelSigmaDau = tracks.rawIteratorAt(candidate.kinkDauID);
auto mcLabelPr = tracks.rawIteratorAt(candidate.prID);
auto pdgSigma = mcLabelSigma.has_mcParticle() ? mcLabelSigma.mcParticle_as<aod::McParticles>().pdgCode() : -999;
auto pdgSigmaDau = mcLabelSigmaDau.has_mcParticle() ? mcLabelSigmaDau.mcParticle_as<aod::McParticles>().pdgCode() : -999;
auto pdgPr = mcLabelPr.has_mcParticle() ? mcLabelPr.mcParticle_as<aod::McParticles>().pdgCode() : -999;

if (!mcLabelSigma.has_mcParticle() || !mcLabelSigmaDau.has_mcParticle() || !mcLabelPr.has_mcParticle()) {
continue; // Skip candidates where MC truth is not available
}

auto mcPartSigma = mcLabelSigma.mcParticle_as<aod::McParticles>();
auto mcPartSigmaDau = mcLabelSigmaDau.mcParticle_as<aod::McParticles>();
auto mcPartPr = mcLabelPr.mcParticle_as<aod::McParticles>();
auto pdgSigma = mcPartSigma.pdgCode();
auto pdgSigmaDau = mcLabelSigmaDau.has_mcParticle() ? mcPartSigmaDau.pdgCode() : -999;
auto pdgPr = mcLabelPr.has_mcParticle() ? mcPartPr.pdgCode() : -999;
float sigmaPtGen = std::hypot(mcPartSigma.px(), mcPartSigma.py());
float prPtGen = std::hypot(mcPartPr.px(), mcPartPr.py());
float kStarGen = getKStar(mcPartSigma.px(), mcPartSigma.py(), mcPartSigma.pz(), mcPartPr.px(), mcPartPr.py(), mcPartPr.pz());
outputDataTableMC(candidate.sigmaCharge,
candidate.sigmaPx,
candidate.sigmaPy,
Expand All @@ -482,7 +529,10 @@ struct sigmaProtonCorrTask {
candidate.nSigmaTOFPr,
pdgSigma,
pdgSigmaDau,
pdgPr);
pdgPr,
sigmaPtGen,
prPtGen,
kStarGen);
}
}
}
Expand Down
Loading