From 49656256818f95800f2500553a6d0fb4caf0dae7 Mon Sep 17 00:00:00 2001 From: Rrantu Date: Mon, 23 Nov 2026 14:40:26 +0100 Subject: [PATCH 1/2] PWGHF: Store interaction rate in UPC Lc output tables --- PWGHF/D2H/Tasks/taskUpcLc.cxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskUpcLc.cxx b/PWGHF/D2H/Tasks/taskUpcLc.cxx index 915e7a19e6a..f4528d42ae1 100644 --- a/PWGHF/D2H/Tasks/taskUpcLc.cxx +++ b/PWGHF/D2H/Tasks/taskUpcLc.cxx @@ -74,8 +74,8 @@ namespace full DECLARE_SOA_COLUMN(M, m, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); -DECLARE_SOA_COLUMN(RunNumber, runNumber, int32_t); //! Run number of the collision -DECLARE_SOA_COLUMN(HasLcCandidate, hasLcCandidate, bool); //! At least one selected Lc candidate within the task rapidity acceptance +DECLARE_SOA_COLUMN(InteractionRate, interactionRate, float); //! Hadronic interaction rate (kHz), -1 for MC or unavailable rate +DECLARE_SOA_COLUMN(HasLcCandidate, hasLcCandidate, bool); //! At least one selected Lc candidate within the task rapidity acceptance DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); DECLARE_SOA_COLUMN(PtProng2, ptProng2, float); @@ -102,13 +102,13 @@ DECLARE_SOA_TABLE(HfUpcQa, "AOD", "HFUPCQA", full::ZdcTimeZNA, full::ZdcTimeZNC, full::HasLcCandidate, - full::RunNumber); + full::InteractionRate); DECLARE_SOA_TABLE(HfUpcLcBdtInfos, "AOD", "HFUPCLCBDTINFOS", full::M, full::Pt, full::BkgScore, - full::RunNumber); + full::InteractionRate); DECLARE_SOA_TABLE(HfUpcLcInfos, "AOD", "HFUPCLCINFOS", full::M, @@ -341,12 +341,16 @@ struct HfTaskUpcLc { registry.fill(HIST("Data/hUpcMulti"), multNTracksPV); registry.fill(HIST("Data/hUpcVtz"), posZ); + float interactionRate = -1.f; if constexpr (!IsMc) { - if (fillHistQa) { + if (FillMl || fillTreeUpcQa || fillHistQa) { const double rate = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); if (rate >= 0.) { - const auto runLabel = std::to_string(bc.runNumber()); - registry.get(HIST("Data/hInteractionRateVsRun"))->Fill(runLabel.c_str(), rate * 1.e-3, 1.); // Hz to kHz + interactionRate = rate * 1.e-3; // Hz to kHz + if (fillHistQa) { + const auto runLabel = std::to_string(bc.runNumber()); + registry.get(HIST("Data/hInteractionRateVsRun"))->Fill(runLabel.c_str(), interactionRate, 1.); + } } } } @@ -397,7 +401,7 @@ struct HfTaskUpcLc { outputBkg = mlProb[MlClassBackground]; /// bkg score } /// Fill the ML outputScores and variables of candidate - rowCandUpcBdt(massLc, pt, outputBkg, bc.runNumber()); + rowCandUpcBdt(massLc, pt, outputBkg, interactionRate); } else { rowCandUpc(massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa); @@ -413,7 +417,7 @@ struct HfTaskUpcLc { } if (fillTreeUpcQa) { // One QA row per selected collision, including collisions without Lc candidates. - rowUpcQa(numPvContributors, multNTracksPV, posZ, fitInfo.ampFT0A, fitInfo.ampFT0C, zdcTimeZNA, zdcTimeZNC, hasLcCandidate, bc.runNumber()); + rowUpcQa(numPvContributors, multNTracksPV, posZ, fitInfo.ampFT0A, fitInfo.ampFT0C, zdcTimeZNA, zdcTimeZNC, hasLcCandidate, interactionRate); } } } From 8048a49d1d6d3f18c601769bc521fdfd764ffa7b Mon Sep 17 00:00:00 2001 From: Rrantu Date: Mon, 23 Nov 2026 15:00:54 +0100 Subject: [PATCH 2/2] PWGHF: Fetch UPC Lc interaction rate independently of histogram filling --- PWGHF/D2H/Tasks/taskUpcLc.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskUpcLc.cxx b/PWGHF/D2H/Tasks/taskUpcLc.cxx index f4528d42ae1..e4361e552c9 100644 --- a/PWGHF/D2H/Tasks/taskUpcLc.cxx +++ b/PWGHF/D2H/Tasks/taskUpcLc.cxx @@ -343,14 +343,12 @@ struct HfTaskUpcLc { float interactionRate = -1.f; if constexpr (!IsMc) { - if (FillMl || fillTreeUpcQa || fillHistQa) { - const double rate = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); - if (rate >= 0.) { - interactionRate = rate * 1.e-3; // Hz to kHz - if (fillHistQa) { - const auto runLabel = std::to_string(bc.runNumber()); - registry.get(HIST("Data/hInteractionRateVsRun"))->Fill(runLabel.c_str(), interactionRate, 1.); - } + const double rate = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); + if (rate >= 0.) { + interactionRate = rate * 1.e-3; // Hz to kHz + if (fillHistQa) { + const auto runLabel = std::to_string(bc.runNumber()); + registry.get(HIST("Data/hInteractionRateVsRun"))->Fill(runLabel.c_str(), interactionRate, 1.); } } }