@@ -784,6 +784,7 @@ struct HfCandidateCreator3ProngExpressions {
784784 // Configuration
785785 o2::framework::Configurable<bool > rejectBackground{" rejectBackground" , true , " Reject particles from background events" };
786786 o2::framework::Configurable<bool > matchKinkedDecayTopology{" matchKinkedDecayTopology" , false , " Match also candidates with tracks that decay with kinked topology" };
787+ o2::framework::Configurable<bool > matchInteractionsWithMaterial{" matchInteractionsWithMaterial" , false , " Match also candidates with tracks that interact with material" };
787788
788789 bool createDplus{false };
789790 bool createDs{false };
@@ -856,6 +857,7 @@ struct HfCandidateCreator3ProngExpressions {
856857 int8_t swapping = 0 ;
857858 int8_t channel = 0 ;
858859 int8_t nKinkedTracks = 0 ;
860+ int8_t nInteractionsWithMaterial = 0 ;
859861 std::vector<int > arrDaughIndex;
860862 std::array<int , 2 > arrPDGDaugh;
861863 std::array<int , 2 > arrPDGResonant1 = {kProton , 313 }; // Λc± → p± K*
@@ -888,15 +890,19 @@ struct HfCandidateCreator3ProngExpressions {
888890 }
889891 }
890892 if (fromBkg) {
891- rowMcMatchRec (flag, origin, swapping, channel, -1 .f , 0 , 0 );
893+ rowMcMatchRec (flag, origin, swapping, channel, -1 .f , 0 , 0 , 0 );
892894 continue ;
893895 }
894896 }
895897
896898 // D± → π± K∓ π±
897899 if (createDplus) {
898- if (matchKinkedDecayTopology) {
899- indexRec = RecoDecay::getMatchedMCRec<false , false , false , true >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kPiPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
900+ if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
901+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kPiPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks, &nInteractionsWithMaterial);
902+ } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
903+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , false >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kPiPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
904+ } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
905+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , false , true >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kPiPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , nullptr , &nInteractionsWithMaterial);
900906 } else {
901907 indexRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kPiPlus , -kKPlus , +kPiPlus }, true , &sign, 2 );
902908 }
@@ -908,15 +914,23 @@ struct HfCandidateCreator3ProngExpressions {
908914 // Ds± → K± K∓ π± and D± → K± K∓ π±
909915 if (flag == 0 && createDs) {
910916 bool isDplus = false ;
911- if (matchKinkedDecayTopology) {
912- indexRec = RecoDecay::getMatchedMCRec<false , false , false , true >(mcParticles, arrayDaughters, Pdg::kDS , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
917+ if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
918+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(mcParticles, arrayDaughters, Pdg::kDS , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks, &nInteractionsWithMaterial);
919+ } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
920+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , false >(mcParticles, arrayDaughters, Pdg::kDS , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
921+ } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
922+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , false , true >(mcParticles, arrayDaughters, Pdg::kDS , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , nullptr , &nInteractionsWithMaterial);
913923 } else {
914924 indexRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughters, Pdg::kDS , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 );
915925 }
916926 if (indexRec == -1 ) {
917927 isDplus = true ;
918- if (matchKinkedDecayTopology) {
919- indexRec = RecoDecay::getMatchedMCRec<false , false , false , true >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
928+ if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
929+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks, &nInteractionsWithMaterial);
930+ } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
931+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , false >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
932+ } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
933+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , false , true >(mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 , nullptr , &nInteractionsWithMaterial);
920934 } else {
921935 indexRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughters, Pdg::kDPlus , std::array{+kKPlus , -kKPlus , +kPiPlus }, true , &sign, 2 );
922936 }
@@ -945,8 +959,12 @@ struct HfCandidateCreator3ProngExpressions {
945959
946960 // Λc± → p± K∓ π±
947961 if (flag == 0 && createLc) {
948- if (matchKinkedDecayTopology) {
949- indexRec = RecoDecay::getMatchedMCRec<false , false , false , true >(mcParticles, arrayDaughters, Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
962+ if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
963+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(mcParticles, arrayDaughters, Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks, &nInteractionsWithMaterial);
964+ } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
965+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , false >(mcParticles, arrayDaughters, Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
966+ } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
967+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , false , true >(mcParticles, arrayDaughters, Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , nullptr , &nInteractionsWithMaterial);
950968 } else {
951969 indexRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughters, Pdg::kLambdaCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
952970 }
@@ -976,8 +994,12 @@ struct HfCandidateCreator3ProngExpressions {
976994
977995 // Ξc± → p± K∓ π±
978996 if (flag == 0 && createXic) {
979- if (matchKinkedDecayTopology) {
980- indexRec = RecoDecay::getMatchedMCRec<false , false , false , true >(mcParticles, arrayDaughters, Pdg::kXiCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
997+ if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
998+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , true >(mcParticles, arrayDaughters, Pdg::kXiCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks, &nInteractionsWithMaterial);
999+ } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
1000+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , true , false >(mcParticles, arrayDaughters, Pdg::kXiCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , &nKinkedTracks);
1001+ } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
1002+ indexRec = RecoDecay::getMatchedMCRec<false , false , false , false , true >(mcParticles, arrayDaughters, Pdg::kXiCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 , nullptr , &nInteractionsWithMaterial);
9811003 } else {
9821004 indexRec = RecoDecay::getMatchedMCRec (mcParticles, arrayDaughters, Pdg::kXiCPlus , std::array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
9831005 }
@@ -993,9 +1015,9 @@ struct HfCandidateCreator3ProngExpressions {
9931015 }
9941016 if (origin == RecoDecay::OriginType::NonPrompt) {
9951017 auto bHadMother = mcParticles.rawIteratorAt (idxBhadMothers[0 ]);
996- rowMcMatchRec (flag, origin, swapping, channel, bHadMother.pt (), bHadMother.pdgCode (), nKinkedTracks);
1018+ rowMcMatchRec (flag, origin, swapping, channel, bHadMother.pt (), bHadMother.pdgCode (), nKinkedTracks, nInteractionsWithMaterial );
9971019 } else {
998- rowMcMatchRec (flag, origin, swapping, channel, -1 .f , 0 , nKinkedTracks);
1020+ rowMcMatchRec (flag, origin, swapping, channel, -1 .f , 0 , nKinkedTracks, nInteractionsWithMaterial );
9991021 }
10001022 }
10011023
0 commit comments