From 4c9e4f8b975e06362cf6e5a7900cf24244b94073 Mon Sep 17 00:00:00 2001 From: xinxiang LIU Date: Thu, 2 Apr 2026 17:59:05 +0200 Subject: [PATCH] Add Lc->pK0s channel in polarization task. --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 808 ++++++++++++++++++---- 1 file changed, 692 insertions(+), 116 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index dcc88fbb5d9..9467cea4acc 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -93,6 +94,11 @@ enum MassHyposLcToPKPi : uint8_t { PiKP, NMassHypoLcToPKPi }; +enum MassHyposLcToPK0S : uint8_t { + PK0S = 0, + K0SP, + NMassHypoLcToPK0S +}; enum QvecEstimator : uint8_t { FV0A = 0, FT0M, @@ -118,6 +124,21 @@ DECLARE_SOA_COLUMN(IsReflected, isReflected, int8_t); DECLARE_SOA_COLUMN(Charge, charge, int8_t); DECLARE_SOA_COLUMN(Origin, origin, int8_t); +DECLARE_SOA_COLUMN(MassLcK0S, massLcK0S, float); +DECLARE_SOA_COLUMN(PtLcK0S, ptLcK0S, float); +DECLARE_SOA_COLUMN(RapidityLcK0S, rapidityLcK0S, float); +DECLARE_SOA_COLUMN(CosThetaStarK0S, cosThetaStarK0S, float); +DECLARE_SOA_COLUMN(PdgMotherProng0K0S, pdgMotherProng0K0S, int); +DECLARE_SOA_COLUMN(PdgMotherProng1K0S, pdgMotherProng1K0S, int); +DECLARE_SOA_COLUMN(MassK0S, massK0S, float); +DECLARE_SOA_COLUMN(BdtBkgScoreK0S, bdtBkgScoreK0S, float); +DECLARE_SOA_COLUMN(BdtNonPromptScoreK0S, bdtNonPromptScoreK0S, float); +DECLARE_SOA_COLUMN(IsRealPK0S, isRealPK0S, int8_t); +DECLARE_SOA_COLUMN(IsRealLcPK0S, isRealLcPK0S, int8_t); +DECLARE_SOA_COLUMN(IsReflectedK0S, isReflectedK0S, int8_t); +DECLARE_SOA_COLUMN(ChargeK0S, chargeK0S, int8_t); +DECLARE_SOA_COLUMN(OriginK0S, originK0S, int8_t); + } // namespace charm_polarisation /// table to study the Lc->PKPi background @@ -140,18 +161,34 @@ DECLARE_SOA_TABLE(HfLcPolBkg, "AOD", "HFLCPOLBKG", charm_polarisation::Charge, charm_polarisation::Origin); +/// table to study the Lc->PK0S background + +DECLARE_SOA_TABLE(HfLcK0SPolBkg, "AOD", "HFLCK0SPOLBKG", + charm_polarisation::MassLcK0S, + charm_polarisation::PtLcK0S, + charm_polarisation::RapidityLcK0S, + charm_polarisation::CosThetaStarK0S, + charm_polarisation::PdgMotherProng0K0S, + charm_polarisation::PdgMotherProng1K0S, + charm_polarisation::MassK0S, + charm_polarisation::BdtBkgScoreK0S, + charm_polarisation::BdtNonPromptScoreK0S, + charm_polarisation::IsRealPK0S, + charm_polarisation::IsRealLcPK0S, + charm_polarisation::IsReflectedK0S, + charm_polarisation::ChargeK0S, + charm_polarisation::OriginK0S); } // namespace o2::aod - struct HfTaskCharmPolarisation { Produces rowCandLcBkg; - + Produces rowCandLcK0SBkg; float bkgRotationAngleStep{0.f}; uint8_t nMassHypos{0u}; Configurable selectionFlagDstarToD0Pi{"selectionFlagDstarToD0Pi", true, "Selection Flag for D* decay to D0 Pi"}; Configurable selectionFlagLcToPKPi{"selectionFlagLcToPKPi", 1, "Selection Flag for Lc decay to P K Pi"}; - + Configurable selectionFlagLcToPK0S{"selectionFlagLcToPK0S", 1, "Selection Flag for Lc decay to P K0S"}; // Configurable harmonic{"harmonic", 2, "harmonic number"}; Configurable qVecDetector{"qVecDetector", 2, "Detector for Q vector estimation (FV0A: 0, FT0M: 1, FT0C: 2)"}; Configurable centEstimator{"centEstimator", 2, "Centrality estimator ((None: 0, FT0C: 2, FT0M: 3))"}; @@ -178,7 +215,8 @@ struct HfTaskCharmPolarisation { /// table for Lc->pKpi background studies in MC Configurable cosThStarAxisLcPKPiBkgMc{"cosThStarAxisLcPKPiBkgMc", 1, "cos(Theta*) axis for background studies (1 = helicity; 2 = production; 3 = beam; 4 = random)"}; - + /// table for Lc->pK0S background studies in MC. + Configurable cosThStarAxisLcPK0SBkgMc{"cosThStarAxisLcPK0SBkgMc", 1, "cos(Theta*) axis for background studies (1 = helicity; 2 = production; 3 = beam; 4 = random)"}; /// veto conditions for Lc->pKpi analysis struct : ConfigurableGroup { Configurable applyLcBkgVeto{"applyLcBkgVeto", false, "Flag to enable the veto on D+ and Ds+ background for Lc->pKpi analysis"}; @@ -228,9 +266,11 @@ struct HfTaskCharmPolarisation { using McParticlesDstarMatched = soa::Join; using McParticles3ProngMatched = soa::Join; + using McParticlesCascadeMatched = soa::Join; using CandDstarWSelFlag = soa::Join; using CandLcToPKPiWSelFlag = soa::Join; + using CandLcToPK0SWSelFlag = soa::Join; using FilteredCandDstarWSelFlag = soa::Filtered; using FilteredCandDstarWSelFlagAndMl = soa::Filtered>; @@ -242,8 +282,14 @@ struct HfTaskCharmPolarisation { using FilteredCandLcToPKPiWSelFlagAndMc = soa::Filtered>; using FilteredCandLcToPKPiWSelFlagAndMcAndMl = soa::Filtered>; + using FilteredCandLcToPK0SWSelFlag = soa::Filtered; + using FilteredCandLcToPK0SWSelFlagAndMl = soa::Filtered>; + using FilteredCandLcToPK0SWSelFlagAndMc = soa::Filtered>; + using FilteredCandLcToPK0SWSelFlagAndMcAndMl = soa::Filtered>; + Filter filterSelectDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstarToD0Pi; Filter filterSelectLcToPKPiCandidates = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLcToPKPi) || (aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLcToPKPi); + Filter filterSelectLcToPK0SCandidates = aod::hf_sel_candidate_lc_to_k0s_p::isSelLcToK0sP >= selectionFlagLcToPK0S; Preslice dstarPerCollision = aod::hf_cand::collisionId; Preslice dstarWithMlPerCollision = aod::hf_cand::collisionId; @@ -255,6 +301,11 @@ struct HfTaskCharmPolarisation { Preslice lcToPKPiWithMcPerCollision = aod::hf_cand::collisionId; Preslice lcToPKPiWithMcAndMlPerCollision = aod::hf_cand::collisionId; + Preslice lcToPK0SPerCollision = aod::hf_cand::collisionId; + Preslice lcToPK0SWithMlPerCollision = aod::hf_cand::collisionId; + Preslice lcToPK0SWithMcPerCollision = aod::hf_cand::collisionId; + Preslice lcToPK0SWithMcAndMlPerCollision = aod::hf_cand::collisionId; + PresliceUnsorted colPerMcCollision = aod::mcparticle::mcCollisionId; ConfigurableAxis configTHnAxisEulerPhi{"configTHnAxisEulerPhi", {24, -o2::constants::math::PI, o2::constants::math::PI}, "Euler polar angle #phi"}; @@ -285,7 +336,8 @@ struct HfTaskCharmPolarisation { void init(InitContext&) { /// check process functions - std::array processes = {doprocessDstar, doprocessDstarWithMl, doprocessLcToPKPi, doprocessLcToPKPiWithMl, doprocessDstarMc, doprocessDstarMcWithMl, doprocessLcToPKPiMc, doprocessLcToPKPiMcWithMl, doprocessLcToPKPiBackgroundMcWithMl, doprocessDstarInPbPb, doprocessDstarWithMlInPbPb, doprocessDstarMcInPbPb, doprocessDstarMcWithMlInPbPb}; + + std::array processes = {doprocessDstar, doprocessDstarWithMl, doprocessLcToPKPi, doprocessLcToPKPiWithMl, doprocessDstarMc, doprocessDstarMcWithMl, doprocessLcToPKPiMc, doprocessLcToPKPiMcWithMl, doprocessLcToPKPiBackgroundMcWithMl, doprocessDstarInPbPb, doprocessDstarWithMlInPbPb, doprocessDstarMcInPbPb, doprocessDstarMcWithMlInPbPb, doprocessLcToPK0S, doprocessLcToPK0SWithMl, doprocessLcToPK0SMc, doprocessLcToPK0SMcWithMl, doprocessLcToPK0SBackgroundMcWithMl}; const int nProcesses = std::accumulate(processes.begin(), processes.end(), 0); if (nProcesses > 1) { LOGP(fatal, "Only one process function should be enabled at a time, please check your configuration"); @@ -357,7 +409,6 @@ struct HfTaskCharmPolarisation { auto invMassBins = thnAxisInvMass.binEdges; minInvMass = invMassBins.front(); maxInvMass = invMassBins.back(); - registry.add("hNumPvContributorsAll", "Number of PV contributors for all events ;num. PV contributors; counts", HistType::kTH1D, {thnAxisNumPvContributors}); registry.add("hNumPvContributorsCand", "Number of PV contributors for events with candidates;num. PV contributors; counts", HistType::kTH1D, {thnAxisNumPvContributors}); registry.add("hNumPvContributorsCandInMass", "Number of PV contributors for events with candidates in the signal region;num. PV contributors; counts", HistType::kTH1D, {thnAxisNumPvContributors}); @@ -427,14 +478,58 @@ struct HfTaskCharmPolarisation { } } } - if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - registry.add("hGenPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); - if (activatePartRecoDstar) { - registry.add("hGenPartRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenPartRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + + else if (doprocessLcToPK0S || doprocessLcToPK0SMc || doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hHelicityaxes.insert(hHelicityaxes.end(), {thnAxisCosThetaStarHelicity}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hHelicityaxes.insert(hHelicityaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + std::vector hRecoHelicityAxes(hHelicityaxes); + if (doprocessLcToPK0SMc) { + hRecoHelicityAxes.insert(hRecoHelicityAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + } else { + hRecoHelicityAxes.insert(hRecoHelicityAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge}); + } + registry.add("hRecoPromptHelicity", "THn for Lc->pK0S prompt", HistType::kTHnSparseF, hRecoHelicityAxes); + registry.add("hRecoNonPromptHelicity", "THn for Lc->pK0S non-prompt", HistType::kTHnSparseF, hRecoHelicityAxes); + } + hHelicityaxes.insert(hHelicityaxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + registry.add("hHelicity", "THn for Lc->pK0S polarisation studies", HistType::kTHnSparseF, hHelicityaxes); + if (activateTHnEulerPhiMonitor) { + std::vector hEulerPhiAxes = {thnAxisInvMass, thnAxisPt, thnAxisTHnAxisEulerPhi}; + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hEulerPhiAxes.insert(hEulerPhiAxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + hEulerPhiAxes.push_back(thnAxisCharge); + if (doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc) { + registry.add("hRecPromptEulerPhiHelicity", "THn for Lc->pK0S Euler phi (prompt)", HistType::kTHnSparseF, hEulerPhiAxes); + registry.add("hRecNonPromptEulerPhiHelicity", "THn for Lc->pK0S Euler phi (non-prompt)", HistType::kTHnSparseF, hEulerPhiAxes); + } else { + registry.add("hEulerPhiHelicity", "THn for Lc->pK0S Euler phi", HistType::kTHnSparseF, hEulerPhiAxes); + } + } + } + + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { + std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + registry.add("hGenPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + if (activatePartRecoDstar) { + registry.add("hGenPartRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenPartRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + } + } + if (doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector const hgenPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisCharge}; + std::vector const hgenNonPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisPtB, thnAxisDausAcc, thnAxisCharge}; + registry.add("hGenPromptHelicity", "Generated prompt Lc->pK0S, helicity axis", HistType::kTHnSparseF, hgenPromptAxesLcToPK0S); + registry.add("hGenNonPromptHelicity", "Generated non-prompt Lc->pK0S, helicity axis", HistType::kTHnSparseF, hgenNonPromptAxesLcToPK0S); } } } @@ -501,14 +596,58 @@ struct HfTaskCharmPolarisation { } } } - if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - registry.add("hGenPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); - if (activatePartRecoDstar) { - registry.add("hGenPartRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenPartRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + + else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { + hProductionaxes.insert(hProductionaxes.end(), {thnAxisCosThetaStarProduction}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hProductionaxes.insert(hProductionaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + std::vector hRecoProductionAxes(hProductionaxes); + if (doprocessLcToPK0SMc) { + hRecoProductionAxes.insert(hRecoProductionAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + } else { + hRecoProductionAxes.insert(hRecoProductionAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge}); + } + registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for reconstructed prompt Lc+ candidates", HistType::kTHnSparseF, hRecoProductionAxes); + registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for reconstructed non-prompt Lc+ candidates", HistType::kTHnSparseF, hRecoProductionAxes); + } + hProductionaxes.insert(hProductionaxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + registry.add("hProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores", HistType::kTHnSparseF, hProductionaxes); + if (activateTHnEulerPhiMonitor) { + std::vector hEulerPhiAxes = {thnAxisInvMass, thnAxisPt, thnAxisTHnAxisEulerPhi}; + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hEulerPhiAxes.insert(hEulerPhiAxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + hEulerPhiAxes.push_back(thnAxisCharge); + if (doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc) { + registry.add("hRecPromptEulerPhiProduction", "THn for polarisation studies with Euler phi w.r.t. production axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, hEulerPhiAxes); + registry.add("hRecNonPromptEulerPhiProduction", "THn for polarisation studies with Euler phi w.r.t. production axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, hEulerPhiAxes); + } else { + registry.add("hEulerPhiProduction", "THn for polarisation studies with Euler phi w.r.t. production axis", HistType::kTHnSparseF, hEulerPhiAxes); + } + } + } + + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { + std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + registry.add("hGenPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + if (activatePartRecoDstar) { + registry.add("hGenPartRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenPartRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + } + } + if (doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector const hgenPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisDausAcc, thnAxisCharge}; + std::vector const hgenNonPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisPtB, thnAxisDausAcc, thnAxisCharge}; + registry.add("hGenPromptProduction", "Generated prompt Lc->pK0S, production axis", HistType::kTHnSparseF, hgenPromptAxesLcToPK0S); + registry.add("hGenNonPromptProduction", "Generated non-prompt Lc->pK0S, production axis", HistType::kTHnSparseF, hgenNonPromptAxesLcToPK0S); } } } @@ -574,14 +713,58 @@ struct HfTaskCharmPolarisation { } } } - if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - registry.add("hGenPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); - if (activatePartRecoDstar) { - registry.add("hGenPartRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenPartRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + + else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { + hBeamaxes.insert(hBeamaxes.end(), {thnAxisCosThetaStarBeam}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hBeamaxes.insert(hBeamaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + std::vector hRecoBeamAxes(hBeamaxes); + if (doprocessLcToPK0SMc) { + hRecoBeamAxes.insert(hRecoBeamAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + } else { + hRecoBeamAxes.insert(hRecoBeamAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge}); + } + registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis for Lc -> pK0S", HistType::kTHnSparseF, hRecoBeamAxes); + registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis for Lc -> pK0S", HistType::kTHnSparseF, hRecoBeamAxes); + } + hBeamaxes.insert(hBeamaxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + registry.add("hBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis for Lc -> pK0S", HistType::kTHnSparseF, hBeamaxes); + if (activateTHnEulerPhiMonitor) { + std::vector hEulerPhiAxes = {thnAxisInvMass, thnAxisPt, thnAxisTHnAxisEulerPhi}; + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hEulerPhiAxes.insert(hEulerPhiAxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + hEulerPhiAxes.push_back(thnAxisCharge); + if (doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc) { + registry.add("hRecPromptEulerPhiBeam", "THn for Euler phi w.r.t. beam axis -- reco prompt signal (Lc->pK0S)", HistType::kTHnSparseF, hEulerPhiAxes); + registry.add("hRecNonPromptEulerPhiBeam", "THn for Euler phi w.r.t. beam axis -- reco non-prompt signal (Lc->pK0S)", HistType::kTHnSparseF, hEulerPhiAxes); + } else { + registry.add("hEulerPhiBeam", "THn for Euler phi w.r.t. beam axis (Lc->pK0S)", HistType::kTHnSparseF, hEulerPhiAxes); + } + } + } + + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + if (doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector const hgenPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisDausAcc, thnAxisCharge}; + std::vector const hgenNonPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisPtB, thnAxisDausAcc, thnAxisCharge}; + registry.add("hGenPromptBeam", "Generated prompt Lc->pK0S, beam axis", HistType::kTHnSparseF, hgenPromptAxesLcToPK0S); + registry.add("hGenNonPromptBeam", "Generated non-prompt Lc->pK0S, beam axis", HistType::kTHnSparseF, hgenNonPromptAxesLcToPK0S); + } + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { + std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarBeam, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + registry.add("hGenPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + if (activatePartRecoDstar) { + registry.add("hGenPartRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenPartRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + } } } } @@ -636,18 +819,50 @@ struct HfTaskCharmPolarisation { hRandomaxes.insert(hRandomaxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); registry.add("hRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores", HistType::kTHnSparseF, hRandomaxes); } - if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { - std::vector hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - std::vector hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; - if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { - hgenPromptAxes.push_back(thnAxisCentrality); - hgenNonPromptAxes.push_back(thnAxisCentrality); + + else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { + hRandomaxes.insert(hRandomaxes.end(), {thnAxisCosThetaStarRandom}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + hRandomaxes.insert(hRandomaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); } - registry.add("hGenPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); - if (activatePartRecoDstar) { - registry.add("hGenPartRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); - registry.add("hGenPartRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + std::vector hRecoRandomAxes(hRandomaxes); + if (doprocessLcToPK0SMc) { + hRecoRandomAxes.insert(hRecoRandomAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + } else { + hRecoRandomAxes.insert(hRecoRandomAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge}); + } + registry.add("hRecoPromptRandom", "THn for Lc->pK0S prompt, random axis", HistType::kTHnSparseF, hRecoRandomAxes); + registry.add("hRecoNonPromptRandom", "THn for Lc->pK0S non-prompt, random axis", HistType::kTHnSparseF, hRecoRandomAxes); + } + hRandomaxes.insert(hRandomaxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisIsRotatedCandidate, thnAxisCharge}); + registry.add("hRandom", "THn for Lc->pK0S polarisation studies with random axis", HistType::kTHnSparseF, hRandomaxes); + } + + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { + std::vector hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + std::vector hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; + if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { + hgenPromptAxes.push_back(thnAxisCentrality); + hgenNonPromptAxes.push_back(thnAxisCentrality); + } + registry.add("hGenPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + if (activatePartRecoDstar) { + registry.add("hGenPartRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes); + registry.add("hGenPartRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes); + } + } + + if (doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector hgenPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisDausAcc, thnAxisCharge}; + std::vector hgenNonPromptAxesLcToPK0S = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarRandom, thnAxisPtB, thnAxisDausAcc, thnAxisCharge}; + registry.add("hGenPromptRandom", "Generated prompt Lc->pK0S, random axis", HistType::kTHnSparseF, hgenPromptAxesLcToPK0S); + registry.add("hGenNonPromptRandom", "Generated non-prompt Lc->pK0S, random axis", HistType::kTHnSparseF, hgenNonPromptAxesLcToPK0S); } } } @@ -724,6 +939,7 @@ struct HfTaskCharmPolarisation { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); } + }; // end init /// \param invMassCharmHad is the invariant-mass of the candidate @@ -771,6 +987,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } else { // without ML if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -792,6 +1013,12 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } + + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -816,6 +1043,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -837,6 +1069,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } } else { // without ML @@ -860,6 +1097,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -881,6 +1123,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } @@ -907,6 +1154,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } else { // without ML if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -928,6 +1180,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -952,6 +1209,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -973,6 +1235,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } } else { // without ML @@ -996,6 +1263,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1017,6 +1289,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } @@ -1043,6 +1320,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } else { // without ML if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1064,6 +1346,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -1088,6 +1375,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1109,6 +1401,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); + } } } } else { // without ML @@ -1132,6 +1429,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1153,6 +1455,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } @@ -1176,6 +1483,8 @@ struct HfTaskCharmPolarisation { } } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); } } else { // without ML if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1194,6 +1503,8 @@ struct HfTaskCharmPolarisation { } } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -1231,6 +1542,8 @@ struct HfTaskCharmPolarisation { } } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1265,6 +1578,8 @@ struct HfTaskCharmPolarisation { } } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); } } } else { // without ML @@ -1285,6 +1600,8 @@ struct HfTaskCharmPolarisation { } } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1303,6 +1620,8 @@ struct HfTaskCharmPolarisation { } } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } } @@ -1391,78 +1710,137 @@ struct HfTaskCharmPolarisation { /// \param areDausInAcc is a flag indicating whether the daughters are in acceptance or not /// \param resoChannelLc indicates the Lc decay channel (direct, resonant) /// \param isPartRecoDstar is a flag indicating if it is a partly reconstructed Dstar->D0pi->Kpipipi0 meson (MC only) - template - void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, float cosThetaStar, int8_t origin, float ptBhadMother, bool areDausInAcc, uint8_t resoChannelLc, int8_t charge, bool isPartRecoDstar, float centrality = -999.f) + template + void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, float cosThetaStar, + int8_t origin, float ptBhadMother, bool areDausInAcc, uint8_t resoChannelLc, + int8_t charge, bool isPartRecoDstar, float centrality = -999.f) { - if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity - if (origin == RecoDecay::OriginType::Prompt) { // prompt - if (!isPartRecoDstar) { - registry.fill(HIST("hGenPromptHelicity"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoPromptHelicity"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } - } else { // non-prompt - if (!isPartRecoDstar) { - registry.fill(HIST("hGenNonPromptHelicity"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoNonPromptHelicity"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { + if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + if (origin == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hGenPromptHelicity"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, charge); + } else { // non-prompt + registry.fill(HIST("hGenNonPromptHelicity"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, charge); + } + } else { // Dstar or Lc->pKpi + if (origin == RecoDecay::OriginType::Prompt) { + if (!isPartRecoDstar) { + registry.fill(HIST("hGenPromptHelicity"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + } else { + registry.fill(HIST("hGenPartRecoPromptHelicity"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + } + } else { // non-prompt + if (!isPartRecoDstar) { + registry.fill(HIST("hGenNonPromptHelicity"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } else { + registry.fill(HIST("hGenPartRecoNonPromptHelicity"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } } } - } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Production) { // Production - if (origin == RecoDecay::OriginType::Prompt) { // prompt - if (!isPartRecoDstar) { - registry.fill(HIST("hGenPromptProduction"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoPromptProduction"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Production) { + if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + if (origin == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hGenPromptProduction"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, charge); + } else { // non-prompt + registry.fill(HIST("hGenNonPromptProduction"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, charge); } - } else { // non-prompt - if (!isPartRecoDstar) { - registry.fill(HIST("hGenNonPromptProduction"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoNonPromptProduction"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } else { // Dstar or Lc->pKpi + if (origin == RecoDecay::OriginType::Prompt) { + if (!isPartRecoDstar) { + registry.fill(HIST("hGenPromptProduction"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + } else { + registry.fill(HIST("hGenPartRecoPromptProduction"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + } + } else { // non-prompt + if (!isPartRecoDstar) { + registry.fill(HIST("hGenNonPromptProduction"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } else { + registry.fill(HIST("hGenPartRecoNonPromptProduction"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } } } - } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Beam) { // Beam - if (origin == RecoDecay::OriginType::Prompt) { // prompt - if (!isPartRecoDstar) { - registry.fill(HIST("hGenPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } - } else { // non-prompt - if (!isPartRecoDstar) { - registry.fill(HIST("hGenNonPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoNonPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Beam) { + if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + if (origin == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hGenPromptBeam"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, charge); + } else { // non-prompt + registry.fill(HIST("hGenNonPromptBeam"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, charge); } - } - } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Random) { // Random - if (origin == RecoDecay::OriginType::Prompt) { - if (!isPartRecoDstar) { - if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { - registry.fill(HIST("hGenPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge, centrality); + } else { // Dstar or Lc->pKpi + if (origin == RecoDecay::OriginType::Prompt) { + if (!isPartRecoDstar) { + registry.fill(HIST("hGenPromptBeam"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); } else { - registry.fill(HIST("hGenPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + registry.fill(HIST("hGenPartRecoPromptBeam"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); } - } else { - if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { - registry.fill(HIST("hGenPartRecoPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge, centrality); + } else { // non-prompt + if (!isPartRecoDstar) { + registry.fill(HIST("hGenNonPromptBeam"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } else { - registry.fill(HIST("hGenPartRecoPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } - } - } else { // non-prompt - if (!isPartRecoDstar) { - if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { - registry.fill(HIST("hGenNonPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge, centrality); + registry.fill(HIST("hGenPartRecoNonPromptBeam"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } + } + } + } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Random) { + if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + if (origin == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hGenPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, charge); + } else { // non-prompt + registry.fill(HIST("hGenNonPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, charge); + } + } else { // Dstar or Lc->pKpi + if (origin == RecoDecay::OriginType::Prompt) { + if (!isPartRecoDstar) { + if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { + registry.fill(HIST("hGenPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge, centrality); + } else { + registry.fill(HIST("hGenPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + } } else { - registry.fill(HIST("hGenNonPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { + registry.fill(HIST("hGenPartRecoPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge, centrality); + } else { + registry.fill(HIST("hGenPartRecoPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + } } - } else { - if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { - registry.fill(HIST("hGenPartRecoNonPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge, centrality); + } else { // non-prompt + if (!isPartRecoDstar) { + if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { + registry.fill(HIST("hGenNonPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge, centrality); + } else { + registry.fill(HIST("hGenNonPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } } else { - registry.fill(HIST("hGenPartRecoNonPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { + registry.fill(HIST("hGenPartRecoNonPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge, centrality); + } else { + registry.fill(HIST("hGenPartRecoNonPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); + } } } } @@ -1502,6 +1880,12 @@ struct HfTaskCharmPolarisation { if (invMassMin < invMass && invMass < invMassMax) { return true; } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + invMassMin = 2.25f; + invMassMax = 2.35f; + if (invMassMin < invMass && invMass < invMassMax) { + return true; + } } return false; @@ -1620,12 +2004,19 @@ struct HfTaskCharmPolarisation { } resoChannelLc = candidate.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± } - /// Lc electric charge from MC truth /// This is checked when the reconstructed 3-prong candidate is matched to MC with RecoDecay::getMatchedMCRec int8_t const flagMc = candidate.flagMcMatchRec(); charge = std::abs(flagMc) > 0 ? flagMc / std::abs(flagMc) : 0; /// 0 should never happen, debug protection + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + int8_t const flagMc = candidate.flagMcMatchRec(); + if (std::abs(flagMc) != 1) { + return isCandidateInSignalRegion; + } + origin = candidate.originMcRec(); + charge = (flagMc > 0) ? 1 : -1; } + } else { /// data if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { @@ -1633,12 +2024,16 @@ struct HfTaskCharmPolarisation { /// Lc charge == first daughter charge auto trackProng0 = candidate.template prong0_as(); charge = static_cast(trackProng0.sign()); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + // /// For Lc -> p K0S, the proton is the first daughter (prong0) + // /// Lc charge == proton charge + auto trackProng0 = candidate.template prong0_as(); + charge = static_cast(trackProng0.sign()); } } // loop over mass hypotheses for (uint8_t iMass = 0u; iMass < nMassHypos; iMass++) { - // variable definition float pxDau{-1000.f}, pyDau{-1000.f}, pzDau{-1000.f}; float pxCharmHad{-1000.f}, pyCharmHad{-1000.f}, pzCharmHad{-1000.f}; @@ -1836,6 +2231,32 @@ struct HfTaskCharmPolarisation { } } // Lc->pKpi + else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + if (bkgRotationId > 0) { + continue; + } + if constexpr (WithMl) { + if (candidate.mlProbLcToK0sP().size() == NScores) { + outputMl[0] = candidate.mlProbLcToK0sP()[0]; + outputMl[1] = candidate.mlProbLcToK0sP()[1]; + outputMl[2] = candidate.mlProbLcToK0sP()[2]; + } + } + isRotatedCandidate = 0; + std::array twoVecProton = candidate.pVectorProng0(); + std::array twoVecK0s = candidate.pVectorProng1(); + pxCharmHad = twoVecProton[0] + twoVecK0s[0]; + pyCharmHad = twoVecProton[1] + twoVecK0s[1]; + pzCharmHad = twoVecProton[2] + twoVecK0s[2]; + pxDau = twoVecProton[0]; + pyDau = twoVecProton[1]; + pzDau = twoVecProton[2]; + massDau = MassProton; + invMassCharmHad = RecoDecay::m(std::array{twoVecProton, twoVecK0s}, + std::array{MassProton, MassK0Short}); + invMassCharmHadForSparse = invMassCharmHad; + rapidity = RecoDecay::y(std::array{pxCharmHad, pyCharmHad, pzCharmHad}, MassLambdaCPlus); + } if (invMassCharmHadForSparse < minInvMass || invMassCharmHadForSparse > maxInvMass) { continue; @@ -1859,19 +2280,26 @@ struct HfTaskCharmPolarisation { if (!isCandidateInSignalRegion) { // it could be that only one mass hypothesis is in signal region isCandidateInSignalRegion = isInSignalRegion(invMassCharmHadForSparse); } - float absEtaTrackMin{-1.f}; int numItsClsMin{-1}, numTpcClsMin{-1}; if (activateTrackingSys) { - auto trackProng0 = candidate.template prong0_as(); - auto trackProng1 = candidate.template prong1_as(); if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { + auto trackProng0 = candidate.template prong0_as(); + auto trackProng1 = candidate.template prong1_as(); auto trackProng2 = candidate.template prongPi_as(); getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); - } else if (Channel == charm_polarisation::DecayChannel::LcToPKPi) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { + auto trackProng0 = candidate.template prong0_as(); + auto trackProng1 = candidate.template prong1_as(); auto trackProng2 = candidate.template prong2_as(); getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + auto trackProton = candidate.template prong0_as(); + auto trackPiPlus = candidate.template posTrack_as(); + auto trackPiMinus = candidate.template negTrack_as(); + getTrackingInfos(std::vector{trackProton, trackPiPlus, trackPiMinus}, + absEtaTrackMin, numItsClsMin, numTpcClsMin); } } @@ -1892,7 +2320,11 @@ struct HfTaskCharmPolarisation { int8_t nMuons{0u}; if constexpr (DoMc) { - nMuons = candidate.nTracksDecayed(); + if constexpr (Channel != charm_polarisation::DecayChannel::LcToPK0S) { + nMuons = candidate.nTracksDecayed(); + } else { + nMuons = 0; + } } if constexpr (WithEp && !DoMc) { @@ -2115,7 +2547,6 @@ struct HfTaskCharmPolarisation { } // end table for Lc->pKpi background studies } /// end loop over mass hypotheses - return isCandidateInSignalRegion; } @@ -2178,6 +2609,17 @@ struct HfTaskCharmPolarisation { /// electric charge from PDG code int const pdgCode = mcParticle.pdgCode(); charge = static_cast(pdgCode / std::abs(pdgCode)); + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + if (std::abs(mcParticle.flagMcMatchGen()) != 1) { + return; + } + origin = mcParticle.originMcGen(); + std::array const dauPdgs = {kProton, kK0Short}; + RecoDecay::getDaughters(mcParticle, &listDaughters, dauPdgs, 2); + massDau = MassProton; + massCharmHad = MassLambdaCPlus; + int const pdgCode = mcParticle.pdgCode(); + charge = static_cast(pdgCode / std::abs(pdgCode)); } float const rapidity = mcParticle.y(); @@ -2219,6 +2661,15 @@ struct HfTaskCharmPolarisation { if (areDauInAcc) { areDauInAcc = isDaughterInAcceptance(dauPart, 0.3, 0.8); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + if (std::abs(dauPart.pdgCode()) == kProton) { + pxDau = dauPart.px(); + pyDau = dauPart.py(); + pzDau = dauPart.pz(); + } + if (areDauInAcc) { + areDauInAcc = isDaughterInAcceptance(dauPart, 0.3, 0.8); + } } } @@ -2233,25 +2684,25 @@ struct HfTaskCharmPolarisation { if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector const helicityVec = fourVecMother.Vect(); float const cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(helicityVec.Mag2()); - fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarHelicity, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); + fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarHelicity, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } if (activateTHnSparseCosThStarProduction) { ROOT::Math::XYZVector const normalVec = ROOT::Math::XYZVector(pyCharmHad, -pxCharmHad, 0.f); float const cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(normalVec.Mag2()); - fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarProduction, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); + fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarProduction, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } if (activateTHnSparseCosThStarBeam) { ROOT::Math::XYZVector const beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); float const cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarBeam, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); + fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarBeam, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } if (activateTHnSparseCosThStarRandom) { ROOT::Math::XYZVector const randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); float const cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); if constexpr (WithCent) { - fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarRandom, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar, *centrality); + fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarRandom, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar, *centrality); } else { - fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarRandom, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); + fillGenHistos(ptCharmHad, numPvContributors, rapidity, cosThetaStarRandom, origin, ptBhadMother, areDauInAcc, resoChannelLc, charge, partRecoDstar); } } } @@ -2516,9 +2967,9 @@ struct HfTaskCharmPolarisation { } PROCESS_SWITCH(HfTaskCharmPolarisation, processDstarMcWithMlInPbPb, "Process Dstar candidates in PbPb MC with ML", false); - //////////////////////////// - // Lc->pKpi analysis /// - //////////////////////////// + ///////////////////////////////////////// + // Lc->pKpi and Lc->pK0s analysis /// + ///////////////////////////////////////// // Lc->pKpi with rectangular cuts void processLcToPKPi(aod::Collisions const& collisions, @@ -2547,6 +2998,31 @@ struct HfTaskCharmPolarisation { } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPi, "Process Lc candidates without ML", false); + void processLcToPK0S(aod::Collisions const& collisions, + FilteredCandLcToPK0SWSelFlag const& lcCandidates, + TracksWithExtra const& tracks) + { + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + int const numPvContributors = collision.numContrib(); + auto groupedLcCandidates = lcCandidates.sliceBy(lcToPK0SPerCollision, thisCollId); + int nCands{0}, nCandsInSignalRegion{0}; + for (const auto& lcCandidate : groupedLcCandidates) { + nCands++; + if (runPolarisationAnalysis(lcCandidate, 0, numPvContributors, -1 /*MC particles*/, tracks)) { + nCandsInSignalRegion++; + } + /// rotational background + for (int iRotation{1}; iRotation <= nBkgRotations; ++iRotation) { + runPolarisationAnalysis(lcCandidate, iRotation, numPvContributors, -1 /*MC particles*/, tracks); + } + } + fillMultHistos(numPvContributors, nCands, nCandsInSignalRegion); + } + } + + PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPK0S, "Process Lc PK0s candidates without ML", false); + // Lc->pKpi with ML cuts void processLcToPKPiWithMl(aod::Collisions const& collisions, FilteredCandLcToPKPiWSelFlagAndMl const& lcCandidates, @@ -2574,6 +3050,31 @@ struct HfTaskCharmPolarisation { } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiWithMl, "Process Lc candidates with ML", false); + void processLcToPK0SWithMl(aod::Collisions const& collisions, + FilteredCandLcToPK0SWSelFlagAndMl const& lcCandidates, + TracksWithExtra const& tracks) + { + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + int const numPvContributors = collision.numContrib(); + auto groupedLcCandidates = lcCandidates.sliceBy(lcToPK0SWithMlPerCollision, thisCollId); + int nCands{0}, nCandsInSignalRegion{0}; + + for (const auto& lcCandidate : groupedLcCandidates) { + nCands++; + if (runPolarisationAnalysis(lcCandidate, 0, numPvContributors, -1 /*MC particles*/, tracks)) { + nCandsInSignalRegion++; + } + /// rotational background + for (int iRotation{1}; iRotation <= nBkgRotations; ++iRotation) { + runPolarisationAnalysis(lcCandidate, iRotation, numPvContributors, -1 /*MC particles*/, tracks); + } + } + fillMultHistos(numPvContributors, nCands, nCandsInSignalRegion); + } + } + PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPK0SWithMl, "Process Lc PK0S candidates with ML", false); + // Lc->pKpi in MC with rectangular cuts void processLcToPKPiMc(aod::McCollisions::iterator const&, McParticles3ProngMatched const& mcParticles, @@ -2607,6 +3108,37 @@ struct HfTaskCharmPolarisation { } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiMc, "Process Lc candidates in MC without ML", false); + void processLcToPK0SMc(aod::McCollisions::iterator const&, + McParticlesCascadeMatched const& mcParticles, + CollisionsWithMcLabels const& collisions, // this is grouped with SmallGroupsCollisionsWithMcLabels const& collisions, + FilteredCandLcToPK0SWSelFlagAndMc const& lcCandidates, + TracksWithExtra const& tracks) + { + int numPvContributorsGen{0}; + for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision + auto thisCollId = collision.globalIndex(); + int const numPvContributors = collision.numContrib(); + auto groupedLcCandidates = lcCandidates.sliceBy(lcToPK0SWithMcAndMlPerCollision, thisCollId); + int nCands{0}, nCandsInSignalRegion{0}; + + if (numPvContributors > numPvContributorsGen) { // we take the associated reconstructed collision with higher number of PV contributors + numPvContributorsGen = numPvContributors; + } + for (const auto& lcCandidate : groupedLcCandidates) { + nCands++; + if (runPolarisationAnalysis(lcCandidate, 0, numPvContributors, -1 /*MC particles*/, tracks)) { + nCandsInSignalRegion++; + } + } + fillMultHistos(numPvContributors, nCands, nCandsInSignalRegion); + } + + for (const auto& mcParticle : mcParticles) { + runMcGenPolarisationAnalysis(mcParticle, mcParticles, numPvContributorsGen); + } + } + PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPK0SMc, "Process Lc PK0s candidates in MC without ML", false); + // Lc->pKpi in MC with ML cuts void processLcToPKPiMcWithMl(aod::McCollisions::iterator const&, McParticles3ProngMatched const& mcParticles, @@ -2640,6 +3172,36 @@ struct HfTaskCharmPolarisation { } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiMcWithMl, "Process Lc candidates in MC with ML", false); + void processLcToPK0SMcWithMl(aod::McCollisions::iterator const&, + McParticlesCascadeMatched const& mcParticles, + CollisionsWithMcLabels const& collisions, // this is grouped with SmallGroups + FilteredCandLcToPK0SWSelFlagAndMcAndMl const& lcCandidates, + TracksWithExtra const& tracks) + { + int numPvContributorsGen{0}; + for (const auto& collision : collisions) { // loop over reco collisions associated to this gen collision + auto thisCollId = collision.globalIndex(); + int const numPvContributors = collision.numContrib(); + auto groupedLcCandidates = lcCandidates.sliceBy(lcToPK0SWithMcAndMlPerCollision, thisCollId); + int nCands{0}, nCandsInSignalRegion{0}; + + if (numPvContributors > numPvContributorsGen) { // we take the associated reconstructed collision with higher number of PV contributors + numPvContributorsGen = numPvContributors; + } + for (const auto& lcCandidate : groupedLcCandidates) { + nCands++; + if (runPolarisationAnalysis(lcCandidate, 0, numPvContributors, -1 /*MC particles*/, tracks)) { + nCandsInSignalRegion++; + } + } + fillMultHistos(numPvContributors, nCands, nCandsInSignalRegion); + } + for (const auto& mcParticle : mcParticles) { + runMcGenPolarisationAnalysis(mcParticle, mcParticles, numPvContributorsGen); + } + } + PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPK0SMcWithMl, "Process Lc PK0s candidates in MC with ML", false); + // Lc->pKpi in MC with ML cuts w/o mcCollision grouping (to study Lc background) void processLcToPKPiBackgroundMcWithMl(McParticles3ProngMatched const& mcParticles, FilteredCandLcToPKPiWSelFlagAndMcAndMl const& lcCandidates, @@ -2655,6 +3217,20 @@ struct HfTaskCharmPolarisation { } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiBackgroundMcWithMl, "Process Lc candidates in MC with ML w/o mcCollision grouping", false); + void processLcToPK0SBackgroundMcWithMl(McParticlesCascadeMatched const& mcParticles, + FilteredCandLcToPK0SWSelFlagAndMcAndMl const& lcCandidates, + TracksWithMcLabels const& tracks) + { + for (const auto& lcCandidate : lcCandidates) { + runPolarisationAnalysis(lcCandidate, 0, /*numPvContributors*/ -1, mcParticles, tracks); + } + + for (const auto& mcParticle : mcParticles) { + runMcGenPolarisationAnalysis(mcParticle, mcParticles, /*numPvContributorsGen*/ -1); + } + } + PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPK0SBackgroundMcWithMl, "Process Lc PK0s candidates in MC with ML w/o mcCollision grouping", false); + // Event-plane resolution void processResolEventPlane(CollsWithQVecs::iterator const& collision, aod::BCsWithTimestamps const&)