Skip to content

Commit e5f881a

Browse files
authored
Modified MC Rec matching function to work with partly reconstructed decays for resonance workflow (AliceO2Group#7905)
1 parent 366cf21 commit e5f881a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Common/Core/RecoDecay.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ struct RecoDecay {
662662

663663
/// Checks whether the reconstructed decay candidate is the expected decay.
664664
/// \param checkProcess switch to accept only decay daughters by checking the production process of MC particles
665+
/// \param acceptIncompleteReco switch to accept candidates with only part of the daughters reconstructed
665666
/// \param particlesMC table with MC particles
666667
/// \param arrDaughters array of candidate daughters
667668
/// \param PDGMother expected mother PDG code
@@ -670,7 +671,7 @@ struct RecoDecay {
670671
/// \param sign antiparticle indicator of the found mother w.r.t. PDGMother; 1 if particle, -1 if antiparticle, 0 if mother not found
671672
/// \param depthMax maximum decay tree level to check; Daughters up to this level will be considered. If -1, all levels are considered.
672673
/// \return index of the mother particle if the mother and daughters are correct, -1 otherwise
673-
template <bool acceptFlavourOscillation = false, bool checkProcess = false, std::size_t N, typename T, typename U>
674+
template <bool acceptFlavourOscillation = false, bool checkProcess = false, bool acceptIncompleteReco = false, std::size_t N, typename T, typename U>
674675
static int getMatchedMCRec(const T& particlesMC,
675676
const std::array<U, N>& arrDaughters,
676677
int PDGMother,
@@ -726,7 +727,7 @@ struct RecoDecay {
726727
return -1;
727728
}
728729
// Check that the number of direct daughters is not larger than the number of expected final daughters.
729-
if constexpr (!checkProcess) {
730+
if constexpr (!acceptIncompleteReco && !checkProcess) {
730731
if (particleMother.daughtersIds().back() - particleMother.daughtersIds().front() + 1 > static_cast<int>(N)) {
731732
// Printf("MC Rec: Rejected: too many direct daughters: %d (expected %ld final)", particleMother.daughtersIds().back() - particleMother.daughtersIds().front() + 1, N);
732733
return -1;
@@ -740,7 +741,7 @@ struct RecoDecay {
740741
// }
741742
// printf("\n");
742743
// Check whether the number of actual final daughters is equal to the number of expected final daughters (i.e. the number of provided prongs).
743-
if (arrAllDaughtersIndex.size() != N) {
744+
if (!acceptIncompleteReco && arrAllDaughtersIndex.size() != N) {
744745
// Printf("MC Rec: Rejected: incorrect number of final daughters: %ld (expected %ld)", arrAllDaughtersIndex.size(), N);
745746
return -1;
746747
}

0 commit comments

Comments
 (0)