Skip to content

Commit b3ed255

Browse files
committed
Replace flags
1 parent 421b0c1 commit b3ed255

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
@@ -952,7 +952,7 @@ struct HfCandidateCreator3ProngExpressions {
952952
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2);
953953
}
954954
if (indexRec > -1) {
955-
flag = sign * (1 << DecayType::DplusToPiKPi);
955+
flag = sign * DecayChannel::DplusToPiKPi;
956956
}
957957
}
958958

@@ -983,7 +983,7 @@ struct HfCandidateCreator3ProngExpressions {
983983
if (indexRec > -1) {
984984
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
985985
// TODO: move to different and explicit flags
986-
flag = sign * (1 << DecayType::DsToKKPi);
986+
flag = sign * (isDplus ? DecayChannel::DplusToPiKK : DecayChannel::DsToPiKK);
987987
if (arrayDaughters[0].has_mcParticle()) {
988988
swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus);
989989
}
@@ -994,9 +994,9 @@ struct HfCandidateCreator3ProngExpressions {
994994
arrPDGDaugh[iProng] = std::abs(daughI.pdgCode());
995995
}
996996
if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) {
997-
channel = isDplus ? DecayChannelDToKKPi::DplusToPhiPi : DecayChannelDToKKPi::DsToPhiPi;
997+
channel = isDplus ? DecayChannel::DplusToPhiPi : DecayChannel::DsToPhiPi;
998998
} else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) {
999-
channel = isDplus ? DecayChannelDToKKPi::DplusToK0starK : DecayChannelDToKKPi::DsToK0starK;
999+
channel = isDplus ? DecayChannel::DplusToK0starK : DecayChannel::DsToK0starK;
10001000
}
10011001
}
10021002
}
@@ -1010,7 +1010,7 @@ struct HfCandidateCreator3ProngExpressions {
10101010
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2);
10111011
}
10121012
if (indexRec > -1) {
1013-
flag = sign * (1 << DstarToPiKPiBkg);
1013+
flag = sign * DecayChannel::DstarToPiKPi;
10141014
channel = 1;
10151015
}
10161016
}
@@ -1027,7 +1027,7 @@ struct HfCandidateCreator3ProngExpressions {
10271027
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2);
10281028
}
10291029
if (indexRec > -1) {
1030-
flag = sign * (1 << DecayType::LcToPKPi);
1030+
flag = sign * DecayChannel::LcToPKPi;
10311031

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

PWGHF/Utils/utilsMcGen.h

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

2626
#include "Common/Core/RecoDecay.h"
2727

28+
#include "PWGHF/Core/DecayChannels.h"
2829
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
2930

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

@@ -116,11 +117,11 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
116117
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
117118
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
118119
// TODO: move to different and explicit flags
119-
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi);
120+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPiKK;
120121
} else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
121122
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
122123
// TODO: move to different and explicit flags
123-
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi);
124+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPiKK;
124125
isDplus = true;
125126
}
126127
if (flag != 0) {
@@ -131,9 +132,9 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
131132
arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode());
132133
}
133134
if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) {
134-
channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi;
135+
channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToPhiPi : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToPhiPi;
135136
} else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) {
136-
channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToK0starK : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToK0starK;
137+
channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannel::DplusToK0starK : o2::hf_decay::hf_cand_3prong::DecayChannel::DsToK0starK;
137138
}
138139
}
139140
}
@@ -142,14 +143,14 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
142143
// D*± → D0(bar) π±
143144
if (flag == 0) {
144145
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2)) {
145-
flag = sign * (1 << o2::aod::hf_cand_3prong::DstarToPiKPiBkg);
146+
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannel::DstarToPiKPi;
146147
}
147148
}
148149

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

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

0 commit comments

Comments
 (0)