Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions PWGHF/Utils/utilsMcGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
bool matched = false;

for (const auto& [chn, finalState] : o2::hf_decay::hf_cand_2prong::daughtersD0Main) {
if (finalState.size() == 3) { // o2-linter: disable=magic-number (Partly Reco 3-prong decays)

Check failure on line 63 in PWGHF/Utils/utilsMcGen.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::array<int, 3> finalStateParts = std::array{finalState[0], finalState[1], finalState[2]};
o2::hf_decay::changeFinalStatePdgSign(particle.pdgCode(), +kPi0, finalStateParts);
matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, finalStateParts, true, &sign, MaxDepth);
} else if (finalState.size() == 2) { // o2-linter: disable=magic-number (Fully Reco 2-prong decays)

Check failure on line 67 in PWGHF/Utils/utilsMcGen.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::array<int, 2> finalStateParts = std::array{finalState[0], finalState[1]};
matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, finalStateParts, true, &sign, MaxDepth);
} else {
Expand Down Expand Up @@ -164,17 +164,17 @@

std::vector<int> arrAllDaughtersIndex;
for (const auto& [chn, finalState] : finalStates) {
if (finalState.size() == 5) { // o2-linter: disable=magic-number (Partly Reco 3-prong decays from 5-prong decays)

Check failure on line 167 in PWGHF/Utils/utilsMcGen.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::array<int, 5> finalStateParts = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]};
o2::hf_decay::changeFinalStatePdgSign(particle.pdgCode(), +kPi0, finalStateParts);
RecoDecay::getDaughters<false>(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth);
matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, -1);
} else if (finalState.size() == 4) { // o2-linter: disable=magic-number (Partly Reco 3-prong decays from 4-prong decays)

Check failure on line 172 in PWGHF/Utils/utilsMcGen.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::array<int, 4> finalStateParts = std::array{finalState[0], finalState[1], finalState[2], finalState[3]};
o2::hf_decay::changeFinalStatePdgSign(particle.pdgCode(), +kPi0, finalStateParts);
RecoDecay::getDaughters<false>(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth);
matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, -1);
} else if (finalState.size() == 3) { // o2-linter: disable=magic-number (Fully Reco 3-prong decays)

Check failure on line 177 in PWGHF/Utils/utilsMcGen.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::array<int, 3> finalStateParts = std::array{finalState[0], finalState[1], finalState[2]};
RecoDecay::getDaughters<false>(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth);
matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, maxDepth);
Expand Down Expand Up @@ -219,7 +219,7 @@
// D± → π± K∓ π±
if (flag == 0) {
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DplusToPiKPi);
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi;
}
}

Expand All @@ -229,11 +229,11 @@
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
// TODO: move to different and explicit flags
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi);
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK;
} else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
// DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
// TODO: move to different and explicit flags
flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi);
flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK;
isDplus = true;
}
if (flag != 0) {
Expand All @@ -244,9 +244,9 @@
arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode());
}
if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) {
channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi;
channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi : o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi;
} else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) {
channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToK0starK : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToK0starK;
channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K : o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions PWGHF/Utils/utilsMcMatching.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ namespace hf_cand_3prong

// D±
static const std::unordered_map<DecayChannelMain, const std::vector<int>> daughtersDplusMain{
{DecayChannelMain::DplusToPiKPi, {+kKMinus, +kKPlus, +kPiPlus}},
{DecayChannelMain::DplusToPiKK, {+kKMinus, +kPiPlus, +kPiPlus}},
{DecayChannelMain::DplusToPiKPi, {+kKMinus, +kPiPlus, +kPiPlus}},
{DecayChannelMain::DplusToPiKK, {+kKMinus, +kKPlus, +kPiPlus}},
{DecayChannelMain::DplusToPiKPiPi0, {+kKMinus, +kPiPlus, +kPiPlus, +kPi0}},
{DecayChannelMain::DplusToPiPiPi, {+kPiMinus, +kPiPlus, +kPiPlus}},
};

static const std::unordered_map<DecayChannelResonant, const std::array<int, 2>> daughtersDplusResonant{
{DecayChannelResonant::DplusToPhiPi, {+o2::constants::physics::kPhi, +kPiPlus}},
{DecayChannelResonant::DplusToKstar0K, {-o2::constants::physics::kK0Star892, +kKPlus}},
{DecayChannelResonant::DplusToKstar1430_0K, {+10311, +kKPlus}},
{DecayChannelResonant::DplusToKstar1430_0K, {-10311, +kKPlus}},
{DecayChannelResonant::DplusToRho0Pi, {+kRho770_0, +kPiPlus}},
{DecayChannelResonant::DplusToF2_1270Pi, {+225, +kPiPlus}},
};
Expand Down Expand Up @@ -110,7 +110,7 @@ static const std::unordered_map<DecayChannelResonant, const std::array<int, 2>>
{DecayChannelResonant::DstarToD0ToKstarPi, {-o2::constants::physics::kKPlusStar892, +kPiPlus}},
{DecayChannelResonant::DstarToDplusToPhiPi, {+o2::constants::physics::kPhi, +kPiPlus}},
{DecayChannelResonant::DstarToDplusToKstar0K, {-o2::constants::physics::kK0Star892, +kKPlus}},
{DecayChannelResonant::DstarToDplusToKstar1430_0K, {+10311, +kKPlus}},
{DecayChannelResonant::DstarToDplusToKstar1430_0K, {-10311, +kKPlus}},
{DecayChannelResonant::DstarToDplusToRho0Pi, {+kRho770_0, +kPiPlus}},
{DecayChannelResonant::DstarToDplusToF2_1270Pi, {+225, +kPiPlus}},
};
Expand All @@ -123,7 +123,7 @@ static const std::unordered_map<DecayChannelMain, const std::vector<int>> daught
{DecayChannelMain::LcToPKK, {+kProton, +kKMinus, +kKPlus}}};

static const std::unordered_map<DecayChannelResonant, const std::array<int, 2>> daughtersLcResonant{
{DecayChannelResonant::LcToPKstar0, {+o2::constants::physics::kK0Star892, +kProton}},
{DecayChannelResonant::LcToPKstar0, {-o2::constants::physics::kK0Star892, +kProton}},
{DecayChannelResonant::LcToDeltaplusplusK, {+2224, +kKMinus}},
{DecayChannelResonant::LcToL1520Pi, {+102134, +kPiPlus}},
};
Expand Down
Loading