2424#include " Common/DataModel/Multiplicity.h"
2525#include " Common/DataModel/EventSelection.h"
2626#include " PWGLF/DataModel/LFStrangenessTables.h"
27+ // #include "/home/mdicosta/alice/O2Physics/Common/TableProducer/Converters/mcCollisionConverter.cxx"
2728
2829using namespace o2 ;
2930using namespace o2 ::framework;
@@ -97,6 +98,7 @@ struct pidStudies {
9798 aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
9899 aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
99100 using CollSels = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms>;
101+ using V0sMCRec = soa::Join<aod::V0Cores, aod::V0CoreMCLabels>;
100102
101103 Configurable<float > massK0Min{" massK0Min" , 0.4 , " Minimum mass for K0" };
102104 Configurable<float > massK0Max{" massK0Max" , 0.6 , " Maximum mass for K0" };
@@ -140,6 +142,45 @@ struct pidStudies {
140142 );
141143 }
142144
145+ template <typename T1>
146+ bool isMatched (const T1& cand) {
147+ LOG (info) << " Checking" ;
148+ if constexpr (std::is_same<T1, V0sMCRec::iterator>::value) {
149+ if (!cand.has_v0MCCore ())
150+ return false ;
151+ auto v0MC = cand.template v0MCCore_as <aod::V0MCCores>();
152+ bool isTrueLambda = false ;
153+ bool isPion = false ;
154+ bool isProton = false ;
155+ if (std::abs (v0MC.pdgCode ()) == 3122 )
156+ // LOG(info) << "Matched Lambda";
157+ isTrueLambda = true ;
158+ if (isTrueLambda && (abs (v0MC.pdgCodeNegative ()) == 211 ))
159+ // LOG(info) << "Matched Pion";
160+ isPion = true ;
161+ if (isPion && (abs (v0MC.pdgCodePositive ()) == 2212 ))
162+ // LOG(info) << "Matched Proton";
163+ isProton = true ;
164+ return isProton;
165+ }
166+ }
167+
168+ void processMC (V0sMCRec const & V0s, aod::V0MCCores const & V0sMC)
169+ {
170+ LOG (info) << " Processing MC" ;
171+ LOG (info) << " Size: " << V0s.size ();
172+ for (const auto & v0 : V0s) {
173+ bool matched = isMatched (v0);
174+ // LOG(info) << "---------";
175+ if (matched) {
176+ LOG (info) << " v0 matched" ;
177+ } else {
178+ LOG (info) << " v0 not matched" ;
179+ }
180+ }
181+ }
182+ PROCESS_SWITCH (pidStudies, processMC, " process MC" , true );
183+
143184 void processData (aod::V0Datas const & V0s, aod::Cascades const & cascades, CollSels const &, PIDTracks const &)
144185 {
145186 for (const auto & v0 : V0s) {
@@ -150,7 +191,7 @@ struct pidStudies {
150191 }
151192 }
152193 }
153- PROCESS_SWITCH (pidStudies, processData, " process data" , true );
194+ PROCESS_SWITCH (pidStudies, processData, " process data" , false );
154195};
155196
156197WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments