Skip to content

Commit 01430bd

Browse files
committed
Fix swap tagging for Bs and B0
1 parent ec292ec commit 01430bd

1 file changed

Lines changed: 25 additions & 9 deletions

File tree

‎PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx‎

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ struct HfDataCreatorJpsiHadReduced {
617617
// B0 → J/Psi K0* → (µ+µ-) (K+pi-)
618618
int indexRec = -1;
619619
// We set acceptIncompleteReco to true to accept the case of bremsstrahlung
620-
indexRec = RecoDecay::getMatchedMCRec<false, false, true, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kB0, std::array{-kMuonMinus, +kMuonMinus, +kKPlus, -kPiPlus}, true, &sign, 2 );
620+
indexRec = RecoDecay::getMatchedMCRec<false, false, true, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kB0, std::array{-kMuonMinus, +kMuonMinus, +kKPlus, -kPiPlus}, true, &sign, 2);
621621
if (indexRec > -1) {
622622
const auto& bParticle = particlesMc.rawIteratorAt(indexRec);
623623
std::vector<int> dauIndices{};
@@ -638,11 +638,15 @@ struct HfDataCreatorJpsiHadReduced {
638638
// we also test pi(K)-mu swapping
639639
if (indexRec < 0) {
640640
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1);
641-
flagSwapped = true;
641+
if (indexRec > -1) {
642+
flagSwapped = true;
643+
}
642644
}
643645
if (indexRec < 0) {
644646
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1);
645-
flagSwapped = true;
647+
if (indexRec > -1) {
648+
flagSwapped = true;
649+
}
646650
}
647651
if (indexRec > -1) {
648652
channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0;
@@ -684,11 +688,15 @@ struct HfDataCreatorJpsiHadReduced {
684688
// we also test pi(K)-mu swapping
685689
if (indexRec < 0) {
686690
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1);
687-
flagSwapped = true;
691+
if (indexRec > -1) {
692+
flagSwapped = true;
693+
}
688694
}
689695
if (indexRec < 0) {
690696
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1);
691-
flagSwapped = true;
697+
if (indexRec > -1) {
698+
flagSwapped = true;
699+
}
692700
}
693701
if (indexRec > -1) {
694702
channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0;
@@ -755,11 +763,15 @@ struct HfDataCreatorJpsiHadReduced {
755763
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kPhi, std::array{+kKPlus, -kKPlus}, true, &sign, 1);
756764
if (indexRec < 0) {
757765
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kPhi, std::array{+kKPlus, -kKPlus}, true, &sign, 1);
758-
flagSwapped = true;
766+
if (indexRec > -1) {
767+
flagSwapped = true;
768+
}
759769
}
760770
if (indexRec < 0) {
761771
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kPhi, std::array{+kKPlus, -kKPlus}, true, &sign, 1);
762-
flagSwapped = true;
772+
if (indexRec > -1) {
773+
flagSwapped = true;
774+
}
763775
}
764776
if (indexRec > -1) {
765777
channel = o2::hf_decay::hf_cand_beauty::BsToJpsiPhi;
@@ -800,11 +812,15 @@ struct HfDataCreatorJpsiHadReduced {
800812
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kPhi, std::array{+kKPlus, -kKPlus}, true, &sign, 1);
801813
if (indexRec < 0) {
802814
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kPhi, std::array{+kKPlus, -kKPlus}, true, &sign, 1);
803-
flagSwapped = true;
815+
if (indexRec > -1) {
816+
flagSwapped = true;
817+
}
804818
}
805819
if (indexRec < 0) {
806820
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kPhi, std::array{+kKPlus, -kKPlus}, true, &sign, 1);
807-
flagSwapped = true;
821+
if (indexRec > -1) {
822+
flagSwapped = true;
823+
}
808824
}
809825
if (indexRec > -1) {
810826
channel = o2::hf_decay::hf_cand_beauty::BsToJpsiPhi;

0 commit comments

Comments
 (0)