Skip to content

Commit 9283357

Browse files
authored
[PWGHF] Bugfixes of correlated background processing in 3-prong decays (#13609)
1 parent 1e141ac commit 9283357

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,8 +1126,8 @@ struct HfCandidateCreator3ProngExpressions {
11261126
if (indexRec > -1) {
11271127
flagChannelMain = sign * channelMain;
11281128

1129-
/// swapping for D+, Ds->Kpipi and Lc->pKpi
1130-
if (std::abs(flagChannelMain) == DecayChannelMain::DplusToPiKK || std::abs(flagChannelMain) == DecayChannelMain::DsToPiKK || std::abs(flagChannelMain) == DecayChannelMain::LcToPKPi) {
1129+
/// swapping for D+, Ds->Kpipi; Lc, Xic->pKpi
1130+
if (std::abs(flagChannelMain) == DecayChannelMain::DplusToPiKK || std::abs(flagChannelMain) == DecayChannelMain::DsToPiKK || std::abs(flagChannelMain) == DecayChannelMain::LcToPKPi || std::abs(flagChannelMain) == DecayChannelMain::XicToPKPi) {
11311131
if (arrayDaughters[0].has_mcParticle()) {
11321132
swapping = static_cast<int8_t>(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus);
11331133
}

PWGHF/TableProducer/treeCreatorLcToPKPi.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ struct HfTreeCreatorLcToPKPi {
401401
Configurable<bool> fillCollIdTable{"fillCollIdTable", false, "Fill a single-column table with collision index"};
402402
Configurable<bool> fillCandidateMcTable{"fillCandidateMcTable", false, "Switch to fill a table with MC particles matched to candidates"};
403403
Configurable<bool> applyMl{"applyMl", false, "Whether ML was used in candidateSelectorLc"};
404-
Configurable<bool> keepOnlySignalMc{"keepOnlySignalMc", false, "Fill MC tree only with signal candidates"};
405-
Configurable<bool> keepOnlyBkg{"keepOnlyBkg", false, "Fill MC tree only with background candidates"};
404+
Configurable<bool> keepSignalMc{"keepSignalMc", false, "Fill MC tree with signal candidates"};
405+
Configurable<bool> keepBkgMc{"keepBkgMc", false, "Fill MC tree with background candidates"};
406406
Configurable<bool> keepCorrBkgMC{"keepCorrBkgMC", false, "Flag to keep correlated background sources (Λc+ -> p K− π+ π0, p π− π+, p K− K+ and other charm hadrons)"};
407407
Configurable<double> downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to store in the tree"};
408408
Configurable<float> downSampleBkgPtMax{"downSampleBkgPtMax", 100.f, "Max. pt for background downsampling"};
@@ -940,11 +940,11 @@ struct HfTreeCreatorLcToPKPi {
940940
const int sigbgstatus = determineSignalBgStatus(candidate, candFlag);
941941
const bool isMcCandidateSignal = (sigbgstatus == Prompt) || (sigbgstatus == NonPrompt);
942942
const bool passSelection = functionSelection >= selectionFlagLc;
943-
const bool keepAll = !keepOnlySignalMc && !keepOnlyBkg && !keepCorrBkgMC;
943+
const bool keepAll = !keepSignalMc && !keepBkgMc && !keepCorrBkgMC;
944944
const int flag = candidate.flagMcMatchRec();
945-
const bool isCorrBkg = (std::abs(flag) != 0 && std::abs(flag) != o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi);
945+
const bool isCorrBkg = (std::abs(flag) != 0 && std::abs(flag) != o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || sigbgstatus == WrongOrder;
946946
const bool notSkippedBkg = isMcCandidateSignal || candidate.pt() > downSampleBkgPtMax || pseudoRndm < downSampleBkgFactor;
947-
if (passSelection && notSkippedBkg && (keepAll || (keepOnlySignalMc && isMcCandidateSignal) || (keepOnlyBkg && !isMcCandidateSignal) || (keepCorrBkgMC && isCorrBkg))) {
947+
if (passSelection && notSkippedBkg && (keepAll || (keepSignalMc && isMcCandidateSignal) || (keepBkgMc && !isMcCandidateSignal) || (keepCorrBkgMC && isCorrBkg))) {
948948
if (fillCandidateLiteTable) {
949949
fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
950950
} else {

0 commit comments

Comments
 (0)