From dbf77fb1812862ca6c5a8c27d392c2aac5f118c5 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Tue, 14 Apr 2026 18:13:05 +0200 Subject: [PATCH 1/7] replace THnSparse with TTree --- PWGHF/D2H/Tasks/taskLc.cxx | 61 ++++++++++++-------------------------- PWGHF/Utils/utilsUpcHf.h | 61 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 42 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index e7144cf505d..1fa8c62b343 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -111,6 +111,9 @@ struct HfTaskLc { Preslice candLcPerCollision = aod::hf_cand::collisionId; PresliceUnsorted colPerMcCollision = aod::mcparticle::mcCollisionId; + Produces rowCandUpcBdt; + Produces rowCandUpc; + ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {72, 0, 36}, ""}; ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {300, 1.98, 2.58}, ""}; ConfigurableAxis thnConfigAxisPtProng{"thnConfigAxisPtProng", {100, 0, 20}, ""}; @@ -128,10 +131,6 @@ struct HfTaskLc { ConfigurableAxis thnConfigAxisOccupancy{"thnConfigAxisOccupancy", {14, 0, 14000}, "axis for centrality"}; ConfigurableAxis thnConfigAxisProperLifetime{"thnConfigAxisProperLifetime", {200, 0, 2}, "Proper lifetime, ps"}; ConfigurableAxis thnConfigAxisGapType{"thnConfigAxisGapType", {7, -1.5, 5.5}, "axis for UPC gap type (see TrueGap enum in o2::aod::sgselector)"}; - ConfigurableAxis thnConfigAxisFV0A{"thnConfigAxisFV0A", {1001, -1.5, 999.5}, "axis for FV0-A amplitude (a.u.)"}; - ConfigurableAxis thnConfigAxisFT0{"thnConfigAxisFT0", {1001, -1.5, 999.5}, "axis for FT0 amplitude (a.u.)"}; - ConfigurableAxis thnConfigAxisZN{"thnConfigAxisZN", {510, -1.5, 49.5}, "axis for ZN energy (a.u.)"}; - ConfigurableAxis thnConfigAxisZNTime{"thnConfigAxisZNTime", {200, -10, 10}, "axis for ZN energy (a.u.)"}; HistogramRegistry registry{"registry", {}}; HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -293,27 +292,17 @@ struct HfTaskLc { const AxisSpec thnAxisTracklets{thnConfigAxisNumPvContr, "Number of PV contributors"}; const AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; const AxisSpec thnAxisProperLifetime{thnConfigAxisProperLifetime, "T_{proper} (ps)"}; - const AxisSpec thnAxisFV0A{thnConfigAxisFV0A, "FV0-A amplitude"}; - const AxisSpec thnAxisFT0A{thnConfigAxisFT0, "FT0-A amplitude"}; - const AxisSpec thnAxisFT0C{thnConfigAxisFT0, "FT0-C amplitude"}; - const AxisSpec thnAxisZNA{thnConfigAxisZN, "ZNA energy"}; - const AxisSpec thnAxisZNC{thnConfigAxisZN, "ZNC energy"}; - const AxisSpec thnAxisZNATime{thnConfigAxisZNTime, "ZNA time"}; - const AxisSpec thnAxisZNCTime{thnConfigAxisZNTime, "ZNC time"}; bool const isDataWithMl = doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M || doprocessDataWithMlWithUpc; bool const isMcWithMl = doprocessMcWithMl || doprocessMcWithMlWithFT0C || doprocessMcWithMlWithFT0M; bool const isDataStd = doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M || doprocessDataStdWithUpc; bool const isMcStd = doprocessMcStd || doprocessMcStdWithFT0C || doprocessMcStdWithFT0M; - std::vector axesStd, axesWithBdt, axesGen, axesUpc, axesUpcWithBdt; + std::vector axesStd, axesWithBdt, axesGen; if (isDataStd && !isUpc) { axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets}; } - if (isDataStd && isUpc) { - axesUpc = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; - } if (isMcStd) { axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; } @@ -323,9 +312,6 @@ struct HfTaskLc { if (isDataWithMl && !isUpc) { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets}; } - if (isDataWithMl && isUpc) { - axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; - } if (isMcWithMl) { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; } @@ -344,25 +330,20 @@ struct HfTaskLc { } } } - if (isUpc) { - if (isDataStd) { - registry.add("hnLcUpcVars", "THn for Lambdac candidates for Data in UPC", HistType::kTHnSparseF, axesUpc); - } else if (isDataWithMl) { - registry.add("hnLcUpcVarsWithBdt", "THn for Lambdac candidates with BDT scores for data in UPC", HistType::kTHnSparseF, axesUpcWithBdt); + if (!isUpc) { + if (isDataWithMl) { + registry.add("hnLcVarsWithBdt", "THn for Lambdac candidates with BDT scores for data with ML", HistType::kTHnSparseF, axesWithBdt); + } else if (isMcWithMl) { + registry.add("hnLcVarsWithBdt", "THn for Lambdac candidates with BDT scores for mc with ML", HistType::kTHnSparseF, axesWithBdt); + registry.add("hnLcVarsGen", "THn for Generated Lambdac", HistType::kTHnSparseF, axesGen); + } else if (isDataStd) { + registry.add("hnLcVars", "THn for Reconstructed Lambdac candidates for data without ML", HistType::kTHnSparseF, axesStd); + } else { + registry.add("hnLcVars", "THn for Reconstructed Lambdac candidates for mc without ML", HistType::kTHnSparseF, axesStd); + registry.add("hnLcVarsGen", "THn for Generated Lambdac", HistType::kTHnSparseF, axesGen); } - } else if (isDataWithMl) { - registry.add("hnLcVarsWithBdt", "THn for Lambdac candidates with BDT scores for data with ML", HistType::kTHnSparseF, axesWithBdt); - } else if (isMcWithMl) { - registry.add("hnLcVarsWithBdt", "THn for Lambdac candidates with BDT scores for mc with ML", HistType::kTHnSparseF, axesWithBdt); - registry.add("hnLcVarsGen", "THn for Generated Lambdac", HistType::kTHnSparseF, axesGen); - } else if (isDataStd) { - registry.add("hnLcVars", "THn for Reconstructed Lambdac candidates for data without ML", HistType::kTHnSparseF, axesStd); - } else { - registry.add("hnLcVars", "THn for Reconstructed Lambdac candidates for mc without ML", HistType::kTHnSparseF, axesStd); - registry.add("hnLcVarsGen", "THn for Generated Lambdac", HistType::kTHnSparseF, axesGen); } } - if (isUpc) { hfEvSel.addHistograms(qaRegistry); // collision monitoring } @@ -821,23 +802,19 @@ struct HfTaskLc { /// Fill the ML outputScores and variables of candidate if (fillUPCTHnLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { - std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; - registry.get(HIST("hnLcUpcVarsWithBdt"))->Fill(valuesToFill.data()); + rowCandUpcBdt(massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); } } else { - std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; - registry.get(HIST("hnLcUpcVarsWithBdt"))->Fill(valuesToFill.data()); + rowCandUpcBdt(massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); } } else { if (fillUPCTHnLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { - std::vector valuesToFill{massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; - registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); + rowCandUpc(massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); } } else { - std::vector valuesToFill{massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; - registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); + rowCandUpc(massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); } } }; diff --git a/PWGHF/Utils/utilsUpcHf.h b/PWGHF/Utils/utilsUpcHf.h index f30d99b5598..90d23d50843 100644 --- a/PWGHF/Utils/utilsUpcHf.h +++ b/PWGHF/Utils/utilsUpcHf.h @@ -27,6 +27,67 @@ #include #include +using namespace o2::framework; +using namespace o2::aod; +namespace o2::aod +{ +namespace full +{ +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); +DECLARE_SOA_COLUMN(PromptScore, promptScore, float); +DECLARE_SOA_COLUMN(FDScore, fDScore, float); +DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); +DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); +DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); +DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); +DECLARE_SOA_COLUMN(CPA, cpa, float); +DECLARE_SOA_COLUMN(PvContributors, pvContributors, float); +DECLARE_SOA_COLUMN(AmpFV0A, ampFV0A, float); +DECLARE_SOA_COLUMN(AmpFT0A, ampFT0A, float); +DECLARE_SOA_COLUMN(AmpFT0C, ampFT0C, float); +DECLARE_SOA_COLUMN(ZdcEnergyZNA, zdcEnergyZNA, float); +DECLARE_SOA_COLUMN(ZdcEnergyZNC, zdcEnergyZNC, float); +DECLARE_SOA_COLUMN(ZdcTimeZNA, zdcTimeZNA, float); +DECLARE_SOA_COLUMN(ZdcTimeZNC, zdcTimeZNC, float); +} // namespace full + +DECLARE_SOA_TABLE(HfUpcLcBdtInfos, "AOD", "HFUPCLCBDTINFOS", + full::M, + full::Pt, + full::BkgScore, + full::PromptScore, + full::FDScore, + full::PvContributors, + full::AmpFV0A, + full::AmpFT0A, + full::AmpFT0C, + full::ZdcEnergyZNA, + full::ZdcEnergyZNC, + full::ZdcTimeZNA, + full::ZdcTimeZNC); + +DECLARE_SOA_TABLE(HfUpcLcInfos, "AOD", "HFUPCLCINFOS", + full::M, + full::Pt, + full::PtProng0, + full::PtProng1, + full::PtProng2, + full::Chi2PCA, + full::DecayLength, + full::CPA, + full::PvContributors, + full::AmpFV0A, + full::AmpFT0A, + full::AmpFT0C, + full::ZdcEnergyZNA, + full::ZdcEnergyZNC, + full::ZdcTimeZNA, + full::ZdcTimeZNC); +} // namespace o2::aod + namespace o2::analysis::hf_upc { From 49e7fa00158af2eb6ecc701ab54e98cbe5599366 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Tue, 14 Apr 2026 18:29:45 +0200 Subject: [PATCH 2/7] fix format --- PWGHF/Utils/utilsUpcHf.h | 67 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/PWGHF/Utils/utilsUpcHf.h b/PWGHF/Utils/utilsUpcHf.h index 90d23d50843..4d7b3c5bf80 100644 --- a/PWGHF/Utils/utilsUpcHf.h +++ b/PWGHF/Utils/utilsUpcHf.h @@ -27,13 +27,12 @@ #include #include -using namespace o2::framework; -using namespace o2::aod; + namespace o2::aod { namespace full { -DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(M, m, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); DECLARE_SOA_COLUMN(PromptScore, promptScore, float); @@ -43,8 +42,8 @@ DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); DECLARE_SOA_COLUMN(DecayLength, decayLength, float); -DECLARE_SOA_COLUMN(CPA, cpa, float); -DECLARE_SOA_COLUMN(PvContributors, pvContributors, float); +DECLARE_SOA_COLUMN(CPA, cPA, float); +DECLARE_SOA_COLUMN(PvContributors, pvContributors, float); DECLARE_SOA_COLUMN(AmpFV0A, ampFV0A, float); DECLARE_SOA_COLUMN(AmpFT0A, ampFT0A, float); DECLARE_SOA_COLUMN(AmpFT0C, ampFT0C, float); @@ -55,37 +54,37 @@ DECLARE_SOA_COLUMN(ZdcTimeZNC, zdcTimeZNC, float); } // namespace full DECLARE_SOA_TABLE(HfUpcLcBdtInfos, "AOD", "HFUPCLCBDTINFOS", - full::M, - full::Pt, - full::BkgScore, - full::PromptScore, - full::FDScore, - full::PvContributors, - full::AmpFV0A, - full::AmpFT0A, - full::AmpFT0C, - full::ZdcEnergyZNA, - full::ZdcEnergyZNC, - full::ZdcTimeZNA, - full::ZdcTimeZNC); + full::M, + full::Pt, + full::BkgScore, + full::PromptScore, + full::FDScore, + full::PvContributors, + full::AmpFV0A, + full::AmpFT0A, + full::AmpFT0C, + full::ZdcEnergyZNA, + full::ZdcEnergyZNC, + full::ZdcTimeZNA, + full::ZdcTimeZNC); DECLARE_SOA_TABLE(HfUpcLcInfos, "AOD", "HFUPCLCINFOS", - full::M, - full::Pt, - full::PtProng0, - full::PtProng1, - full::PtProng2, - full::Chi2PCA, - full::DecayLength, - full::CPA, - full::PvContributors, - full::AmpFV0A, - full::AmpFT0A, - full::AmpFT0C, - full::ZdcEnergyZNA, - full::ZdcEnergyZNC, - full::ZdcTimeZNA, - full::ZdcTimeZNC); + full::M, + full::Pt, + full::PtProng0, + full::PtProng1, + full::PtProng2, + full::Chi2PCA, + full::DecayLength, + full::CPA, + full::PvContributors, + full::AmpFV0A, + full::AmpFT0A, + full::AmpFT0C, + full::ZdcEnergyZNA, + full::ZdcEnergyZNC, + full::ZdcTimeZNA, + full::ZdcTimeZNC); } // namespace o2::aod namespace o2::analysis::hf_upc From 4a06d14747c307018669bab1aff5f30eced3e419 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Wed, 15 Apr 2026 14:31:02 +0200 Subject: [PATCH 3/7] fix format issue --- PWGHF/D2H/Tasks/taskLc.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 1fa8c62b343..fe3fb588651 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -73,6 +73,9 @@ using namespace o2::analysis::hf_upc; /// Λc± → p± K∓ π± analysis task struct HfTaskLc { + Produces rowCandUpcBdt; + Produces rowCandUpc; + Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen particle rapidity"}; Configurable yCandRecoMax{"yCandRecoMax", 0.8, "max. cand. rapidity"}; @@ -111,9 +114,6 @@ struct HfTaskLc { Preslice candLcPerCollision = aod::hf_cand::collisionId; PresliceUnsorted colPerMcCollision = aod::mcparticle::mcCollisionId; - Produces rowCandUpcBdt; - Produces rowCandUpc; - ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {72, 0, 36}, ""}; ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {300, 1.98, 2.58}, ""}; ConfigurableAxis thnConfigAxisPtProng{"thnConfigAxisPtProng", {100, 0, 20}, ""}; From ad50d9a47365feec6fc530903b30a5d2c180da01 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Wed, 15 Apr 2026 14:35:53 +0200 Subject: [PATCH 4/7] fix clang format --- PWGHF/Utils/utilsUpcHf.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/Utils/utilsUpcHf.h b/PWGHF/Utils/utilsUpcHf.h index 4d7b3c5bf80..25737dce9f2 100644 --- a/PWGHF/Utils/utilsUpcHf.h +++ b/PWGHF/Utils/utilsUpcHf.h @@ -27,7 +27,6 @@ #include #include - namespace o2::aod { namespace full From 2b5d84133e604f3ff158167b9ef281d041c2bbf3 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Wed, 15 Apr 2026 15:56:20 +0200 Subject: [PATCH 5/7] Move column definitions to the task --- PWGHF/D2H/Tasks/taskLc.cxx | 65 ++++++++++++++++++++++++++++++++++++-- PWGHF/Utils/utilsUpcHf.h | 59 ---------------------------------- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index fe3fb588651..578b112afe1 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -71,6 +71,65 @@ using namespace o2::hf_occupancy; using namespace o2::hf_evsel; using namespace o2::analysis::hf_upc; +namespace o2::aod +{ +namespace full +{ +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); +DECLARE_SOA_COLUMN(PromptScore, promptScore, float); +DECLARE_SOA_COLUMN(FDScore, fDScore, float); +DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); +DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); +DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); +DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); +DECLARE_SOA_COLUMN(CPA, cPA, float); +DECLARE_SOA_COLUMN(PvContributors, pvContributors, float); +DECLARE_SOA_COLUMN(AmpFV0A, ampFV0A, float); +DECLARE_SOA_COLUMN(AmpFT0A, ampFT0A, float); +DECLARE_SOA_COLUMN(AmpFT0C, ampFT0C, float); +DECLARE_SOA_COLUMN(ZdcEnergyZNA, zdcEnergyZNA, float); +DECLARE_SOA_COLUMN(ZdcEnergyZNC, zdcEnergyZNC, float); +DECLARE_SOA_COLUMN(ZdcTimeZNA, zdcTimeZNA, float); +DECLARE_SOA_COLUMN(ZdcTimeZNC, zdcTimeZNC, float); +} // namespace full + +DECLARE_SOA_TABLE(HfUpcLcBdtInfos, "AOD", "HFUPCLCBDTINFOS", + full::M, + full::Pt, + full::BkgScore, + full::PromptScore, + full::FDScore, + full::PvContributors, + full::AmpFV0A, + full::AmpFT0A, + full::AmpFT0C, + full::ZdcEnergyZNA, + full::ZdcEnergyZNC, + full::ZdcTimeZNA, + full::ZdcTimeZNC); + +DECLARE_SOA_TABLE(HfUpcLcInfos, "AOD", "HFUPCLCINFOS", + full::M, + full::Pt, + full::PtProng0, + full::PtProng1, + full::PtProng2, + full::Chi2PCA, + full::DecayLength, + full::CPA, + full::PvContributors, + full::AmpFV0A, + full::AmpFT0A, + full::AmpFT0C, + full::ZdcEnergyZNA, + full::ZdcEnergyZNC, + full::ZdcTimeZNA, + full::ZdcTimeZNC); +} // namespace o2::aod + /// Λc± → p± K∓ π± analysis task struct HfTaskLc { Produces rowCandUpcBdt; @@ -82,7 +141,7 @@ struct HfTaskLc { Configurable> binsPt{"binsPt", std::vector{hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits"}; // ThnSparse for ML outputScores and Vars Configurable fillTHn{"fillTHn", false, "fill THn"}; - Configurable fillUPCTHnLite{"fillUPCTHnLite", false, "fill THn"}; + Configurable fillUPCTreeLite{"fillUPCTreeLite", false, "fill THn"}; Configurable storeOccupancy{"storeOccupancy", true, "Flag to store occupancy information"}; Configurable occEstimator{"occEstimator", 2, "Occupancy estimation (None: 0, ITS: 1, FT0C: 2)"}; Configurable storeProperLifetime{"storeProperLifetime", false, "Flag to store proper lifetime"}; @@ -800,7 +859,7 @@ struct HfTaskLc { outputFD = mlProb[MlClassNonPrompt]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate - if (fillUPCTHnLite) { + if (fillUPCTreeLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { rowCandUpcBdt(massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); } @@ -809,7 +868,7 @@ struct HfTaskLc { } } else { - if (fillUPCTHnLite) { + if (fillUPCTreeLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { rowCandUpc(massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); } diff --git a/PWGHF/Utils/utilsUpcHf.h b/PWGHF/Utils/utilsUpcHf.h index 25737dce9f2..f30d99b5598 100644 --- a/PWGHF/Utils/utilsUpcHf.h +++ b/PWGHF/Utils/utilsUpcHf.h @@ -27,65 +27,6 @@ #include #include -namespace o2::aod -{ -namespace full -{ -DECLARE_SOA_COLUMN(M, m, float); -DECLARE_SOA_COLUMN(Pt, pt, float); -DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); -DECLARE_SOA_COLUMN(PromptScore, promptScore, float); -DECLARE_SOA_COLUMN(FDScore, fDScore, float); -DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); -DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); -DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); -DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); -DECLARE_SOA_COLUMN(DecayLength, decayLength, float); -DECLARE_SOA_COLUMN(CPA, cPA, float); -DECLARE_SOA_COLUMN(PvContributors, pvContributors, float); -DECLARE_SOA_COLUMN(AmpFV0A, ampFV0A, float); -DECLARE_SOA_COLUMN(AmpFT0A, ampFT0A, float); -DECLARE_SOA_COLUMN(AmpFT0C, ampFT0C, float); -DECLARE_SOA_COLUMN(ZdcEnergyZNA, zdcEnergyZNA, float); -DECLARE_SOA_COLUMN(ZdcEnergyZNC, zdcEnergyZNC, float); -DECLARE_SOA_COLUMN(ZdcTimeZNA, zdcTimeZNA, float); -DECLARE_SOA_COLUMN(ZdcTimeZNC, zdcTimeZNC, float); -} // namespace full - -DECLARE_SOA_TABLE(HfUpcLcBdtInfos, "AOD", "HFUPCLCBDTINFOS", - full::M, - full::Pt, - full::BkgScore, - full::PromptScore, - full::FDScore, - full::PvContributors, - full::AmpFV0A, - full::AmpFT0A, - full::AmpFT0C, - full::ZdcEnergyZNA, - full::ZdcEnergyZNC, - full::ZdcTimeZNA, - full::ZdcTimeZNC); - -DECLARE_SOA_TABLE(HfUpcLcInfos, "AOD", "HFUPCLCINFOS", - full::M, - full::Pt, - full::PtProng0, - full::PtProng1, - full::PtProng2, - full::Chi2PCA, - full::DecayLength, - full::CPA, - full::PvContributors, - full::AmpFV0A, - full::AmpFT0A, - full::AmpFT0C, - full::ZdcEnergyZNA, - full::ZdcEnergyZNC, - full::ZdcTimeZNA, - full::ZdcTimeZNC); -} // namespace o2::aod - namespace o2::analysis::hf_upc { From d1704b240578da5e855c2f7245d9eb9ca78650e8 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Wed, 15 Apr 2026 16:25:37 +0200 Subject: [PATCH 6/7] fix column names --- PWGHF/D2H/Tasks/taskLc.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 578b112afe1..6268addbfa8 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -79,13 +79,13 @@ DECLARE_SOA_COLUMN(M, m, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); DECLARE_SOA_COLUMN(PromptScore, promptScore, float); -DECLARE_SOA_COLUMN(FDScore, fDScore, float); +DECLARE_SOA_COLUMN(FdScore, fdScore, float); DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); DECLARE_SOA_COLUMN(DecayLength, decayLength, float); -DECLARE_SOA_COLUMN(CPA, cPA, float); +DECLARE_SOA_COLUMN(Cpa, cpa, float); DECLARE_SOA_COLUMN(PvContributors, pvContributors, float); DECLARE_SOA_COLUMN(AmpFV0A, ampFV0A, float); DECLARE_SOA_COLUMN(AmpFT0A, ampFT0A, float); @@ -101,7 +101,7 @@ DECLARE_SOA_TABLE(HfUpcLcBdtInfos, "AOD", "HFUPCLCBDTINFOS", full::Pt, full::BkgScore, full::PromptScore, - full::FDScore, + full::FdScore, full::PvContributors, full::AmpFV0A, full::AmpFT0A, @@ -119,7 +119,7 @@ DECLARE_SOA_TABLE(HfUpcLcInfos, "AOD", "HFUPCLCINFOS", full::PtProng2, full::Chi2PCA, full::DecayLength, - full::CPA, + full::Cpa, full::PvContributors, full::AmpFV0A, full::AmpFT0A, From e3210c9e68beb70d8b77f2dc2fe983988c7a5bb8 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Wed, 15 Apr 2026 18:20:34 +0200 Subject: [PATCH 7/7] rename Configurable --- PWGHF/D2H/Tasks/taskLc.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 6268addbfa8..35173d01aa0 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -141,7 +141,7 @@ struct HfTaskLc { Configurable> binsPt{"binsPt", std::vector{hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits"}; // ThnSparse for ML outputScores and Vars Configurable fillTHn{"fillTHn", false, "fill THn"}; - Configurable fillUPCTreeLite{"fillUPCTreeLite", false, "fill THn"}; + Configurable fillTreeOnlySingleGap{"fillTreeOnlySingleGap", false, "fill THn"}; Configurable storeOccupancy{"storeOccupancy", true, "Flag to store occupancy information"}; Configurable occEstimator{"occEstimator", 2, "Occupancy estimation (None: 0, ITS: 1, FT0C: 2)"}; Configurable storeProperLifetime{"storeProperLifetime", false, "Flag to store proper lifetime"}; @@ -859,7 +859,7 @@ struct HfTaskLc { outputFD = mlProb[MlClassNonPrompt]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate - if (fillUPCTreeLite) { + if (fillTreeOnlySingleGap) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { rowCandUpcBdt(massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); } @@ -868,7 +868,7 @@ struct HfTaskLc { } } else { - if (fillUPCTreeLite) { + if (fillTreeOnlySingleGap) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { rowCandUpc(massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)); }