Skip to content

Commit 33b4e53

Browse files
committed
Replace flags
1 parent 5151ad1 commit 33b4e53

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

PWGHF/Core/DecayChannels.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ enum DecayChannel : int8_t {
5959
DsToPiPiPiPi0, // π+ π− π+ π0
6060
DsToPhiPi, // φ π+
6161
DsToK0starK, // K0* K+
62+
// D*+
63+
DstarToPiKPi, // π+ K− π+ (from [(D0 → π+ K−) π+])
6264
// Λc+
6365
LcToPKPi, // p K− π+
6466
LcToPKPiPi0, // p K− π+ π0
@@ -78,7 +80,8 @@ namespace hf_cand_dstar
7880
/// @brief D*+ candidates
7981
enum DecayChannel : int8_t {
8082
// D*+
81-
DstarToPiKPiPi0 = 1, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0])
83+
DstarToPiKPi = 1, // π+ K− π+ (from [(D0 → π+ K−) π+])
84+
DstarToPiKPiPi0, // π+ K− π+ π0 (from [(D0 → π+ K− π0) π+] or [(D+ → π+ K− π+) π0])
8285
//
8386
Last
8487
};

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ struct HfCandidateCreator3ProngExpressions {
955955
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
956956
}
957957
if (indexRec > -1) {
958-
flag = sign * (1 << DecayType::DplusToPiKPi);
958+
flag = sign * DecayChannel::DplusToPiKPi;
959959
}
960960
}
961961

@@ -986,7 +986,7 @@ struct HfCandidateCreator3ProngExpressions {
986986
if (indexRec > -1) {
987987
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
988988
// TODO: move to different and explicit flags
989-
flag = sign * (1 << DecayType::DsToKKPi);
989+
flag = sign * (isDplus ? DecayChannel::DplusToPiKK : DecayChannel::DsToPiKK);
990990
if (arrayDaughters[0].has_mcParticle()) {
991991
swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus);
992992
}
@@ -997,9 +997,9 @@ struct HfCandidateCreator3ProngExpressions {
997997
arrPDGDaugh[iProng] = std::abs(daughI.pdgCode());
998998
}
999999
if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) {
1000-
channel = isDplus ? DecayChannelDToKKPi::DplusToPhiPi : DecayChannelDToKKPi::DsToPhiPi;
1000+
channel = isDplus ? DecayChannel::DplusToPhiPi : DecayChannel::DsToPhiPi;
10011001
} else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) {
1002-
channel = isDplus ? DecayChannelDToKKPi::DplusToK0starK : DecayChannelDToKKPi::DsToK0starK;
1002+
channel = isDplus ? DecayChannel::DplusToK0starK : DecayChannel::DsToK0starK;
10031003
}
10041004
}
10051005
}
@@ -1013,7 +1013,7 @@ struct HfCandidateCreator3ProngExpressions {
10131013
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2);
10141014
}
10151015
if (indexRec > -1) {
1016-
flag = sign * (1 << DstarToPiKPiBkg);
1016+
flag = sign * DecayChannel::DstarToPiKPi;
10171017
channel = 1;
10181018
}
10191019
}
@@ -1030,7 +1030,7 @@ struct HfCandidateCreator3ProngExpressions {
10301030
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
10311031
}
10321032
if (indexRec > -1) {
1033-
flag = sign * (1 << DecayType::LcToPKPi);
1033+
flag = sign * DecayChannel::LcToPKPi;
10341034

10351035
// Flagging the different Λc± → p± K∓ π± decay channels
10361036
if (arrayDaughters[0].has_mcParticle()) {
@@ -1065,7 +1065,7 @@ struct HfCandidateCreator3ProngExpressions {
10651065
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
10661066
}
10671067
if (indexRec > -1) {
1068-
flag = sign * (1 << DecayType::XicToPKPi);
1068+
flag = sign * DecayChannel::XicToPKPi;
10691069
if (arrayDaughters[0].has_mcParticle()) {
10701070
swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus);
10711071
}

PWGHF/Utils/utilsMcGen.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include "Common/Core/RecoDecay.h"
3030

31+
#include "PWGHF/Core/DecayChannels.h"
3132
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
3233

3334
namespace hf_mc_gen
@@ -109,7 +110,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
109110
// D± → π± K∓ π±
110111
if (flag == 0) {
111112
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
112-
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DplusToPiKPi);
113+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPiKPi;
113114
}
114115
}
115116

@@ -119,11 +120,11 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
119120
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
120121
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
121122
// TODO: move to different and explicit flags
122-
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi);
123+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPiKK;
123124
} else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
124125
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
125126
// TODO: move to different and explicit flags
126-
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi);
127+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPiKK;
127128
isDplus = true;
128129
}
129130
if (flag != 0) {
@@ -134,9 +135,9 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
134135
arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode());
135136
}
136137
if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) {
137-
channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi;
138+
channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPhiPi : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPhiPi;
138139
} else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) {
139-
channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToK0starK : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToK0starK;
140+
channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToK0starK : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToK0starK;
140141
}
141142
}
142143
}
@@ -145,14 +146,14 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
145146
// D*± → D0(bar) π±
146147
if (flag == 0) {
147148
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2)) {
148-
flag = sign * (1 << o2::aod::hf_cand_3prong::DstarToPiKPiBkg);
149+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DstarToPiKPi;
149150
}
150151
}
151152

152153
// Λc± → p± K∓ π±
153154
if (flag == 0) {
154155
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) {
155-
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi);
156+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::LcToPKPi;
156157

157158
// Flagging the different Λc± → p± K∓ π± decay channels
158159
RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1);
@@ -175,7 +176,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
175176
// Ξc± → p± K∓ π±
176177
if (flag == 0) {
177178
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) {
178-
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::XicToPKPi);
179+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::XicToPKPi;
179180
}
180181
}
181182

0 commit comments

Comments
 (0)