From 2533fe1ce23eb753832816268e89d1f381ddcb92 Mon Sep 17 00:00:00 2001 From: scannito Date: Thu, 15 Jan 2026 17:57:57 +0100 Subject: [PATCH] Differentiate table naming --- .../DataModel/LFPhiStrangeCorrelationTables.h | 37 +++++++++--- .../Strangeness/phiStrangeCorrelator.cxx | 60 ++++++++++++++----- .../Strangeness/phiStrangeCorrelation.cxx | 22 ++++--- 3 files changed, 89 insertions(+), 30 deletions(-) diff --git a/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h b/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h index b19b67f9388..e755053e077 100644 --- a/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h +++ b/PWGLF/DataModel/LFPhiStrangeCorrelationTables.h @@ -22,14 +22,6 @@ namespace o2::aod { -namespace lf_selection_phi_collision -{ -DECLARE_SOA_COLUMN(PhimesonSel, phimesonSel, bool); -} // namespace lf_selection_phi_collision - -DECLARE_SOA_TABLE(PhimesonSelection, "AOD", "PHIINCOLL", - lf_selection_phi_collision::PhimesonSel); - namespace lf_selection_phi_candidate { DECLARE_SOA_INDEX_COLUMN(Collision, collision); @@ -45,13 +37,40 @@ DECLARE_SOA_DYNAMIC_COLUMN(InMassRegion, inMassRegion, }); } // namespace lf_selection_phi_candidate -DECLARE_SOA_TABLE(PhimesonCandidates, "AOD", "PHICANDIDATES", +DECLARE_SOA_TABLE(PhimesonCandidatesData, "AOD", "PHICANDIDATESDATA", + lf_selection_phi_candidate::CollisionId, + lf_selection_phi_candidate::M, + lf_selection_phi_candidate::Pt, + lf_selection_phi_candidate::Y, + lf_selection_phi_candidate::Phi, + lf_selection_phi_candidate::InMassRegion); + +DECLARE_SOA_TABLE(PhimesonCandidatesMcReco, "AOD", "PHICANDIDATESMCRECO", + lf_selection_phi_candidate::CollisionId, + lf_selection_phi_candidate::M, + lf_selection_phi_candidate::Pt, + lf_selection_phi_candidate::Y, + lf_selection_phi_candidate::Phi, + lf_selection_phi_candidate::InMassRegion); + +DECLARE_SOA_TABLE(PhimesonCandidatesMcGen, "AOD", "PHICANDIDATESMCGEN", lf_selection_phi_candidate::CollisionId, lf_selection_phi_candidate::M, lf_selection_phi_candidate::Pt, lf_selection_phi_candidate::Y, lf_selection_phi_candidate::Phi, lf_selection_phi_candidate::InMassRegion); + +namespace lf_selection_phi_collision +{ +DECLARE_SOA_COLUMN(PhimesonSel, phimesonSel, bool); +} // namespace lf_selection_phi_collision + +DECLARE_SOA_TABLE(PhimesonSelectionData, "AOD", "PHIINCOLLDATA", + lf_selection_phi_collision::PhimesonSel); + +DECLARE_SOA_TABLE(PhimesonSelectionMcGen, "AOD", "PHIINCOLLMCGEN", + lf_selection_phi_collision::PhimesonSel); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFPHISTRANGECORRELATIONTABLES_H_ diff --git a/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx b/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx index 273b20fe7cf..55e4f024588 100644 --- a/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx +++ b/PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx @@ -60,8 +60,10 @@ using namespace o2::framework; using namespace o2::framework::expressions; struct PhiMesonCandProducer { - // Produce the table with the event selection information - Produces phimesonCandidates; + // Produce the table with the phi candidates information + Produces phimesonCandidatesData; + // Produces phimesonCandidatesMcReco; + Produces phimesonCandidatesMcGen; HistogramRegistry histos{"phiCandidates", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -189,14 +191,43 @@ struct PhiMesonCandProducer { histos.fill(HIST("h1PhiCandidateMass"), recPhi.M()); - phimesonCandidates(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi()); + phimesonCandidatesData(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi()); } } } PROCESS_SWITCH(PhiMesonCandProducer, processData, "Process function to select Phi meson candidates in Data", true); - void processMCReco(SimCollisions::iterator const& collision, FullMCTracks const&) + void processMCRecoDataLike(SimCollisions::iterator const& collision, FullMCTracks const&) + { + auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + for (const auto& track1 : posThisColl) { + if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) + continue; + + for (const auto& track2 : negThisColl) { + if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) + continue; + + ROOT::Math::PxPyPzMVector recPhi = recMother(track1, track2, massKa, massKa); + + if (recPhi.Pt() < phiConfigs.minPhiPt) + continue; + if (recPhi.M() > phiConfigs.maxMPhi) + continue; + if (std::abs(recPhi.Rapidity()) > phiConfigs.cfgYAcceptance) + continue; + + phimesonCandidatesData(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi()); + } + } + } + + PROCESS_SWITCH(PhiMesonCandProducer, processMCRecoDataLike, "Process function to select Phi meson candidates in MCReco w/o MC truth", false); + + /*void processMCReco(SimCollisions::iterator const& collision, FullMCTracks const&) { auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); @@ -218,12 +249,12 @@ struct PhiMesonCandProducer { if (std::abs(recPhi.Rapidity()) > phiConfigs.cfgYAcceptance) continue; - phimesonCandidates(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi()); + phimesonCandidatesMcReco(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi()); } } } - PROCESS_SWITCH(PhiMesonCandProducer, processMCReco, "Process function to select Phi meson candidates in MCReco", false); + PROCESS_SWITCH(PhiMesonCandProducer, processMCReco, "Process function to select Phi meson candidates in MCReco w MC truth", false);*/ void processMCGen(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) { @@ -248,7 +279,7 @@ struct PhiMesonCandProducer { if (std::abs(genKPair.Rapidity()) > phiConfigs.cfgYAcceptance) continue; - phimesonCandidates(mcCollision.globalIndex(), genKPair.M(), genKPair.Pt(), genKPair.Rapidity(), genKPair.Phi()); + phimesonCandidatesMcGen(mcCollision.globalIndex(), genKPair.M(), genKPair.Pt(), genKPair.Rapidity(), genKPair.Phi()); } } } @@ -258,7 +289,8 @@ struct PhiMesonCandProducer { struct PhiMesonSelCollision { // Produce the table with the event selection information - Produces phimesonSelection; + Produces phimesonSelectionData; + Produces phimesonSelectionMcGen; HistogramRegistry histos{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -433,23 +465,23 @@ struct PhiMesonSelCollision { return true; } - void processData(SelCollisions::iterator const& collision, aod::PhimesonCandidates const& phiCandidates) + void processData(SelCollisions::iterator const& collision, aod::PhimesonCandidatesData const& phiCandidatesData) { - phimesonSelection(defaultEventSelection(collision) && selectionType == 1 ? eventHasPhi(collision, phiCandidates) : true); + phimesonSelectionData(defaultEventSelection(collision) && selectionType == 1 ? eventHasPhi(collision, phiCandidatesData) : true); } PROCESS_SWITCH(PhiMesonSelCollision, processData, "Process function to select events with Phi mesons in Data", true); - void processMCReco(SimCollisions::iterator const& collision, MCCollisions const&, aod::PhimesonCandidates const& phiCandidates) + void processMCReco(SimCollisions::iterator const& collision, MCCollisions const&, aod::PhimesonCandidatesData const& phiCandidatesData) { - phimesonSelection(defaultEventSelection(collision) && selectionType == 1 ? eventHasPhi(collision, phiCandidates) : true); + phimesonSelectionData(defaultEventSelection(collision) && selectionType == 1 ? eventHasPhi(collision, phiCandidatesData) : true); } PROCESS_SWITCH(PhiMesonSelCollision, processMCReco, "Process function to select events with Phi mesons in MCReco", false); - void processMCGen(MCCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, aod::PhimesonCandidates const& phiCandidates) + void processMCGen(MCCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, aod::PhimesonCandidatesMcGen const& phiCandidatesMcGen) { - phimesonSelection(pwglf::isINELgt0mc(mcParticles, pdgDB) && selectionType == 1 ? eventHasPhi(mcCollision, phiCandidates) : true); + phimesonSelectionMcGen(pwglf::isINELgt0mc(mcParticles, pdgDB) && selectionType == 1 ? eventHasPhi(mcCollision, phiCandidatesMcGen) : true); } PROCESS_SWITCH(PhiMesonSelCollision, processMCGen, "Process function to select events with Phi mesons in MCGen", false); diff --git a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx index 7226974f530..a8c51642ec3 100644 --- a/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx @@ -90,12 +90,20 @@ static constexpr std::array particleOf #define LIST_OF_PARTICLES_OF_INTEREST \ X(Phi) \ X(K0S) \ - X(PionTPC) \ - X(PionTPCTOF) + X(Pion) \ + //X(PionTPC) \ + //X(PionTPCTOF) enum ParticleOfInterest { #define X(name) name, LIST_OF_PARTICLES_OF_INTEREST +#undef X + ParticleOfInterestSize +}; + +static constexpr std::array particleOfInterestLabels{ +#define X(name) #name, + LIST_OF_PARTICLES_OF_INTEREST #undef X }; @@ -251,9 +259,9 @@ struct PhiStrangenessCorrelation { Filter v0PreFilter = (nabs(aod::v0data::dcapostopv) > v0Configs.v0SettingDCAPosToPV && nabs(aod::v0data::dcanegtopv) > v0Configs.v0SettingDCANegToPV && aod::v0data::dcaV0daughters < v0Configs.v0SettingDCAV0Dau); // Defining the type of the collisions for data and MC - using SelCollisions = soa::Filtered>; + using SelCollisions = soa::Filtered>; using SimCollisions = soa::Join; - using MCCollisions = soa::Filtered>; + using MCCollisions = soa::Filtered>; // Defining the type of the V0s and corresponding daughter tracks for data and MC using FullV0s = soa::Filtered; @@ -274,7 +282,7 @@ struct PhiStrangenessCorrelation { Preslice collPerMCCollision = aod::mccollisionlabel::mcCollisionId; Preslice v0PerCollision = aod::v0::collisionId; Preslice trackPerCollision = aod::track::collisionId; - Preslice phiCandPerCollision = aod::lf_selection_phi_candidate::collisionId; + PresliceUnsorted phiCandPerCollision = aod::lf_selection_phi_candidate::collisionId; // Preslice mcPartPerMCCollision = aod::mcparticle::mcCollisionId; } preslices; @@ -514,7 +522,7 @@ struct PhiStrangenessCorrelation { return true; } - void processPhiK0SPionDeltayDeltaphiData2D(SelCollisions::iterator const& collision, aod::PhimesonCandidates const& phiCandidates, FullTracks const& fullTracks, FullV0s const& V0s, V0DauTracks const&) + void processPhiK0SPionDeltayDeltaphiData2D(SelCollisions::iterator const& collision, aod::PhimesonCandidatesData const& phiCandidates, FullTracks const& fullTracks, FullV0s const& V0s, V0DauTracks const&) { float multiplicity = collision.centFT0M(); @@ -573,7 +581,7 @@ struct PhiStrangenessCorrelation { PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SPionDeltayDeltaphiData2D, "Process function for Phi-K0S and Phi-Pion Deltay and Deltaphi 2D Correlations in Data", true); - void processParticleEfficiency(MCCollisions::iterator const& mcCollision, SimCollisions const& collisions, FullMCTracks const& fullMCTracks, FullMCV0s const& V0s, V0DauMCTracks const&, aod::McParticles const& mcParticles, aod::PhimesonCandidates const& phiCandidates) + void processParticleEfficiency(MCCollisions::iterator const& mcCollision, SimCollisions const& collisions, FullMCTracks const& fullMCTracks, FullMCV0s const& V0s, V0DauMCTracks const&, aod::McParticles const& mcParticles, aod::PhimesonCandidatesData const& phiCandidates) { uint16_t numberAssocColls{0}; std::vector zVtxs;