From 872cc825353530f5fb075fbc50f2112d3d49b079 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 26 May 2026 14:40:39 +0200 Subject: [PATCH] Avoid filling a vector just to count the bits --- DataFormats/Detectors/CTP/src/CTPRateFetcher.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DataFormats/Detectors/CTP/src/CTPRateFetcher.cxx b/DataFormats/Detectors/CTP/src/CTPRateFetcher.cxx index 5f31fe5741240..939203d168604 100644 --- a/DataFormats/Detectors/CTP/src/CTPRateFetcher.cxx +++ b/DataFormats/Detectors/CTP/src/CTPRateFetcher.cxx @@ -233,9 +233,7 @@ double CTPRateFetcher::pileUpCorrection(double triggerRate) if (mLHCIFdata.getFillNumber() == 0) { LOG(fatal) << "No filling" << std::endl; } - auto bfilling = mLHCIFdata.getBunchFilling(); - std::vector bcs = bfilling.getFilledBCs(); - double nbc = bcs.size(); + double nbc = mLHCIFdata.getBunchFilling().getPattern().count(); double nTriggersPerFilledBC = triggerRate / nbc / constants::lhc::LHCRevFreq; double mu = -std::log(1 - nTriggersPerFilledBC); return mu * nbc * constants::lhc::LHCRevFreq;