@@ -275,6 +275,7 @@ struct Chk892pp {
275275 int kPDGK0 = kK0 ;
276276 int kKstarPlus = o2::constants::physics::Pdg::kKPlusStar892 ;
277277 // int kPiPlus = 211;
278+ double fMaxPosPV = 1e-2 ;
278279
279280 void init (o2::framework::InitContext&)
280281 {
@@ -445,12 +446,15 @@ struct Chk892pp {
445446
446447 histos.add (" EffKstar/genKstar" , " Gen Kstar (|y|<0.5)" , HistType::kTH2F , {ptAxis, centAxis});
447448 histos.add (" EffKstar/genKstar_pri" , " Gen primary Kstar (|y|<0.5)" , HistType::kTH2F , {ptAxis, centAxis});
449+ histos.add (" EffKstar/genKstar_pri_pos" , " Gen primary Kstar selected by vertex position (|y|<0.5)" , HistType::kTH2F , {ptAxis, centAxis});
448450 histos.add (" EffKstar/recoKstar" , " Kstar Reco matched (final all)" , HistType::kTH2F , {ptAxis, centAxis});
449451
450452 histos.add (" Correction/sigLoss_den" , " Gen Kstar (|y|<0.5) in truth class" , HistType::kTH2F , {ptAxis, centAxis});
451453 histos.add (" Correction/sigLoss_den_pri" , " Gen primary Kstar (|y|<0.5) in truth class" , HistType::kTH2F , {ptAxis, centAxis});
454+ histos.add (" Correction/sigLoss_den_pri_pos" , " Gen primary Kstar selected by vertex position (|y|<0.5) in truth class" , HistType::kTH2F , {ptAxis, centAxis});
452455 histos.add (" Correction/sigLoss_num" , " Gen Kstar (|y|<0.5, selected events) in reco class" , HistType::kTH2F , {ptAxis, centAxis});
453456 histos.add (" Correction/sigLoss_num_pri" , " Gen primary Kstar (|y|<0.5, selected events) in reco class" , HistType::kTH2F , {ptAxis, centAxis});
457+ histos.add (" Correction/sigLoss_num_pri_pos" , " Gen primary Kstar selected by vertex position (|y|<0.5, selected events) in reco class" , HistType::kTH2F , {ptAxis, centAxis});
454458 histos.add (" Correction/EF_den" , " Gen events (truth class)" , HistType::kTH1F , {centAxis});
455459 histos.add (" Correction/EF_num" , " Reco events (selected events)" , HistType::kTH1F , {centAxis});
456460 histos.add (" Correction/MCTruthCent_all" , " MC truth FT0M centrality (all mcCollisions)" , HistType::kTH1F , {centAxis});
@@ -914,7 +918,7 @@ struct Chk892pp {
914918 return true ;
915919 } // matchRecoToTruthKstar
916920
917- void effKstarProcessGen (MCTrueTrackCandidates const & mcparts)
921+ void effKstarProcessGen (soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms> const &, MCTrueTrackCandidates const & mcparts)
918922 {
919923 for (const auto & part : mcparts) {
920924 if (!part.has_mcCollision ())
@@ -971,6 +975,18 @@ struct Chk892pp {
971975 if (part.vt () == 0 ) {
972976 histos.fill (HIST (" EffKstar/genKstar_pri" ), part.pt (), lCentrality);
973977 }
978+
979+ const auto mcc = part.mcCollision_as <soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms>>();
980+
981+ const float dx = part.vx () - mcc.posX ();
982+ const float dy = part.vy () - mcc.posY ();
983+ const float dz = part.vz () - mcc.posZ ();
984+
985+ const float distanceFromPV = std::sqrt (dx * dx + dy * dy + dz * dz);
986+
987+ if (distanceFromPV < fMaxPosPV ) {
988+ histos.fill (HIST (" EffKstar/genKstar_pri_pos" ), part.pt (), lCentrality);
989+ }
974990 }
975991 } // effKstarProcessGen
976992
@@ -1038,7 +1054,7 @@ struct Chk892pp {
10381054 }
10391055 } // effKstarProcessReco
10401056
1041- void fillSigLossNum (MCTrueTrackCandidates const & mcparts)
1057+ void fillSigLossNum (soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms> const &, MCTrueTrackCandidates const & mcparts)
10421058 {
10431059 for (auto const & part : mcparts) {
10441060 if (!part.has_mcCollision ())
@@ -1062,10 +1078,22 @@ struct Chk892pp {
10621078 if (part.vt () == 0 ) {
10631079 histos.fill (HIST (" Correction/sigLoss_num_pri" ), part.pt (), lCentrality);
10641080 }
1081+
1082+ const auto mcc = part.mcCollision_as <soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms>>();
1083+
1084+ const float dx = part.vx () - mcc.posX ();
1085+ const float dy = part.vy () - mcc.posY ();
1086+ const float dz = part.vz () - mcc.posZ ();
1087+
1088+ const float distanceFromPV = std::sqrt (dx * dx + dy * dy + dz * dz);
1089+
1090+ if (distanceFromPV < fMaxPosPV ) {
1091+ histos.fill (HIST (" Correction/sigLoss_num_pri_pos" ), part.pt (), lCentrality);
1092+ }
10651093 }
10661094 } // fillSigLossNum
10671095
1068- void fillSigLossDen (MCTrueTrackCandidates const & mcparts)
1096+ void fillSigLossDen (soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms> const &, MCTrueTrackCandidates const & mcparts)
10691097 {
10701098 for (auto const & part : mcparts) {
10711099 if (!part.has_mcCollision ())
@@ -1089,6 +1117,18 @@ struct Chk892pp {
10891117 if (part.vt () == 0 ) {
10901118 histos.fill (HIST (" Correction/sigLoss_den_pri" ), part.pt (), lCentrality);
10911119 }
1120+
1121+ const auto mcc = part.mcCollision_as <soa::Join<MCTrueEventCandidates, aod::McCentFT0Ms>>();
1122+
1123+ const float dx = part.vx () - mcc.posX ();
1124+ const float dy = part.vy () - mcc.posY ();
1125+ const float dz = part.vz () - mcc.posZ ();
1126+
1127+ const float distanceFromPV = std::sqrt (dx * dx + dy * dy + dz * dz);
1128+
1129+ if (distanceFromPV < fMaxPosPV ) {
1130+ histos.fill (HIST (" Correction/sigLoss_den_pri_pos" ), part.pt (), lCentrality);
1131+ }
10921132 }
10931133 } // fillSigLossDen
10941134
@@ -1351,10 +1391,10 @@ struct Chk892pp {
13511391 buildReferenceMcIds (mccolls, mcpart);
13521392 effK0sProcessGen (mcpart);
13531393 effK0sProcessReco (v0s);
1354- effKstarProcessGen (mcpart);
1394+ effKstarProcessGen (mccolls, mcpart);
13551395 effKstarProcessReco (v0s, tracks);
1356- fillSigLossNum (mcpart);
1357- fillSigLossDen (mcpart);
1396+ fillSigLossNum (mccolls, mcpart);
1397+ fillSigLossDen (mccolls, mcpart);
13581398
13591399 for (const auto & mcid : refClassIds) {
13601400 histos.fill (HIST (" Correction/EF_den" ), refCentByMcId[mcid]);
0 commit comments