Skip to content

Commit 8334ba9

Browse files
committed
Deleted debug prints
1 parent 7e66dec commit 8334ba9

File tree

5 files changed

+15
-76
lines changed

5 files changed

+15
-76
lines changed

PWGHF/Core/DecayChannels.h

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#ifndef PWGHF_CORE_DECAYCHANNELS_H_
2222
#define PWGHF_CORE_DECAYCHANNELS_H_
2323

24+
#include <array>
2425
#include <cstdint>
2526
#include <unordered_map>
26-
#include <array>
2727

2828
using namespace o2::constants::physics;
2929

@@ -62,10 +62,10 @@ enum DecayChannelResonant : int8_t {
6262
std::unordered_map<DecayChannelMain, std::vector<int> > finalStates2Prongs =
6363
{
6464
{DecayChannelMain::D0ToPiK, std::vector<int>{+kKMinus, +kPiPlus}},
65-
{DecayChannelMain::D0ToKK, std::vector<int>{+kKMinus, +kKPlus}},
6665
{DecayChannelMain::D0ToPiKPi0, std::vector<int>{+kKMinus, +kPiPlus, +kPi0}},
6766
{DecayChannelMain::D0ToPiPi, std::vector<int>{+kPiMinus, +kPiPlus}},
68-
{DecayChannelMain::D0ToPiPiPi0, std::vector<int>{+kPiMinus, +kPiPlus, +kPi0}}
67+
{DecayChannelMain::D0ToPiPiPi0, std::vector<int>{+kPiMinus, +kPiPlus, +kPi0}},
68+
{DecayChannelMain::D0ToKK, std::vector<int>{+kKMinus, +kKPlus}},
6969
};
7070

7171
std::unordered_map<DecayChannelResonant, std::array<int, 2> > resoStatesD0 =
@@ -388,25 +388,19 @@ namespace o2::hf_corrbkg
388388
/// \return true if the resonant channel is matched, false otherwise
389389
template <std::size_t N>
390390
bool checkResonantDecay(std::array<int, N> arrPdgResoChn, std::array<int, N> arrPdgDaugs) {
391-
// LOG(info) << "Testing: " << arrPdgResoChn[0] << ", " << arrPdgResoChn[1] << " matching PDG codes: " << arrPdgDaugs[0] << ", " << arrPdgDaugs[1];
392391
for (size_t i = 0; i < N; i++) {
393-
// LOG(info) << "Checking daughter index: " << arrPdgResoChn[i];
394392
bool findDaug = false;
395393
for (size_t j = 0; j < N; j++) {
396-
// LOG(info) << "Checking daughter PDG: " << arrPdgResoChn[i] << " against resonant PDG: " << arrPdgDaugs[j];
397394
if (std::abs(arrPdgResoChn[i]) == std::abs(arrPdgDaugs[j])) {
398395
arrPdgDaugs[j] = -1; // Mark as found
399-
// LOG(info) << "Matched!";
400396
findDaug = true;
401397
break;
402398
}
403399
}
404400
if (!findDaug) {
405-
// LOG(info) << "Returning false";
406401
return false;
407402
}
408403
}
409-
// LOG(info) << "Resonant decay found with daughters: " << arrPdgResoChn[0] << ", " << arrPdgResoChn[1] << " matching PDG codes: " << arrPdgDaugs[0] << ", " << arrPdgDaugs[1];
410404
return true;
411405
}
412406

@@ -421,43 +415,19 @@ namespace o2::hf_corrbkg
421415
void flagResonantDecay(int motherPdg, int8_t* channel, std::array<int, N> arrDaughPdgs) {
422416
if constexpr (is3Prong) {
423417
std::unordered_map<hf_cand_3prong::DecayChannelResonant, std::array<int, 2> > resoStates = getResoChannels3Prong(motherPdg);
424-
if (abs(motherPdg) == Pdg::kDPlus) {
425-
std::cout << "Flagging resonant channel for D+ with daughters: " << arrDaughPdgs[0] << " " << arrDaughPdgs[1] << std::endl;
426-
}
427-
if (abs(motherPdg) == Pdg::kDS) {
428-
std::cout << "Flagging resonant channel for Ds with daughters: " << arrDaughPdgs[0] << " " << arrDaughPdgs[1] << std::endl;
429-
}
430-
if (abs(motherPdg) == Pdg::kDStar) {
431-
std::cout << "Flagging resonant channel for Dstar with daughters: " << arrDaughPdgs[0] << " " << arrDaughPdgs[1] << std::endl;
432-
}
433-
if (abs(motherPdg) == Pdg::kLambdaCPlus) {
434-
std::cout << "Flagging resonant channel for LambdaC with daughters: " << arrDaughPdgs[0] << " " << arrDaughPdgs[1] << std::endl;
435-
}
436-
if (abs(motherPdg) == Pdg::kXiCPlus) {
437-
std::cout << "Flagging resonant channel for XiC with daughters: " << arrDaughPdgs[0] << " " << arrDaughPdgs[1] << std::endl;
438-
}
439418
for (const auto& [flag, pdgCodes] : resoStates) {
440419
if (checkResonantDecay(arrDaughPdgs, pdgCodes)) {
441420
*channel = flag;
442-
// if (abs(motherPdg) == Pdg::kDStar) {
443-
// LOG(info) << "Dstar resonant decay found with channel: " << static_cast<int>(*channel);
444-
// }
445421
break;
446422
}
447423
}
448-
LOG(info) << "Leaving function with channel: " << static_cast<int>(*channel);
449-
// if (abs(motherPdg) == Pdg::kDStar) {
450-
// }
451424
} else {
452425
if (motherPdg != Pdg::kD0) {
453-
// LOG(error) << "Resonant decay flagging is only implemented for D0 resonances in 2-prong decays.";
454426
return;
455427
}
456428
for (const auto& [flag, pdgCodes] : hf_cand_2prong::resoStatesD0) {
457-
// std::cout << "Checking D0 resonant decay with flag: " << flag << ", pdgCodes: " << pdgCodes[0] << ", " << pdgCodes[1] << " vs " << arrDaughPdgs[0] << " " << arrDaughPdgs[1] << std::endl;
458429
if (checkResonantDecay(arrDaughPdgs, pdgCodes)) {
459430
*channel = flag;
460-
// LOG(info) << "D0 resonant decay found with channel: " << static_cast<int>(*channel);
461431
break;
462432
}
463433
}

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,17 +791,17 @@ struct HfCandidateCreator2ProngExpressions {
791791
indexRec = RecoDecay::getMatchedMCRec<false, false, true, false, false>(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, depth);
792792
}
793793

794-
if (indexRec != -1) {
794+
if (indexRec > -1) {
795795
auto motherParticle = mcParticles.rawIteratorAt(indexRec);
796796
std::array<int, 3> finalStateParts2ProngAll = std::array{finalState[0], finalState[1], finalState[2]};
797-
if (sign < 0) {
797+
if (motherParticle.pdgCode() < 0) {
798798
for (auto& part : finalStateParts2ProngAll) {
799799
if (part == kPi0) {
800800
part = -part; // The Pi0 pdg code does not change between particle and antiparticle
801801
}
802802
}
803803
}
804-
if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, Pdg::kD0, finalStateParts2ProngAll, false, &sign, depth)) {
804+
if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, Pdg::kD0, finalStateParts2ProngAll, true, &sign, depth)) {
805805
indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one does not match the reconstructed one
806806
}
807807
}

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ struct HfCandidateCreator3Prong {
590590
uint8_t bitmapProngsContributorsPV = 0;
591591
if (indexCollision == track0.collisionId() && track0.isPVContributor()) {
592592
SETBIT(bitmapProngsContributorsPV, 0);
593-
}
593+
}
594594
if (indexCollision == track1.collisionId() && track1.isPVContributor()) {
595595
SETBIT(bitmapProngsContributorsPV, 1);
596596
}
@@ -957,7 +957,7 @@ struct HfCandidateCreator3ProngExpressions {
957957
auto finalStates = getDecayChannel3Prong(pdg);
958958
for (const auto& [chn, finalState] : finalStates) {
959959
std::array<int, 3> finalStateParts3Prong = std::array{finalState[0], finalState[1], finalState[2]};
960-
if (finalState.size() > 3) { // Partly Reco 3-prong decays
960+
if (finalState.size() > 3) { // Partly Reco 4-prong decays
961961
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
962962
indexRec = RecoDecay::getMatchedMCRec<false, false, true, true, true>(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial);
963963
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
@@ -968,11 +968,10 @@ struct HfCandidateCreator3ProngExpressions {
968968
indexRec = RecoDecay::getMatchedMCRec<false, false, true, false, false>(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth);
969969
}
970970

971-
if (indexRec != -1) {
971+
if (indexRec > -1) {
972972
auto motherParticle = mcParticles.rawIteratorAt(indexRec);
973973
if (finalState.size() == 4) { // Check if the final state has 4 particles
974974
std::array<int, 4> finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], finalState[3]};
975-
// std::array<int, 4> finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], sign*finalState[3]};
976975
if (sign < 0) {
977976
for (auto& part : finalStateParts3ProngAll) {
978977
if (part == kPi0) {
@@ -983,8 +982,7 @@ struct HfCandidateCreator3ProngExpressions {
983982
if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdg, finalStateParts3ProngAll, false, &sign, depth)) {
984983
indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one is not matched
985984
}
986-
} else if (finalState.size() == 5) { // Check if the final state has 3 particles
987-
// std::array<int, 5> finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], sign*finalState[3], sign*finalState[4]};
985+
} else if (finalState.size() == 5) { // Check if the final state has 5 particles
988986
std::array<int, 5> finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]};
989987
if (sign < 0) {
990988
for (auto& part : finalStateParts3ProngAll) {
@@ -993,7 +991,7 @@ struct HfCandidateCreator3ProngExpressions {
993991
}
994992
}
995993
}
996-
if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdg, finalStateParts3ProngAll, false, &sign, depth)) {
994+
if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdg, finalStateParts3ProngAll, true, &sign, depth)) {
997995
indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one is not matched
998996
}
999997
}
@@ -1013,7 +1011,6 @@ struct HfCandidateCreator3ProngExpressions {
10131011
continue; // Skip unsupported final states
10141012
}
10151013
if (indexRec > -1) {
1016-
// std::cout << "Matched final state: " << chn << " with PDG code: " << pdg << std::endl;
10171014
flag = sign * chn;
10181015

10191016
// Flag the resonant decay channel
@@ -1031,8 +1028,6 @@ struct HfCandidateCreator3ProngExpressions {
10311028
arrPDGDaugh[iProng] = daughI.pdgCode();
10321029
}
10331030
flagResonantDecay<true>(pdg, &channel, arrPDGDaugh);
1034-
LOG(info) << "[matchFinalStateCorrBkgs] Matched final state: " << chn << " with PDG code: " << static_cast<int>(pdg) << ", flag: " << static_cast<int>(flag) << ", &sign: " << static_cast<int>(sign);
1035-
LOG(info) << "[matchFinalStateCorrBkgs] Flag set to: " << static_cast<int>(flag) << " sign: " << static_cast<int>(sign) << " for channel: " << static_cast<int>(channel);
10361031
}
10371032
break; // Exit loop if a match is found
10381033
}
@@ -1041,7 +1036,6 @@ struct HfCandidateCreator3ProngExpressions {
10411036
break; // Exit loop if a match is found
10421037
}
10431038
}
1044-
// LOG(info) << "Corr Bkg matching ended with flag " << static_cast<int>(flag) << " and indexRec " << static_cast<int>(indexRec) << ", &sign " << static_cast<int>(sign) << ", channel " << static_cast<int>(channel);
10451039
} else {
10461040
// D± → π± K∓ π±
10471041
if (flag == 0) {

PWGHF/TableProducer/treeCreatorD0ToKPi.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ struct HfTreeCreatorD0ToKPi {
510510
if constexpr (applyMl) {
511511
rowCandidateMl.reserve(candidates.size());
512512
}
513-
LOG(info) << "Processing " << candidates.size() << " candidates";
514513
for (const auto& candidate : candidates) {
515514
if constexpr (onlyBkg) {
516515
if ( TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_2prong::DecayType::D0ToPiK) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0)) ) {

PWGHF/Utils/utilsMcGen.h

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -202,55 +202,31 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V
202202
}
203203
if (matched) {
204204
flag = sign * chn;
205-
if (motherPdgCode == Pdg::kDStar) {
206-
// std::cout << "Found D*: " << static_cast<int>(flag) << " with PDG code: " << motherPdgCode << std::endl;
207-
}
208205
// Flag the resonant decay channel
209206
int resoMaxDepth = 1;
210207
std::vector<int> arrResoDaughIndex = {};
211208
if (std::abs(motherPdgCode) == Pdg::kDStar) {
212209
std::vector<int> arrResoDaughIndexDStar = {};
213210
RecoDecay::getDaughters(particle, &arrResoDaughIndexDStar, std::array{0}, resoMaxDepth);
214211
for (size_t iDaug = 0; iDaug < arrResoDaughIndexDStar.size(); iDaug++) {
215-
if (std::abs(mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]).pdgCode()) == Pdg::kD0) {
216-
// LOG(info) << "[matchFinalStateCorrBkgsGen] D* Daughter with PDG code: " << mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]).pdgCode() << " recognized as D0.";
217-
auto daughDstarD0 = mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]);
218-
RecoDecay::getDaughters(daughDstarD0, &arrResoDaughIndex, std::array{0}, resoMaxDepth);
219-
break;
220-
} else if (std::abs(mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]).pdgCode()) == Pdg::kDPlus) {
221-
LOG(info) << "[matchFinalStateCorrBkgsGen] D* Daughter with PDG code: " << mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]).pdgCode() << " is a D+.";
222-
auto daughDstarDplus = mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]);
223-
RecoDecay::getDaughters(daughDstarDplus, &arrResoDaughIndex, std::array{0}, resoMaxDepth);
212+
auto daughDstar = mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]);
213+
if (std::abs(daughDstar.pdgCode()) == Pdg::kD0 || std::abs(daughDstar.pdgCode()) == Pdg::kDPlus) {
214+
RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, resoMaxDepth);
224215
break;
225216
} else {
226-
// LOG(info) << "[matchFinalStateCorrBkgsGen] D* Daughter with PDG code: " << mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]).pdgCode() << " not recognized.";
217+
LOG(info) << "[matchFinalStateCorrBkgsGen] D* Daughter with PDG code: " << mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]).pdgCode() << " not recognized.";
227218
}
228-
229-
// std::cout << "[matchFinalStateCorrBkgsGen] D* Daughter index: " << arrResoDaughIndexDStar[iDaug] << std::endl;
230219
}
231220
} else {
232221
RecoDecay::getDaughters(particle, &arrResoDaughIndex, std::array{0}, resoMaxDepth);
233222
}
234223
std::array<int, NDaughtersResonant> arrPDGDaugh = {};
235-
if (std::abs(motherPdgCode) == Pdg::kDStar) {
236-
// LOG(info) << "[matchFinalStateCorrBkgsGen] D* decay detected, arrResoDaughIndex size: " << arrResoDaughIndex.size();
237-
}
238224
if (arrResoDaughIndex.size() == NDaughtersResonant) {
239-
if (std::abs(motherPdgCode) == Pdg::kDStar) {
240-
// LOG(info) << "[matchFinalStateCorrBkgsGen] Flagging resonant decay ... ";
241-
}
242225
for (auto iProng = 0u; iProng < NDaughtersResonant; ++iProng) {
243226
auto daughI = mcParticles.rawIteratorAt(arrResoDaughIndex[iProng]);
244-
if (std::abs(motherPdgCode) == Pdg::kDStar) {
245-
// std::cout << "Adding daughter PDG: " << daughI.pdgCode() << std::endl;
246-
}
247227
arrPDGDaugh[iProng] = daughI.pdgCode();
248228
}
249229
flagResonantDecay<true>(motherPdgCode, &channel, arrPDGDaugh);
250-
if (std::abs(motherPdgCode) == Pdg::kDStar) {
251-
// LOG(info) << "[matchFinalStateCorrBkgsGen] Matched final state: " << chn << " with PDG code: " << motherPdgCode << ", flag: " << static_cast<int>(flag) << ", sign: " << static_cast<int>(sign);
252-
// LOG(info) << "[matchFinalStateCorrBkgsGen] Flag set to: " << static_cast<int>(flag) << " sign: " << static_cast<int>(sign) << " for channel: " << static_cast<int>(channel);
253-
}
254230
}
255231
break; // Exit loop if a match is found
256232
}

0 commit comments

Comments
 (0)