@@ -152,11 +152,19 @@ struct HFCandidateCreator3ProngMC {
152152 {
153153 int8_t sign = 0 ;
154154 int8_t flag = 0 ;
155+ int8_t DecayChannel = 0 ;
156+ std::vector<int > arrDaughIndex;
157+ std::array<int , 2 > arrPDGDaugh;
158+ std::array<int , 2 > arrPDGResonant1 = {2212 , 313 }; // Λc± → p± K*
159+ std::array<int , 2 > arrPDGResonant2 = {2224 , 321 }; // Λc± → Δ(1232)±± K∓
160+ std::array<int , 2 > arrPDGResonant3 = {3124 , 211 }; // Λc± → Λ(1520) π±
155161
156162 // Match reconstructed candidates.
157163 for (auto & candidate : candidates) {
158164 // Printf("New rec. candidate");
159165 flag = 0 ;
166+ DecayChannel = 0 ;
167+ arrDaughIndex.clear ();
160168 auto arrayDaughters = array{candidate.index0_as <aod::BigTracksMC>(), candidate.index1_as <aod::BigTracksMC>(), candidate.index2_as <aod::BigTracksMC>()};
161169
162170 // D± → π± K∓ π±
@@ -168,18 +176,37 @@ struct HFCandidateCreator3ProngMC {
168176 // Λc± → p± K∓ π±
169177 if (flag == 0 ) {
170178 // Printf("Checking Λc± → p± K∓ π±");
171- if (RecoDecay::getMatchedMCRec (particlesMC, std::move (arrayDaughters), 4122 , array{+kProton , -kKPlus , +kPiPlus }, true , &sign) > -1 ) {
179+ auto indexRecLc = RecoDecay::getMatchedMCRec (particlesMC, std::move (arrayDaughters), 4122 , array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
180+ if (indexRecLc > -1 ) {
172181 flag = sign * (1 << LcToPKPi);
182+
183+ // Printf("Flagging the different Λc± → p± K∓ π± decay channels");
184+ RecoDecay::getDaughters (particlesMC, indexRecLc, &arrDaughIndex, array{0 }, 1 );
185+ if (arrDaughIndex.size () == 2 ) {
186+ for (auto iProng = 0 ; iProng < arrDaughIndex.size (); ++iProng) {
187+ auto daughI = particlesMC.iteratorAt (arrDaughIndex[iProng]);
188+ arrPDGDaugh[iProng] = std::abs (daughI.pdgCode ());
189+ }
190+ if (arrPDGDaugh[0 ] == arrPDGResonant1[0 ] && arrPDGDaugh[1 ] == arrPDGResonant1[1 ]) {
191+ DecayChannel = 1 ;
192+ } else if (arrPDGDaugh[0 ] == arrPDGResonant2[0 ] && arrPDGDaugh[1 ] == arrPDGResonant2[1 ]) {
193+ DecayChannel = 2 ;
194+ } else if (arrPDGDaugh[0 ] == arrPDGResonant3[0 ] && arrPDGDaugh[1 ] == arrPDGResonant3[1 ]) {
195+ DecayChannel = 3 ;
196+ }
197+ }
173198 }
174199 }
175200
176- rowMCMatchRec (flag);
201+ rowMCMatchRec (flag, DecayChannel );
177202 }
178203
179204 // Match generated particles.
180205 for (auto & particle : particlesMC) {
181206 // Printf("New gen. candidate");
182207 flag = 0 ;
208+ DecayChannel = 0 ;
209+ arrDaughIndex.clear ();
183210
184211 // D± → π± K∓ π±
185212 // Printf("Checking D± → π± K∓ π±");
@@ -190,12 +217,29 @@ struct HFCandidateCreator3ProngMC {
190217 // Λc± → p± K∓ π±
191218 if (flag == 0 ) {
192219 // Printf("Checking Λc± → p± K∓ π±");
193- if (RecoDecay::isMatchedMCGen (particlesMC, particle, 4122 , array{+kProton , -kKPlus , +kPiPlus }, true , &sign)) {
220+ auto isMatchedGenLc = RecoDecay::isMatchedMCGen (particlesMC, particle, 4122 , array{+kProton , -kKPlus , +kPiPlus }, true , &sign, 2 );
221+ if (isMatchedGenLc) {
194222 flag = sign * (1 << LcToPKPi);
223+
224+ // Printf("Flagging the different Λc± → p± K∓ π± decay channels");
225+ RecoDecay::getDaughters (particlesMC, particle.globalIndex (), &arrDaughIndex, array{0 }, 1 );
226+ if (arrDaughIndex.size () == 2 ) {
227+ for (auto jProng = 0 ; jProng < arrDaughIndex.size (); ++jProng) {
228+ auto daughJ = particlesMC.iteratorAt (arrDaughIndex[jProng]);
229+ arrPDGDaugh[jProng] = std::abs (daughJ.pdgCode ());
230+ }
231+ if (arrPDGDaugh[0 ] == arrPDGResonant1[0 ] && arrPDGDaugh[1 ] == arrPDGResonant1[1 ]) {
232+ DecayChannel = 1 ;
233+ } else if (arrPDGDaugh[0 ] == arrPDGResonant2[0 ] && arrPDGDaugh[1 ] == arrPDGResonant2[1 ]) {
234+ DecayChannel = 2 ;
235+ } else if (arrPDGDaugh[0 ] == arrPDGResonant3[0 ] && arrPDGDaugh[1 ] == arrPDGResonant3[1 ]) {
236+ DecayChannel = 3 ;
237+ }
238+ }
195239 }
196240 }
197241
198- rowMCMatchGen (flag);
242+ rowMCMatchGen (flag, DecayChannel );
199243 }
200244 }
201245};
0 commit comments