83 if (
data.size() == 0) {
86 auto fillfunction = [
this](
int thread,
const gsl::span<const o2::emcal::Cell>
data,
double minCellEnergy) {
87 LOG(
debug) <<
"filling in thread " << thread <<
" ncells = " <<
data.size();
88 auto& mCurrentHist = mTimeHisto[thread];
89 unsigned int nEntries = 0;
90 for (
auto cell :
data) {
91 double cellEnergy = cell.getEnergy();
92 double cellTime = cell.getTimeStamp();
93 int id = cell.getTower();
94 if (mApplyGainCalib) {
98 if (cellEnergy > minCellEnergy) {
99 LOG(
debug) <<
"inserting in cell ID " <<
id <<
": cellTime = " << cellTime;
100 mCurrentHist(cellTime,
id);
104 mVecNEntriesInHisto[thread] += nEntries;
107 std::vector<gsl::span<const o2::emcal::Cell>> ranges(mNThreads);
108 auto size_per_thread =
static_cast<unsigned int>(std::ceil((
static_cast<float>(
data.size()) / mNThreads)));
109 unsigned int currentfirst = 0;
110 for (
int ithread = 0; ithread < mNThreads; ithread++) {
111 unsigned int nelements = std::min(size_per_thread,
static_cast<unsigned int>(
data.size() - 1 - currentfirst));
112 ranges[ithread] =
data.subspan(currentfirst, nelements);
113 currentfirst += nelements;
114 LOG(
debug) <<
"currentfirst " << currentfirst <<
" nelements " << nelements;
119#if (defined(WITH_OPENMP) && !defined(__CLING__))
120 LOG(
debug) <<
"Number of threads that will be used = " << mNThreads;
121#pragma omp parallel for num_threads(mNThreads)
123 LOG(
debug) <<
"OPEN MP will not be used for the bad channel calibration";
125 for (
int ithread = 0; ithread < mNThreads; ithread++) {
126 fillfunction(ithread, ranges[ithread], minCellEnergy);
131 for (
auto& nEntr : mVecNEntriesInHisto) {
132 mNEntriesInHisto += nEntr;