@@ -945,25 +945,17 @@ struct HfCandidateCreator3ProngExpressions {
945945 }
946946 }
947947
948- // LOG(info) << "CIAO REC MATCHING";
949948 if (matchCorrBkgs) {
950- // LOG(info) << "CIAO 1";
951- // LOG(info) << "--------------------------------------------";
952- // LOG(info) << "Matching correlated bkgs";
953949 std::array<int , 5 > mothersPdgCodes = {Pdg::kDPlus , Pdg::kDS , Pdg::kDStar , Pdg::kLambdaCPlus , Pdg::kXiCPlus };
954950 indexRec = -1 ; // Index of the matched reconstructed candidate
955-
956- // LOG(info) << "CIAO 2";
951+
957952 for (const auto & pdg : mothersPdgCodes) {
958953 int depth = 2 ;
959954 if (pdg == Pdg::kDStar ) {
960955 depth = 3 ; // D0 resonant decays are active
961956 }
962- // LOG(info) << "CIAO 3";
963957 auto finalStates = getDecayChannel3Prong (pdg);
964- // LOG(info) << "CIAO 3.0";
965958 for (const auto & [chn, finalState] : finalStates) {
966- // LOG(info) << "CIAO 3.0.1";
967959 std::array<int , 3 > finalStateParts3Prong = std::array{finalState[0 ], finalState[1 ], finalState[2 ]};
968960 if (finalState.size () > 3 ) { // Partly Reco 3-prong decays
969961 if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
@@ -975,8 +967,7 @@ struct HfCandidateCreator3ProngExpressions {
975967 } else {
976968 indexRec = RecoDecay::getMatchedMCRec<false , false , true , false , false >(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true , &sign, depth);
977969 }
978-
979- // LOG(info) << "CIAO 3.0.2";
970+
980971 if (indexRec != -1 ) {
981972 auto motherParticle = mcParticles.rawIteratorAt (indexRec);
982973 if (finalState.size () == 4 ) { // Check if the final state has 4 particles
@@ -992,30 +983,22 @@ struct HfCandidateCreator3ProngExpressions {
992983 if (!RecoDecay::isMatchedMCGen (mcParticles, motherParticle, pdg, finalStateParts3ProngAll, false , &sign, depth)) {
993984 indexRec = -1 ; // Reset indexRec if the generated decay does not match the reconstructed one is not matched
994985 }
995- // LOG(info) << "CIAO 3.0.3";
996986 } else if (finalState.size () == 5 ) { // Check if the final state has 3 particles
997987 // std::array<int, 5> finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], sign*finalState[3], sign*finalState[4]};
998- // LOG(info) << "CIAO 3.0.4";
999988 std::array<int , 5 > finalStateParts3ProngAll = std::array{finalState[0 ], finalState[1 ], finalState[2 ], finalState[3 ], finalState[4 ]};
1000989 if (sign < 0 ) {
1001990 for (auto & part : finalStateParts3ProngAll) {
1002991 if (part == kPi0 ) {
1003992 part = -part; // The Pi0 pdg code does not change between particle and antiparticle
1004993 }
1005994 }
1006- // LOG(info) << "CIAO 3.0.5";
1007995 }
1008996 if (!RecoDecay::isMatchedMCGen (mcParticles, motherParticle, pdg, finalStateParts3ProngAll, false , &sign, depth)) {
1009997 indexRec = -1 ; // Reset indexRec if the generated decay does not match the reconstructed one is not matched
1010- // LOG(info) << "CIAO 3.0.6";
1011998 }
1012- // LOG(info) << "CIAO 3.0.7";
1013999 }
1014- // LOG(info) << "CIAO 3.0.8";
10151000 }
1016- // LOG(info) << "CIAO 3.0.9";
10171001 } else if (finalState.size () == 3 ) { // Fully Reco 3-prong decays
1018- // LOG(info) << "CIAO 3.1";
10191002 if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
10201003 indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true , &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial);
10211004 } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
@@ -1025,19 +1008,18 @@ struct HfCandidateCreator3ProngExpressions {
10251008 } else {
10261009 indexRec = RecoDecay::getMatchedMCRec<false , false , false , false , false >(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true , &sign, depth);
10271010 }
1028- // LOG(info) << "CIAO 3.2";
10291011 } else {
10301012 LOG (info) << " Final state size not supported: " << finalState.size ();
10311013 continue ; // Skip unsupported final states
10321014 }
1033- // LOG(info) << "CIAO 4";
10341015 if (indexRec > -1 ) {
10351016 // std::cout << "Matched final state: " << chn << " with PDG code: " << pdg << std::endl;
10361017 flag = sign * chn;
1037-
1018+
10381019 // Flag the resonant decay channel
10391020 int resoMaxDepth = 1 ;
1040- if (std::abs (pdg) == Pdg::kDStar ) {
1021+ // if (std::abs(pdg) == Pdg::kDStar) {
1022+ if (std::abs (mcParticles.rawIteratorAt (indexRec).pdgCode ()) == Pdg::kDStar ) {
10411023 resoMaxDepth = 2 ; // Flag D0 resonances
10421024 }
10431025 std::vector<int > arrResoDaughIndex = {};
@@ -1049,16 +1031,16 @@ struct HfCandidateCreator3ProngExpressions {
10491031 arrPDGDaugh[iProng] = daughI.pdgCode ();
10501032 }
10511033 flagResonantDecay<true >(pdg, &channel, arrPDGDaugh);
1052- // LOG(info) << "CIAO 5";
1053- // LOG(info) << "[matchFinalStateCorrBkgs] Matched final state: " << chn << " with PDG code: " << static_cast<int>(pdg) << ", flag: " << static_cast<int>(flag) << ", &sign: " << static_cast<int>(sign);
1054- // LOG(info) << "[matchFinalStateCorrBkgs] Flag set to: " << static_cast<int>(flag) << " sign: " << static_cast<int>(sign) << " for channel: " << static_cast<int>(channel);
1034+ LOG (info) << " [matchFinalStateCorrBkgs] Matched final state: " << chn << " with PDG code: " << static_cast <int >(pdg) << " , flag: " << static_cast <int >(flag) << " , &sign: " << static_cast <int >(sign);
1035+ LOG (info) << " [matchFinalStateCorrBkgs] Flag set to: " << static_cast <int >(flag) << " sign: " << static_cast <int >(sign) << " for channel: " << static_cast <int >(channel);
10551036 }
10561037 break ; // Exit loop if a match is found
10571038 }
1058- // LOG(info) << "CIAO 6";
1039+ }
1040+ if (indexRec > -1 ) {
1041+ break ; // Exit loop if a match is found
10591042 }
10601043 }
1061- // LOG(info) << "CIAO 7";
10621044 // LOG(info) << "Corr Bkg matching ended with flag " << static_cast<int>(flag) << " and indexRec " << static_cast<int>(indexRec) << ", &sign " << static_cast<int>(sign) << ", channel " << static_cast<int>(channel);
10631045 } else {
10641046 // D± → π± K∓ π±
0 commit comments