Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWGHF: Adding correlated bkg information in D+ tree #7947

Merged
merged 4 commits into from
Oct 11, 2024
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
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ struct HfCandidateSelectorDplusToPiKPi {
Configurable<std::vector<double>> binsPtTrack{"binsPtTrack", std::vector<double>{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for DCA pT-dependent cut"};
// QA switch
Configurable<bool> activateQA{"activateQA", false, "Flag to enable QA histogram"};
// Correlated background from Ds and D+
Configurable<bool> storeDsDplusBkg{"storeDsDplusBkg", false, "Flag to store correlated background from misidentified product of Ds and D+ decay"};
// ML inference
Configurable<bool> applyMl{"applyMl", false, "Flag to apply ML selections"};
Configurable<std::vector<double>> binsPtMl{"binsPtMl", std::vector<double>{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"};
Expand Down Expand Up @@ -223,7 +225,7 @@ struct HfCandidateSelectorDplusToPiKPi {

auto ptCand = candidate.pt();

if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::DplusToPiKPi)) {
if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::DplusToPiKPi) && !(storeDsDplusBkg && TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::DsToKKPi))) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
mfaggin marked this conversation as resolved.
Show resolved Hide resolved
hfSelDplusToPiKPiCandidate(statusDplusToPiKPi);
if (applyMl) {
hfMlDplusToPiKPiCandidate(outputMlNotPreselected);
Expand Down
16 changes: 11 additions & 5 deletions PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE",
full::Phi,
full::Y,
hf_cand_3prong::FlagMcMatchRec,
hf_cand_3prong::OriginMcRec)
hf_cand_3prong::OriginMcRec,
hf_cand_3prong::FlagMcDecayChanRec)

DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL",
collision::BCId,
Expand Down Expand Up @@ -204,7 +205,8 @@ DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL",
full::Y,
full::E,
hf_cand_3prong::FlagMcMatchRec,
hf_cand_3prong::OriginMcRec);
hf_cand_3prong::OriginMcRec,
hf_cand_3prong::FlagMcDecayChanRec);

DECLARE_SOA_TABLE(HfCandDpFullEvs, "AOD", "HFCANDDPFULLEV",
collision::BCId,
Expand Down Expand Up @@ -249,7 +251,7 @@ struct HfTreeCreatorDplusToPiKPi {
Filter filterSelectCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi));

Partition<SelectedCandidatesMc> reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi));
Partition<SelectedCandidatesMc> reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) || nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)); // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π±
Partition<SelectedCandidatesMc> reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi));

void init(InitContext const&)
Expand All @@ -274,9 +276,11 @@ struct HfTreeCreatorDplusToPiKPi {
{
int8_t flagMc = 0;
int8_t originMc = 0;
int8_t channelMc = 0;
if constexpr (doMc) {
flagMc = candidate.flagMcMatchRec();
originMc = candidate.originMcRec();
channelMc = candidate.flagMcDecayChanRec();
}

auto prong0 = candidate.template prong0_as<TracksWPid>();
Expand Down Expand Up @@ -327,7 +331,8 @@ struct HfTreeCreatorDplusToPiKPi {
candidate.phi(),
hfHelper.yDplus(candidate),
flagMc,
originMc);
originMc,
channelMc);
} else {
rowCandidateFull(
candidate.collision().bcId(),
Expand Down Expand Up @@ -407,7 +412,8 @@ struct HfTreeCreatorDplusToPiKPi {
hfHelper.yDplus(candidate),
hfHelper.eDplus(candidate),
flagMc,
originMc);
originMc,
channelMc);
}
}

Expand Down
Loading