1515// / \author Fabrizio Chinu <fabrizio.chinu@cern.ch>, Università and INFN Torino
1616// / \author Stefano Politanò <stefano.politano@cern.ch>, INFN Torino
1717// / \author Marcello Di Costanzo <marcello.di.costanzo@cern.ch>, Politecnico and INFN Torino
18+ // / \author Marcello Di Costanzo <luca.aglietta@unito.it>, Università and INFN Torino
1819
1920#include " Framework/AnalysisTask.h"
2021#include " Framework/HistogramRegistry.h"
2425#include " Common/DataModel/Multiplicity.h"
2526#include " Common/DataModel/EventSelection.h"
2627#include " PWGLF/DataModel/LFStrangenessTables.h"
28+ #include " PWGLF/DataModel/LFStrangenessPIDTables.h"
2729// #include "/home/mdicosta/alice/O2Physics/Common/TableProducer/Converters/mcCollisionConverter.cxx"
2830
2931using namespace o2 ;
@@ -98,7 +100,11 @@ struct pidStudies {
98100 aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
99101 aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
100102 using CollSels = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms>;
101- using V0sMCRec = soa::Join<aod::V0Cores, aod::V0CoreMCLabels>;
103+ using V0sMCRec = soa::Join<aod::V0Datas, aod::V0CoreMCLabels>;
104+ using dauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs, aod::DauTrackTOFPIDs>;
105+ // using dauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs>;
106+
107+ // using V0sMCRec = soa::Join<aod::V0Cores, aod::V0CoreMCLabels>;
102108
103109 Configurable<float > massK0Min{" massK0Min" , 0.4 , " Minimum mass for K0" };
104110 Configurable<float > massK0Max{" massK0Max" , 0.6 , " Maximum mass for K0" };
@@ -112,71 +118,112 @@ struct pidStudies {
112118 template <bool isMc, typename Cand>
113119 void fillTree (Cand const & candidate)
114120 {
115- const auto & posTrack = candidate.template posTrack_as <PIDTracks>();
116- const auto & negTrack = candidate.template negTrack_as <PIDTracks>();
117- pidV0 (
118- candidate.mK0Short (),
119- candidate.mLambda (),
120- posTrack.pt (),
121- negTrack.pt (),
122- candidate.v0radius (),
123- candidate.v0cosPA (),
124- posTrack.tofNSigmaPi (),
125- negTrack.tofNSigmaPi (),
126- posTrack.tofNSigmaKa (),
127- negTrack.tofNSigmaKa (),
128- posTrack.tofNSigmaPr (),
129- negTrack.tofNSigmaPr (),
130- posTrack.tpcNSigmaPi (),
131- negTrack.tpcNSigmaPi (),
132- posTrack.tpcNSigmaKa (),
133- negTrack.tpcNSigmaKa (),
134- posTrack.tpcNSigmaPr (),
135- negTrack.tpcNSigmaPr (),
136- candidate.alpha (),
137- candidate.qtarm (),
138- candidate.template collision_as <CollSels>().ft0cOccupancyInTimeRange (),
139- candidate.template collision_as <CollSels>().trackOccupancyInTimeRange (),
140- candidate.template collision_as <CollSels>().centFT0C (),
141- candidate.template collision_as <CollSels>().centFT0M ()
142- );
121+ if constexpr (!isMc) {
122+ const auto & posTrack = candidate.template posTrack_as <PIDTracks>();
123+ const auto & negTrack = candidate.template negTrack_as <PIDTracks>();
124+ pidV0 (
125+ candidate.mK0Short (),
126+ candidate.mLambda (),
127+ posTrack.pt (),
128+ negTrack.pt (),
129+ candidate.v0radius (),
130+ candidate.v0cosPA (),
131+ posTrack.tofNSigmaPi (),
132+ negTrack.tofNSigmaPi (),
133+ posTrack.tofNSigmaKa (),
134+ negTrack.tofNSigmaKa (),
135+ posTrack.tofNSigmaPr (),
136+ negTrack.tofNSigmaPr (),
137+ posTrack.tpcNSigmaPi (),
138+ negTrack.tpcNSigmaPi (),
139+ posTrack.tpcNSigmaKa (),
140+ negTrack.tpcNSigmaKa (),
141+ posTrack.tpcNSigmaPr (),
142+ negTrack.tpcNSigmaPr (),
143+ candidate.alpha (),
144+ candidate.qtarm (),
145+ candidate.template collision_as <CollSels>().ft0cOccupancyInTimeRange (),
146+ candidate.template collision_as <CollSels>().trackOccupancyInTimeRange (),
147+ candidate.template collision_as <CollSels>().centFT0C (),
148+ candidate.template collision_as <CollSels>().centFT0M ()
149+ );
150+ } else {
151+ LOG (info) << " Filling MC" ;
152+ const auto & posTrack = candidate.template posTrack_as <PIDTracks>();
153+ const auto & negTrack = candidate.template negTrack_as <PIDTracks>();
154+
155+ // auto negTrack = candidate.template negTrack_as<soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs, aod::DauTrackTOFPIDs>>();
156+ // auto posTrack = candidate.template posTrack_as<soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs, aod::DauTrackTOFPIDs>>();
157+
158+ pidV0 (
159+ candidate.mK0Short (),
160+ candidate.mLambda (),
161+ posTrack.pt (),
162+ negTrack.pt (),
163+ candidate.v0radius (),
164+ candidate.v0cosPA (),
165+ posTrack.tofNSigmaPi (),
166+ negTrack.tofNSigmaPi (),
167+ posTrack.tofNSigmaKa (),
168+ negTrack.tofNSigmaKa (),
169+ posTrack.tofNSigmaPr (),
170+ negTrack.tofNSigmaPr (),
171+ posTrack.tpcNSigmaPi (),
172+ negTrack.tpcNSigmaPi (),
173+ posTrack.tpcNSigmaKa (),
174+ negTrack.tpcNSigmaKa (),
175+ posTrack.tpcNSigmaPr (),
176+ negTrack.tpcNSigmaPr (),
177+ candidate.alpha (),
178+ candidate.qtarm (),
179+ 0 , // candidate.template collision_as<CollSels>().ft0cOccupancyInTimeRange(),
180+ 0 , // candidate.template collision_as<CollSels>().trackOccupancyInTimeRange(),
181+ 0 , // candidate.template collision_as<CollSels>().centFT0C(),
182+ 0 // candidate.template collision_as<CollSels>().centFT0M()
183+ );
184+ }
185+
143186 }
144187
145188 template <typename T1>
146189 bool isMatched (const T1& cand) {
147- LOG (info) << " Checking" ;
190+ // LOG(info) << "Checking";
191+ bool matched = false ;
148192 if constexpr (std::is_same<T1, V0sMCRec::iterator>::value) {
149193 if (!cand.has_v0MCCore ())
150194 return false ;
151195 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;
196+ if (std::abs (v0MC.pdgCode ()) == 3122 && (abs (v0MC.pdgCodeNegative ()) == 211 )
197+ && (abs (v0MC.pdgCodePositive ()) == 2212 )) {
198+ LOG (info) << " Lambda matched" ;
199+ matched = true ;
200+ }
201+ if (std::abs (v0MC.pdgCode ()) == 310 && (abs (v0MC.pdgCodeNegative ()) == 211 )
202+ && (abs (v0MC.pdgCodePositive ()) == 211 )) {
203+ LOG (info) << " K0S matched" ;
204+ matched = true ;
205+ }
165206 }
207+ return matched;
166208 }
167209
168- void processMC (V0sMCRec const & V0s, aod::V0MCCores const & V0sMC)
210+ void processMC (V0sMCRec const & V0s, aod::V0MCCores const & V0sMC, PIDTracks const & )
169211 {
170- LOG (info) << " Processing MC" ;
171- LOG (info) << " Size: " << V0s.size ();
212+ // LOG(info) << "Processing MC";
213+ // LOG(info) << "Size: " << V0s.size();
172214 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- }
215+ if (v0.mK0Short () > massK0Min && v0.mK0Short () < massK0Max ||
216+ v0.mLambda () > massLambdaMin && v0.mLambda () < massLambdaMax ||
217+ v0.mAntiLambda () > massLambdaMin && v0.mAntiLambda () < massLambdaMax) {
218+ // LOG(info) << "mass sel ok";
219+ // bool matched = isMatched(v0);
220+ // LOG(info) << "---------";
221+ if (isMatched (v0)) {
222+ fillTree<true >(v0);
223+ } else {
224+ LOG (info) << " v0 not matched" ;
225+ }
226+ }
180227 }
181228 }
182229 PROCESS_SWITCH (pidStudies, processMC, " process MC" , true );
0 commit comments