Skip to content

Commit c896be8

Browse files
authored
[PWGHF] derivedDataCreatorDsToKKPi: Fix PiKK selection (#18108)
1 parent 9632e60 commit c896be8

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct HfDerivedDataCreatorDsToKKPi {
8989

9090
SliceCache cache;
9191
static constexpr double Mass{o2::constants::physics::MassDS};
92-
static constexpr int NHypothesesCand{1}; // Number of possible selection hypotheses per candidate.
92+
static constexpr int NHypothesesCand{2}; // Number of possible selection hypotheses per candidate.
9393

9494
using CollisionsWCentMult = soa::Join<aod::Collisions, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
9595
using CollisionsWMcCentMult = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
@@ -101,7 +101,7 @@ struct HfDerivedDataCreatorDsToKKPi {
101101
using MatchedGenCandidatesMc = soa::Filtered<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>;
102102
using TypeMcCollisions = soa::Join<aod::McCollisions, aod::McCentFT0Ms>;
103103

104-
Filter filterSelectCandidates = (aod::hf_sel_candidate_ds::isSelDsToKKPi & static_cast<int>(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1
104+
Filter filterSelectCandidates = (aod::hf_sel_candidate_ds::isSelDsToKKPi & static_cast<int>(BIT(aod::SelectionStep::RecoMl - 1))) != 0 || (aod::hf_sel_candidate_ds::isSelDsToPiKK & static_cast<int>(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1
105105
Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0);
106106

107107
Preslice<SelectedCandidates> candidatesPerCollision = aod::hf_cand::collisionId;
@@ -266,7 +266,7 @@ struct HfDerivedDataCreatorDsToKKPi {
266266
int8_t flagMcRec = 0, origin = 0, swapping = 0, flagDecayChanRec = 0;
267267
for (const auto& candidate : candidatesThisColl) {
268268
if constexpr (IsMl) {
269-
if (!TESTBIT(candidate.isSelDsToKKPi(), aod::SelectionStep::RecoMl)) {
269+
if (!TESTBIT(candidate.isSelDsToKKPi(), aod::SelectionStep::RecoMl) && !TESTBIT(candidate.isSelDsToPiKK(), aod::SelectionStep::RecoMl)) {
270270
continue;
271271
}
272272
}
@@ -295,11 +295,20 @@ struct HfDerivedDataCreatorDsToKKPi {
295295
double const ct = HfHelper::ctDs(candidate);
296296
double const y = HfHelper::yDs(candidate);
297297
float const massDsToKKPi = HfHelper::invMassDsToKKPi(candidate);
298-
std::vector<float> mlScoresDsToKKPi;
298+
float const massDsToPiKK = HfHelper::invMassDsToPiKK(candidate);
299+
std::vector<float> mlScoresDsToKKPi, mlScoresDsToPiKK;
300+
auto selectionStep = aod::SelectionStep::RecoMl - 1;
299301
if constexpr (IsMl) {
302+
selectionStep = aod::SelectionStep::RecoMl;
300303
std::copy(candidate.mlProbDsToKKPi().begin(), candidate.mlProbDsToKKPi().end(), std::back_inserter(mlScoresDsToKKPi));
304+
std::copy(candidate.mlProbDsToPiKK().begin(), candidate.mlProbDsToPiKK().end(), std::back_inserter(mlScoresDsToPiKK));
305+
}
306+
if (TESTBIT(candidate.isSelDsToKKPi(), selectionStep)) {
307+
fillTablesCandidate(candidate, 0, massDsToKKPi, ct, y, flagMcRec, origin, swapping, flagDecayChanRec, mlScoresDsToKKPi);
308+
}
309+
if (TESTBIT(candidate.isSelDsToPiKK(), selectionStep)) {
310+
fillTablesCandidate(candidate, 1, massDsToPiKK, ct, y, flagMcRec, origin, swapping, flagDecayChanRec, mlScoresDsToPiKK);
301311
}
302-
fillTablesCandidate(candidate, 0, massDsToKKPi, ct, y, flagMcRec, origin, swapping, flagDecayChanRec, mlScoresDsToKKPi);
303312
}
304313
}
305314
}

0 commit comments

Comments
 (0)