Skip to content

Commit 09cda74

Browse files
authored
Common/Core: add check in getCharmHadronOrigin to reject in case of first mother parton (#7074)
1 parent bb7c403 commit 09cda74

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Common/Core/RecoDecay.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,16 @@ struct RecoDecay {
935935
for (auto& iPart : arrayIds[-stage]) { // check all the particles that were the mothers at the previous stage
936936
auto particleMother = particlesMC.rawIteratorAt(iPart - particlesMC.offset());
937937
if (particleMother.has_mothers()) {
938+
939+
// we exit immediately if searchUpToQuark is false and the first mother is a parton (an hadron should never be the mother of a parton)
940+
if (!searchUpToQuark) {
941+
auto mother = particlesMC.rawIteratorAt(particleMother.mothersIds().front() - particlesMC.offset());
942+
auto PDGParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother
943+
if (PDGParticleIMother < 9 || (PDGParticleIMother > 20 && PDGParticleIMother < 38)) {
944+
return OriginType::Prompt;
945+
}
946+
}
947+
938948
for (auto iMother = particleMother.mothersIds().front(); iMother <= particleMother.mothersIds().back(); ++iMother) { // loop over the mother particles of the analysed particle
939949
if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again
940950
continue;

0 commit comments

Comments
 (0)