diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index fa36132eb6d..e494d017558 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -344,7 +344,6 @@ struct Chargedkstaranalysis { AxisSpec thnAxisPhi = {axisCfgs.configThnAxisPhi, "Configurabel phi axis"}; // 0 to 2pi // THnSparse AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; - if (!doprocessMC) { histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{5, 0, 5.0}}); auto hCutFlow = histos.get(HIST("hEvtSelInfo")); @@ -403,7 +402,6 @@ struct Chargedkstaranalysis { histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); histos.add("QA/before/CentDist1", "Centrality distribution", HistType::kTH1F, {{110, 0, 110}}); - histos.add("QA/trkbpionTPCPIDME", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); // Bachelor pion @@ -744,88 +742,7 @@ struct Chargedkstaranalysis { return returnFlag; } - template - bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& K0scand) - { - if (std::abs(bTrack.PDGCode()) != kPiPlus) // Are you pion? - return false; - if (std::abs(K0scand.PDGCode()) != kPDGK0s) // Are you K0s? - return false; - - auto motherbTrack = bTrack.template mothers_as(); - auto motherkV0 = K0scand.template mothers_as(); - - // Check bTrack first - if (std::abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? - return false; // Apply first since it's more restrictive - - if (std::abs(motherkV0.pdgCode()) != kPDGK0) // Is it K0s? - return false; - // Check if K0s's mother is K0 (311) - auto motherK0 = motherkV0.template mothers_as(); - if (std::abs(motherK0.pdgCode()) != kPDGK0) - return false; - - // Check if K0's mother is Kstar (323) - auto motherKstar = motherK0.template mothers_as(); - if (std::abs(motherKstar.pdgCode()) != kKstarPlus) - return false; - - // Check if bTrack and K0 have the same mother (global index) - if (motherbTrack.globalIndex() != motherK0.globalIndex()) - return false; - - return true; - } - int count = 0; - template - bool matchRecoToTruthKstar(V0T const& v0, TrkT const& trk) - { - if (!v0.has_mcParticle() || !trk.has_mcParticle()) - return false; - - auto mcK0s = v0.template mcParticle_as(); - auto mcPi = trk.template mcParticle_as(); - - if (std::abs(mcK0s.pdgCode()) != kPDGK0s) - return false; - if (std::abs(mcPi.pdgCode()) != kPiPlus) - return false; - - MCTrueTrackCandidates::iterator kstarFromPi; - bool havePiKstar = false; - for (const auto& m1 : mcPi.template mothers_as()) { - if (std::abs(m1.pdgCode()) == kKstarPlus) { - kstarFromPi = m1; - havePiKstar = true; - break; - } - } - if (!havePiKstar) { - return false; - } - - bool shareSameKstar = false; - for (const auto& m1 : mcK0s.template mothers_as()) { - if (std::abs(m1.pdgCode()) == kPDGK0) { - for (const auto& m2 : m1.template mothers_as()) { - if (m2.globalIndex() == kstarFromPi.globalIndex()) { - shareSameKstar = true; - break; - } - } - if (shareSameKstar) - break; - } - } - if (!shareSameKstar) { - return false; - } - - return true; - } // matchRecoToTruthKstar - template void fillKstarHist(bool isRot, float multiplicity, const T& mother, double cosTheta) { @@ -1313,7 +1230,6 @@ struct Chargedkstaranalysis { histos.fill(HIST("QA/MC/QACent_woCut"), lCentrality); histos.fill(HIST("QA/MC/QAvtxz_woCut"), coll.posZ()); } - if (!colCuts.isSelected(coll)) continue; if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker(coll)) @@ -1408,9 +1324,7 @@ struct Chargedkstaranalysis { if (!coll.has_mcCollision()) continue; - const auto mcid = coll.mcCollisionId(); - if (allowedMcIds.count(mcid) == 0) continue; // To check the event is allowed or not @@ -1427,7 +1341,6 @@ struct Chargedkstaranalysis { } if (!selectionK0s(coll, v0)) continue; - auto trks = tracks.sliceBy(perCollision, v0.collisionId()); // Grouping the tracks with the v0s, means only those tracks that belong to the same collision as v0 for (const auto& bTrack : trks) { if (bTrack.collisionId() != v0.collisionId()) @@ -1436,7 +1349,6 @@ struct Chargedkstaranalysis { continue; if (!selectionPIDPion(bTrack)) continue; - LorentzVectorSetXYZM lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot; lResoSecondary = LorentzVectorSetXYZM(v0.px(), v0.py(), v0.pz(), MassK0Short); @@ -1447,7 +1359,6 @@ struct Chargedkstaranalysis { const double yreco = lResoKstar.Rapidity(); if (std::abs(yreco) > kstarCutCfgs.cKstarMaxRap) continue; - // Since we are doing the MC study and we know about the PDG code of each particle let's try to check the things which we have if (!v0.has_mcParticle() || !bTrack.has_mcParticle()) continue; @@ -1470,6 +1381,24 @@ struct Chargedkstaranalysis { if (!havePiKstar) { continue; } + // Loops over all the mother's of K0s and check if this K0s comming from a kstar and also share the smae mother as of the pion + bool shareSameKstar = false; + for (const auto& m1 : mcK0s.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kPDGK0) { + for (const auto& m2 : m1.template mothers_as()) { + if (m2.globalIndex() == kstarFromPi.globalIndex()) { + shareSameKstar = true; + break; + } + } + if (shareSameKstar) + break; + } + } + if (!shareSameKstar) { + continue; + } + histos.fill(HIST("EffKstar/recoKstar"), ptreco, lCentrality); if (helicityCfgs.cBoostKShot) { fillInvMass(lResoKstar, lCentrality, lResoSecondary, lDecayDaughter_bach, eventCutCfgs.confIsMix);