Skip to content

Commit 95e9e68

Browse files
authored
[PWGLF] configurable for mother id check (#16038)
1 parent 9bc860b commit 95e9e68

1 file changed

Lines changed: 53 additions & 37 deletions

File tree

PWGLF/Tasks/Resonances/kstarqa.cxx

Lines changed: 53 additions & 37 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) {
@@ -1443,7 +1450,9 @@ struct Kstarqa {
14431450

14441451
void processSEMC(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/)
14451452
{
1446-
// auto oldindex = -999;
1453+
// if (configGp.isCheckMotherClosure) {
1454+
auto oldindex = -999;
1455+
// }
14471456
if (!collision.has_mcCollision()) {
14481457
return;
14491458
}
@@ -1580,45 +1589,48 @@ struct Kstarqa {
15801589
hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_after"), track2.tpcNSigmaPi(), track2.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, track2.pt());
15811590
}
15821591

1583-
// for (const auto& mothertrack1 : mctrack1.mothers_as<aod::McParticles>()) {
1584-
// for (const auto& mothertrack2 : mctrack2.mothers_as<aod::McParticles>()) {
1592+
if (configGp.isCheckMotherClosure) {
1593+
for (const auto& mothertrack1 : mctrack1.mothers_as<aod::McParticles>()) {
1594+
for (const auto& mothertrack2 : mctrack2.mothers_as<aod::McParticles>()) {
15851595

1586-
// if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) {
1587-
// continue;
1588-
// }
1596+
if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) {
1597+
continue;
1598+
}
15891599

1590-
// if (!mothertrack1.producedByGenerator()) {
1591-
// continue;
1592-
// }
1600+
if (!mothertrack1.producedByGenerator()) {
1601+
continue;
1602+
}
15931603

1594-
// if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) {
1595-
// continue;
1596-
// }
1597-
// rEventSelection.fill(HIST("recMCparticles"), 11.5);
1604+
if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) {
1605+
continue;
1606+
}
1607+
rEventSelection.fill(HIST("recMCparticles"), 11.5);
15981608

1599-
// oldindex = mothertrack1.globalIndex();
1609+
oldindex = mothertrack1.globalIndex();
16001610

1601-
// daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1602-
// daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1603-
// mother = daughter1 + daughter2; // Kstar meson
1611+
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1612+
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1613+
mother = daughter1 + daughter2; // Kstar meson
16041614

1605-
// hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1606-
// hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
1615+
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1616+
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
16071617

1608-
// isMix = false;
1609-
// fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1610-
// }
1611-
// }
1618+
isMix = false;
1619+
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1620+
}
1621+
}
1622+
} else {
16121623

1613-
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1614-
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1615-
mother = daughter1 + daughter2; // Kstar meson
1624+
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1625+
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1626+
mother = daughter1 + daughter2; // Kstar meson
16161627

1617-
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1618-
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
1628+
hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt());
1629+
hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt());
16191630

1620-
isMix = false;
1621-
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1631+
isMix = false;
1632+
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2);
1633+
}
16221634
}
16231635
}
16241636
PROCESS_SWITCH(Kstarqa, processSEMC, "Process same event in MC", false);
@@ -1633,10 +1645,12 @@ struct Kstarqa {
16331645
if (configGp.isApplyMCGenVz && std::abs(mcCollision.posZ()) > configGp.cutzvertex) {
16341646
return;
16351647
}
1648+
rEventSelection.fill(HIST("eventsCheckGen"), 1.5);
16361649

16371650
if (configGp.isINELgt0Gen && !mcCollision.isInelGt0()) {
16381651
return;
16391652
}
1653+
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);
16401654

16411655
std::vector<int64_t> selectedEvents(collisions.size());
16421656
int nevts = 0;
@@ -1651,10 +1665,9 @@ struct Kstarqa {
16511665
if (configGp.isINELgt0 && !isINELgt0true) {
16521666
return;
16531667
}
1654-
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);
1668+
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
16551669

16561670
for (const auto& collision : collisions) {
1657-
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
16581671

16591672
if (!selectionEvent(collision, false)) { // don't fill event cut histogram
16601673
continue;
@@ -1944,10 +1957,12 @@ struct Kstarqa {
19441957

19451958
void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&)
19461959
{
1960+
rEventSelection.fill(HIST("eventsCheckRec"), 0.5);
19471961

19481962
if (!collision.has_mcCollision()) {
19491963
return;
19501964
}
1965+
rEventSelection.fill(HIST("eventsCheckRec"), 1.5);
19511966

19521967
double multiplicityRec = -1.0;
19531968
// multiplicityRec = collision.mcCollision_as<EventMCGenerated>().centFT0M();
@@ -1957,6 +1972,7 @@ struct Kstarqa {
19571972
if (configGp.isINELgt0 && !collision.isInelGt0()) {
19581973
return;
19591974
}
1975+
rEventSelection.fill(HIST("eventsCheckRec"), 2.5);
19601976
// multiplicity = collision.centFT0M();
19611977

19621978
if (cSelectMultEstimator == kFT0M) {
@@ -1977,8 +1993,8 @@ struct Kstarqa {
19771993
if (!selectionEvent(collision, true)) { // fill MC event cut histogram
19781994
return;
19791995
}
1996+
rEventSelection.fill(HIST("eventsCheckRec"), 3.5);
19801997

1981-
rEventSelection.fill(HIST("eventsCheckGen"), 5.5);
19821998
hInvMass.fill(HIST("h1RecMult"), multiplicity);
19831999
hInvMass.fill(HIST("h1RecMult2"), multiplicityRec);
19842000

0 commit comments

Comments
 (0)