From e075988b0e9810f7a4591fdeccf491efeccb4be7 Mon Sep 17 00:00:00 2001 From: sawankumawat Date: Thu, 30 Apr 2026 14:14:07 +0530 Subject: [PATCH 1/4] mother track check in generated MC --- PWGLF/Tasks/Resonances/kstarqa.cxx | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 45e210e1cb1..c5b73895865 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -658,7 +658,11 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedPi, 2))) { return true; } @@ -681,7 +685,11 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) { return true; } @@ -736,7 +744,11 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedMID, 2))) { return true; } @@ -759,7 +771,11 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedMID, 2))) { return true; } @@ -858,7 +874,11 @@ struct Kstarqa { return true; } } +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.pt() >= configGp.lowPtCutPID && std::abs(candidate.tpcNSigmaPi()) < configGp.nsigmaCutTPCPi && candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedPi, 2))) { return true; } @@ -894,7 +914,11 @@ struct Kstarqa { return true; } } +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.pt() >= configGp.lowPtCutPID && candidate.hasTOF()) { if (candidate.pt() < ptCut2 && std::abs(candidate.tpcNSigmaKa()) < configGp.nsigmaCutTPCKa && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) { return true; @@ -936,7 +960,11 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (configGp.nsigmaCutCombinedPi * configGp.nsigmaCutCombinedPi)) { return true; } @@ -958,7 +986,11 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD if (!configGp.isSquarePIDcut) { +======= + if (!isSquarePIDcut) { +>>>>>>> 935384c59 (added square PID cut) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) { return true; } From c7903d25680db5bcedc9dd8d77103cbaccae666d Mon Sep 17 00:00:00 2001 From: sawankumawat Date: Thu, 30 Apr 2026 14:14:55 +0530 Subject: [PATCH 2/4] mother track check in generated MC --- PWGLF/Tasks/Resonances/kstarqa.cxx | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index c5b73895865..dce7f29f8aa 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -658,11 +658,15 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedPi, 2))) { return true; } @@ -685,11 +689,15 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) { return true; } @@ -744,11 +752,15 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedMID, 2))) { return true; } @@ -771,11 +783,15 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedMID, 2))) { return true; } @@ -874,11 +890,15 @@ struct Kstarqa { return true; } } +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.pt() >= configGp.lowPtCutPID && std::abs(candidate.tpcNSigmaPi()) < configGp.nsigmaCutTPCPi && candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (std::pow(configGp.nsigmaCutCombinedPi, 2))) { return true; } @@ -914,11 +934,15 @@ struct Kstarqa { return true; } } +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.pt() >= configGp.lowPtCutPID && candidate.hasTOF()) { if (candidate.pt() < ptCut2 && std::abs(candidate.tpcNSigmaKa()) < configGp.nsigmaCutTPCKa && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) { return true; @@ -960,11 +984,15 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, 2) + std::pow(candidate.tpcNSigmaPi(), 2)) < (configGp.nsigmaCutCombinedPi * configGp.nsigmaCutCombinedPi)) { return true; } @@ -986,11 +1014,15 @@ struct Kstarqa { return true; } } else { +<<<<<<< HEAD <<<<<<< HEAD if (!configGp.isSquarePIDcut) { ======= if (!isSquarePIDcut) { >>>>>>> 935384c59 (added square PID cut) +======= + if (!configGp.isSquarePIDcut) { +>>>>>>> 2e2ba799d (added configurable group) if (candidate.hasTOF() && (std::pow(candidate.tofNSigmaKa() - configGp.shiftInNsigmaTOFKa, 2) + std::pow(candidate.tpcNSigmaKa(), 2)) < (std::pow(configGp.nsigmaCutCombinedKa, 2))) { return true; } From 91503be2d91466866205e21c334fd0f4adff4a25 Mon Sep 17 00:00:00 2001 From: sawankumawat Date: Thu, 30 Apr 2026 14:12:51 +0530 Subject: [PATCH 3/4] mother track check in generated MC --- PWGLF/Tasks/Resonances/kstarqa.cxx | 106 +++++++++++++++++------------ 1 file changed, 61 insertions(+), 45 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index dce7f29f8aa..618fe8927ed 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -82,6 +82,7 @@ struct Kstarqa { struct : ConfigurableGroup { // Configurables for event selections + Configurable isCheckMotherClosure{"isCheckMotherClosure", false, "Check mother globalid in MC for closure"}; Configurable isSquarePIDcut{"isSquarePIDcut", false, "Apply square PID cut"}; Configurable isINELgt0{"isINELgt0", true, "INEL>0 selection"}; Configurable 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 { rEventSelection.add("tracksCheckData", "No. of events in the data", kTH1I, {{10, 0, 10}}); rEventSelection.add("eventsCheckGen", "No. of events in the generated MC", kTH1I, {{10, 0, 10}}); + rEventSelection.add("eventsCheckRec", "No. of events in the generated MC", kTH1I, {{5, 0, 5}}); rEventSelection.add("recMCparticles", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}}); rEventSelection.add("hOccupancy", "Occupancy distribution", kTH1F, {{1000, 0, 15000}}); @@ -439,11 +441,16 @@ struct Kstarqa { std::shared_ptr hGenTracks = rEventSelection.get(HIST("eventsCheckGen")); hGenTracks->GetXaxis()->SetBinLabel(1, "All events"); - hGenTracks->GetXaxis()->SetBinLabel(2, "INELgt0+vtz"); + hGenTracks->GetXaxis()->SetBinLabel(2, "Vz cut"); hGenTracks->GetXaxis()->SetBinLabel(3, "INELgt0"); - hGenTracks->GetXaxis()->SetBinLabel(4, "All Collisions"); - hGenTracks->GetXaxis()->SetBinLabel(5, "Gen events with at least 1 rec event"); - hGenTracks->GetXaxis()->SetBinLabel(6, "Rec events"); + hGenTracks->GetXaxis()->SetBinLabel(4, "PWGlf:INELgt0"); + hGenTracks->GetXaxis()->SetBinLabel(5, "Atleat 1rec"); + + std::shared_ptr hRecTracks = rEventSelection.get(HIST("eventsCheckRec")); + hRecTracks->GetXaxis()->SetBinLabel(1, "All events"); + hRecTracks->GetXaxis()->SetBinLabel(2, "has_MCcollision"); + hRecTracks->GetXaxis()->SetBinLabel(3, "INELgt0"); + hRecTracks->GetXaxis()->SetBinLabel(4, "Event_Selection"); // Multplicity distribution if (cQAevents) { @@ -1507,7 +1514,9 @@ struct Kstarqa { void processSEMC(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) { - // auto oldindex = -999; + if (configGp.isCheckMotherClosure) { + auto oldindex = -999; + } if (!collision.has_mcCollision()) { return; } @@ -1644,45 +1653,48 @@ struct Kstarqa { hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_after"), track2.tpcNSigmaPi(), track2.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, track2.pt()); } - // for (const auto& mothertrack1 : mctrack1.mothers_as()) { - // for (const auto& mothertrack2 : mctrack2.mothers_as()) { + if (configGp.isCheckMotherClosure) { + for (const auto& mothertrack1 : mctrack1.mothers_as()) { + for (const auto& mothertrack2 : mctrack2.mothers_as()) { - // if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { - // continue; - // } + if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { + continue; + } - // if (!mothertrack1.producedByGenerator()) { - // continue; - // } + if (!mothertrack1.producedByGenerator()) { + continue; + } - // if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { - // continue; - // } - // rEventSelection.fill(HIST("recMCparticles"), 11.5); + if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { + continue; + } + rEventSelection.fill(HIST("recMCparticles"), 11.5); - // oldindex = mothertrack1.globalIndex(); + oldindex = mothertrack1.globalIndex(); - // daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); - // daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); - // mother = daughter1 + daughter2; // Kstar meson + daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); + mother = daughter1 + daughter2; // Kstar meson - // hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); - // hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); + hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); + hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); - // isMix = false; - // fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); - // } - // } + isMix = false; + fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); + } + } + } else { - daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); - daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); - mother = daughter1 + daughter2; // Kstar meson + daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); + mother = daughter1 + daughter2; // Kstar meson - hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); - hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); + hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); + hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); - isMix = false; - fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); + isMix = false; + fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); + } } } PROCESS_SWITCH(Kstarqa, processSEMC, "Process same event in MC", false); @@ -1693,14 +1705,16 @@ struct Kstarqa { // void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { rEventSelection.fill(HIST("eventsCheckGen"), 0.5); - + if (configGp.isApplyMCGenVz && std::abs(mcCollision.posZ()) > configGp.cutzvertex) { return; } - + rEventSelection.fill(HIST("eventsCheckGen"), 1.5); + if (configGp.isINELgt0Gen && !mcCollision.isInelGt0()) { return; } + rEventSelection.fill(HIST("eventsCheckGen"), 2.5); std::vector selectedEvents(collisions.size()); int nevts = 0; @@ -1715,10 +1729,9 @@ struct Kstarqa { if (configGp.isINELgt0 && !isINELgt0true) { return; } - rEventSelection.fill(HIST("eventsCheckGen"), 2.5); + rEventSelection.fill(HIST("eventsCheckGen"), 3.5); for (const auto& collision : collisions) { - rEventSelection.fill(HIST("eventsCheckGen"), 3.5); if (!selectionEvent(collision, false)) { // don't fill event cut histogram continue; @@ -2008,21 +2021,24 @@ struct Kstarqa { void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&) { - + rEventSelection.fill(HIST("eventsCheckRec"), 0.5); + if (!collision.has_mcCollision()) { return; } - + rEventSelection.fill(HIST("eventsCheckRec"), 1.5); + double multiplicityRec = -1.0; // multiplicityRec = collision.mcCollision_as().centFT0M(); const auto& mcCollisionRec = collision.mcCollision_as(); multiplicityRec = mcCollisionRec.centFT0M(); - + if (configGp.isINELgt0 && !collision.isInelGt0()) { return; } + rEventSelection.fill(HIST("eventsCheckRec"), 2.5); // multiplicity = collision.centFT0M(); - + if (cSelectMultEstimator == kFT0M) { multiplicity = collision.centFT0M(); } else if (cSelectMultEstimator == kFT0A) { @@ -2034,15 +2050,15 @@ struct Kstarqa { } else { multiplicity = collision.centFT0M(); // default } - + hInvMass.fill(HIST("hAllRecCollisions"), multiplicity); hInvMass.fill(HIST("hAllRecCollisionsCalib"), multiplicityRec); - + if (!selectionEvent(collision, true)) { // fill MC event cut histogram return; } + rEventSelection.fill(HIST("eventsCheckRec"), 3.5); - rEventSelection.fill(HIST("eventsCheckGen"), 5.5); hInvMass.fill(HIST("h1RecMult"), multiplicity); hInvMass.fill(HIST("h1RecMult2"), multiplicityRec); From 45be12604bfe4037a3fb5acb5a727ba6b0e9f496 Mon Sep 17 00:00:00 2001 From: sawankumawat Date: Thu, 30 Apr 2026 14:16:52 +0530 Subject: [PATCH 4/4] solved whitespace error --- PWGLF/Tasks/Resonances/kstarqa.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 618fe8927ed..1588a664818 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -1705,12 +1705,12 @@ struct Kstarqa { // void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { rEventSelection.fill(HIST("eventsCheckGen"), 0.5); - + if (configGp.isApplyMCGenVz && std::abs(mcCollision.posZ()) > configGp.cutzvertex) { return; } rEventSelection.fill(HIST("eventsCheckGen"), 1.5); - + if (configGp.isINELgt0Gen && !mcCollision.isInelGt0()) { return; } @@ -2022,23 +2022,23 @@ struct Kstarqa { void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&) { rEventSelection.fill(HIST("eventsCheckRec"), 0.5); - + if (!collision.has_mcCollision()) { return; } rEventSelection.fill(HIST("eventsCheckRec"), 1.5); - + double multiplicityRec = -1.0; // multiplicityRec = collision.mcCollision_as().centFT0M(); const auto& mcCollisionRec = collision.mcCollision_as(); multiplicityRec = mcCollisionRec.centFT0M(); - + if (configGp.isINELgt0 && !collision.isInelGt0()) { return; } rEventSelection.fill(HIST("eventsCheckRec"), 2.5); // multiplicity = collision.centFT0M(); - + if (cSelectMultEstimator == kFT0M) { multiplicity = collision.centFT0M(); } else if (cSelectMultEstimator == kFT0A) { @@ -2050,10 +2050,10 @@ struct Kstarqa { } else { multiplicity = collision.centFT0M(); // default } - + hInvMass.fill(HIST("hAllRecCollisions"), multiplicity); hInvMass.fill(HIST("hAllRecCollisionsCalib"), multiplicityRec); - + if (!selectionEvent(collision, true)) { // fill MC event cut histogram return; }