Skip to content

Commit ab01c22

Browse files
authored
removing check on decay channel type (#17339)
1 parent 1381de7 commit ab01c22

2 files changed

Lines changed: 12 additions & 46 deletions

File tree

PWGJE/Core/JetHFUtilities.h

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -609,58 +609,33 @@ bool isHFDaughterTrack(T& track, U& candidate)
609609
* @param particles particle table
610610
*/
611611
template <typename T, typename U, typename V>
612-
auto matchedHFParticle(const T& candidate, const U& /*tracks*/, const V& /*particles*/, bool& isMatched)
612+
auto matchedHFParticle(const T& candidate, const U& /*tracks*/, const V& /*particles*/)
613613
{
614614

615615
typename V::iterator candidateDaughterParticle;
616-
isMatched = false;
617616
if constexpr (isD0Candidate<T>()) {
618-
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) {
619-
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
620-
isMatched = true;
621-
}
617+
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
622618
}
623619
if constexpr (isDplusCandidate<T>()) {
624-
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) {
625-
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
626-
isMatched = true;
627-
}
620+
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
628621
}
629622
if constexpr (isDsCandidate<T>()) {
630-
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) {
631-
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
632-
isMatched = true;
633-
}
623+
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
634624
}
635625
if constexpr (isDstarCandidate<T>()) {
636-
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) {
637-
candidateDaughterParticle = candidate.template prong2_as<U>().template mcParticle_as<V>();
638-
isMatched = true;
639-
}
626+
candidateDaughterParticle = candidate.template prong2_as<U>().template mcParticle_as<V>();
640627
}
641628
if constexpr (isLcCandidate<T>()) {
642-
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) {
643-
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
644-
isMatched = true;
645-
}
629+
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
646630
}
647631
if constexpr (isB0Candidate<T>()) {
648-
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::B0ToDminusPi) {
649-
candidateDaughterParticle = candidate.template prong3_as<U>().template mcParticle_as<V>();
650-
isMatched = true;
651-
}
632+
candidateDaughterParticle = candidate.template prong3_as<U>().template mcParticle_as<V>();
652633
}
653634
if constexpr (isBplusCandidate<T>()) {
654-
if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::BplusToD0Pi) {
655-
candidateDaughterParticle = candidate.template prong2_as<U>().template mcParticle_as<V>();
656-
isMatched = true;
657-
}
635+
candidateDaughterParticle = candidate.template prong2_as<U>().template mcParticle_as<V>();
658636
}
659637
if constexpr (isXicToXiPiPiCandidate<T>()) {
660-
if (std::abs(candidate.flagMcMatchRec()) == o2::aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi) {
661-
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
662-
isMatched = true;
663-
}
638+
candidateDaughterParticle = candidate.template prong0_as<U>().template mcParticle_as<V>();
664639
}
665640
return candidateDaughterParticle.template mothers_first_as<V>();
666641
}
@@ -675,13 +650,8 @@ auto matchedHFParticle(const T& candidate, const U& /*tracks*/, const V& /*parti
675650
template <typename T, typename U, typename V>
676651
auto matchedHFParticleId(const T& candidate, const U& tracks, const V& particles)
677652
{
678-
bool isMatched = false;
679-
auto matchedParticle = matchedHFParticle(candidate, tracks, particles, isMatched);
680-
if (isMatched) {
681-
return matchedParticle.globalIndex();
682-
} else {
683-
return int64_t{-1}; // does this clash with the case where a track doesnt have an associated particle?
684-
}
653+
auto matchedParticle = matchedHFParticle(candidate, tracks, particles);
654+
return matchedParticle.globalIndex();
685655
}
686656

687657
/**

PWGJE/Tasks/jetCorrelationD0.cxx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,7 @@ struct JetCorrelationD0 {
471471
if (d0Candidate.pt() < d0PtCutMin) { // once settled on a mlcut, then add the lower bound of the systematics as a cut here
472472
continue;
473473
}
474-
bool isMatched = false;
475-
const auto& d0Particle = jethfutilities::matchedHFParticle(d0Candidate, tracks, particles, isMatched);
476-
if (!isMatched) {
477-
continue;
478-
}
474+
const auto& d0Particle = jethfutilities::matchedHFParticle(d0Candidate, tracks, particles);
479475
for (const auto& McDJet : McDJets) {
480476
if (McDJet.pt() < jetPtCutMin) {
481477
continue;

0 commit comments

Comments
 (0)