diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index e451eea36b3..50a42a0254d 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -471,6 +471,9 @@ struct HfCandidateCreator3ProngExpressions { bool createLc{false}; bool createXic{false}; float zPvPosMax{1000.f}; + float useTimeFrameBorderCut{false}; + + using BCsInfo = soa::Join; void init(InitContext& initContext) { @@ -490,6 +493,8 @@ struct HfCandidateCreator3ProngExpressions { createXic = option.defaultValue.get(); } else if (option.name.compare("zPvPosMax") == 0) { zPvPosMax = option.defaultValue.get(); + } else if (option.name.compare("useTimeFrameBorderCut") == 0) { + useTimeFrameBorderCut = option.defaultValue.get(); } } break; @@ -506,7 +511,8 @@ struct HfCandidateCreator3ProngExpressions { /// Performs MC matching. void processMc(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, - aod::McCollisions const&) + aod::McCollisions const&, + BCsInfo const&) { rowCandidateProng3->bindExternalIndices(&tracks); @@ -630,6 +636,14 @@ struct HfCandidateCreator3ProngExpressions { continue; } + if (useTimeFrameBorderCut) { // accept only mc particles coming from bc that are far away from TF border and ITSROFrame + auto bc = mcCollision.bc_as(); + if (!bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) || !bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + rowMcMatchGen(flag, origin, channel); + continue; + } + } + // D± → π± K∓ π± if (createDplus) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {