Skip to content

Commit 5c29360

Browse files
committed
[PWGDQ] fix match type assignment in ML training data producer
The match type assigned to candidate MFT-MCH matches in the ML training data producer task was wrongly set to "fake" in cases where the MCH track is pairable but the corresponding MFT track does not have an associated MC particle. In such cases the match type is now correctly assigned as "wrong".
1 parent 55f54a0 commit 5c29360

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

PWGDQ/Tasks/mftMchMatcher.cxx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,9 @@ struct mftMchMatcher {
550550
template <class TMCH, class TMFTs>
551551
bool isDecay(TMCH const& mchTrack, TMFTs const& mftTracks)
552552
{
553+
if (!mchTrack.has_mcParticle()) {
554+
return false;
555+
}
553556
const auto& mchMcParticle = mchTrack.mcParticle();
554557

555558
const auto& mchMotherParticles = mchMcParticle.template mothers_as<aod::McParticles>();
@@ -589,12 +592,6 @@ struct mftMchMatcher {
589592
auto const& mchTrack = muonTrack.template matchMCHTrack_as<TMUONS>();
590593
auto const& mftTrack = muonTrack.template matchMFTTrack_as<TMFTS>();
591594

592-
if (!mchTrack.has_mcParticle() || !mftTrack.has_mcParticle()) {
593-
// if either the MCH or the MFT tracks are fakes (not associated to any MC particles)
594-
// we consider the match as fake
595-
return (isBestMatch ? kMatchTypeFakeLeading : kMatchTypeFakeNonLeading);
596-
}
597-
598595
bool isPaired = isPairedMuon(mchTrack.globalIndex(), matchablePairs);
599596
std::pair<int64_t, int64_t> matchPair{mchTrack.globalIndex(), mftTrack.globalIndex()};
600597
bool isTrueMatch = std::find(matchablePairs.begin(), matchablePairs.end(), matchPair) != matchablePairs.end();

0 commit comments

Comments
 (0)