@@ -60,8 +60,10 @@ using namespace o2::framework;
6060using namespace o2 ::framework::expressions;
6161
6262struct 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
259290struct 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 );
0 commit comments