Skip to content

Commit d29a139

Browse files
authored
[PWGLF] Differentiate table naming for phi-strange analysis (#14506)
1 parent c700e49 commit d29a139

File tree

3 files changed

+89
-30
lines changed

3 files changed

+89
-30
lines changed

PWGLF/DataModel/LFPhiStrangeCorrelationTables.h

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@
2222

2323
namespace o2::aod
2424
{
25-
namespace lf_selection_phi_collision
26-
{
27-
DECLARE_SOA_COLUMN(PhimesonSel, phimesonSel, bool);
28-
} // namespace lf_selection_phi_collision
29-
30-
DECLARE_SOA_TABLE(PhimesonSelection, "AOD", "PHIINCOLL",
31-
lf_selection_phi_collision::PhimesonSel);
32-
3325
namespace lf_selection_phi_candidate
3426
{
3527
DECLARE_SOA_INDEX_COLUMN(Collision, collision);
@@ -45,13 +37,40 @@ DECLARE_SOA_DYNAMIC_COLUMN(InMassRegion, inMassRegion,
4537
});
4638
} // namespace lf_selection_phi_candidate
4739

48-
DECLARE_SOA_TABLE(PhimesonCandidates, "AOD", "PHICANDIDATES",
40+
DECLARE_SOA_TABLE(PhimesonCandidatesData, "AOD", "PHICANDIDATESDATA",
41+
lf_selection_phi_candidate::CollisionId,
42+
lf_selection_phi_candidate::M,
43+
lf_selection_phi_candidate::Pt,
44+
lf_selection_phi_candidate::Y,
45+
lf_selection_phi_candidate::Phi,
46+
lf_selection_phi_candidate::InMassRegion<lf_selection_phi_candidate::M>);
47+
48+
DECLARE_SOA_TABLE(PhimesonCandidatesMcReco, "AOD", "PHICANDIDATESMCRECO",
49+
lf_selection_phi_candidate::CollisionId,
50+
lf_selection_phi_candidate::M,
51+
lf_selection_phi_candidate::Pt,
52+
lf_selection_phi_candidate::Y,
53+
lf_selection_phi_candidate::Phi,
54+
lf_selection_phi_candidate::InMassRegion<lf_selection_phi_candidate::M>);
55+
56+
DECLARE_SOA_TABLE(PhimesonCandidatesMcGen, "AOD", "PHICANDIDATESMCGEN",
4957
lf_selection_phi_candidate::CollisionId,
5058
lf_selection_phi_candidate::M,
5159
lf_selection_phi_candidate::Pt,
5260
lf_selection_phi_candidate::Y,
5361
lf_selection_phi_candidate::Phi,
5462
lf_selection_phi_candidate::InMassRegion<lf_selection_phi_candidate::M>);
63+
64+
namespace lf_selection_phi_collision
65+
{
66+
DECLARE_SOA_COLUMN(PhimesonSel, phimesonSel, bool);
67+
} // namespace lf_selection_phi_collision
68+
69+
DECLARE_SOA_TABLE(PhimesonSelectionData, "AOD", "PHIINCOLLDATA",
70+
lf_selection_phi_collision::PhimesonSel);
71+
72+
DECLARE_SOA_TABLE(PhimesonSelectionMcGen, "AOD", "PHIINCOLLMCGEN",
73+
lf_selection_phi_collision::PhimesonSel);
5574
} // namespace o2::aod
5675

5776
#endif // PWGLF_DATAMODEL_LFPHISTRANGECORRELATIONTABLES_H_

PWGLF/TableProducer/Strangeness/phiStrangeCorrelator.cxx

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ using namespace o2::framework;
6060
using namespace o2::framework::expressions;
6161

6262
struct PhiMesonCandProducer {
63-
// Produce the table with the event selection information
64-
Produces<aod::PhimesonCandidates> phimesonCandidates;
63+
// Produce the table with the phi candidates information
64+
Produces<aod::PhimesonCandidatesData> phimesonCandidatesData;
65+
// Produces<aod::PhimesonCandidatesMcReco> phimesonCandidatesMcReco;
66+
Produces<aod::PhimesonCandidatesMcGen> phimesonCandidatesMcGen;
6567

6668
HistogramRegistry histos{"phiCandidates", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
6769

@@ -189,14 +191,43 @@ struct PhiMesonCandProducer {
189191

190192
histos.fill(HIST("h1PhiCandidateMass"), recPhi.M());
191193

192-
phimesonCandidates(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi());
194+
phimesonCandidatesData(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi());
193195
}
194196
}
195197
}
196198

197199
PROCESS_SWITCH(PhiMesonCandProducer, processData, "Process function to select Phi meson candidates in Data", true);
198200

199-
void processMCReco(SimCollisions::iterator const& collision, FullMCTracks const&)
201+
void processMCRecoDataLike(SimCollisions::iterator const& collision, FullMCTracks const&)
202+
{
203+
auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
204+
auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
205+
206+
for (const auto& track1 : posThisColl) {
207+
if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1))
208+
continue;
209+
210+
for (const auto& track2 : negThisColl) {
211+
if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2))
212+
continue;
213+
214+
ROOT::Math::PxPyPzMVector recPhi = recMother(track1, track2, massKa, massKa);
215+
216+
if (recPhi.Pt() < phiConfigs.minPhiPt)
217+
continue;
218+
if (recPhi.M() > phiConfigs.maxMPhi)
219+
continue;
220+
if (std::abs(recPhi.Rapidity()) > phiConfigs.cfgYAcceptance)
221+
continue;
222+
223+
phimesonCandidatesData(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi());
224+
}
225+
}
226+
}
227+
228+
PROCESS_SWITCH(PhiMesonCandProducer, processMCRecoDataLike, "Process function to select Phi meson candidates in MCReco w/o MC truth", false);
229+
230+
/*void processMCReco(SimCollisions::iterator const& collision, FullMCTracks const&)
200231
{
201232
auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
202233
auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache);
@@ -218,12 +249,12 @@ struct PhiMesonCandProducer {
218249
if (std::abs(recPhi.Rapidity()) > phiConfigs.cfgYAcceptance)
219250
continue;
220251
221-
phimesonCandidates(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi());
252+
phimesonCandidatesMcReco(collision.globalIndex(), recPhi.M(), recPhi.Pt(), recPhi.Rapidity(), recPhi.Phi());
222253
}
223254
}
224255
}
225256
226-
PROCESS_SWITCH(PhiMesonCandProducer, processMCReco, "Process function to select Phi meson candidates in MCReco", false);
257+
PROCESS_SWITCH(PhiMesonCandProducer, processMCReco, "Process function to select Phi meson candidates in MCReco w MC truth", false);*/
227258

228259
void processMCGen(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles)
229260
{
@@ -248,7 +279,7 @@ struct PhiMesonCandProducer {
248279
if (std::abs(genKPair.Rapidity()) > phiConfigs.cfgYAcceptance)
249280
continue;
250281

251-
phimesonCandidates(mcCollision.globalIndex(), genKPair.M(), genKPair.Pt(), genKPair.Rapidity(), genKPair.Phi());
282+
phimesonCandidatesMcGen(mcCollision.globalIndex(), genKPair.M(), genKPair.Pt(), genKPair.Rapidity(), genKPair.Phi());
252283
}
253284
}
254285
}
@@ -258,7 +289,8 @@ struct PhiMesonCandProducer {
258289

259290
struct PhiMesonSelCollision {
260291
// Produce the table with the event selection information
261-
Produces<aod::PhimesonSelection> phimesonSelection;
292+
Produces<aod::PhimesonSelectionData> phimesonSelectionData;
293+
Produces<aod::PhimesonSelectionMcGen> phimesonSelectionMcGen;
262294

263295
HistogramRegistry histos{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
264296

@@ -433,23 +465,23 @@ struct PhiMesonSelCollision {
433465
return true;
434466
}
435467

436-
void processData(SelCollisions::iterator const& collision, aod::PhimesonCandidates const& phiCandidates)
468+
void processData(SelCollisions::iterator const& collision, aod::PhimesonCandidatesData const& phiCandidatesData)
437469
{
438-
phimesonSelection(defaultEventSelection<false>(collision) && selectionType == 1 ? eventHasPhi<false>(collision, phiCandidates) : true);
470+
phimesonSelectionData(defaultEventSelection<false>(collision) && selectionType == 1 ? eventHasPhi<false>(collision, phiCandidatesData) : true);
439471
}
440472

441473
PROCESS_SWITCH(PhiMesonSelCollision, processData, "Process function to select events with Phi mesons in Data", true);
442474

443-
void processMCReco(SimCollisions::iterator const& collision, MCCollisions const&, aod::PhimesonCandidates const& phiCandidates)
475+
void processMCReco(SimCollisions::iterator const& collision, MCCollisions const&, aod::PhimesonCandidatesData const& phiCandidatesData)
444476
{
445-
phimesonSelection(defaultEventSelection<true, MCCollisions>(collision) && selectionType == 1 ? eventHasPhi<true, MCCollisions>(collision, phiCandidates) : true);
477+
phimesonSelectionData(defaultEventSelection<true, MCCollisions>(collision) && selectionType == 1 ? eventHasPhi<true, MCCollisions>(collision, phiCandidatesData) : true);
446478
}
447479

448480
PROCESS_SWITCH(PhiMesonSelCollision, processMCReco, "Process function to select events with Phi mesons in MCReco", false);
449481

450-
void processMCGen(MCCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, aod::PhimesonCandidates const& phiCandidates)
482+
void processMCGen(MCCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, aod::PhimesonCandidatesMcGen const& phiCandidatesMcGen)
451483
{
452-
phimesonSelection(pwglf::isINELgt0mc(mcParticles, pdgDB) && selectionType == 1 ? eventHasPhi<true>(mcCollision, phiCandidates) : true);
484+
phimesonSelectionMcGen(pwglf::isINELgt0mc(mcParticles, pdgDB) && selectionType == 1 ? eventHasPhi<true>(mcCollision, phiCandidatesMcGen) : true);
453485
}
454486

455487
PROCESS_SWITCH(PhiMesonSelCollision, processMCGen, "Process function to select events with Phi mesons in MCGen", false);

PWGLF/Tasks/Strangeness/phiStrangeCorrelation.cxx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,20 @@ static constexpr std::array<std::string_view, ParticleOfInterestSize> particleOf
9090
#define LIST_OF_PARTICLES_OF_INTEREST \
9191
X(Phi) \
9292
X(K0S) \
93-
X(PionTPC) \
94-
X(PionTPCTOF)
93+
X(Pion) \
94+
//X(PionTPC) \
95+
//X(PionTPCTOF)
9596
9697
enum ParticleOfInterest {
9798
#define X(name) name,
9899
LIST_OF_PARTICLES_OF_INTEREST
100+
#undef X
101+
ParticleOfInterestSize
102+
};
103+
104+
static constexpr std::array<std::string_view, ParticleOfInterestSize> particleOfInterestLabels{
105+
#define X(name) #name,
106+
LIST_OF_PARTICLES_OF_INTEREST
99107
#undef X
100108
};
101109
@@ -251,9 +259,9 @@ struct PhiStrangenessCorrelation {
251259
Filter v0PreFilter = (nabs(aod::v0data::dcapostopv) > v0Configs.v0SettingDCAPosToPV && nabs(aod::v0data::dcanegtopv) > v0Configs.v0SettingDCANegToPV && aod::v0data::dcaV0daughters < v0Configs.v0SettingDCAV0Dau);
252260

253261
// Defining the type of the collisions for data and MC
254-
using SelCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::PVMults, aod::PhimesonSelection>>;
262+
using SelCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::PVMults, aod::PhimesonSelectionData>>;
255263
using SimCollisions = soa::Join<SelCollisions, aod::McCollisionLabels>;
256-
using MCCollisions = soa::Filtered<soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::PhimesonSelection>>;
264+
using MCCollisions = soa::Filtered<soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::PhimesonSelectionMcGen>>;
257265

258266
// Defining the type of the V0s and corresponding daughter tracks for data and MC
259267
using FullV0s = soa::Filtered<aod::V0Datas>;
@@ -274,7 +282,7 @@ struct PhiStrangenessCorrelation {
274282
Preslice<SimCollisions> collPerMCCollision = aod::mccollisionlabel::mcCollisionId;
275283
Preslice<FullMCV0s> v0PerCollision = aod::v0::collisionId;
276284
Preslice<FullMCTracks> trackPerCollision = aod::track::collisionId;
277-
Preslice<aod::PhimesonCandidates> phiCandPerCollision = aod::lf_selection_phi_candidate::collisionId;
285+
PresliceUnsorted<aod::PhimesonCandidatesData> phiCandPerCollision = aod::lf_selection_phi_candidate::collisionId;
278286

279287
// Preslice<aod::McParticles> mcPartPerMCCollision = aod::mcparticle::mcCollisionId;
280288
} preslices;
@@ -514,7 +522,7 @@ struct PhiStrangenessCorrelation {
514522
return true;
515523
}
516524

517-
void processPhiK0SPionDeltayDeltaphiData2D(SelCollisions::iterator const& collision, aod::PhimesonCandidates const& phiCandidates, FullTracks const& fullTracks, FullV0s const& V0s, V0DauTracks const&)
525+
void processPhiK0SPionDeltayDeltaphiData2D(SelCollisions::iterator const& collision, aod::PhimesonCandidatesData const& phiCandidates, FullTracks const& fullTracks, FullV0s const& V0s, V0DauTracks const&)
518526
{
519527
float multiplicity = collision.centFT0M();
520528

@@ -573,7 +581,7 @@ struct PhiStrangenessCorrelation {
573581

574582
PROCESS_SWITCH(PhiStrangenessCorrelation, processPhiK0SPionDeltayDeltaphiData2D, "Process function for Phi-K0S and Phi-Pion Deltay and Deltaphi 2D Correlations in Data", true);
575583

576-
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)
584+
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)
577585
{
578586
uint16_t numberAssocColls{0};
579587
std::vector<float> zVtxs;

0 commit comments

Comments
 (0)