diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index dcc88fbb5d9..a726dced178 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -141,17 +141,15 @@ DECLARE_SOA_TABLE(HfLcPolBkg, "AOD", "HFLCPOLBKG", charm_polarisation::Origin); } // namespace o2::aod - struct HfTaskCharmPolarisation { Produces rowCandLcBkg; - 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 +176,6 @@ 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)"}; - /// 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 +225,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 +241,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 +260,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 +295,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}; 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"); @@ -426,15 +437,57 @@ struct HfTaskCharmPolarisation { registry.add("hEulerPhiHelicity", "THn for polarisation studies with Euler phi w.r.t. helicity axis", HistType::kTHnSparseF, hEulerPhiAxes); } } + } else if (doprocessLcToPK0S || doprocessLcToPK0SMc || doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl) { + hHelicityaxes.insert(hHelicityaxes.end(), {thnAxisCosThetaStarHelicity}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl) { + hHelicityaxes.insert(hHelicityaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector hRecoHelicityAxes(hHelicityaxes); + if (doprocessLcToPK0SMc) { + hRecoHelicityAxes.insert(hRecoHelicityAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, 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, thnAxisCharge}); + registry.add("hHelicity", "THn for Lc->pK0S polarisation studies", HistType::kTHnSparseF, hHelicityaxes); + if (activateTHnEulerPhiMonitor) { + std::vector hEulerPhiAxes = {thnAxisInvMass, thnAxisPt, thnAxisTHnAxisEulerPhi}; + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl) { + hEulerPhiAxes.insert(hEulerPhiAxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + hEulerPhiAxes.push_back(thnAxisCharge); + if (doprocessLcToPK0SMcWithMl || 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) { - 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 (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + 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 (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); } } } @@ -500,15 +553,57 @@ struct HfTaskCharmPolarisation { registry.add("hEulerPhiProduction", "THn for polarisation studies with Euler phi w.r.t. production axis", HistType::kTHnSparseF, hEulerPhiAxes); } } + } else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { + hProductionaxes.insert(hProductionaxes.end(), {thnAxisCosThetaStarProduction}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl) { + hProductionaxes.insert(hProductionaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector hRecoProductionAxes(hProductionaxes); + if (doprocessLcToPK0SMc) { + hRecoProductionAxes.insert(hRecoProductionAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, 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, 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) { + hEulerPhiAxes.insert(hEulerPhiAxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + hEulerPhiAxes.push_back(thnAxisCharge); + if (doprocessLcToPK0SMcWithMl || 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) { - 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 (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + 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 (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); } } } @@ -573,15 +668,57 @@ struct HfTaskCharmPolarisation { registry.add("hEulerPhiBeam", "THn for polarisation studies with Euler phi w.r.t. beam axis", HistType::kTHnSparseF, hEulerPhiAxes); } } + } else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { + hBeamaxes.insert(hBeamaxes.end(), {thnAxisCosThetaStarBeam}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl) { + hBeamaxes.insert(hBeamaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector hRecoBeamAxes(hBeamaxes); + if (doprocessLcToPK0SMc) { + hRecoBeamAxes.insert(hRecoBeamAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, 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, 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) { + hEulerPhiAxes.insert(hEulerPhiAxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + hEulerPhiAxes.push_back(thnAxisCharge); + if (doprocessLcToPK0SMcWithMl || 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) { - 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); + + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + if (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); + } } } } @@ -635,19 +772,49 @@ 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); + } else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { + hRandomaxes.insert(hRandomaxes.end(), {thnAxisCosThetaStarRandom}); + if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl) { + hRandomaxes.insert(hRandomaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); + } + if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + std::vector hRecoRandomAxes(hRandomaxes); + if (doprocessLcToPK0SMc) { + hRecoRandomAxes.insert(hRecoRandomAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, 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, thnAxisCharge}); + registry.add("hRandom", "THn for Lc->pK0S polarisation studies with random axis", 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); + + if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || + doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || + 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); + } } - 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) { + 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); } } } @@ -771,6 +938,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) { // Lc+ -> pK0s + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, 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 +964,12 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } + + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -816,6 +994,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) { // Lc+ -> pK0s + 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 +1020,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) { // Lc+ -> pK0s + 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 +1048,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + 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 +1074,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + 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 +1105,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) { // Lc+ -> pK0s + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, 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 +1131,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -952,6 +1160,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) { // Lc+ -> pK0s + 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 +1186,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) { // Lc+ -> pK0s + 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 +1214,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + 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 +1240,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + 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 +1271,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) { // Lc+ -> pK0s + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, 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 +1297,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); + if (activateTHnEulerPhiMonitor) { + registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, phiEuler, charge); + } } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -1088,6 +1326,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) { // Lc+ -> pK0s + 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 +1352,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) { // Lc+ -> pK0s + 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 +1380,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + 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 +1406,11 @@ struct HfTaskCharmPolarisation { if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s + 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 +1434,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) { // Lc+ -> pK0s + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // without ML if constexpr (Channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ @@ -1194,6 +1454,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) { // Lc+ -> pK0s + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -1231,6 +1493,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) { // Lc+ -> pK0s + 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 +1529,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) { // Lc+ -> pK0s + 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 +1551,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) { // Lc+ -> pK0s + 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 +1571,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) { // Lc+ -> pK0s + registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } } @@ -1391,78 +1661,113 @@ 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 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 { // 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::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); + registry.fill(HIST("hGenPartRecoNonPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, 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); + } + } 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); + } } } } @@ -1496,7 +1801,7 @@ struct HfTaskCharmPolarisation { if (invMassMin < invMass && invMass < invMassMax) { return true; } - } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ (to be tuned!) + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi || Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ (to be tuned!) invMassMin = 2.25f; invMassMax = 2.35f; if (invMassMin < invMass && invMass < invMassMax) { @@ -1620,12 +1925,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 +1945,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}; @@ -1835,7 +2151,32 @@ struct HfTaskCharmPolarisation { continue; } - } // 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 +2200,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 +2240,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) { @@ -2178,6 +2530,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(); @@ -2210,7 +2573,7 @@ struct HfTaskCharmPolarisation { areDauInAcc = isDaughterInAcceptance(dauPartD0, 0.3, 0.8); } } - } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi || Channel == charm_polarisation::DecayChannel::LcToPK0S) { if (std::abs(dauPart.pdgCode()) == kProton) { pxDau = dauPart.px(); pyDau = dauPart.py(); @@ -2233,25 +2596,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 +2879,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, @@ -2546,6 +2909,27 @@ struct HfTaskCharmPolarisation { } } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPi, "Process Lc candidates without ML", false); + // Lc->pK0s with rectangular cuts + 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++; + } + } + 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, @@ -2573,6 +2957,27 @@ struct HfTaskCharmPolarisation { } } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiWithMl, "Process Lc candidates with ML", false); + // Lc->pK0s with ML cuts + 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++; + } + } + 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&, @@ -2606,6 +3011,37 @@ struct HfTaskCharmPolarisation { } } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiMc, "Process Lc candidates in MC without ML", false); + // Lc->pK0s in MC with rectangular cuts + 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&, @@ -2639,6 +3075,36 @@ struct HfTaskCharmPolarisation { } } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiMcWithMl, "Process Lc candidates in MC with ML", false); + // Lc->pK0s in MC with ML cuts + 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, @@ -2654,7 +3120,6 @@ struct HfTaskCharmPolarisation { } } PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPKPiBackgroundMcWithMl, "Process Lc candidates in MC with ML w/o mcCollision grouping", false); - // Event-plane resolution void processResolEventPlane(CollsWithQVecs::iterator const& collision, aod::BCsWithTimestamps const&)