@@ -59,6 +59,7 @@ struct HfTaskDstarToD0Pi {
5959 Configurable<bool > selectionFlagDstarToD0Pi{" selectionFlagDstarToD0Pi" , true , " Selection Flag for D* decay to D0 & Pi" };
6060 Configurable<bool > isCentStudy{" isCentStudy" , true , " Flag to select centrality study" };
6161 Configurable<bool > qaEnabled{" qaEnabled" , true , " Flag to enable QA histograms" };
62+ Configurable<bool > studyD0ToPiKPi0{" studyD0ToPiKPi0" , false , " Flag to study D*->D0(piKpi0)pi channel" };
6263
6364 // CCDB configuration
6465 Configurable<bool > useWeight{" useWeight" , true , " Flag to use weights from CCDB" };
@@ -262,6 +263,28 @@ struct HfTaskDstarToD0Pi {
262263 }
263264 }
264265
266+ if (studyD0ToPiKPi0) {
267+ // inclusive D0ToPiKPi0 study
268+ if (doprocessMcWML && isCentStudy) {
269+ registry.add (" D0ToPiKPi0/hDeltaInvMassVsPtVsCentVsBDTScore" , " #Delta #it{M}_{inv} Vs Pt Vs Cent Vs BDTScore for D0ToPiKPi0" , {HistType::kTHnSparseF , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }, {axisCentrality}, {axisBDTScoreBackground}, {axisBDTScorePrompt}, {axisBDTScoreNonPrompt}}}, true );
270+ } else if (doprocessMcWoMl && isCentStudy) {
271+ registry.add (" D0ToPiKPi0/hDeltaInvMassDstar3D" , " #Delta #it{M}_{inv} D* Candidate for D0ToPiKPi0; inv. mass ((#pi #pi k) - (#pi k)) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c}); FT0M centrality" , {HistType::kTH3F , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }, {axisCentrality}}}, true );
272+ } else if (doprocessMcWML && !isCentStudy) {
273+ registry.add (" D0ToPiKPi0/hDeltaInvMassVsPtVsBDTScore" , " #Delta #it{M}_{inv} Vs Pt Vs BDTScore for D0ToPiKPi0" , {HistType::kTHnSparseF , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }, {axisBDTScoreBackground}, {axisBDTScorePrompt}, {axisBDTScoreNonPrompt}}}, true );
274+ } else if (doprocessMcWoMl && !isCentStudy) {
275+ registry.add (" D0ToPiKPi0/hDeltaInvMassDstar2D" , " #Delta #it{M}_{inv} D* Candidate for D0ToPiKPi0; inv. mass ((#pi #pi k) - (#pi k)) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }}}, true );
276+ }
277+
278+ // differential (prompt/Non-prompt) D0ToPiKPi0 study
279+ if (doprocessMcWML) {
280+ registry.add (" D0ToPiKPi0/hPromptDeltaInvMassVsPtVsBDTScore" , " Prompt #Delta #it{M}_{inv} Vs Pt Vs BDTScore for D0ToPiKPi0" , {HistType::kTHnSparseF , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }, {axisBDTScoreBackground}, {axisBDTScorePrompt}, {axisBDTScoreNonPrompt}}}, true );
281+ registry.add (" D0ToPiKPi0/hNonPromptDeltaInvMassVsPtVsBDTScore" , " Non-Prompt #Delta #it{M}_{inv} Vs Pt Vs BDTScore for D0ToPiKPi0" , {HistType::kTHnSparseF , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }, {axisBDTScoreBackground}, {axisBDTScorePrompt}, {axisBDTScoreNonPrompt}}}, true );
282+ } else if (doprocessMcWoMl) {
283+ registry.add (" D0ToPiKPi0/hPromptDeltaInvMassDstar2D" , " Prompt #Delta #it{M}_{inv} D* Candidate for D0ToPiKPi0; inv. mass ((#pi #pi k) - (#pi k)) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }}}, true );
284+ registry.add (" D0ToPiKPi0/hNonPromptDeltaInvMassDstar2D" , " Non-Prompt #Delta #it{M}_{inv} D* Candidate for D0ToPiKPi0; inv. mass ((#pi #pi k) - (#pi k)) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {{axisDeltaInvMass}, {vecPtBins, " #it{p}_{T} (GeV/#it{c})" }}}, true );
285+ }
286+ }
287+
265288 // if weights to be applied
266289 if (useWeight) {
267290 ccdbApi.init (ccdbUrl);
@@ -542,6 +565,38 @@ struct HfTaskDstarToD0Pi {
542565 }
543566 }
544567 }
568+ } else if (studyD0ToPiKPi0 && candDstarMcRec.isSelDstarToD0Pi () && (std::abs (candDstarMcRec.flagMcMatchRec ()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0) && (std::abs (candDstarMcRec.flagMcMatchRecD0 ()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0)) {
569+ // Aplly all selection to study D*->D0(piKpi0)pi channel same as signal channel
570+ // MC Matched but to D*->D0(piKpi0)pi channel
571+ auto deltaMDstar = std::abs (candDstarMcRec.invMassDstar () - candDstarMcRec.invMassD0 ());
572+ if constexpr (ApplyMl) {
573+ auto bdtScore = candDstarMcRec.mlProbDstarToD0Pi ();
574+ // inclusive study
575+ if (isCentStudy) {
576+ registry.fill (HIST (" D0ToPiKPi0/hDeltaInvMassVsPtVsCentVsBDTScore" ), deltaMDstar, candDstarMcRec.pt (), centrality, bdtScore[0 ], bdtScore[1 ], bdtScore[2 ]);
577+ } else {
578+ registry.fill (HIST (" D0ToPiKPi0/hDeltaInvMassVsPtVsBDTScore" ), deltaMDstar, candDstarMcRec.pt (), bdtScore[0 ], bdtScore[1 ], bdtScore[2 ]);
579+ }
580+ // differential (prompt/Non-prompt) study
581+ if (candDstarMcRec.originMcRec () == RecoDecay::OriginType::Prompt) {
582+ registry.fill (HIST (" D0ToPiKPi0/hPromptDeltaInvMassVsPtVsBDTScore" ), deltaMDstar, candDstarMcRec.pt (), bdtScore[0 ], bdtScore[1 ], bdtScore[2 ]);
583+ } else if (candDstarMcRec.originMcRec () == RecoDecay::OriginType::NonPrompt) {
584+ registry.fill (HIST (" D0ToPiKPi0/hNonPromptDeltaInvMassVsPtVsBDTScore" ), deltaMDstar, candDstarMcRec.pt (), bdtScore[0 ], bdtScore[1 ], bdtScore[2 ]);
585+ }
586+ } else { // without ML
587+ // inclusive study
588+ if (isCentStudy) {
589+ registry.fill (HIST (" D0ToPiKPi0/hDeltaInvMassDstar3D" ), deltaMDstar, candDstarMcRec.pt (), centrality);
590+ } else {
591+ registry.fill (HIST (" D0ToPiKPi0/hDeltaInvMassDstar2D" ), deltaMDstar, candDstarMcRec.pt ());
592+ }
593+ // differential (prompt/Non-prompt) study
594+ if (candDstarMcRec.originMcRec () == RecoDecay::OriginType::Prompt) {
595+ registry.fill (HIST (" D0ToPiKPi0/hPromptDeltaInvMassDstar2D" ), deltaMDstar, candDstarMcRec.pt ());
596+ } else if (candDstarMcRec.originMcRec () == RecoDecay::OriginType::NonPrompt) {
597+ registry.fill (HIST (" D0ToPiKPi0/hNonPromptDeltaInvMassDstar2D" ), deltaMDstar, candDstarMcRec.pt ());
598+ }
599+ }
545600 } else { // MC Unmatched (Baground at Reconstruction Level)
546601 if (qaEnabled) {
547602 registry.fill (HIST (" QA/hCPASkimD0RecBg" ), candDstarMcRec.cpaD0 ());
0 commit comments