Skip to content

Commit d192a2d

Browse files
PWGHF: Adding correlated bkg information in D+ tree (#7947)
* PWGHF: Adding possibility to store correlated bkg from D+ and Ds in D+ tree * PWGHF: Adding channel info in D+ tree * Update PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx Co-authored-by: Fabio Catalano <fabio.catalano372@gmail.com> * Update PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx Co-authored-by: Fabio Catalano <fabio.catalano372@gmail.com> --------- Co-authored-by: Fabio Catalano <fabio.catalano372@gmail.com>
1 parent 6cfbb3a commit d192a2d

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

PWGHF/TableProducer/candidateSelectorDplusToPiKPi.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ struct HfCandidateSelectorDplusToPiKPi {
6060
Configurable<std::vector<double>> binsPtTrack{"binsPtTrack", std::vector<double>{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for DCA pT-dependent cut"};
6161
// QA switch
6262
Configurable<bool> activateQA{"activateQA", false, "Flag to enable QA histogram"};
63+
// Correlated background from Ds and D+
64+
Configurable<bool> storeDsDplusBkg{"storeDsDplusBkg", false, "Flag to store correlated background from misidentified product of Ds and D+ decay"};
6365
// ML inference
6466
Configurable<bool> applyMl{"applyMl", false, "Flag to apply ML selections"};
6567
Configurable<std::vector<double>> binsPtMl{"binsPtMl", std::vector<double>{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"};
@@ -223,7 +225,7 @@ struct HfCandidateSelectorDplusToPiKPi {
223225

224226
auto ptCand = candidate.pt();
225227

226-
if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::DplusToPiKPi)) {
228+
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∓ π±
227229
hfSelDplusToPiKPiCandidate(statusDplusToPiKPi);
228230
if (applyMl) {
229231
hfMlDplusToPiKPiCandidate(outputMlNotPreselected);

PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE",
124124
full::Phi,
125125
full::Y,
126126
hf_cand_3prong::FlagMcMatchRec,
127-
hf_cand_3prong::OriginMcRec)
127+
hf_cand_3prong::OriginMcRec,
128+
hf_cand_3prong::FlagMcDecayChanRec)
128129

129130
DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL",
130131
collision::BCId,
@@ -204,7 +205,8 @@ DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL",
204205
full::Y,
205206
full::E,
206207
hf_cand_3prong::FlagMcMatchRec,
207-
hf_cand_3prong::OriginMcRec);
208+
hf_cand_3prong::OriginMcRec,
209+
hf_cand_3prong::FlagMcDecayChanRec);
208210

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

252-
Partition<SelectedCandidatesMc> reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi));
254+
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∓ π±
253255
Partition<SelectedCandidatesMc> reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast<int8_t>(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi));
254256

255257
void init(InitContext const&)
@@ -274,9 +276,11 @@ struct HfTreeCreatorDplusToPiKPi {
274276
{
275277
int8_t flagMc = 0;
276278
int8_t originMc = 0;
279+
int8_t channelMc = 0;
277280
if constexpr (doMc) {
278281
flagMc = candidate.flagMcMatchRec();
279282
originMc = candidate.originMcRec();
283+
channelMc = candidate.flagMcDecayChanRec();
280284
}
281285

282286
auto prong0 = candidate.template prong0_as<TracksWPid>();
@@ -327,7 +331,8 @@ struct HfTreeCreatorDplusToPiKPi {
327331
candidate.phi(),
328332
hfHelper.yDplus(candidate),
329333
flagMc,
330-
originMc);
334+
originMc,
335+
channelMc);
331336
} else {
332337
rowCandidateFull(
333338
candidate.collision().bcId(),
@@ -407,7 +412,8 @@ struct HfTreeCreatorDplusToPiKPi {
407412
hfHelper.yDplus(candidate),
408413
hfHelper.eDplus(candidate),
409414
flagMc,
410-
originMc);
415+
originMc,
416+
channelMc);
411417
}
412418
}
413419

0 commit comments

Comments
 (0)