@@ -485,6 +485,17 @@ struct HfDataCreatorCharmHadPiReduced {
485485 }
486486 }
487487 }
488+ // B0 → D- K+ → (π- K+ π-) K+
489+ if (!flag) {
490+ indexRec = RecoDecay::getMatchedMCRec<true , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ], vecDaughtersB[2 ], vecDaughtersB[3 ]}, Pdg::kB0 , std::array{-kPiPlus , +kKPlus , -kPiPlus , +kKPlus }, true , &sign, 3 );
491+ if (indexRec > -1 ) {
492+ // D- → π- K+ π-
493+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ], vecDaughtersB[2 ]}, Pdg::kDMinus , std::array{-kPiPlus , +kKPlus , -kPiPlus }, true , &sign, 2 );
494+ if (indexRec > -1 ) {
495+ flag = sign * BIT (hf_cand_b0::DecayTypeMc::B0ToDplusKToPiKPiK);
496+ }
497+ }
498+ }
488499 // Partly reconstructed decays, i.e. the 4 prongs have a common b-hadron ancestor
489500 // convention: final state particles are prong0,1,2,3
490501 if (!flag) {
@@ -604,6 +615,41 @@ struct HfDataCreatorCharmHadPiReduced {
604615 }
605616 }
606617 }
618+ // Bs → Ds- K+ → (K- K+ π-) K+
619+ if (!flag) {
620+ indexRec = RecoDecay::getMatchedMCRec<true , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ], vecDaughtersB[2 ], vecDaughtersB[3 ]}, Pdg::kBS , std::array{-kKPlus , +kKPlus , -kPiPlus , +kKPlus }, true , &sign, 3 );
621+ if (indexRec > -1 ) {
622+ // Ds- → K- K+ π-
623+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ], vecDaughtersB[2 ]}, -Pdg::kDS , std::array{-kKPlus , +kKPlus , -kPiPlus }, true , &sign, 2 );
624+ if (indexRec > -1 ) {
625+ std::vector<int > arrDaughDsIndex;
626+ std::array<int , 2 > arrPDGDaughDs;
627+ RecoDecay::getDaughters (particlesMc.rawIteratorAt (indexRec), &arrDaughDsIndex, std::array{0 }, 1 );
628+ if (arrDaughDsIndex.size () == 2 ) {
629+ for (auto iProng = 0u ; iProng < arrDaughDsIndex.size (); ++iProng) {
630+ auto daughI = particlesMc.rawIteratorAt (arrDaughDsIndex[iProng]);
631+ arrPDGDaughDs[iProng] = std::abs (daughI.pdgCode ());
632+ }
633+ // Ds- → Phi π- → K- K+ π- and Ds- → K0* K- → K- K+ π-
634+ if ((arrPDGDaughDs[0 ] == arrPDGResonantDsPhiPi[0 ] && arrPDGDaughDs[1 ] == arrPDGResonantDsPhiPi[1 ]) || (arrPDGDaughDs[0 ] == arrPDGResonantDsPhiPi[1 ] && arrPDGDaughDs[1 ] == arrPDGResonantDsPhiPi[0 ])) {
635+ flag = sign * BIT (hf_cand_bs::DecayTypeMc::BsToDsKToPhiPiKToKKPiK);
636+ } else if ((arrPDGDaughDs[0 ] == arrPDGResonantDKstarK[0 ] && arrPDGDaughDs[1 ] == arrPDGResonantDKstarK[1 ]) || (arrPDGDaughDs[0 ] == arrPDGResonantDKstarK[1 ] && arrPDGDaughDs[1 ] == arrPDGResonantDKstarK[0 ])) {
637+ flag = sign * BIT (hf_cand_bs::DecayTypeMc::BsToDsKToK0starKKToKKPiK);
638+ }
639+ }
640+ } else {
641+ debug = 1 ;
642+ LOGF (debug, " Bs decays in the expected final state but the condition on the intermediate state is not fulfilled" );
643+ }
644+
645+ auto indexMother = RecoDecay::getMother (particlesMc, vecDaughtersB.back ().template mcParticle_as <PParticles>(), Pdg::kBS , true );
646+ if (indexMother >= 0 ) {
647+ auto particleMother = particlesMc.rawIteratorAt (indexMother);
648+ motherPt = particleMother.pt ();
649+ checkWrongCollision (particleMother, collision, indexCollisionMaxNumContrib, flagWrongCollision);
650+ }
651+ }
652+ }
607653 // Partly reconstructed decays, i.e. the 4 prongs have a common b-hadron ancestor
608654 // convention: final state particles are prong0,1,2,3
609655 if (!flag) {
@@ -669,7 +715,7 @@ struct HfDataCreatorCharmHadPiReduced {
669715 // D0(bar) → K+ π-;
670716 indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ]}, Pdg::kD0 , std::array{+kPiPlus , -kKPlus }, true , &sign, 1 );
671717 if (indexRec > -1 ) {
672- flag = sign * BIT (hf_cand_bplus::DecayType::BplusToD0Pi );
718+ flag = sign * BIT (hf_cand_bplus::DecayTypeMc::BplusToD0PiToKPiPi );
673719 } else {
674720 debug = 1 ;
675721 LOGF (debug, " B+ decays in the expected final state but the condition on the intermediate state is not fulfilled" );
@@ -684,6 +730,27 @@ struct HfDataCreatorCharmHadPiReduced {
684730 }
685731 // additional checks for correlated backgrounds
686732 if (checkDecayTypeMc) {
733+ if (!flag) {
734+ // B+ → D0(bar) K+ → (K+ π-) K+
735+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ], vecDaughtersB[2 ]}, Pdg::kBPlus , std::array{+kKPlus , +kKPlus , -kPiPlus }, true , &sign, 2 );
736+ if (indexRec > -1 ) {
737+ // D0(bar) → K+ π-;
738+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ]}, Pdg::kD0 , std::array{+kPiPlus , -kKPlus }, true , &sign, 1 );
739+ if (indexRec > -1 ) {
740+ flag = sign * BIT (hf_cand_bplus::DecayTypeMc::BplusToD0KToKPiK);
741+ } else {
742+ debug = 1 ;
743+ LOGF (debug, " B+ decays in the expected final state but the condition on the intermediate state is not fulfilled" );
744+ }
745+
746+ auto indexMother = RecoDecay::getMother (particlesMc, vecDaughtersB.back ().template mcParticle_as <PParticles>(), Pdg::kBPlus , true );
747+ if (indexMother >= 0 ) {
748+ auto particleMother = particlesMc.rawIteratorAt (indexMother);
749+ motherPt = particleMother.pt ();
750+ checkWrongCollision (particleMother, collision, indexCollisionMaxNumContrib, flagWrongCollision);
751+ }
752+ }
753+ }
687754 // Partly reconstructed decays, i.e. the 3 prongs have a common b-hadron ancestor
688755 // convention: final state particles are prong0,1,2
689756 if (!flag) {
@@ -769,7 +836,7 @@ struct HfDataCreatorCharmHadPiReduced {
769836 // Lc+ → p K- π+
770837 indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(particlesMc, std::array{vecDaughtersB[0 ], vecDaughtersB[1 ], vecDaughtersB[2 ]}, Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
771838 if (indexRec > -1 ) {
772- flag = sign * BIT (hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiK );
839+ flag = sign * BIT (hf_cand_lb::DecayTypeMc::LbToLcKToPKPiK );
773840 }
774841 }
775842 }
0 commit comments