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
78 changes: 46 additions & 32 deletions PWGJE/Core/JetHFUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,20 +601,6 @@ bool isHFDaughterTrack(T& track, U& candidate)
}
}

/**
* returns the index of the JMcParticle matched to the HF candidate
*
* @param candidate hf candidate that is being checked
* @param tracks track table
* @param particles particle table
*/
template <typename T, typename U, typename V>
auto matchedHFParticleId(const T& candidate, const U& /*tracks*/, const V& /*particles*/)
{
const auto candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
return candidateDaughterParticle.template mothers_first_as<V>().globalIndex(); // can we get the Id directly?
}

/**
* returns the JMcParticle matched to the HF candidate
*
Expand All @@ -626,35 +612,63 @@ template <typename T, typename U, typename V>
auto matchedHFParticle(const T& candidate, const U& /*tracks*/, const V& /*particles*/)
{

const typename V::iterator candidateDaughterParticle;
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) {
candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
typename V::iterator candidateDaughterParticle;
if constexpr (isD0Candidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) {
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
}
}
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) {
candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
if constexpr (isDplusCandidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) {
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
}
}
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) {
candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
if constexpr (isDsCandidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) {
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
}
}
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) {
candidateDaughterParticle = candidate.template prong3_as<U>().template mcParticle_as<V>();
if constexpr (isDstarCandidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) {
candidateDaughterParticle = candidate.template prong2_as<U>().template mcParticle_as<V>();
}
}
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) {
candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
if constexpr (isLcCandidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) {
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
}
}
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::B0ToDminusPi) {
candidateDaughterParticle = candidate.template prong4_as<U>().template mcParticle_as<V>();
if constexpr (isB0Candidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::B0ToDminusPi) {
candidateDaughterParticle = candidate.template prong3_as<U>().template mcParticle_as<V>();
}
}
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::BplusToD0Pi) {
candidateDaughterParticle = candidate.template prong3_as<U>().template mcParticle_as<V>();
if constexpr (isBplusCandidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::BplusToD0Pi) {
candidateDaughterParticle = candidate.template prong2_as<U>().template mcParticle_as<V>();
}
}
if (std::abs(candidate.flagMcMatchRec()) == o2::aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi) {
candidateDaughterParticle = candidate.template prong1_as<U>().template mcParticle_as<V>();
if constexpr (isXicToXiPiPiCandidate<T>()) {
if (std::abs(candidate.flagMcMatchRec()) == o2::aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi) {
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
}
}

return candidateDaughterParticle.template mothers_first_as<V>();
}

/**
* returns the index of the JMcParticle matched to the HF candidate
*
* @param candidate hf candidate that is being checked
* @param tracks track table
* @param particles particle table
*/
template <typename T, typename U, typename V>
auto matchedHFParticleId(const T& candidate, const U& tracks, const V& particles)
{
return (matchedHFParticle(candidate, tracks, particles)).globalIndex();
}

/**
* returns a slice of the table depending on the index of the HF candidate
*
Expand Down
Loading