Skip to content

Commit ba6a03d

Browse files
sdudi123sandeep dudi
andauthored
[PWGUD] UPC tag logic change for generated event MC (#15252)
Co-authored-by: sandeep dudi <sandeep.dudi@cern.ch>
1 parent 0b62b01 commit ba6a03d

File tree

1 file changed

+52
-53
lines changed

1 file changed

+52
-53
lines changed

PWGUD/Tasks/sginclusivePhiKstarSD.cxx

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ struct SginclusivePhiKstarSD {
368368
"All Events",
369369
"has_udMcCollision",
370370
Form("generatorsID = %d", generatedId.value),
371+
Form("upcFlag = %d%s", upcflag.value, check(upcflag.value != -1)),
371372
Form("GapsideMC = %d", gapsideMC.value),
372373
Form("|Vz| < %.1f", vzCut.value),
373374
Form("Occupancy < %.0f%s", confgOccCut.value, check(useOccCut.value)),
@@ -381,7 +382,6 @@ struct SginclusivePhiKstarSD {
381382
std::string("kIsGoodZvtxFT0vsPV") + check(useZvtxftovpv.value),
382383
std::string("kIsVertexITSTPC") + check(useVtxItsTpc.value),
383384
Form("RCTFlag = %d%s", cutRCTflag.value, check(cutRCTflag.value > 0)),
384-
Form("upcFlag = %d%s", upcflag.value, check(upcflag.value != -1)),
385385
Form("%d < numContrib < %d%s", mintrack.value, maxtrack.value, check(usenumContrib.value))};
386386

387387
for (size_t i = 0; i < eveCutLabelsMC.size(); ++i) {
@@ -1421,71 +1421,70 @@ struct SginclusivePhiKstarSD {
14211421
registry.get<TH1>(HIST("Reco/Stat"))->Fill(4.0, 1.);
14221422
registry.get<TH1>(HIST("Reco/Stat"))->Fill(truegapSide, 1.);
14231423

1424-
if (upcflag != -1 && collision.flags() == upcflag) {
1425-
auto partSlice = McParts.sliceBy(partPerMcCollision, mccoll.globalIndex());
1426-
for (const auto& trk1 : partSlice) {
1427-
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kK0Star892) {
1428-
vkstar.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassK0Star892);
1429-
auto kDaughters = trk1.daughters_as<aod::UDMcParticles>();
1430-
const size_t kExpectedNumberOfDaughters = 2;
1431-
if (kDaughters.size() != kExpectedNumberOfDaughters) {
1424+
auto partSlice = McParts.sliceBy(partPerMcCollision, mccoll.globalIndex());
1425+
for (const auto& trk1 : partSlice) {
1426+
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kK0Star892) {
1427+
vkstar.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassK0Star892);
1428+
auto kDaughters = trk1.daughters_as<aod::UDMcParticles>();
1429+
const size_t kExpectedNumberOfDaughters = 2;
1430+
if (kDaughters.size() != kExpectedNumberOfDaughters) {
1431+
continue;
1432+
}
1433+
auto daughtp = false;
1434+
auto daughtm = false;
1435+
for (const auto& kCurrentDaughter : kDaughters) {
1436+
if (!kCurrentDaughter.isPhysicalPrimary()) {
14321437
continue;
14331438
}
1434-
auto daughtp = false;
1435-
auto daughtm = false;
1436-
for (const auto& kCurrentDaughter : kDaughters) {
1437-
if (!kCurrentDaughter.isPhysicalPrimary()) {
1438-
continue;
1439-
}
1440-
if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kKPlus) {
1441-
daughtp = true;
1442-
} else if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kPiPlus) {
1443-
daughtm = true;
1444-
}
1439+
if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kKPlus) {
1440+
daughtp = true;
1441+
} else if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kPiPlus) {
1442+
daughtm = true;
14451443
}
1446-
if (daughtp && daughtm) {
1447-
if (std::abs(vkstar.Rapidity()) < 0.5) {
1448-
registry.get<TH3>(HIST("MC/accMPtRap_kstar_G1"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1449-
if (truegapSide == gapsideMC) {
1450-
registry.get<TH3>(HIST("MC/accMPtRap_kstar_G11"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1451-
}
1444+
}
1445+
if (daughtp && daughtm) {
1446+
if (std::abs(vkstar.Rapidity()) < 0.5) {
1447+
registry.get<TH3>(HIST("MC/accMPtRap_kstar_G1"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
1448+
if (truegapSide == gapsideMC) {
1449+
registry.get<TH3>(HIST("MC/accMPtRap_kstar_G11"))->Fill(vkstar.M(), vkstar.Pt(), vkstar.Rapidity(), 1.);
14521450
}
14531451
}
14541452
}
1455-
// phi
1456-
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kPhi) {
1457-
if (trk1.has_mothers()) {
1458-
continue;
1459-
}
1460-
vphi.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassPhi);
1461-
auto kDaughters = trk1.daughters_as<aod::UDMcParticles>();
1462-
const size_t kExpectedNumberOfDaughters1 = 2;
1463-
if (kDaughters.size() != kExpectedNumberOfDaughters1) {
1453+
}
1454+
// phi
1455+
if (std::abs(trk1.pdgCode()) == o2::constants::physics::Pdg::kPhi) {
1456+
if (trk1.has_mothers()) {
1457+
continue;
1458+
}
1459+
vphi.SetCoordinates(trk1.px(), trk1.py(), trk1.pz(), o2::constants::physics::MassPhi);
1460+
auto kDaughters = trk1.daughters_as<aod::UDMcParticles>();
1461+
const size_t kExpectedNumberOfDaughters1 = 2;
1462+
if (kDaughters.size() != kExpectedNumberOfDaughters1) {
1463+
continue;
1464+
}
1465+
auto daughtp1 = false;
1466+
auto daughtm1 = false;
1467+
for (const auto& kCurrentDaughter : kDaughters) {
1468+
if (!kCurrentDaughter.isPhysicalPrimary()) {
14641469
continue;
14651470
}
1466-
auto daughtp1 = false;
1467-
auto daughtm1 = false;
1468-
for (const auto& kCurrentDaughter : kDaughters) {
1469-
if (!kCurrentDaughter.isPhysicalPrimary()) {
1470-
continue;
1471-
}
1472-
if (kCurrentDaughter.pdgCode() == PDG_t::kKPlus) {
1473-
daughtp1 = true;
1474-
} else if (kCurrentDaughter.pdgCode() == PDG_t::kKMinus) {
1475-
daughtm1 = true;
1476-
}
1471+
if (kCurrentDaughter.pdgCode() == PDG_t::kKPlus) {
1472+
daughtp1 = true;
1473+
} else if (kCurrentDaughter.pdgCode() == PDG_t::kKMinus) {
1474+
daughtm1 = true;
14771475
}
1478-
if (daughtp1 && daughtm1) {
1479-
if (std::abs(vphi.Rapidity()) < 0.5) {
1480-
registry.get<TH3>(HIST("MC/accMPtRap_phi_G1"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
1481-
if (truegapSide == gapsideMC) {
1482-
registry.get<TH3>(HIST("MC/accMPtRap_phi_G11"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
1483-
}
1476+
}
1477+
if (daughtp1 && daughtm1) {
1478+
if (std::abs(vphi.Rapidity()) < 0.5) {
1479+
registry.get<TH3>(HIST("MC/accMPtRap_phi_G1"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
1480+
if (truegapSide == gapsideMC) {
1481+
registry.get<TH3>(HIST("MC/accMPtRap_phi_G11"))->Fill(vphi.M(), vphi.Pt(), vphi.Rapidity(), 1.);
14841482
}
14851483
}
14861484
}
14871485
}
14881486
}
1487+
14891488
if (truegapSide != gapsideMC)
14901489
return;
14911490
registry.fill(HIST("Reco/hEventCutFlowMC"), 4);
@@ -1516,7 +1515,7 @@ struct SginclusivePhiKstarSD {
15161515

15171516
if (useTfb && collision.tfb() != 1)
15181517
return;
1519-
registry.fill(HIST("Reco/hEventCutFlowMC"), 1);
1518+
registry.fill(HIST("Reco/hEventCutFlowMC"), 11);
15201519

15211520
if (useItsrofb && collision.itsROFb() != 1)
15221521
return;

0 commit comments

Comments
 (0)