@@ -985,17 +985,22 @@ struct LambdaTableProducer {
985985 histos.fill (HIST (SubDirRG[rg]) + HIST (SubDirPart[part]) + HIST (" hPhi" ), phi);
986986 }
987987
988- template <typename T>
988+ template <DMCType dmc, typename T>
989989 void getMatchEffHist (T const & tracks)
990990 {
991991 for (auto const & track : tracks) {
992- if (track.pt () <= cTrackMinPt && std::abs (track.eta ()) >= cTrackEtaCut) {
992+ if constexpr (dmc == kMC ) { // Check corresponding MC particle
993+ if (!track.has_mcParticle ()) {
994+ continue ;
995+ }
996+ }
997+ if (track.pt () <= cTrackMinPt && std::abs (track.eta ()) >= cTrackEtaCut) { // Kinematic selection
993998 continue ;
994999 }
995- if (track.hasITS ()) {
1000+ if (track.hasITS ()) { // ITS only track
9961001 histos.fill (HIST (" Tracks/h2f_itstrack_centpt" ), cent, track.pt ());
9971002 }
998- if (track.hasITS () && track.hasTPC ()) {
1003+ if (track.hasITS () && track.hasTPC ()) { // ITS + TPC track
9991004 histos.fill (HIST (" Tracks/h2f_itstpctrack_centpt" ), cent, track.pt ());
10001005 }
10011006 }
@@ -1030,10 +1035,14 @@ struct LambdaTableProducer {
10301035
10311036 // Loop over V0s
10321037 for (auto const & v0 : v0tracks) {
1038+ // daugthers
1039+ auto postrack = v0.template posTrack_as <T>();
1040+ auto negtrack = v0.template negTrack_as <T>();
1041+
10331042 // check for corresponding MCGen Particle
10341043 if constexpr (dmc == kMC ) {
10351044 histos.fill (HIST (" Tracks/h1f_tracks_info" ), kTracksBeforeHasMcParticle );
1036- if (!v0.has_mcParticle ()) {
1045+ if (!v0.has_mcParticle () || !postrack. has_mcParticle () || !negtrack. has_mcParticle ()) { // check corresponding MC particle
10371046 continue ;
10381047 }
10391048 }
@@ -1279,7 +1288,7 @@ struct LambdaTableProducer {
12791288 return ;
12801289 }
12811290 // Get Matching Efficiency
1282- getMatchEffHist (tracks);
1291+ getMatchEffHist< kData > (tracks);
12831292 }
12841293
12851294 PROCESS_SWITCH (LambdaTableProducer, processMatchEffData, " Process for Matching Efficieny Calculation" , false );
@@ -1315,7 +1324,7 @@ struct LambdaTableProducer {
13151324 return ;
13161325 }
13171326 // Get Matching Efficiency
1318- getMatchEffHist (tracks);
1327+ getMatchEffHist< kData > (tracks);
13191328 }
13201329
13211330 PROCESS_SWITCH (LambdaTableProducer, processMatchEffMCReco, " Process for Matching Efficieny Calculation at MC Reconstructed Level" , false );
0 commit comments