From acf30a6452e3001262f13fa50aedfbe57a17d427 Mon Sep 17 00:00:00 2001 From: Subhadeep Mandal Date: Tue, 20 Jan 2026 20:04:59 +0530 Subject: [PATCH] Optimised to remove misidentification of particles --- PWGLF/Tasks/Resonances/kstar892LightIon.cxx | 323 ++++++++++++++++++-- 1 file changed, 302 insertions(+), 21 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstar892LightIon.cxx b/PWGLF/Tasks/Resonances/kstar892LightIon.cxx index 19c0e261938..f18aad19290 100644 --- a/PWGLF/Tasks/Resonances/kstar892LightIon.cxx +++ b/PWGLF/Tasks/Resonances/kstar892LightIon.cxx @@ -92,6 +92,9 @@ struct Kstar892LightIon { Configurable isVertexITSTPC{"isVertexITSTPC", false, "Vertex ITS TPC"}; Configurable isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"}; + // check + Configurable isApplyEvSelFactors{"isApplyEvSelFactors", false, "Apply event selection cut in processCorrFactors"}; + // Configurables for track selections Configurable isPVContributor{"isPVContributor", true, "PV contributor track selection"}; // PV Contriuibutor Configurable isPrimaryTrack{"isPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz @@ -129,6 +132,9 @@ struct Kstar892LightIon { Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; Configurable onlyTPC{"onlyTPC", false, "only TPC tracks"}; Configurable isApplypTdepPID{"isApplypTdepPID", false, "Apply pT dependent PID"}; + Configurable isApplypTdepPIDwTOF{"isApplypTdepPIDwTOF", false, "Apply pT dependent PID with compulsory TOF condition in a pT range"}; + Configurable isApplyMID{"isApplyMID", false, "Apply particle MID"}; + Configurable isApplypTdepMID{"isApplypTdepMID", false, "Apply pT dependent particle MID"}; Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3.0, "TPC Nsigma cut for pions"}; Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3.0, "TPC Nsigma cut for kaons"}; @@ -137,6 +143,9 @@ struct Kstar892LightIon { Configurable nsigmaCutCombinedKa{"nsigmaCutCombinedKa", 3.0, "Combined Nsigma cut for kaon"}; Configurable nsigmaCutCombinedPi{"nsigmaCutCombinedPi", 3.0, "Combined Nsigma cut for pion"}; + Configurable nsigmaCutCombinedMID{"nsigmaCutCombinedMID", 3.0, "Combined Nsigma cut for pion in MID"}; + Configurable nsigmaCutTPCMID{"nsigmaCutTPCMID", 1.0, "MID Nsigma cut for pion in TPC"}; + // Fixed variables float lowPtCutPID = 0.5; } selectionConfig; @@ -152,6 +161,8 @@ struct Kstar892LightIon { Configurable selectCentEstimator{"selectCentEstimator", 0, "Select centrality estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C, 3 - FV0A"}; + Configurable reflectionType{"reflectionType", 0, "Reflection: 0=Rho, 1=Omega, 2=Phi, 3=Kstar (for processRecReflection)"}; + // Configurable for histograms ConfigurableAxis binsCentPlot{"binsCentPlot", {110, 0.0, 110}, "Centrality axis"}; ConfigurableAxis axisdEdx{"axisdEdx", {1, 0.0f, 200.0f}, "dE/dx (a.u.)"}; @@ -161,7 +172,7 @@ struct Kstar892LightIon { ConfigurableAxis binsImpactPar{"binsImpactPar", {100, 0, 25}, "Binning of the impact parameter axis"}; ConfigurableAxis axisNch{"axisNch", {100, 0.0f, 100.0f}, "Number of charged particles in |y| < 0.5"}; - enum MultEstimator { + enum CentEstimator { kFT0M, kFT0A, kFT0C, @@ -177,8 +188,17 @@ struct Kstar892LightIon { kProton }; + enum PartReflection { + kRho, + kOmega, + kPhi, + kKstar + }; + int noOfDaughters = 2; + double pionPIDpTlow = 1, pionPIDpThigh = 2.5, kaonPIDpTlow = 0.7, kaonPIDpThigh = 2.5; + TRandom* rn = new TRandom(); void init(InitContext const&) @@ -318,10 +338,6 @@ struct Kstar892LightIon { hMC.add("CorrFactors/h3dGenKstarVsMultMCVsCentrality", "MC centrality vs centrality vs p_{T}", kTH3D, {axisNch, {101, 0.0f, 101.0f}, ptAxis}); } - if (doprocessRecMisID) { - hMC.add("RecMisID/hMassMisID", "Reconstruction misidentification", kTH3F, {ptAxis, centralityAxis, invmassAxis}); - } - if (doprocessLossMCMultiplicity) { hMC.add("LossMult/hMultMC", "Charged Paticle multiplicity in generated MC before event selection", kTH1F, {axisNch}); hMC.add("LossMult/hCentVsMultMC", "Centrality vs Charged Particle Multiplicity", kTH2F, {centralityAxis, axisNch}); @@ -331,6 +347,14 @@ struct Kstar892LightIon { hMC.add("LossMult/hGenKstar_vs_pt_vs_multMC", "pT vs Charged particle multiplicity", kTH2F, {ptAxis, axisNch}); hMC.add("LossMult/hGenKstarRecoEvt_vs_pt_vs_multMC", "pT vs Charged particle multiplicity with reconstruction", kTH2F, {ptAxis, axisNch}); } + + if (doprocessRecMisID) { + hMC.add("RecMisID/hMassMisID", "Reconstruction misidentification", kTH3F, {ptAxis, centralityAxis, invmassAxis}); + } + + if (doprocessRecReflection) { + hMC.add("Reflections/hReflection", "Refelction template of Rho", kTH3F, {ptAxis, centralityAxis, invmassAxis}); + } } double massPi = o2::constants::physics::MassPiPlus; @@ -552,7 +576,7 @@ struct Kstar892LightIon { } template - bool selectionPIDNew(const T& candidate, int PID) + bool selectionPIDpTdep(const T& candidate, int PID) { if (PID == PIDParticle::kPion) { if (candidate.pt() < selectionConfig.lowPtCutPID && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi) { @@ -578,6 +602,101 @@ struct Kstar892LightIon { return false; } + template + bool selectionPIDpTdepTOF(const T& candidate, int PID) + { + if (PID == PIDParticle::kPion) { + if (candidate.pt() < pionPIDpTlow || candidate.pt() > pionPIDpThigh) { + if (candidate.pt() < selectionConfig.lowPtCutPID && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi) { + return true; + } + if (candidate.pt() >= selectionConfig.lowPtCutPID && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi && candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < selectionConfig.nsigmaCutTOFPi) { + return true; + } + if (candidate.pt() >= selectionConfig.lowPtCutPID && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi && !candidate.hasTOF()) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (selectionConfig.nsigmaCutCombinedPi * selectionConfig.nsigmaCutCombinedPi)) { + return true; + } + } + } else if (PID == PIDParticle::kKaon) { + if (candidate.pt() < kaonPIDpTlow || candidate.pt() > kaonPIDpThigh) { + if (candidate.pt() < selectionConfig.lowPtCutPID && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCKa) { + return true; + } + if (candidate.pt() >= selectionConfig.lowPtCutPID && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCKa && candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < selectionConfig.nsigmaCutTOFKa) { + return true; + } + if (candidate.pt() >= selectionConfig.lowPtCutPID && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCKa && !candidate.hasTOF()) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (selectionConfig.nsigmaCutCombinedKa * selectionConfig.nsigmaCutCombinedKa)) { + return true; + } + } + } + return false; + } + + template + bool selectionMID(const T& candidate, int PID) + { + if (PID == PIDParticle::kPion) { + if (selectionConfig.onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } else if (selectionConfig.onlyTPC) { + if (std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (selectionConfig.nsigmaCutCombinedMID * selectionConfig.nsigmaCutCombinedMID)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } + } else if (PID == PIDParticle::kKaon) { + if (selectionConfig.onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } else if (selectionConfig.onlyTPC) { + if (std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (selectionConfig.nsigmaCutCombinedMID * selectionConfig.nsigmaCutCombinedMID)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } + } + return false; + } + + template + bool selectionMIDpTdep(const T& candidate, int PID) + { + if (PID == PIDParticle::kPion) { + if (candidate.pt() >= pionPIDpTlow && candidate.pt() < pionPIDpThigh && !candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } else if (PID == PIDParticle::kKaon) { + if (candidate.pt() >= kaonPIDpTlow && candidate.pt() < kaonPIDpThigh && !candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCMID) { + return true; + } + } + return false; + } + //*********Varibles declaration*************** float centrality{-1.0}, theta2; ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterRot, mother, motherRot; @@ -714,14 +833,25 @@ struct Kstar892LightIon { } // since we are using combinations full index policy, so repeated pairs are allowed, so we can check one with Kaon and other with pion - if (!selectionConfig.isApplypTdepPID && !selectionPID(track1, 1)) // Track 1 is checked with Kaon + if ((!selectionConfig.isApplypTdepPID && !selectionConfig.isApplypTdepPIDwTOF) && !selectionPID(track1, 1)) // Track 1 is checked with Kaon continue; - if (!selectionConfig.isApplypTdepPID && !selectionPID(track2, 0)) // Track 2 is checked with Pion + if ((!selectionConfig.isApplypTdepPID && !selectionConfig.isApplypTdepPIDwTOF) && !selectionPID(track2, 0)) // Track 2 is checked with Pion continue; - if (selectionConfig.isApplypTdepPID && !selectionPIDNew(track1, 1)) // Track 1 is checked with Kaon + if (selectionConfig.isApplypTdepPID && !selectionPIDpTdep(track1, 1)) // Track 1 is checked with Kaon + continue; + if (selectionConfig.isApplypTdepPID && !selectionPIDpTdep(track2, 0)) // Track 2 is checked with Pion continue; - if (selectionConfig.isApplypTdepPID && !selectionPIDNew(track2, 0)) // Track 2 is checked with Pion + + if (selectionConfig.isApplypTdepPIDwTOF && !selectionPIDpTdepTOF(track1, 1)) // Track 1 is checked with Kaon + continue; + if (selectionConfig.isApplypTdepPIDwTOF && !selectionPIDpTdepTOF(track2, 0)) // Track 2 is checked with Pion + continue; + + if (selectionConfig.isApplyMID && (selectionMID(track1, 0) || selectionMID(track2, 1))) + continue; + + if (selectionConfig.isApplypTdepMID && (selectionMIDpTdep(track1, 0) || selectionMIDpTdep(track2, 1))) continue; if (cQAplots) { @@ -847,10 +977,19 @@ struct Kstar892LightIon { } // since we are using combinations full index policy, so repeated pairs are allowed, so we can check one with Kaon and other with pion - if (!selectionConfig.isApplypTdepPID && (!selectionPID(track1, 1) || !selectionPID(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + if ((!selectionConfig.isApplypTdepPID && !selectionConfig.isApplypTdepPIDwTOF) && (!selectionPID(track1, 1) || !selectionPID(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion continue; - if (selectionConfig.isApplypTdepPID && (!selectionPIDNew(track1, 1) || !selectionPIDNew(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + if (selectionConfig.isApplypTdepPID && (!selectionPIDpTdep(track1, 1) || !selectionPIDpTdep(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplypTdepPIDwTOF && (!selectionPIDpTdepTOF(track1, 1) || !selectionPIDpTdepTOF(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplyMID && (selectionMID(track1, 0) || selectionMID(track2, 1))) + continue; + + if (selectionConfig.isApplypTdepMID && (selectionMIDpTdep(track1, 0) || selectionMIDpTdep(track2, 1))) continue; if (cQAplots) { @@ -940,10 +1079,19 @@ struct Kstar892LightIon { continue; } - if (!selectionConfig.isApplypTdepPID && (!selectionPID(t1, 1) || !selectionPID(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + if ((!selectionConfig.isApplypTdepPID && !selectionConfig.isApplypTdepPIDwTOF) && (!selectionPID(t1, 1) || !selectionPID(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplypTdepPID && (!selectionPIDpTdep(t1, 1) || !selectionPIDpTdep(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplypTdepPIDwTOF && (!selectionPIDpTdepTOF(t1, 1) || !selectionPIDpTdepTOF(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplyMID && (selectionMID(t1, 0) || selectionMID(t2, 1))) continue; - if (selectionConfig.isApplypTdepPID && (!selectionPIDNew(t1, 1) || !selectionPIDNew(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + if (selectionConfig.isApplypTdepMID && (selectionMIDpTdep(t1, 0) || selectionMIDpTdep(t2, 1))) continue; daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa); @@ -1008,10 +1156,19 @@ struct Kstar892LightIon { continue; } - if (!selectionConfig.isApplypTdepPID && (!selectionPID(t1, 1) || !selectionPID(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + if ((!selectionConfig.isApplypTdepPID && !selectionConfig.isApplypTdepPIDwTOF) && (!selectionPID(t1, 1) || !selectionPID(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion continue; - if (selectionConfig.isApplypTdepPID && (!selectionPIDNew(t1, 1) || !selectionPIDNew(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + if (selectionConfig.isApplypTdepPID && (!selectionPIDpTdep(t1, 1) || !selectionPIDpTdep(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplypTdepPIDwTOF && (!selectionPIDpTdepTOF(t1, 1) || !selectionPIDpTdepTOF(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplyMID && (selectionMID(t1, 0) || selectionMID(t2, 1))) + continue; + + if (selectionConfig.isApplypTdepMID && (selectionMIDpTdep(t1, 0) || selectionMIDpTdep(t2, 1))) continue; if (!t1.has_mcParticle() || !t2.has_mcParticle()) { @@ -1272,12 +1429,20 @@ struct Kstar892LightIon { } if (track1PDG == PDG_t::kPiPlus) { - if (!selectionConfig.isApplypTdepPID && !(selectionPID(track1, 0) && selectionPID(track2, 1))) { // pion and kaon + if ((!selectionConfig.isApplypTdepPID && !selectionConfig.isApplypTdepPIDwTOF) && !(selectionPID(track1, 0) && selectionPID(track2, 1))) { // pion and kaon continue; - } else if (selectionConfig.isApplypTdepPID && !(selectionPIDNew(track1, 0) && selectionPIDNew(track2, 1))) { // pion and kaon + } else if (selectionConfig.isApplypTdepPID && !(selectionPIDpTdep(track1, 0) && selectionPIDpTdep(track2, 1))) { // pion and kaon + continue; + } else if (selectionConfig.isApplypTdepPIDwTOF && !(selectionPIDpTdepTOF(track1, 0) && selectionPIDpTdepTOF(track2, 1))) { continue; } + if (selectionConfig.isApplyMID && (selectionMID(track1, 1) || selectionMID(track2, 0))) + continue; + + if (selectionConfig.isApplypTdepMID && (selectionMIDpTdep(track1, 1) || selectionMIDpTdep(track2, 0))) + continue; + if (cQAplots) { if (track1.sign() < 0 && track2.sign() > 0) { hPID.fill(HIST("After/hTPCnsigPi_Neg_mult_pt"), track1.tpcNSigmaPi(), centrality, track1.pt()); @@ -1293,12 +1458,20 @@ struct Kstar892LightIon { } } else if (track1PDG == PDG_t::kKPlus) { - if (!selectionConfig.isApplypTdepPID && !(selectionPID(track1, 1) && selectionPID(track2, 0))) { // kaon and pion + if ((!selectionConfig.isApplypTdepPID && !selectionConfig.isApplypTdepPIDwTOF) && !(selectionPID(track1, 1) && selectionPID(track2, 0))) { // kaon and pion + continue; + } else if (selectionConfig.isApplypTdepPID && !(selectionPIDpTdep(track1, 1) && selectionPIDpTdep(track2, 0))) { // kaon and pion continue; - } else if (selectionConfig.isApplypTdepPID && !(selectionPIDNew(track1, 1) && selectionPIDNew(track2, 0))) { // kaon and pion + } else if (selectionConfig.isApplypTdepPIDwTOF && !(selectionPIDpTdepTOF(track1, 1) && selectionPIDpTdepTOF(track2, 0))) { continue; } + if (selectionConfig.isApplyMID && (selectionMID(track1, 0) || selectionMID(track2, 1))) + continue; + + if (selectionConfig.isApplypTdepMID && (selectionMIDpTdep(track1, 0) || selectionMIDpTdep(track2, 1))) + continue; + if (cQAplots) { if (track1.sign() < 0 && track2.sign() > 0) { hPID.fill(HIST("After/hTPCnsigKa_Neg_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); @@ -1415,7 +1588,7 @@ struct Kstar892LightIon { float centrality = 100.5f; for (auto const& collision : collisions) { - if (!selectionEvent(collision, false)) // don't fill event cut histogram + if (selectionConfig.isApplyEvSelFactors && !selectionEvent(collision, false)) continue; if (selectCentEstimator == kFT0M) { @@ -1618,6 +1791,114 @@ struct Kstar892LightIon { } } PROCESS_SWITCH(Kstar892LightIon, processRecMisID, "Process Reconstructed MisID Background", false); + + void processRecReflection(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&) + { + if (!collision.has_mcCollision()) + return; + + if (!selectionEvent(collision, false)) + return; + + if (selectCentEstimator == kFT0M) { + centrality = collision.centFT0M(); + } else if (selectCentEstimator == kFT0A) { + centrality = collision.centFT0A(); + } else if (selectCentEstimator == kFT0C) { + centrality = collision.centFT0C(); + } else if (selectCentEstimator == kFV0A) { + centrality = collision.centFV0A(); + } else { + centrality = collision.centFT0M(); // default + } + + for (const auto& [track1, track2] : + combinations(CombinationsFullIndexPolicy(tracks, tracks))) { + + if (!selectionTrack(track1) || !selectionTrack(track2)) + continue; + + if (track1.index() >= track2.index()) + continue; + + if (track1.sign() * track2.sign() >= 0) + continue; + + if (!track1.has_mcParticle() || !track2.has_mcParticle()) + continue; + + const auto mc1 = track1.mcParticle(); + const auto mc2 = track2.mcParticle(); + + if (!mc1.isPhysicalPrimary() || !mc2.isPhysicalPrimary()) + continue; + + bool sameMother = false; + int motherPDG = 0; + + for (const auto& m1 : mc1.mothers_as()) { + for (const auto& m2 : mc2.mothers_as()) { + if (m1.globalIndex() == m2.globalIndex()) { + motherPDG = std::abs(m1.pdgCode()); + sameMother = true; + break; + } + } + if (sameMother) + break; + } + + if (!sameMother) + continue; + + ROOT::Math::PxPyPzMVector p1, p2; + + if (reflectionType == kRho) { // Rho0 (770) -> pi pi -> K pi + if (motherPDG != PDG_t::kRho770_0) + continue; + if (std::abs(mc1.pdgCode()) != PDG_t::kPiPlus || std::abs(mc2.pdgCode()) != PDG_t::kPiPlus) + continue; + + p1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + p2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); + } else if (reflectionType == kOmega) { // Omega (782) -> pi pi (pi0) -> K pi + if (motherPDG != o2::constants::physics::kOmega) + continue; + if (std::abs(mc1.pdgCode()) != PDG_t::kPiPlus || std::abs(mc2.pdgCode()) != PDG_t::kPiPlus) + continue; + + p1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + p2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); + } else if (reflectionType == kPhi) { // Phi (1020) -> K K -> K pi + if (motherPDG != o2::constants::physics::kPhi) + continue; + if (std::abs(mc1.pdgCode()) != PDG_t::kKPlus || std::abs(mc2.pdgCode()) != PDG_t::kKPlus) + continue; + + p1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massPi); + p2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massKa); + } else if (reflectionType == kKstar) { // K*0 (892) Self-Reflection (swap) + if (motherPDG != o2::constants::physics::kK0Star892) + continue; + + if (!((std::abs(mc1.pdgCode()) == PDG_t::kPiPlus && std::abs(mc2.pdgCode()) == PDG_t::kKPlus) || (std::abs(mc1.pdgCode()) == PDG_t::kKPlus && std::abs(mc2.pdgCode()) == PDG_t::kPiPlus))) + continue; + + p1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), std::abs(mc1.pdgCode()) == PDG_t::kKPlus ? massPi : massKa); + p2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), std::abs(mc2.pdgCode()) == PDG_t::kKPlus ? massPi : massKa); + } else { + continue; + } + + auto fakeMother = p1 + p2; + + if (fakeMother.Rapidity() < selectionConfig.motherRapidityMin || fakeMother.Rapidity() > selectionConfig.motherRapidityMax) + continue; + + hMC.fill(HIST("Reflections/hReflection"), fakeMother.Pt(), centrality, fakeMother.M()); + } + } + PROCESS_SWITCH(Kstar892LightIon, processRecReflection, "Process particle reflection", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)