From a72b3729ed600c564624056a8a2a5b674aeac458 Mon Sep 17 00:00:00 2001 From: xinxiang LIU Date: Thu, 2 Apr 2026 17:59:05 +0200 Subject: [PATCH 1/2] Add Lc->pK0s channel in polarization task. --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 812 +++++++++++++++++++--- 1 file changed, 704 insertions(+), 108 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index dcc88fbb5d9..e82ca8a0316 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -60,6 +60,7 @@ #include #include #include +#include using namespace o2; using namespace o2::aod; @@ -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,22 @@ 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 +162,35 @@ DECLARE_SOA_TABLE(HfLcPolBkg, "AOD", "HFLCPOLBKG", charm_polarisation::Charge, charm_polarisation::Origin); -} // namespace o2::aod +/// 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 +217,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"}; @@ -226,11 +266,13 @@ struct HfTaskCharmPolarisation { using TracksWithMcLabels = soa::Join; using TracksWithExtra = soa::Join; - using McParticlesDstarMatched = soa::Join; + 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 +284,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,10 +303,15 @@ 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"}; - ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.179f}, "#it{M} (GeV/#it{c}^{2})"}; // o2-linter: disable=pdg/explicit-mass (false positive) +ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.179f}, "#it{M} (GeV/#it{c}^{2})"}; // o2-linter: disable=pdg/explicit-mass (false positive) ConfigurableAxis configThnAxisPt{"configThnAxisPt", {100, 0.f, 100.f}, "#it{p}_{T} (GeV/#it{c})"}; ConfigurableAxis configThnAxisY{"configThnAxisY", {20, -1.f, 1.f}, "#it{y}"}; ConfigurableAxis configThnAxisCosThetaStarHelicity{"configThnAxisCosThetaStarHelicity", {20, -1.f, 1.f}, "cos(#vartheta_{helicity})"}; @@ -285,7 +338,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 +411,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,16 +480,63 @@ 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); } } + + } if (activateTHnSparseCosThStarProduction) { @@ -501,16 +601,63 @@ 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); + } + } + + } if (activateTHnSparseCosThStarBeam) { @@ -574,16 +721,62 @@ 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); + } + } + } + } if (activateTHnSparseCosThStarRandom) { @@ -636,18 +829,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 +949,7 @@ struct HfTaskCharmPolarisation { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); } + }; // end init /// \param invMassCharmHad is the invariant-mass of the candidate @@ -771,6 +997,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 +1023,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 +1053,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 +1079,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 +1107,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 +1133,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 +1164,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 +1190,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 +1219,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 +1245,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 +1273,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 +1299,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 +1330,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 +1356,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 +1385,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 +1411,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 +1439,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 +1465,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); + } } } } @@ -1177,6 +1494,9 @@ 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*+ if (activateTrackingSys) { @@ -1194,6 +1514,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 +1553,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 +1589,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 +1611,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 +1631,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,11 +1721,22 @@ 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) - { - if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity - if (origin == RecoDecay::OriginType::Prompt) { // prompt + 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) { + 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 { @@ -1405,69 +1746,117 @@ struct HfTaskCharmPolarisation { 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); + 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 + } + } 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 { // Dstar or Lc->pKpi + if (origin == RecoDecay::OriginType::Prompt) { if (!isPartRecoDstar) { - registry.fill(HIST("hGenPromptProduction"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + 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); + 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); + 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); + 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 + } + } 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 { // Dstar or Lc->pKpi + if (origin == RecoDecay::OriginType::Prompt) { if (!isPartRecoDstar) { - registry.fill(HIST("hGenPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); + 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); + 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); + 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); + registry.fill(HIST("hGenPartRecoNonPromptBeam"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } } - } else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Random) { // Random + } + } 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); + 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); + registry.fill(HIST("hGenPromptRandom"), 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); + 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); + 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("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); + registry.fill(HIST("hGenNonPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } } else { if (doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb) { - registry.fill(HIST("hGenPartRecoNonPromptRandom"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge, centrality); + 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); + registry.fill(HIST("hGenPartRecoNonPromptRandom"), ptCharmHad, numPvContributors, + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, resoChannelLc, charge); } } } } } +} /// \param numPvContributors is the number of PV contributors /// \param nCands is the number of candidates associated to a collision @@ -1502,6 +1891,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; @@ -1619,26 +2014,38 @@ struct HfTaskCharmPolarisation { massHypoMcTruth = charm_polarisation::MassHyposLcToPKPi::PKPi; } 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 { + + }else { /// data if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { /// Calculate the electric charge from reconstructed daughter tracks /// 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 +2243,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,21 +2292,28 @@ struct HfTaskCharmPolarisation { if (!isCandidateInSignalRegion) { // it could be that only one mass hypothesis is in signal region isCandidateInSignalRegion = isInSignalRegion(invMassCharmHadForSparse); } - - float absEtaTrackMin{-1.f}; + 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 trackProng2 = candidate.template prongPi_as(); - getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); - } else if (Channel == charm_polarisation::DecayChannel::LcToPKPi) { - auto trackProng2 = candidate.template prong2_as(); - getTrackingInfos(std::vector{trackProng0, trackProng1, trackProng2}, absEtaTrackMin, numItsClsMin, numTpcClsMin); + 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 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); + } } - } // helicity ROOT::Math::XYZVector const helicityVec = fourVecMother.Vect(); @@ -1892,7 +2332,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 +2559,6 @@ struct HfTaskCharmPolarisation { } // end table for Lc->pKpi background studies } /// end loop over mass hypotheses - return isCandidateInSignalRegion; } @@ -2178,8 +2621,20 @@ 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(); if (std::abs(rapidity) > 1.f) { // we do not keep particles with |y| > 1 return; @@ -2219,7 +2674,17 @@ 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); + } } + } float const phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); @@ -2233,25 +2698,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 +2981,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, @@ -2531,22 +2996,48 @@ struct HfTaskCharmPolarisation { auto groupedLcCandidates = lcCandidates.sliceBy(lcToPKPiPerCollision, 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); - } - } + 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, 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 +3065,33 @@ 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, @@ -2581,7 +3099,7 @@ struct HfTaskCharmPolarisation { FilteredCandLcToPKPiWSelFlagAndMc const& lcCandidates, TracksWithExtra const& tracks) { - int numPvContributorsGen{0}; + 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(); @@ -2607,6 +3125,38 @@ 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 +3190,37 @@ 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 +3236,21 @@ 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&) From 0a7fa1d4f0388673b87081bc86671f9aadee5e82 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 2 Apr 2026 16:05:52 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 596 +++++++++++----------- 1 file changed, 288 insertions(+), 308 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index e82ca8a0316..9467cea4acc 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -58,9 +58,9 @@ #include #include #include +#include #include #include -#include using namespace o2; using namespace o2::aod; @@ -98,7 +98,7 @@ enum MassHyposLcToPK0S : uint8_t { PK0S = 0, K0SP, NMassHypoLcToPK0S -}; +}; enum QvecEstimator : uint8_t { FV0A = 0, FT0M, @@ -124,14 +124,13 @@ 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(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(MassK0S, massK0S, float); DECLARE_SOA_COLUMN(BdtBkgScoreK0S, bdtBkgScoreK0S, float); DECLARE_SOA_COLUMN(BdtNonPromptScoreK0S, bdtNonPromptScoreK0S, float); DECLARE_SOA_COLUMN(IsRealPK0S, isRealPK0S, int8_t); @@ -162,7 +161,6 @@ 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", @@ -183,14 +181,14 @@ DECLARE_SOA_TABLE(HfLcK0SPolBkg, "AOD", "HFLCK0SPOLBKG", } // namespace o2::aod struct HfTaskCharmPolarisation { Produces rowCandLcBkg; - Produces rowCandLcK0SBkg; + 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 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))"}; @@ -217,7 +215,7 @@ 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. + /// 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 { @@ -266,13 +264,13 @@ struct HfTaskCharmPolarisation { using TracksWithMcLabels = soa::Join; using TracksWithExtra = soa::Join; - using McParticlesDstarMatched = soa::Join; + 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 CandLcToPK0SWSelFlag = soa::Join; using FilteredCandDstarWSelFlag = soa::Filtered; using FilteredCandDstarWSelFlagAndMl = soa::Filtered>; @@ -284,8 +282,8 @@ struct HfTaskCharmPolarisation { using FilteredCandLcToPKPiWSelFlagAndMc = soa::Filtered>; using FilteredCandLcToPKPiWSelFlagAndMcAndMl = soa::Filtered>; - using FilteredCandLcToPK0SWSelFlag = soa::Filtered; - using FilteredCandLcToPK0SWSelFlagAndMl = soa::Filtered>; + using FilteredCandLcToPK0SWSelFlag = soa::Filtered; + using FilteredCandLcToPK0SWSelFlagAndMl = soa::Filtered>; using FilteredCandLcToPK0SWSelFlagAndMc = soa::Filtered>; using FilteredCandLcToPK0SWSelFlagAndMcAndMl = soa::Filtered>; @@ -303,7 +301,7 @@ struct HfTaskCharmPolarisation { Preslice lcToPKPiWithMcPerCollision = aod::hf_cand::collisionId; Preslice lcToPKPiWithMcAndMlPerCollision = aod::hf_cand::collisionId; - Preslice lcToPK0SPerCollision = 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; @@ -311,7 +309,7 @@ struct HfTaskCharmPolarisation { PresliceUnsorted colPerMcCollision = aod::mcparticle::mcCollisionId; ConfigurableAxis configTHnAxisEulerPhi{"configTHnAxisEulerPhi", {24, -o2::constants::math::PI, o2::constants::math::PI}, "Euler polar angle #phi"}; -ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.179f}, "#it{M} (GeV/#it{c}^{2})"}; // o2-linter: disable=pdg/explicit-mass (false positive) + ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.179f}, "#it{M} (GeV/#it{c}^{2})"}; // o2-linter: disable=pdg/explicit-mass (false positive) ConfigurableAxis configThnAxisPt{"configThnAxisPt", {100, 0.f, 100.f}, "#it{p}_{T} (GeV/#it{c})"}; ConfigurableAxis configThnAxisY{"configThnAxisY", {20, -1.f, 1.f}, "#it{y}"}; ConfigurableAxis configThnAxisCosThetaStarHelicity{"configThnAxisCosThetaStarHelicity", {20, -1.f, 1.f}, "cos(#vartheta_{helicity})"}; @@ -339,7 +337,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 { /// check process functions - std::array processes = {doprocessDstar, doprocessDstarWithMl, doprocessLcToPKPi, doprocessLcToPKPiWithMl, doprocessDstarMc, doprocessDstarMcWithMl, doprocessLcToPKPiMc, doprocessLcToPKPiMcWithMl, doprocessLcToPKPiBackgroundMcWithMl, doprocessDstarInPbPb, doprocessDstarWithMlInPbPb, doprocessDstarMcInPbPb, doprocessDstarMcWithMlInPbPb,doprocessLcToPK0S, doprocessLcToPK0SWithMl, doprocessLcToPK0SMc, doprocessLcToPK0SMcWithMl, doprocessLcToPK0SBackgroundMcWithMl}; + 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"); @@ -481,7 +479,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } - else if (doprocessLcToPK0S || doprocessLcToPK0SMc || doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { + else if (doprocessLcToPK0S || doprocessLcToPK0SMc || doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { hHelicityaxes.insert(hHelicityaxes.end(), {thnAxisCosThetaStarHelicity}); if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { hHelicityaxes.insert(hHelicityaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); @@ -513,10 +511,9 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } - if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || - doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; @@ -535,8 +532,6 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 registry.add("hGenNonPromptHelicity", "Generated non-prompt Lc->pK0S, helicity axis", HistType::kTHnSparseF, hgenNonPromptAxesLcToPK0S); } } - - } if (activateTHnSparseCosThStarProduction) { @@ -602,8 +597,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } - - else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { + else if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0S || doprocessLcToPK0SMc) { hProductionaxes.insert(hProductionaxes.end(), {thnAxisCosThetaStarProduction}); if (doprocessLcToPK0SWithMl || doprocessLcToPK0SMcWithMl || doprocessLcToPK0SBackgroundMcWithMl) { hProductionaxes.insert(hProductionaxes.end(), {thnAxisMlBkg, thnAxisMlNonPrompt}); @@ -637,7 +631,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl || - doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { + doprocessLcToPK0SBackgroundMcWithMl || doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) { if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { std::vector const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarProduction, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge}; @@ -656,8 +650,6 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 registry.add("hGenNonPromptProduction", "Generated non-prompt Lc->pK0S, production axis", HistType::kTHnSparseF, hgenNonPromptAxesLcToPK0S); } } - - } if (activateTHnSparseCosThStarBeam) { @@ -722,61 +714,59 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } - 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); - } - } + 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 || - 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); - } - } + 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 (activateTHnSparseCosThStarRandom) { @@ -848,7 +838,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { @@ -949,7 +939,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); } - + }; // end init /// \param invMassCharmHad is the invariant-mass of the candidate @@ -997,7 +987,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); @@ -1023,7 +1013,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { @@ -1053,10 +1043,10 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); + registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } else { // non-prompt @@ -1079,10 +1069,10 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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); + } 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); + registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } @@ -1107,7 +1097,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1133,7 +1123,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1164,7 +1154,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); @@ -1190,7 +1180,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1219,7 +1209,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); @@ -1245,7 +1235,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); @@ -1273,7 +1263,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1299,7 +1289,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1330,7 +1320,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); @@ -1356,7 +1346,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1385,7 +1375,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); @@ -1411,7 +1401,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 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) { + } 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); @@ -1439,7 +1429,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1465,7 +1455,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hRecNonPromptEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, resoChannelLc, charge); } - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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); @@ -1493,8 +1483,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } 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) { + } 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 @@ -1514,7 +1503,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } 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) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); } } @@ -1553,7 +1542,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } 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) { + } 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 @@ -1589,7 +1578,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } 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) { + } 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); } } @@ -1611,7 +1600,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } 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) { + } 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 @@ -1631,7 +1620,7 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 } } 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) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } @@ -1722,141 +1711,141 @@ ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {200, 0.139f, 0.17 /// \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) -{ - 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); + 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) { + 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) { - 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 { // Dstar or Lc->pKpi - if (origin == RecoDecay::OriginType::Prompt) { - if (!isPartRecoDstar) { + } 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, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoPromptProduction"), ptCharmHad, numPvContributors, - std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } - } else { // non-prompt - if (!isPartRecoDstar) { + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, charge); + } else { // non-prompt 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); + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, 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) { - 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 { // Dstar or Lc->pKpi - if (origin == RecoDecay::OriginType::Prompt) { - if (!isPartRecoDstar) { + } 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, resoChannelLc, charge); - } else { - registry.fill(HIST("hGenPartRecoPromptBeam"), ptCharmHad, numPvContributors, - std::abs(rapCharmHad), cosThetaStar, areDausInAcc, resoChannelLc, charge); - } - } else { // non-prompt - if (!isPartRecoDstar) { + std::abs(rapCharmHad), cosThetaStar, areDausInAcc, charge); + } else { // non-prompt 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); + std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, 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 { // 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, + 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); + } } } } } } -} /// \param numPvContributors is the number of PV contributors /// \param nCands is the number of candidates associated to a collision @@ -1891,7 +1880,7 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f if (invMassMin < invMass && invMass < invMassMax) { return true; } - } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { invMassMin = 2.25f; invMassMax = 2.35f; if (invMassMin < invMass && invMass < invMassMax) { @@ -2014,35 +2003,34 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f massHypoMcTruth = charm_polarisation::MassHyposLcToPKPi::PKPi; } 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 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 { + + } else { /// data if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) { /// Calculate the electric charge from reconstructed daughter tracks /// Lc charge == first daughter charge auto trackProng0 = candidate.template prong0_as(); charge = static_cast(trackProng0.sign()); - }else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } 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()); + auto trackProng0 = candidate.template prong0_as(); + charge = static_cast(trackProng0.sign()); } } - // loop over mass hypotheses for (uint8_t iMass = 0u; iMass < nMassHypos; iMass++) { @@ -2243,20 +2231,20 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f } } // Lc->pKpi - else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { if (bkgRotationId > 0) { - continue; + continue; } if constexpr (WithMl) { - if (candidate.mlProbLcToK0sP().size() == NScores) { - outputMl[0] = candidate.mlProbLcToK0sP()[0]; - outputMl[1] = candidate.mlProbLcToK0sP()[1]; - outputMl[2] = candidate.mlProbLcToK0sP()[2]; - } + 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(); + std::array twoVecK0s = candidate.pVectorProng1(); pxCharmHad = twoVecProton[0] + twoVecK0s[0]; pyCharmHad = twoVecProton[1] + twoVecK0s[1]; pzCharmHad = twoVecProton[2] + twoVecK0s[2]; @@ -2265,7 +2253,7 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f pzDau = twoVecProton[2]; massDau = MassProton; invMassCharmHad = RecoDecay::m(std::array{twoVecProton, twoVecK0s}, - std::array{MassProton, MassK0Short}); + std::array{MassProton, MassK0Short}); invMassCharmHadForSparse = invMassCharmHad; rapidity = RecoDecay::y(std::array{pxCharmHad, pyCharmHad, pzCharmHad}, MassLambdaCPlus); } @@ -2292,28 +2280,28 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f if (!isCandidateInSignalRegion) { // it could be that only one mass hypothesis is in signal region isCandidateInSignalRegion = isInSignalRegion(invMassCharmHadForSparse); } - float absEtaTrackMin{-1.f}; + float absEtaTrackMin{-1.f}; int numItsClsMin{-1}, numTpcClsMin{-1}; if (activateTrackingSys) { 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 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 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 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); - } + auto trackPiPlus = candidate.template posTrack_as(); + auto trackPiMinus = candidate.template negTrack_as(); + getTrackingInfos(std::vector{trackProton, trackPiPlus, trackPiMinus}, + absEtaTrackMin, numItsClsMin, numTpcClsMin); } + } // helicity ROOT::Math::XYZVector const helicityVec = fourVecMother.Vect(); @@ -2335,7 +2323,7 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f if constexpr (Channel != charm_polarisation::DecayChannel::LcToPK0S) { nMuons = candidate.nTracksDecayed(); } else { - nMuons = 0; + nMuons = 0; } } @@ -2621,10 +2609,10 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f /// 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) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { if (std::abs(mcParticle.flagMcMatchGen()) != 1) { - return; - } + return; + } origin = mcParticle.originMcGen(); std::array const dauPdgs = {kProton, kK0Short}; RecoDecay::getDaughters(mcParticle, &listDaughters, dauPdgs, 2); @@ -2634,7 +2622,6 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f charge = static_cast(pdgCode / std::abs(pdgCode)); } - float const rapidity = mcParticle.y(); if (std::abs(rapidity) > 1.f) { // we do not keep particles with |y| > 1 return; @@ -2674,7 +2661,7 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f if (areDauInAcc) { areDauInAcc = isDaughterInAcceptance(dauPart, 0.3, 0.8); } - } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { + } else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { if (std::abs(dauPart.pdgCode()) == kProton) { pxDau = dauPart.px(); pyDau = dauPart.py(); @@ -2684,7 +2671,6 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f areDauInAcc = isDaughterInAcceptance(dauPart, 0.3, 0.8); } } - } float const phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); @@ -2996,47 +2982,46 @@ void fillGenHistos(float ptCharmHad, int numPvContributors, float rapCharmHad, f auto groupedLcCandidates = lcCandidates.sliceBy(lcToPKPiPerCollision, 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); - } - } + 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, processLcToPKPi, "Process Lc candidates without ML", false); -void processLcToPK0S(aod::Collisions const& collisions, + 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++; + { + 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); - } + nCandsInSignalRegion++; } - fillMultHistos(numPvContributors, nCands, 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); + PROCESS_SWITCH(HfTaskCharmPolarisation, processLcToPK0S, "Process Lc PK0s candidates without ML", false); // Lc->pKpi with ML cuts void processLcToPKPiWithMl(aod::Collisions const& collisions, @@ -3065,11 +3050,10 @@ void processLcToPK0S(aod::Collisions const& collisions, } 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(); @@ -3091,7 +3075,6 @@ void processLcToPK0S(aod::Collisions const& collisions, } 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, @@ -3099,7 +3082,7 @@ void processLcToPK0S(aod::Collisions const& collisions, FilteredCandLcToPKPiWSelFlagAndMc const& lcCandidates, TracksWithExtra const& tracks) { - int numPvContributorsGen{0}; + 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(); @@ -3130,7 +3113,7 @@ void processLcToPK0S(aod::Collisions const& collisions, 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(); @@ -3156,7 +3139,6 @@ void processLcToPK0S(aod::Collisions const& collisions, } 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, @@ -3220,7 +3202,6 @@ void processLcToPK0S(aod::Collisions const& collisions, } 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, @@ -3239,7 +3220,7 @@ void processLcToPK0S(aod::Collisions const& collisions, void processLcToPK0SBackgroundMcWithMl(McParticlesCascadeMatched const& mcParticles, FilteredCandLcToPK0SWSelFlagAndMcAndMl const& lcCandidates, TracksWithMcLabels const& tracks) - { + { for (const auto& lcCandidate : lcCandidates) { runPolarisationAnalysis(lcCandidate, 0, /*numPvContributors*/ -1, mcParticles, tracks); } @@ -3250,7 +3231,6 @@ void processLcToPK0S(aod::Collisions const& collisions, } 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&)