Skip to content

Commit e2c77d4

Browse files
authored
[PWGHF,PWGJE] Unify and extend MC flags in candidate tables (3-prong, D*+) (#11382)
1 parent b195616 commit e2c77d4

35 files changed

+384
-157
lines changed

PWGHF/Core/DecayChannels.h

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file DecayChannels.h
13+
/// \brief Definitions of constants for MC flagging of HF decay channels.
14+
/// \author Vít Kučera <vit.kucera@cern.ch>, Inha University
15+
/// \note DecayChannelMain enums define unique combinations of the mother and the daughters for main channels.
16+
/// \note DecayChannelResonant enums define unique combinations of the mother and the daughters for resonant channels.
17+
/// \note Value 0 is reserved to indicate no match.
18+
/// \note Daughter ordering convention: (charm|strange|π±|K±|π0), (baryon|meson), (+|−)
19+
20+
#ifndef PWGHF_CORE_DECAYCHANNELS_H_
21+
#define PWGHF_CORE_DECAYCHANNELS_H_
22+
23+
#include <cstdint>
24+
25+
namespace o2::hf_decay
26+
{
27+
28+
// TODO
29+
// - HF cascades (Λc+ → p K0short)
30+
// - HF cascades to LF cascades (Ωc0/Ξc0 → Ξ+ π−, Ξc+ → Ξ+ π− π+)
31+
// - Σc
32+
33+
namespace hf_cand_2prong
34+
{
35+
/// @brief 2-prong candidates: main channels
36+
enum DecayChannelMain : int8_t {
37+
// D0
38+
D0ToPiK = 1, // π+ K−
39+
D0ToPiKPi0, // π+ K− π0
40+
D0ToPiPi, // π+ π−
41+
D0ToPiPiPi0, // π+ π− π0
42+
D0ToKK, // K+ K−
43+
//
44+
LastChannelMain
45+
};
46+
/// @brief 2-prong candidates: resonant channels
47+
enum DecayChannelResonant : int8_t {
48+
// D0
49+
D0ToRhoplusPi = 1, // ρ+ π−
50+
D0ToRhoplusK, // ρ+ K−
51+
D0ToKstar0Pi0, // anti-K*0 π0
52+
D0ToKstarPi, // K*− π+
53+
//
54+
LastChannelResonant
55+
};
56+
} // namespace hf_cand_2prong
57+
58+
namespace hf_cand_3prong
59+
{
60+
/// @brief 3-prong candidates: main channels
61+
enum DecayChannelMain : int8_t {
62+
// D+
63+
DplusToPiKPi = 1, // π+ K− π+
64+
DplusToPiKPiPi0, // π+ K− π+ π0
65+
DplusToPiPiPi, // π+ π− π+
66+
DplusToPiKK, // π+ K− K+
67+
// Ds+
68+
DsToPiKK, // π+ K− K+
69+
DsToPiKKPi0, // π+ K− K+ π0
70+
DsToPiPiK, // π+ π− K+
71+
DsToPiPiPi, // π+ π− π+
72+
DsToPiPiPiPi0, // π+ π− π+ π0
73+
// D*+
74+
DstarToPiKPi, // π+ K− π+ (from [(D0 → π+ K−) π+])
75+
// Λc+
76+
LcToPKPi, // p K− π+
77+
LcToPKPiPi0, // p K− π+ π0
78+
LcToPPiPi, // p π− π+
79+
LcToPKK, // p K− K+
80+
// Ξc+
81+
XicToPKPi, // p K− π+
82+
XicToPKK, // p K− K+
83+
XicToSPiPi, // Σ+ π− π+
84+
//
85+
LastChannelMain
86+
};
87+
/// @brief 3-prong candidates: resonant channels
88+
enum DecayChannelResonant : int8_t {
89+
// D+
90+
DplusToPhiPi = 1, // φ π+
91+
DplusToKstar0K, // anti-K*0 K+
92+
DplusToKstar1430_0K, // anti-K*0(1430) K+
93+
DplusToRho0Pi, // ρ0 π+
94+
DplusToF2_1270Pi, // f2(1270) π+
95+
// Ds+
96+
DsToPhiPi, // φ π+
97+
DsToPhiRhoplus, // φ ρ+
98+
DsToKstar0K, // anti-K*0 K+
99+
DsToKstar0Pi, // anti-K*0 π+
100+
DsToRho0Pi, // ρ0 π+
101+
DsToRho0K, // ρ0 K+
102+
DsToF2_1270Pi, // f2(1270) π+
103+
DsToF0_1370K, // f0(1370) K+
104+
DsToEtaPi, // η π+
105+
// Λc+
106+
LcToPKstar0, // p K*0(892)
107+
LcToDeltaplusplusK, // Δ++ K−
108+
LcToL1520Pi, // Λ(1520) π+
109+
// Ξc+
110+
XicToPKstar0, // p anti-K*0(892)
111+
XicToPPhi, // p φ
112+
//
113+
LastChannelResonant
114+
};
115+
} // namespace hf_cand_3prong
116+
117+
namespace hf_cand_dstar
118+
{
119+
/// @brief D*+ candidates: main channels
120+
enum DecayChannelMain : int8_t {
121+
// D*+
122+
DstarToPiKPi = 1, // π+ K− π+ (from [(D0 → π+ K−) π+])
123+
DstarToPiKPiPi0, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0])
124+
//
125+
LastChannelMain
126+
};
127+
} // namespace hf_cand_dstar
128+
129+
namespace hf_cand_beauty
130+
{
131+
/// @brief beauty candidates: main channels
132+
enum DecayChannelMain : int8_t {
133+
// B0
134+
B0ToDminusPi = 1, // D− π+
135+
B0ToDminusPiPi0, // D− π+ π0
136+
B0ToDminusPiGamma, // D− π+ γ0
137+
B0ToDminusK, // D− K+
138+
B0ToD0PiPi, // anti-D0 π+ π−
139+
// Bs0
140+
BsToDsPi, // Ds− π+
141+
BsToDsPiPi0, // Ds− π+ π0
142+
BsToDsPiGamma, // Ds− π+ γ0
143+
BsToDsK, // Ds− K+
144+
// Λb0
145+
LbToLcPi, // Λc+ π−
146+
LbToLcPiPi0, // Λc+ π− π0
147+
LbToLcPiGamma, // Λc+ π− γ0
148+
LbToLcK, // Λc+ K−
149+
LbToLcKPi0, // Λc+ K− π0
150+
// B+
151+
BplusToD0Pi, // anti-D0 π+
152+
BplusToD0PiPi0, // anti-D0 π+ π0
153+
BplusToD0PiGamma, // anti-D0 π+ γ0
154+
BplusToD0K, // anti-D0 K+
155+
//
156+
LastChannelMain
157+
};
158+
/// @brief beauty candidates: resonant channels
159+
enum DecayChannelResonant : int8_t {
160+
// B0
161+
B0ToDminusRhoplus = 1, // D− ρ+
162+
B0ToDstarminusPi, // D*− π+
163+
// Bs0
164+
BsToDsRhoplus, // Ds− ρ+
165+
BsToDsstarPi, // Ds*− π+
166+
// Λb0
167+
LbToLcRhoplus, // Λc+ ρ−
168+
LbToScPi, // Σc+ π−
169+
LbToScK, // Σc+ K−
170+
LbToSc0Pi0, // Σc0 π0
171+
// B+
172+
BplusToD0Rhoplus, // anti-D0 ρ+
173+
BplusToDstar0Pi, // anti-D*0 π+
174+
//
175+
LastChannelResonant
176+
};
177+
} // namespace hf_cand_beauty
178+
} // namespace o2::hf_decay
179+
180+
#endif // PWGHF_CORE_DECAYCHANNELS_H_

PWGHF/D2H/Tasks/taskCharmPolarisation.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,8 @@ struct TaskPolarisationCharmHadrons {
10861086
bool partRecoDstar{false};
10871087
if constexpr (doMc) {
10881088
if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) {
1089-
partRecoDstar = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_dstar::DecayType::DstarToD0PiPi0) && TESTBIT(std::abs(candidate.flagMcMatchRecD0()), aod::hf_cand_dstar::DecayType::D0ToPiKPi0);
1090-
bool signalDstar = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_dstar::DecayType::DstarToD0Pi) && TESTBIT(std::abs(candidate.flagMcMatchRecD0()), aod::hf_cand_dstar::DecayType::D0ToPiK);
1089+
partRecoDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0 && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0;
1090+
bool signalDstar = std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi && std::abs(candidate.flagMcMatchRecD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK;
10911091
if (!signalDstar && (!partRecoDstar || !activatePartRecoDstar)) { // this candidate is not signal and not partially reconstructed signal, skip
10921092
return isCandidateInSignalRegion;
10931093
}
@@ -1099,8 +1099,8 @@ struct TaskPolarisationCharmHadrons {
10991099
return isCandidateInSignalRegion;
11001100
}
11011101
} else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) {
1102-
if constexpr (!studyLcPKPiBkgMc) { // skip this if studyLcPKPiBkgMc is true, since we are interested in background
1103-
if (!TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { // this candidate is not signal, skip
1102+
if constexpr (!studyLcPKPiBkgMc) { // skip this if studyLcPKPiBkgMc is true, since we are interested in background
1103+
if (std::abs(candidate.flagMcMatchRec()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // this candidate is not signal, skip
11041104
return isCandidateInSignalRegion;
11051105
}
11061106
origin = candidate.originMcRec();
@@ -1501,7 +1501,7 @@ struct TaskPolarisationCharmHadrons {
15011501

15021502
/// check if the pKpi triplet is a Lc->pKpi
15031503
int8_t isRealLcPKPi = 0;
1504-
if (isRealPKPi && TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi)) {
1504+
if (isRealPKPi && (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi)) {
15051505
isRealLcPKPi = 1;
15061506
}
15071507

@@ -1607,8 +1607,8 @@ struct TaskPolarisationCharmHadrons {
16071607
int8_t charge = -99;
16081608
bool partRecoDstar{false};
16091609
if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) {
1610-
partRecoDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), aod::hf_cand_dstar::DecayType::DstarToD0PiPi0) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), aod::hf_cand_dstar::DecayType::D0ToPiKPi0);
1611-
bool signalDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), aod::hf_cand_dstar::DecayType::DstarToD0Pi) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), aod::hf_cand_dstar::DecayType::D0ToPiK);
1610+
partRecoDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0);
1611+
bool signalDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK);
16121612

16131613
if (!signalDstar && (!activatePartRecoDstar || !partRecoDstar)) { // this particle is not signal and not partially reconstructed signal, skip
16141614
return;
@@ -1629,7 +1629,7 @@ struct TaskPolarisationCharmHadrons {
16291629
massDau = massPi;
16301630
massCharmHad = massDstar;
16311631
} else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) {
1632-
if (!TESTBIT(std::abs(mcParticle.flagMcMatchGen()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { // this particle is not signal, skip
1632+
if (std::abs(mcParticle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // this particle is not signal, skip
16331633
return;
16341634
}
16351635
origin = mcParticle.originMcGen();

PWGHF/D2H/Tasks/taskDplus.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ struct HfTaskDplus {
7474
Partition<CandDplusDataWithMl> selectedDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
7575

7676
// Matched MC
77-
Partition<CandDplusMcReco> recoDPlusCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
78-
Partition<CandDplusMcRecoWithMl> recoDPlusCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
77+
Partition<CandDplusMcReco> recoDPlusCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
78+
Partition<CandDplusMcRecoWithMl> recoDPlusCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
7979

8080
// MC Bkg
81-
Partition<CandDplusMcReco> recoBkgCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
82-
Partition<CandDplusMcRecoWithMl> recoBkgCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
81+
Partition<CandDplusMcReco> recoBkgCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
82+
Partition<CandDplusMcRecoWithMl> recoBkgCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
8383

8484
ConfigurableAxis thnConfigAxisY{"thnConfigAxisY", {40, -1, 1}, "Cand. rapidity bins"};
8585
ConfigurableAxis thnConfigAxisCent{"thnConfigAxisCent", {110, 0., 110.}, ""};
@@ -569,7 +569,7 @@ struct HfTaskDplus {
569569
ptGenB = -1;
570570
flagGenB = -1;
571571
auto yGen = RecoDecay::y(particle.pVector(), o2::constants::physics::MassDPlus);
572-
if ((yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) || (std::abs(particle.flagMcMatchGen()) != 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) {
572+
if ((yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) || (std::abs(particle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) {
573573
continue;
574574
}
575575
if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) {

PWGHF/D2H/Tasks/taskDs.cxx

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ enum DataType { Data = 0,
5757
McBkg,
5858
kDataTypes };
5959

60+
enum Mother : int8_t {
61+
Ds,
62+
Dplus
63+
};
64+
65+
enum ResonantChannel : int8_t {
66+
PhiPi = 1,
67+
Kstar0K = 2
68+
};
69+
70+
static std::unordered_map<int8_t, std::unordered_map<int8_t, int8_t>> channelsResonant = {{{Mother::Ds, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}},
71+
{Mother::Dplus, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K}}}}};
72+
6073
template <typename T>
6174
concept hasDsMlInfo = requires(T candidate) {
6275
candidate.mlProbDsToKKPi();
@@ -66,7 +79,7 @@ concept hasDsMlInfo = requires(T candidate) {
6679
/// Ds± analysis task
6780
struct HfTaskDs {
6881

69-
Configurable<int> decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"};
82+
Configurable<int> decayChannel{"decayChannel", 1, "Switch between resonant decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"};
7083
Configurable<bool> fillDplusMc{"fillDplusMc", true, "Switch to fill Dplus MC information"};
7184
Configurable<int> selectionFlagDs{"selectionFlagDs", 7, "Selection Flag for Ds"};
7285
Configurable<std::vector<int>> classMl{"classMl", {0, 2, 3}, "Indexes of ML scores to be stored. Three indexes max."};
@@ -128,7 +141,6 @@ struct HfTaskDs {
128141
ConfigurableAxis axisCentrality{"axisCentrality", {100, 0., 1.}, "axis for centrality/multiplicity"};
129142
ConfigurableAxis axisOccupancy{"axisOccupancy", {14, 0., 14000.}, "axis for occupancy"};
130143

131-
int offsetDplusDecayChannel = aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi - aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; // Offset between Dplus and Ds to use the same decay channel. See aod::hf_cand_3prong::DecayChannelDToKKPi
132144
int mRunNumber{0};
133145
bool lCalibLoaded;
134146
TList* lCalibObjects;
@@ -162,6 +174,10 @@ struct HfTaskDs {
162174
LOGP(fatal, "No process function enabled");
163175
}
164176

177+
if (decayChannel != ResonantChannel::PhiPi && decayChannel != ResonantChannel::Kstar0K) {
178+
LOGP(fatal, "Invalid value of decayChannel");
179+
}
180+
165181
AxisSpec ptbins{axisPt, "#it{p}_{T} (GeV/#it{c})"};
166182
AxisSpec ptBHad{axisPtBHad, "#it{p}_{T}(B) (GeV/#it{c})"};
167183
AxisSpec flagBHad{axisFlagBHad, "B Hadron flag"};
@@ -272,37 +288,37 @@ struct HfTaskDs {
272288
template <typename CandDs>
273289
bool isDsPrompt(const CandDs& candidate)
274290
{
275-
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel && candidate.originMcRec() == RecoDecay::OriginType::Prompt;
291+
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Ds][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::Prompt;
276292
}
277293

278294
template <typename CandDs>
279295
bool isDplusPrompt(const CandDs& candidate)
280296
{
281-
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel + offsetDplusDecayChannel && candidate.originMcRec() == RecoDecay::OriginType::Prompt;
297+
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Dplus][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::Prompt;
282298
}
283299

284300
template <typename CandDs>
285301
bool isDsNonPrompt(const CandDs& candidate)
286302
{
287-
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
303+
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Ds][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
288304
}
289305

290306
template <typename CandDs>
291307
bool isDplusNonPrompt(const CandDs& candidate)
292308
{
293-
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && candidate.flagMcDecayChanRec() == decayChannel + offsetDplusDecayChannel && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
309+
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK) && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Dplus][decayChannel] && candidate.originMcRec() == RecoDecay::OriginType::NonPrompt;
294310
}
295311

296312
template <typename CandDs>
297313
bool isDplusBkg(const CandDs& candidate)
298314
{
299-
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi));
315+
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi);
300316
}
301317

302318
template <typename CandDs>
303319
bool isLcBkg(const CandDs& candidate)
304320
{
305-
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi));
321+
return std::abs(candidate.flagMcMatchRec()) == static_cast<int8_t>(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi);
306322
}
307323

308324
/// Checks whether the candidate is in the signal region of either the Ds or D+ decay
@@ -673,9 +689,9 @@ struct HfTaskDs {
673689
// MC gen.
674690
for (const auto& particle : mcParticles) {
675691

676-
if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) {
692+
if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK || std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK) {
677693
const auto& recoCollsPerMcColl = recoCollisions.sliceBy(colPerMcCollision, particle.mcCollision().globalIndex());
678-
if (particle.flagMcDecayChanGen() == decayChannel || (fillDplusMc && particle.flagMcDecayChanGen() == (decayChannel + offsetDplusDecayChannel))) {
694+
if (particle.flagMcDecayChanGen() == channelsResonant[Mother::Ds][decayChannel] || (fillDplusMc && particle.flagMcDecayChanGen() == channelsResonant[Mother::Dplus][decayChannel])) {
679695
auto pt = particle.pt();
680696
double y{0.f};
681697

@@ -689,7 +705,7 @@ struct HfTaskDs {
689705
occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerMcColl, occEstimator);
690706
}
691707

692-
if (particle.flagMcDecayChanGen() == decayChannel) {
708+
if (particle.flagMcDecayChanGen() == channelsResonant[Mother::Ds][decayChannel]) {
693709
y = RecoDecay::y(particle.pVector(), o2::constants::physics::MassDS);
694710
if (yCandGenMax >= 0. && std::abs(y) > yCandGenMax) {
695711
continue;

0 commit comments

Comments
 (0)