@@ -1416,8 +1416,27 @@ struct SginclusivePhiKstarSD {
14161416 for (const auto & trk1 : partSlice) {
14171417 if (std::abs (trk1.pdgCode ()) == o2::constants::physics::Pdg::kK0Star892 ) {
14181418 vkstar.SetCoordinates (trk1.px (), trk1.py (), trk1.pz (), o2::constants::physics::MassK0Star892);
1419- if (std::abs (vkstar.Rapidity ()) < 0.5 ) {
1420- registry.get <TH3>(HIST (" MC/accMPtRap_kstar_G1" ))->Fill (vkstar.M (), vkstar.Pt (), vkstar.Rapidity (), 1 .);
1419+ auto kDaughters = trk1.daughters_as <aod::UDMcParticles>();
1420+ const size_t kExpectedNumberOfDaughters = 2 ;
1421+ if (kDaughters .size () != kExpectedNumberOfDaughters ) {
1422+ continue ;
1423+ }
1424+ auto daughtp = false ;
1425+ auto daughtm = false ;
1426+ for (const auto & kCurrentDaughter : kDaughters ) {
1427+ if (!kCurrentDaughter .isPhysicalPrimary ()) {
1428+ continue ;
1429+ }
1430+ if (std::abs (kCurrentDaughter .pdgCode ()) == PDG_t::kKPlus ) {
1431+ daughtp = true ;
1432+ } else if (std::abs (kCurrentDaughter .pdgCode ()) == PDG_t::kPiPlus ) {
1433+ daughtm = true ;
1434+ }
1435+ }
1436+ if (daughtp && daughtm) {
1437+ if (std::abs (vkstar.Rapidity ()) < 0.5 ) {
1438+ registry.get <TH3>(HIST (" MC/accMPtRap_kstar_G1" ))->Fill (vkstar.M (), vkstar.Pt (), vkstar.Rapidity (), 1 .);
1439+ }
14211440 }
14221441 }
14231442 // phi
@@ -1426,8 +1445,27 @@ struct SginclusivePhiKstarSD {
14261445 continue ;
14271446 }
14281447 vphi.SetCoordinates (trk1.px (), trk1.py (), trk1.pz (), o2::constants::physics::MassPhi);
1429- if (std::abs (vphi.Rapidity ()) < 0.5 ) {
1430- registry.get <TH3>(HIST (" MC/accMPtRap_phi_G1" ))->Fill (vphi.M (), vphi.Pt (), vphi.Rapidity (), 1 .);
1448+ auto kDaughters = trk1.daughters_as <aod::UDMcParticles>();
1449+ const size_t kExpectedNumberOfDaughters1 = 2 ;
1450+ if (kDaughters .size () != kExpectedNumberOfDaughters1 ) {
1451+ continue ;
1452+ }
1453+ auto daughtp1 = false ;
1454+ auto daughtm1 = false ;
1455+ for (const auto & kCurrentDaughter : kDaughters ) {
1456+ if (!kCurrentDaughter .isPhysicalPrimary ()) {
1457+ continue ;
1458+ }
1459+ if (kCurrentDaughter .pdgCode () == PDG_t::kKPlus ) {
1460+ daughtp1 = true ;
1461+ } else if (kCurrentDaughter .pdgCode () == PDG_t::kKMinus ) {
1462+ daughtm1 = true ;
1463+ }
1464+ }
1465+ if (daughtp1 && daughtm1) {
1466+ if (std::abs (vphi.Rapidity ()) < 0.5 ) {
1467+ registry.get <TH3>(HIST (" MC/accMPtRap_phi_G1" ))->Fill (vphi.M (), vphi.Pt (), vphi.Rapidity (), 1 .);
1468+ }
14311469 }
14321470 }
14331471 }
@@ -1502,8 +1540,12 @@ struct SginclusivePhiKstarSD {
15021540 return ;
15031541 registry.fill (HIST (" Reco/hEventCutFlowMC" ), 17 );
15041542
1505- if (qaMC)
1543+ if (qaMC) {
15061544 rQA.fill (HIST (" hOcc_after_mc" ), collision.occupancyInTime ());
1545+ rQA.fill (HIST (" hVertexX_mc" ), collision.posX ());
1546+ rQA.fill (HIST (" hVertexY_mc" ), collision.posY ());
1547+ rQA.fill (HIST (" hVertexZ_mc" ), collision.posZ ());
1548+ }
15071549
15081550 // registry.get<TH1>(HIST("Reco/nPVContributors"))->Fill(pvContributors.size(), 1.);
15091551 // ROOT::Math::PxPyPzMVector vphi;
0 commit comments