Skip to content

Commit 91503be

Browse files
committed
mother track check in generated MC
1 parent c7903d2 commit 91503be

1 file changed

Lines changed: 61 additions & 45 deletions

File tree

PWGLF/Tasks/Resonances/kstarqa.cxx

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct Kstarqa {
8282

8383
struct : ConfigurableGroup {
8484
// Configurables for event selections
85+
Configurable<bool> isCheckMotherClosure{"isCheckMotherClosure", false, "Check mother globalid in MC for closure"};
8586
Configurable<bool> isSquarePIDcut{"isSquarePIDcut", false, "Apply square PID cut"};
8687
Configurable<bool> isINELgt0{"isINELgt0", true, "INEL>0 selection"};
8788
Configurable<bool> isINELgt0Gen{"isINELgt0Gen", false, "Apply INEL>0 in Gen direclty from collisions in addition to already applied from pwglf::inelGt"};
@@ -406,6 +407,7 @@ struct Kstarqa {
406407

407408
rEventSelection.add("tracksCheckData", "No. of events in the data", kTH1I, {{10, 0, 10}});
408409
rEventSelection.add("eventsCheckGen", "No. of events in the generated MC", kTH1I, {{10, 0, 10}});
410+
rEventSelection.add("eventsCheckRec", "No. of events in the generated MC", kTH1I, {{5, 0, 5}});
409411
rEventSelection.add("recMCparticles", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}});
410412
rEventSelection.add("hOccupancy", "Occupancy distribution", kTH1F, {{1000, 0, 15000}});
411413

@@ -439,11 +441,16 @@ struct Kstarqa {
439441

440442
std::shared_ptr<TH1> hGenTracks = rEventSelection.get<TH1>(HIST("eventsCheckGen"));
441443
hGenTracks->GetXaxis()->SetBinLabel(1, "All events");
442-
hGenTracks->GetXaxis()->SetBinLabel(2, "INELgt0+vtz");
444+
hGenTracks->GetXaxis()->SetBinLabel(2, "Vz cut");
443445
hGenTracks->GetXaxis()->SetBinLabel(3, "INELgt0");
444-
hGenTracks->GetXaxis()->SetBinLabel(4, "All Collisions");
445-
hGenTracks->GetXaxis()->SetBinLabel(5, "Gen events with at least 1 rec event");
446-
hGenTracks->GetXaxis()->SetBinLabel(6, "Rec events");
446+
hGenTracks->GetXaxis()->SetBinLabel(4, "PWGlf:INELgt0");
447+
hGenTracks->GetXaxis()->SetBinLabel(5, "Atleat 1rec");
448+
449+
std::shared_ptr<TH1> hRecTracks = rEventSelection.get<TH1>(HIST("eventsCheckRec"));
450+
hRecTracks->GetXaxis()->SetBinLabel(1, "All events");
451+
hRecTracks->GetXaxis()->SetBinLabel(2, "has_MCcollision");
452+
hRecTracks->GetXaxis()->SetBinLabel(3, "INELgt0");
453+
hRecTracks->GetXaxis()->SetBinLabel(4, "Event_Selection");
447454

448455
// Multplicity distribution
449456
if (cQAevents) {
@@ -1507,7 +1514,9 @@ struct Kstarqa {
15071514

15081515
void processSEMC(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/)
15091516
{
1510-
// auto oldindex = -999;
1517+
if (configGp.isCheckMotherClosure) {
1518+
auto oldindex = -999;
1519+
}
15111520
if (!collision.has_mcCollision()) {
15121521
return;
15131522
}
@@ -1644,45 +1653,48 @@ struct Kstarqa {
16441653
hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_after"), track2.tpcNSigmaPi(), track2.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, track2.pt());
16451654
}
16461655

1647-
// for (const auto& mothertrack1 : mctrack1.mothers_as<aod::McParticles>()) {
1648-
// for (const auto& mothertrack2 : mctrack2.mothers_as<aod::McParticles>()) {
1656+
if (configGp.isCheckMotherClosure) {
1657+
for (const auto& mothertrack1 : mctrack1.mothers_as<aod::McParticles>()) {
1658+
for (const auto& mothertrack2 : mctrack2.mothers_as<aod::McParticles>()) {
16491659

1650-
// if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) {
1651-
// continue;
1652-
// }
1660+
if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) {
1661+
continue;
1662+
}
16531663

1654-
// if (!mothertrack1.producedByGenerator()) {
1655-
// continue;
1656-
// }
1664+
if (!mothertrack1.producedByGenerator()) {
1665+
continue;
1666+
}
16571667

1658-
// if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) {
1659-
// continue;
1660-
// }
1661-
// rEventSelection.fill(HIST("recMCparticles"), 11.5);
1668+
if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) {
1669+
continue;
1670+
}
1671+
rEventSelection.fill(HIST("recMCparticles"), 11.5);
16621672

1663-
// oldindex = mothertrack1.globalIndex();
1673+
oldindex = mothertrack1.globalIndex();
16641674

1665-
// daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1666-
// daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1667-
// mother = daughter1 + daughter2; // Kstar meson
1675+
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1676+
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1677+
mother = daughter1 + daughter2; // Kstar meson
16681678

1669-
// hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1670-
// hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
1679+
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1680+
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
16711681

1672-
// isMix = false;
1673-
// fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1674-
// }
1675-
// }
1682+
isMix = false;
1683+
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1684+
}
1685+
}
1686+
} else {
16761687

1677-
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1678-
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1679-
mother = daughter1 + daughter2; // Kstar meson
1688+
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1689+
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1690+
mother = daughter1 + daughter2; // Kstar meson
16801691

1681-
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1682-
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
1692+
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1693+
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
16831694

1684-
isMix = false;
1685-
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1695+
isMix = false;
1696+
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1697+
}
16861698
}
16871699
}
16881700
PROCESS_SWITCH(Kstarqa, processSEMC, "Process same event in MC", false);
@@ -1693,14 +1705,16 @@ struct Kstarqa {
16931705
// void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
16941706
{
16951707
rEventSelection.fill(HIST("eventsCheckGen"), 0.5);
1696-
1708+
16971709
if (configGp.isApplyMCGenVz && std::abs(mcCollision.posZ()) > configGp.cutzvertex) {
16981710
return;
16991711
}
1700-
1712+
rEventSelection.fill(HIST("eventsCheckGen"), 1.5);
1713+
17011714
if (configGp.isINELgt0Gen && !mcCollision.isInelGt0()) {
17021715
return;
17031716
}
1717+
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);
17041718

17051719
std::vector<int64_t> selectedEvents(collisions.size());
17061720
int nevts = 0;
@@ -1715,10 +1729,9 @@ struct Kstarqa {
17151729
if (configGp.isINELgt0 && !isINELgt0true) {
17161730
return;
17171731
}
1718-
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);
1732+
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
17191733

17201734
for (const auto& collision : collisions) {
1721-
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
17221735

17231736
if (!selectionEvent(collision, false)) { // don't fill event cut histogram
17241737
continue;
@@ -2008,21 +2021,24 @@ struct Kstarqa {
20082021

20092022
void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&)
20102023
{
2011-
2024+
rEventSelection.fill(HIST("eventsCheckRec"), 0.5);
2025+
20122026
if (!collision.has_mcCollision()) {
20132027
return;
20142028
}
2015-
2029+
rEventSelection.fill(HIST("eventsCheckRec"), 1.5);
2030+
20162031
double multiplicityRec = -1.0;
20172032
// multiplicityRec = collision.mcCollision_as<EventMCGenerated>().centFT0M();
20182033
const auto& mcCollisionRec = collision.mcCollision_as<EventMCGenerated>();
20192034
multiplicityRec = mcCollisionRec.centFT0M();
2020-
2035+
20212036
if (configGp.isINELgt0 && !collision.isInelGt0()) {
20222037
return;
20232038
}
2039+
rEventSelection.fill(HIST("eventsCheckRec"), 2.5);
20242040
// multiplicity = collision.centFT0M();
2025-
2041+
20262042
if (cSelectMultEstimator == kFT0M) {
20272043
multiplicity = collision.centFT0M();
20282044
} else if (cSelectMultEstimator == kFT0A) {
@@ -2034,15 +2050,15 @@ struct Kstarqa {
20342050
} else {
20352051
multiplicity = collision.centFT0M(); // default
20362052
}
2037-
2053+
20382054
hInvMass.fill(HIST("hAllRecCollisions"), multiplicity);
20392055
hInvMass.fill(HIST("hAllRecCollisionsCalib"), multiplicityRec);
2040-
2056+
20412057
if (!selectionEvent(collision, true)) { // fill MC event cut histogram
20422058
return;
20432059
}
2060+
rEventSelection.fill(HIST("eventsCheckRec"), 3.5);
20442061

2045-
rEventSelection.fill(HIST("eventsCheckGen"), 5.5);
20462062
hInvMass.fill(HIST("h1RecMult"), multiplicity);
20472063
hInvMass.fill(HIST("h1RecMult2"), multiplicityRec);
20482064

0 commit comments

Comments
 (0)