Skip to content

Commit f04e9d2

Browse files
sdudi123sandeep dudi
andauthored
[PWGUD] MC particle selection criteria added (#14689)
Co-authored-by: sandeep dudi <sandeep.dudi@cern.ch>
1 parent 0dc1761 commit f04e9d2

File tree

1 file changed

+197
-21
lines changed

1 file changed

+197
-21
lines changed

PWGUD/Tasks/sginclusivePhiKstarSD.cxx

Lines changed: 197 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ struct SginclusivePhiKstarSD {
333333
registry.add("MC/genM_1", "Generated events; Mass (GeV/#it{c}^2)", {HistType::kTH1F, {{220, 0.98, 1.2}}});
334334

335335
registry.add("MC/accMPtRap_phi_G", "Generated Phi; Mass (GeV/#it{c}^2); #it{p}_{T} (GeV/#it{c})", {HistType::kTH3F, {{220, 0.98, 1.20}, {200, 0.0, 10.0}, {60, -1.5, 1.5}}});
336+
registry.add("MC/accMPtRap_phi_G1", "Generated Phi1; Mass (GeV/#it{c}^2); #it{p}_{T} (GeV/#it{c})", {HistType::kTH3F, {{220, 0.98, 1.20}, {200, 0.0, 10.0}, {60, -1.5, 1.5}}});
337+
registry.add("MC/accMPtRap_phi_G2", "Generated Phi2; Mass (GeV/#it{c}^2); #it{p}_{T} (GeV/#it{c})", {HistType::kTH3F, {{220, 0.98, 1.20}, {200, 0.0, 10.0}, {60, -1.5, 1.5}}});
336338

337339
registry.add("MC/accEtaPt", "Generated events in acceptance; eta (1); #it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{60, -1.5, 1.5}, {250, 0.0, 5.0}}});
338340
registry.add("MC/accRap", "Generated events in acceptance; Rapidity (1)", {HistType::kTH1F, {{60, -1.5, 1.5}}});
@@ -344,6 +346,8 @@ struct SginclusivePhiKstarSD {
344346
registry.add("MC/pDiff", "McTruth - reconstructed track momentum; McTruth - reconstructed track momentum; Entries", {HistType::kTH2F, {{240, -6., 6.}, {3, -1.5, 1.5}}});
345347
// K*0
346348
registry.add("MC/accMPtRap_kstar_G", "Generated K*0; Mass (GeV/#it{c}^2); #it{p}_{T} (GeV/#it{c})", {HistType::kTH3F, {{400, 0., 2.0}, {200, 0.0, 10.0}, {60, -1.5, 1.5}}});
349+
registry.add("MC/accMPtRap_kstar_G1", "Generated K*0 from kp; Mass (GeV/#it{c}^2); #it{p}_{T} (GeV/#it{c})", {HistType::kTH3F, {{400, 0., 2.0}, {200, 0.0, 10.0}, {60, -1.5, 1.5}}});
350+
registry.add("MC/accMPtRap_kstar_G2", "Generated K*0 from kp2; Mass (GeV/#it{c}^2); #it{p}_{T} (GeV/#it{c})", {HistType::kTH3F, {{400, 0., 2.0}, {200, 0.0, 10.0}, {60, -1.5, 1.5}}});
347351
registry.add("MC/genEtaPt_k", "Generated events; eta (1); #it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{60, -1.5, 1.5}, {250, 0.0, 5.0}}});
348352
registry.add("MC/genRap_k", "Generated events; Rapidity (1)", {HistType::kTH1F, {{60, -1.5, 1.5}}});
349353
registry.add("MC/genMPt_k", "Generated events; Mass (GeV/#it{c}^2); #it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{400, 0., 2.0}, {200, 0.0, 10.0}}});
@@ -474,6 +478,7 @@ struct SginclusivePhiKstarSD {
474478

475479
// Rapidity, pseudorapisdity
476480
rQA.add("hEta_all_after_mc", "Pseudorapidity of all tracks after track selection; #eta; Counts", kTH1F, {{400, -1.0, 1.0}});
481+
rQA.add("hphi_all_after_mc", "phi of all tracks after track selection; #eta; Counts", kTH1F, {{400, -4.0, 4.0}});
477482

478483
rQA.add("hEta_ka_mc", "Pseudorapidity of selected Kaons; #eta; Counts", kTH1F, {{400, -1.0, 1.0}});
479484
rQA.add("hRap_ka_mc", "Rapidity of selected Kaons; y; Counts", kTH1F, {{400, -1.0, 1.0}});
@@ -1195,7 +1200,7 @@ struct SginclusivePhiKstarSD {
11951200
PresliceUnsorted<CCs> colPerMcCollision = aod::udcollision::udMcCollisionId;
11961201
PresliceUnsorted<TCs> trackPerMcParticle = aod::udmctracklabel::udMcParticleId;
11971202

1198-
void processMCTruth(aod::UDMcCollisions const& mccollisions, CCs const& collisions, aod::UDMcParticles const& McParts, TCs const& tracks)
1203+
void processMCTruth(aod::UDMcCollisions const& mccollisions, CCs const& collisions, aod::UDMcParticles const& McParts, TCs const& /*tracks*/)
11991204
{
12001205
// number of McCollisions in DF
12011206
ROOT::Math::PxPyPzMVector v0;
@@ -1215,6 +1220,75 @@ struct SginclusivePhiKstarSD {
12151220
// get McParticles which belong to mccollision
12161221
auto partSlice = McParts.sliceBy(partPerMcCollision, mccollision.globalIndex());
12171222
registry.get<TH1>(HIST("MC/nParts"))->Fill(partSlice.size(), 1.);
1223+
for (const auto& trk1 : partSlice) {
1224+
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kK0Star892) {
1225+
vkstar.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassK0Star892);
1226+
auto kDaughters = trk1.daughters_as<aod::UDMcParticles>();
1227+
const size_t kExpectedNumberOfDaughters = 2;
1228+
if (kDaughters.size() != kExpectedNumberOfDaughters) {
1229+
continue;
1230+
}
1231+
auto daughtp = false;
1232+
auto daughtm = false;
1233+
for (const auto& kCurrentDaughter : kDaughters) {
1234+
if (!kCurrentDaughter.isPhysicalPrimary()) {
1235+
continue;
1236+
}
1237+
if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kKPlus) {
1238+
daughtp = true;
1239+
v0.SetCoordinates(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassKaonCharged);
1240+
} else if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kPiPlus) {
1241+
daughtm = true;
1242+
v1.SetCoordinates(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassPionCharged);
1243+
}
1244+
}
1245+
if (daughtp && daughtm) {
1246+
v01 = v0 + v1;
1247+
if (std::abs(v01.Rapidity()) < 0.5) {
1248+
registry.get<TH3>(HIST("MC/accMPtRap_kstar_G"))->Fill(v01.M(), v01.Pt(), v01.Rapidity(), 1.);
1249+
}
1250+
if (std::abs(vkstar.Rapidity()) < 0.5) {
1251+
// registry.get<TH3>(HIST("MC/accMPtRap_kstar_G1"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1252+
}
1253+
}
1254+
}
1255+
// phi
1256+
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kPhi) {
1257+
if (trk1.has_mothers()) {
1258+
continue;
1259+
}
1260+
vphi.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassPhi);
1261+
auto kDaughters = trk1.daughters_as<aod::UDMcParticles>();
1262+
const size_t kExpectedNumberOfDaughters1 = 2;
1263+
if (kDaughters.size() != kExpectedNumberOfDaughters1) {
1264+
continue;
1265+
}
1266+
auto daughtp1 = false;
1267+
auto daughtm1 = false;
1268+
for (const auto& kCurrentDaughter : kDaughters) {
1269+
if (!kCurrentDaughter.isPhysicalPrimary()) {
1270+
continue;
1271+
}
1272+
if (kCurrentDaughter.pdgCode() == PDG_t::kKPlus) {
1273+
daughtp1 = true;
1274+
v0.SetCoordinates(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassKaonCharged);
1275+
} else if (kCurrentDaughter.pdgCode() == PDG_t::kKMinus) {
1276+
daughtm1 = true;
1277+
v1.SetCoordinates(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassKaonCharged);
1278+
}
1279+
}
1280+
if (daughtp1 && daughtm1) {
1281+
v01 = v0 + v1;
1282+
if (std::abs(v01.Rapidity()) < 0.5) {
1283+
registry.get<TH3>(HIST("MC/accMPtRap_phi_G"))->Fill(v01.M(), v01.Pt(), v01.Rapidity(), 1.);
1284+
}
1285+
if (std::abs(vphi.Rapidity()) < 0.5) {
1286+
registry.get<TH3>(HIST("MC/accMPtRap_phi_G2"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
1287+
}
1288+
}
1289+
}
1290+
}
1291+
/*
12181292
for (const auto& [tr1, tr2] : combinations(partSlice, partSlice)) {
12191293
if ((tr1.pdgCode() == kKPlus && tr2.pdgCode() == kPiMinus) || (tr1.pdgCode() == kKMinus && tr2.pdgCode() == kPiPlus) || (tr1.pdgCode() == kPiPlus && tr2.pdgCode() == kKMinus) || (tr1.pdgCode() == kPiMinus && tr2.pdgCode() == kKPlus)) {
12201294
if (std::abs(tr1.pdgCode()) == kKPlus) {
@@ -1238,7 +1312,7 @@ struct SginclusivePhiKstarSD {
12381312
for (const auto& mother : tr1.mothers_as<aod::UDMcParticles>()) {
12391313
if (std::abs(mother.pdgCode()) == o2::constants::physics::Pdg::kK0Star892) {
12401314
vkstar.SetCoordinates(mother.px(), mother.py(), mother.pz(), o2::constants::physics::MassK0Star892);
1241-
registry.get<TH3>(HIST("MC/accMPtRap_kstar_G"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1315+
// registry.get<TH3>(HIST("MC/accMPtRap_kstar_G"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
12421316
flag = true;
12431317
}
12441318
}
@@ -1279,7 +1353,7 @@ struct SginclusivePhiKstarSD {
12791353
for (const auto& mother : tr1.mothers_as<aod::UDMcParticles>()) {
12801354
if (std::abs(mother.pdgCode()) == o2::constants::physics::Pdg::kPhi) {
12811355
vphi.SetCoordinates(mother.px(), mother.py(), mother.pz(), o2::constants::physics::MassPhi);
1282-
registry.get<TH3>(HIST("MC/accMPtRap_phi_G"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
1356+
// registry.get<TH3>(HIST("MC/accMPtRap_phi_G"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
12831357
flag = true;
12841358
}
12851359
}
@@ -1316,13 +1390,16 @@ struct SginclusivePhiKstarSD {
13161390
registry.get<TH2>(HIST("MC/pDiff"))->Fill(-5.9, -1, 1.);
13171391
}
13181392
}
1393+
*/
13191394
}
13201395
}
13211396
PROCESS_SWITCH(SginclusivePhiKstarSD, processMCTruth, "Process MC truth", true);
13221397
// ...............................................................................................................
1323-
void processReco(CC const& collision, TCs const& tracks, aod::UDMcCollisions const& /*mccollisions*/, aod::UDMcParticles const& /*McParts*/)
1398+
void processReco(CC const& collision, TCs const& tracks, aod::UDMcCollisions const& /*mccollisions*/, aod::UDMcParticles const& McParts)
13241399
{
13251400
registry.fill(HIST("Reco/hEventCutFlowMC"), 0);
1401+
ROOT::Math::PxPyPzMVector vkstar;
1402+
ROOT::Math::PxPyPzMVector vphi;
13261403

13271404
if (!collision.has_udMcCollision())
13281405
return;
@@ -1334,6 +1411,66 @@ struct SginclusivePhiKstarSD {
13341411
auto mccoll = collision.udMcCollision();
13351412
if (mccoll.generatorsID() != generatedId)
13361413
return;
1414+
if (upcflag != -1 && collision.flags() == upcflag) {
1415+
auto partSlice = McParts.sliceBy(partPerMcCollision, mccoll.globalIndex());
1416+
for (const auto& trk1 : partSlice) {
1417+
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kK0Star892) {
1418+
vkstar.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassK0Star892);
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+
}
1440+
}
1441+
}
1442+
// phi
1443+
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kPhi) {
1444+
if (trk1.has_mothers()) {
1445+
continue;
1446+
}
1447+
vphi.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassPhi);
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+
}
1469+
}
1470+
}
1471+
}
1472+
}
1473+
13371474
registry.fill(HIST("Reco/hEventCutFlowMC"), 2);
13381475

13391476
float fitCut[5] = {fv0Cut, ft0aCut, ft0cCut, fddaCut, fddcCut};
@@ -1403,12 +1540,16 @@ struct SginclusivePhiKstarSD {
14031540
return;
14041541
registry.fill(HIST("Reco/hEventCutFlowMC"), 17);
14051542

1406-
if (qaMC)
1543+
if (qaMC) {
14071544
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+
}
14081549

14091550
// registry.get<TH1>(HIST("Reco/nPVContributors"))->Fill(pvContributors.size(), 1.);
1410-
ROOT::Math::PxPyPzMVector vphi;
1411-
ROOT::Math::PxPyPzMVector vkstar;
1551+
// ROOT::Math::PxPyPzMVector vphi;
1552+
// ROOT::Math::PxPyPzMVector vkstar;
14121553
ROOT::Math::PxPyPzMVector v0;
14131554
ROOT::Math::PxPyPzMVector vr0;
14141555
ROOT::Math::PxPyPzMVector vr1;
@@ -1465,6 +1606,7 @@ struct SginclusivePhiKstarSD {
14651606
rQA.fill(HIST("hDcaxy_all_after_mc"), tr1.dcaXY());
14661607
rQA.fill(HIST("hDcaz_all_after_mc"), tr1.dcaZ());
14671608
rQA.fill(HIST("hEta_all_after_mc"), v0.Eta());
1609+
rQA.fill(HIST("hphi_all_after_mc"), v0.Phi());
14681610

14691611
rQA.fill(HIST("tpc_dedx_mc"), v0.P(), tr1.tpcSignal());
14701612
rQA.fill(HIST("tof_beta_mc"), v0.P(), tr1.beta());
@@ -1519,8 +1661,8 @@ struct SginclusivePhiKstarSD {
15191661
continue;
15201662
vr1.SetCoordinates(tr2.px(), tr2.py(), tr2.pz(), o2::constants::physics::MassKaonCharged);
15211663
auto mcPart2 = tr2.udMcParticle();
1522-
if (std::abs(mcPart2.globalIndex() - mcPart1.globalIndex()) != 1)
1523-
continue;
1664+
// if (std::abs(mcPart2.globalIndex() - mcPart1.globalIndex()) != 1)
1665+
// continue;
15241666
if (std::abs(mcPart1.pdgCode()) != kKPlus || std::abs(mcPart2.pdgCode()) != kKPlus)
15251667
continue;
15261668
if (mcPart1.pdgCode() == mcPart2.pdgCode())
@@ -1529,33 +1671,50 @@ struct SginclusivePhiKstarSD {
15291671
continue;
15301672
bool flag = false;
15311673
bool flag1 = false;
1674+
int gIndex1 = 0;
1675+
int gIndex2 = 0;
15321676
if (mcPart1.has_mothers() && mcPart2.has_mothers()) {
15331677
for (const auto& mother : mcPart1.mothers_as<aod::UDMcParticles>()) {
15341678
if (std::abs(mother.pdgCode()) == o2::constants::physics::Pdg::kPhi) {
1679+
if (mother.has_mothers()) {
1680+
continue;
1681+
}
15351682
vphi.SetCoordinates(mother.px(), mother.py(), mother.pz(), o2::constants::physics::MassPhi);
1536-
registry.get<TH3>(HIST("MC/accMPtRap_phi_T"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
1683+
if (std::abs(vphi.Rapidity()) > 0.5)
1684+
continue;
15371685
flag = true;
1686+
gIndex1 = mother.globalIndex();
15381687
}
15391688
}
15401689
for (const auto& mother1 : mcPart1.mothers_as<aod::UDMcParticles>()) {
15411690
if (std::abs(mother1.pdgCode()) == o2::constants::physics::Pdg::kPhi) {
1691+
vphi.SetCoordinates(mother1.px(), mother1.py(), mother1.pz(), o2::constants::physics::MassPhi);
1692+
if (std::abs(vphi.Rapidity()) > 0.5)
1693+
continue;
15421694
flag1 = true;
1695+
gIndex2 = mother1.globalIndex();
15431696
}
15441697
}
15451698
}
15461699
vr0g.SetCoordinates(mcPart1.px(), mcPart1.py(), mcPart1.pz(), o2::constants::physics::MassKaonCharged);
15471700
vr1g.SetCoordinates(mcPart2.px(), mcPart2.py(), mcPart2.pz(), o2::constants::physics::MassKaonCharged);
15481701
vr01g = vr0g + vr1g;
15491702
vr01 = vr0 + vr1;
1550-
1551-
if (flag && flag1) {
1552-
registry.get<TH2>(HIST("Reco/selMPt"))->Fill(vr01.M(), vr01.Pt(), 1.);
1703+
if (flag && flag1 && (gIndex1 == gIndex2)) {
1704+
if (std::abs(vr01g.Rapidity()) < 0.5) {
1705+
registry.get<TH2>(HIST("Reco/selMPt"))->Fill(vr01g.M(), vr01g.Pt(), 1.);
1706+
}
1707+
if (std::abs(vr01.Rapidity()) < 0.5) {
1708+
registry.get<TH3>(HIST("Reco/selMPtRap"))->Fill(vr01.M(), vr01.Pt(), vr01.Rapidity(), 1.);
1709+
}
1710+
if (std::abs(vphi.Rapidity()) < 0.5) {
1711+
registry.get<TH3>(HIST("MC/accMPtRap_phi_T"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
1712+
}
15531713
}
15541714
registry.get<TH1>(HIST("Reco/selRap"))->Fill(vr01.Rapidity(), 1.);
1555-
registry.get<TH3>(HIST("Reco/selMPtRap"))->Fill(vr01.M(), vr01.Pt(), vr01.Rapidity(), 1.);
15561715
registry.get<TH1>(HIST("Reco/selPt"))->Fill(vr01.Pt(), 1.);
15571716
registry.get<TH1>(HIST("Reco/selM"))->Fill(vr01.M(), 1.);
1558-
registry.get<TH3>(HIST("Reco/selMPtRap_gen"))->Fill(vr01g.M(), vr01g.Pt(), vr01g.Rapidity(), 1.);
1717+
// registry.get<TH3>(HIST("Reco/selMPtRap_gen"))->Fill(vr01g.M(), vr01g.Pt(), vr01g.Rapidity(), 1.);
15591718
}
15601719
}
15611720
}
@@ -1573,8 +1732,8 @@ struct SginclusivePhiKstarSD {
15731732
continue;
15741733
if (!mcPart1.isPhysicalPrimary() || !mcPart2.isPhysicalPrimary())
15751734
continue;
1576-
if (std::abs(mcPart2.globalIndex() - mcPart1.globalIndex()) != 1)
1577-
continue;
1735+
// if (std::abs(mcPart2.globalIndex() - mcPart1.globalIndex()) != 1)
1736+
// continue;
15781737

15791738
if (tr1.sign() * tr2.sign() > 0)
15801739
continue;
@@ -1591,26 +1750,43 @@ struct SginclusivePhiKstarSD {
15911750
if (trackselector(tr1, parameters) && trackselector(tr2, parameters)) {
15921751
bool flag = false;
15931752
bool flag1 = false;
1753+
int gIndex1 = 0;
1754+
int gIndex2 = 0;
15941755
if (mcPart1.has_mothers() && mcPart2.has_mothers()) {
15951756
for (const auto& mother : mcPart1.mothers_as<aod::UDMcParticles>()) {
15961757
if (std::abs(mother.pdgCode()) == o2::constants::physics::Pdg::kK0Star892) {
15971758
vkstar.SetCoordinates(mother.px(), mother.py(), mother.pz(), o2::constants::physics::MassK0Star892);
1598-
registry.get<TH3>(HIST("MC/accMPtRap_kstar_T"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1759+
// registry.get<TH3>(HIST("MC/accMPtRap_kstar_T"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1760+
if (std::abs(vkstar.Rapidity()) > 0.5)
1761+
continue;
15991762
flag = true;
1763+
gIndex1 = mother.globalIndex();
16001764
}
16011765
}
16021766
for (const auto& mother1 : mcPart2.mothers_as<aod::UDMcParticles>()) {
16031767
if (std::abs(mother1.pdgCode()) == o2::constants::physics::Pdg::kK0Star892) {
1768+
vkstar.SetCoordinates(mother1.px(), mother1.py(), mother1.pz(), o2::constants::physics::MassK0Star892);
1769+
if (std::abs(vkstar.Rapidity()) > 0.5)
1770+
continue;
16041771
flag1 = true;
1772+
gIndex2 = mother1.globalIndex();
16051773
}
16061774
}
16071775
}
1608-
if (flag && flag1) {
1609-
registry.get<TH2>(HIST("Reco/selMPt_k"))->Fill(vr01.M(), vr01.Pt(), 1.);
1776+
if (flag && flag1 && (gIndex1 == gIndex2)) {
1777+
if (std::abs(vr01g.Rapidity()) < 0.5) {
1778+
registry.get<TH2>(HIST("Reco/selMPt_k"))->Fill(vr01g.M(), vr01g.Pt(), 1.);
1779+
}
1780+
if (std::abs(vr01.Rapidity()) < 0.5) {
1781+
registry.get<TH3>(HIST("Reco/selMPtRap_k"))->Fill(vr01.M(), vr01.Pt(), vr01.Rapidity(), 1.);
1782+
}
1783+
if (std::abs(vkstar.Rapidity()) < 0.5) {
1784+
registry.get<TH3>(HIST("MC/accMPtRap_kstar_T"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1785+
}
16101786
}
16111787
registry.get<TH1>(HIST("Reco/selM_k_K"))->Fill(vr01.M(), 1.);
16121788
registry.get<TH1>(HIST("Reco/selRap_k"))->Fill(vr01.Rapidity(), 1.);
1613-
registry.get<TH3>(HIST("Reco/selMPtRap_k"))->Fill(vr01.M(), vr01.Pt(), vr01.Rapidity(), 1.);
1789+
16141790
registry.get<TH1>(HIST("Reco/selPt_k"))->Fill(vr01.Pt(), 1.);
16151791
registry.get<TH3>(HIST("Reco/selMPtRap_k_gen"))->Fill(vr01g.M(), vr01g.Pt(), vr01g.Rapidity(), 1.);
16161792
}

0 commit comments

Comments
 (0)