diff --git a/PWGJE/Core/JetTaggingUtilities.h b/PWGJE/Core/JetTaggingUtilities.h index 0e8b08c3fa2..754c19331dc 100644 --- a/PWGJE/Core/JetTaggingUtilities.h +++ b/PWGJE/Core/JetTaggingUtilities.h @@ -990,12 +990,16 @@ int vertexClustering(AnyCollision const& collision, AnalysisJet const& jet, AnyT int trkIdx = 0; for (auto const& constituent : jet.template tracks_as()) { if (!constituent.has_mcParticle() || !constituent.template mcParticle_as().isPhysicalPrimary() || constituent.pt() < trackPtMin) { - trkLabels["trkOrigin"].push_back(0); + trkLabels["trkOrigin"].push_back(0); // fake track, non-physical primary track } else { const auto& particle = constituent.template mcParticle_as(); - int orig = RecoDecay::getParticleOrigin(particles, particle, searchUpToQuark); - trkLabels["trkOrigin"].push_back((orig > 0) ? orig : (trkLabels["trkVtxIndex"][trkIdx] == 0) ? 3 - : 4); + if (particle.mcCollisionId() != collision.globalIndex()) { + trkLabels["trkOrigin"].push_back(0); // mismatched coll track + } else { + int orig = RecoDecay::getParticleOrigin(particles, particle, searchUpToQuark); + trkLabels["trkOrigin"].push_back((orig != RecoDecay::OriginType::None) ? static_cast(orig) : (trkLabels["trkVtxIndex"][trkIdx] == 0) ? 3 + : 4); // 1: charm, 2: beauty, 3: primary, 4: other secondary + } } trkIdx++; diff --git a/PWGJE/TableProducer/derivedDataProducer.cxx b/PWGJE/TableProducer/derivedDataProducer.cxx index 6a482f981df..3676ab5a6e9 100644 --- a/PWGJE/TableProducer/derivedDataProducer.cxx +++ b/PWGJE/TableProducer/derivedDataProducer.cxx @@ -582,7 +582,7 @@ struct JetDerivedDataProducerTask { auto collisionTrackIndices = assocCollisions.sliceBy(preslices.perCollisionTrackIndices, collision.globalIndex()); for (auto const& collisionTrackIndex : collisionTrackIndices) { auto track = collisionTrackIndex.track_as>(); - if (track.collisionId() == collision.globalIndex() && track.has_mcParticle()) { + if (track.has_mcParticle()) { products.jMcTracksLabelTable(track.mcParticleId()); } else { products.jMcTracksLabelTable(-1);