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
78 changes: 51 additions & 27 deletions PWGHF/Core/HfHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,44 +309,42 @@ struct HfHelper {
return std::abs(massKKPairDsToPiKK(candidate) - o2::constants::physics::MassPhi);
}

/// Calculate the cosine of the angle between the pion and the opposite sign kaon in the phi rest frame
/// \param candidate Ds candidate from aod::HfCand3Prong table
/// \param option mass hypothesis considered: 0 = KKPi, 1 = PiKK
/// \return cosine of pion-kaon angle in the phi rest frame
/// Calculate the cosine of the angle between two particles in the rest frame of two particles
/// \param candidate Candidate with three prongs
/// \param massHypo mass array of the three prongs in the order of prong0, prong1, prong2
/// \param prong0ForRestFrame index of the first prong to define the rest frame (0, 1, or 2)
/// \param prong1ForRestFrame index of the second prong to define the rest frame (0, 1, or 2)
/// \return cosine of the angle between the two particles in the rest frame of two particles
template <typename T>
static auto cosPiKPhiRestFrame(const T& candidate, int option)
static auto cosABInRestFrame(const T& candidate, std::array<double, 3> massHypo, int prong0ForRestFrame, int prong1ForRestFrame)
{
// Ported from AliAODRecoDecayHF3Prong::CosPiKPhiRFrame
std::array<float, 3> momPi{};
std::array<float, 3> momK1{};
std::array<float, 3> momK2{};
std::array<float, 3> momProng0{};
std::array<float, 3> momProng1{};
std::array<float, 3> momProng2{};

if (option == 0) { // KKPi
momPi = candidate.pVectorProng2();
momK1 = candidate.pVectorProng1();
momK2 = candidate.pVectorProng0();
} else { // PiKK
momPi = candidate.pVectorProng0();
momK1 = candidate.pVectorProng1();
momK2 = candidate.pVectorProng2();
}
momProng0 = candidate.pVectorProng0();
momProng1 = candidate.pVectorProng1();
momProng2 = candidate.pVectorProng2();

ROOT::Math::PxPyPzMVector const vecPi(momPi[0], momPi[1], momPi[2], o2::constants::physics::MassPiPlus);
ROOT::Math::PxPyPzMVector const vecK1(momK1[0], momK1[1], momK1[2], o2::constants::physics::MassKPlus);
ROOT::Math::PxPyPzMVector const vecK2(momK2[0], momK2[1], momK2[2], o2::constants::physics::MassKPlus);
ROOT::Math::PxPyPzMVector const vecPhi = vecK1 + vecK2;
auto prongForAngle = 3 - prong0ForRestFrame - prong1ForRestFrame;
ROOT::Math::PxPyPzMVector const vecProng0(momProng0[0], momProng0[1], momProng0[2], massHypo[0]);
ROOT::Math::PxPyPzMVector const vecProng1(momProng1[0], momProng1[1], momProng1[2], massHypo[1]);
ROOT::Math::PxPyPzMVector const vecProng2(momProng2[0], momProng2[1], momProng2[2], massHypo[2]);
std::array<ROOT::Math::PxPyPzMVector, 3> vecProngs{vecProng0, vecProng1, vecProng2};
ROOT::Math::PxPyPzMVector const vecRestFrame = vecProngs[prong0ForRestFrame] + vecProngs[prong1ForRestFrame];

ROOT::Math::Boost const boostToPhiRestFrame(vecPhi.BoostToCM());
auto momPiPhiRestFrame = boostToPhiRestFrame(vecPi).Vect();
auto momK1PhiRestFrame = boostToPhiRestFrame(vecK1).Vect();
ROOT::Math::Boost const boostToPhiRestFrame(vecRestFrame.BoostToCM());
auto momProng0ForAngle = boostToPhiRestFrame(vecProngs[prongForAngle]).Vect();
auto momProng1ForAngle = boostToPhiRestFrame(vecProngs[prong1ForRestFrame]).Vect();

return momPiPhiRestFrame.Dot(momK1PhiRestFrame) / std::sqrt(momPiPhiRestFrame.Mag2() * momK1PhiRestFrame.Mag2());
return momProng0ForAngle.Dot(momProng1ForAngle) / std::sqrt(momProng0ForAngle.Mag2() * momProng1ForAngle.Mag2());
}

template <typename T>
static auto cos3PiKDsToKKPi(const T& candidate)
{
auto cosPiK = cosPiKPhiRestFrame(candidate, 0);
auto cosPiK = cosABInRestFrame(candidate, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}, 0, 1);
return cosPiK * cosPiK * cosPiK;
}

Expand All @@ -359,7 +357,7 @@ struct HfHelper {
template <typename T>
static auto cos3PiKDsToPiKK(const T& candidate)
{
auto cosPiK = cosPiKPhiRestFrame(candidate, 1);
auto cosPiK = cosABInRestFrame(candidate, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus}, 1, 2);
return cosPiK * cosPiK * cosPiK;
}

Expand All @@ -369,6 +367,32 @@ struct HfHelper {
return std::abs(cos3PiKDsToPiKK(candidate));
}

template <typename T>
static auto cos3MuKBpToMuMuK(const T& candidate)
{
auto cosMuK = cosABInRestFrame(candidate, std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus}, 0, 1);
return cosMuK * cosMuK * cosMuK;
}

template <typename T>
static auto absCos3MuKBpToMuMuK(const T& candidate)
{
return std::abs(cos3MuKBpToMuMuK(candidate));
}

template <typename T>
static auto cos3MuKBpToKMuMu(const T& candidate)
{
auto cosMuK = cosABInRestFrame(candidate, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassMuon, o2::constants::physics::MassMuon}, 1, 2);
return cosMuK * cosMuK * cosMuK;
}

template <typename T>
static auto absCos3MuKBpToKMuMu(const T& candidate)
{
return std::abs(cos3MuKBpToKMuMu(candidate));
}

// Λc± → p± K∓ π±

template <typename T>
Expand Down
3 changes: 3 additions & 0 deletions PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ DECLARE_SOA_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, float
DECLARE_SOA_COLUMN(ImpactParameterJpsiDauPos, impactParameterJpsiDauPos, float); //! Impact parameter of Jpsi daughter candidate
DECLARE_SOA_COLUMN(ImpactParameterJpsiDauNeg, impactParameterJpsiDauNeg, float); //! Impact parameter of Jpsi daughter candidate
DECLARE_SOA_COLUMN(ImpactParameterLfTrack0, impactParameterLfTrack0, float); //! Impact parameter of Phi daughter candidate
DECLARE_SOA_COLUMN(AbsCos3MuKBpToMuMuK, absCos3MuKBpToMuMuK, float); //! Absolute value of the cosine of the angle between one of the muons and the kaon in the J/Psi rest frame
DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate
DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane
DECLARE_SOA_COLUMN(CpaJpsi, cpaJpsi, float); //! Cosine pointing angle of Jpsi daughter candidate
Expand Down Expand Up @@ -144,6 +145,7 @@ DECLARE_SOA_TABLE(HfRedCandBpLites, "AOD", "HFREDCANDBPLITE", //! Table with som
hf_cand_bplustojpsik_lite::ImpactParameterProduct,
hf_cand_bplustojpsik_lite::ImpactParameterProductJpsi,
hf_cand_bplustojpsik_lite::MaxNormalisedDeltaIP,
hf_cand_bplustojpsik_lite::AbsCos3MuKBpToMuMuK,
hf_cand_bplustojpsik_lite::MlScoreSig,
// hf_sel_candidate_bplus::IsSelBplusToJpsiPi,
// Jpsi meson features
Expand Down Expand Up @@ -461,6 +463,7 @@ struct HfTaskBplusToJpsiKReduced {
candidate.impactParameterProduct(),
candidate.impactParameterProductJpsi(),
candidate.maxNormalisedDeltaIP(),
HfHelper::absCos3MuKBpToMuMuK(candidate),
candidateMlScoreSig,
// J/Psi features
invMassJpsi,
Expand Down
Loading