Skip to content

Commit bd619d0

Browse files
committed
Avoid filling a vector just to count the bits
1 parent 531ea81 commit bd619d0

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

DataFormats/Detectors/CTP/src/CTPRateFetcher.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ double CTPRateFetcher::pileUpCorrection(double triggerRate)
233233
if (mLHCIFdata.getFillNumber() == 0) {
234234
LOG(fatal) << "No filling" << std::endl;
235235
}
236-
auto bfilling = mLHCIFdata.getBunchFilling();
237-
std::vector<int> bcs = bfilling.getFilledBCs();
238-
double nbc = bcs.size();
236+
double nbc = mLHCIFdata.getBunchFilling().getPattern().count();
239237
double nTriggersPerFilledBC = triggerRate / nbc / constants::lhc::LHCRevFreq;
240238
double mu = -std::log(1 - nTriggersPerFilledBC);
241239
return mu * nbc * constants::lhc::LHCRevFreq;

0 commit comments

Comments
 (0)