@@ -267,6 +267,7 @@ struct alice3decayFinder {
267267 dmeson.mcTruth = 2 ; // D0bar
268268 }
269269 }
270+
270271 return true ;
271272 }
272273
@@ -362,7 +363,9 @@ struct alice3decayFinder {
362363
363364 if (doprocessFindDmesons) {
364365 histos.add (" h2dGenD" , " h2dGenD" , kTH2F , {axisPt, axisEta});
366+ histos.add (" h2dGenD_KpiOnly" , " h2dGenD_KpiOnly" , kTH2F , {axisPt, axisEta});
365367 histos.add (" h2dGenDbar" , " h2dGenDbar" , kTH2F , {axisPt, axisEta});
368+ histos.add (" h2dGenDbar_KpiOnly" , " h2dGenDbar_KpiOnly" , kTH2F , {axisPt, axisEta});
366369 histos.add (" h3dRecD" , " h3dRecD" , kTH3F , {axisPt, axisEta, axisDMass});
367370 histos.add (" h3dRecDSig" , " h3dRecDSig" , kTH3F , {axisPt, axisEta, axisDMass});
368371 histos.add (" h3dRecDRefl" , " h3dRecDRefl" , kTH3F , {axisPt, axisEta, axisDMass});
@@ -471,11 +474,37 @@ struct alice3decayFinder {
471474 if (doprocessFindDmesons) {
472475 for (auto const & mcParticle : trueD) {
473476 histos.fill (HIST (" h2dGenD" ), mcParticle.pt (), mcParticle.eta ());
474- histos.fill (HIST (" hDGenForEfficiency" ), mcParticle.pt (), mcParticle.y ()); // in common for D and Dbar
477+ auto daughters = mcParticle.template daughters_as <aod::McParticles>();
478+ if (daughters.size () != 2 )
479+ continue ;
480+ // int daugID[2];
481+ int daugPDG[2 ], i = 0 ;
482+ for (const auto & dau : daughters) {
483+ // daugID[i] = dau.globalIndex();
484+ daugPDG[i] = dau.pdgCode ();
485+ i++;
486+ }
487+ if ((std::fabs (daugPDG[0 ]) == 321 && std::fabs (daugPDG[1 ]) == 211 ) || (std::fabs (daugPDG[0 ]) == 211 && std::fabs (daugPDG[1 ]) == 321 )) {
488+ histos.fill (HIST (" h2dGenD_KpiOnly" ), mcParticle.pt (), mcParticle.eta ());
489+ histos.fill (HIST (" hDGenForEfficiency" ), mcParticle.pt (), mcParticle.y ()); // in common for D and Dbar
490+ }
475491 }
476492 for (auto const & mcParticle : trueDbar) {
477493 histos.fill (HIST (" h2dGenDbar" ), mcParticle.pt (), mcParticle.eta ());
478- histos.fill (HIST (" hDGenForEfficiency" ), mcParticle.pt (), mcParticle.y ()); // in common for D and Dbar
494+ auto daughters = mcParticle.template daughters_as <aod::McParticles>();
495+ if (daughters.size () != 2 )
496+ continue ;
497+ // int daugID[2];
498+ int daugPDG[2 ], i = 0 ;
499+ for (const auto & dau : daughters) {
500+ // daugID[i] = dau.globalIndex();
501+ daugPDG[i] = dau.pdgCode ();
502+ i++;
503+ }
504+ if ((std::fabs (daugPDG[0 ]) == 321 && std::fabs (daugPDG[1 ]) == 211 ) || (std::fabs (daugPDG[0 ]) == 211 && std::fabs (daugPDG[1 ]) == 321 )) {
505+ histos.fill (HIST (" h2dGenDbar_KpiOnly" ), mcParticle.pt (), mcParticle.eta ());
506+ histos.fill (HIST (" hDGenForEfficiency" ), mcParticle.pt (), mcParticle.y ()); // in common for D and Dbar
507+ }
479508 }
480509 }
481510 if (doprocessFindLcBaryons) {
@@ -509,6 +538,7 @@ struct alice3decayFinder {
509538 // D0 mesons
510539 for (auto const & posTrackRow : tracksPiPlusFromDgrouped) {
511540 for (auto const & negTrackRow : tracksKaMinusFromDgrouped) {
541+
512542 if (mcSameMotherCheck && !checkSameMother (posTrackRow, negTrackRow))
513543 continue ;
514544 if (!buildDecayCandidateTwoBody (posTrackRow, negTrackRow, o2::constants::physics::MassPionCharged, o2::constants::physics::MassKaonCharged, mcParticles))
@@ -651,9 +681,11 @@ struct alice3decayFinder {
651681 mcTruthOutcome (dmeson.mcTruth );
652682 }
653683 }
684+
654685 // D0bar mesons
655686 for (auto const & posTrackRow : tracksKaPlusFromDgrouped) {
656687 for (auto const & negTrackRow : tracksPiMinusFromDgrouped) {
688+
657689 if (mcSameMotherCheck && !checkSameMother (posTrackRow, negTrackRow))
658690 continue ;
659691 if (!buildDecayCandidateTwoBody (posTrackRow, negTrackRow, o2::constants::physics::MassKaonCharged, o2::constants::physics::MassPionCharged, mcParticles))
0 commit comments