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
2 changes: 1 addition & 1 deletion PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@
auto finalStates = getDecayChannelMain(pdg);
for (const auto& [chn, finalState] : finalStates) {
std::array<int, 3> finalStateParts3Prong = std::array{finalState[0], finalState[1], finalState[2]};
if (finalState.size() > 3) { // Partly Reco decays with 4 or 5 final state particles, o2-linter: disable=magic-number
if (finalState.size() > 3) { // Partly Reco decays with 4 or 5 final state particles, o2-linter: disable=magic-number

Check failure on line 962 in PWGHF/TableProducer/candidateCreator3Prong.cxx

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.
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
indexRec = RecoDecay::getMatchedMCRec<false, false, true, true, true>(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial);
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
Expand All @@ -972,13 +972,13 @@

if (indexRec > -1) {
auto motherParticle = mcParticles.rawIteratorAt(indexRec);
if (finalState.size() == 4) { // Check if the final state has 4 particles, o2-linter: disable=magic-number

Check failure on line 975 in PWGHF/TableProducer/candidateCreator3Prong.cxx

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> finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], finalState[3]};
changeFinalStatePdgSign(motherParticle.pdgCode(), +kPi0, finalStateParts3ProngAll);
if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdg, finalStateParts3ProngAll, true, &sign, depth)) {
indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one is not matched
}
} else if (finalState.size() == 5) { // Check if the final state has 5 particles, o2-linter: disable=magic-number

Check failure on line 981 in PWGHF/TableProducer/candidateCreator3Prong.cxx

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> finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]};
changeFinalStatePdgSign(motherParticle.pdgCode(), +kPi0, finalStateParts3ProngAll);
if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdg, finalStateParts3ProngAll, true, &sign, depth)) {
Expand All @@ -986,7 +986,7 @@
}
}
}
} else if (finalState.size() == 3) { // Fully Reco 3-prong decays, o2-linter: disable=magic-number

Check failure on line 989 in PWGHF/TableProducer/candidateCreator3Prong.cxx

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.
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial);
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
Expand Down
2 changes: 1 addition & 1 deletion 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) { // Partly Reco 3-prong decays, o2-linter: disable=magic-number

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) { // Fully Reco 2-prong decays, o2-linter: disable=magic-number

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) { // Partly Reco 3-prong decays from 5-prong decays, o2-linter: disable=magic-number

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) { // Partly Reco 3-prong decays from 4-prong decays, o2-linter: disable=magic-number

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]};
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) { // Fully Reco 3-prong decays, o2-linter: disable=magic-number

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
2 changes: 1 addition & 1 deletion PWGHF/Utils/utilsMcMatching.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ inline int8_t flagResonantDecay(const int motherPdg, std::array<int, N> const& a
return 0;
}

/// Flip the sign of a specific PDG code in an array
/// Flip the sign of a specific PDG code in an array
/// of PDG codes representing either a final or a resonant state
/// \tparam N size of the array of PDG codes
/// \param motherPdgCode PDG code of the mother particle
Expand Down
Loading