56 if (
data.size() == 0) {
60 auto fillfunction = [
this](
int thread,
const gsl::span<const o2::emcal::Cell>&
data,
double minCellEnergy,
double minCellEnergyTime) {
61 LOG(
debug) <<
"filling in thread " << thread <<
" ncells = " <<
data.size();
62 auto& mCurrentHist = mHisto[thread];
63 auto& mCurrentHistTime = mHistoTime[thread];
64 unsigned int nEntries = 0;
65 for (
const auto& cell :
data) {
66 int id = cell.getTower();
67 double cellEnergy = cell.getEnergy();
69 if (mApplyGainCalib) {
70 LOG(
debug) <<
" gain calib factor for cell " <<
id <<
" = " << mArrGainCalibFactors[
id];
71 cellEnergy *= mArrGainCalibFactors[
id];
74 if (cellEnergy < minCellEnergy) {
75 LOG(
debug) <<
"skipping cell ID " <<
id <<
": with energy = " << cellEnergy <<
" below threshold of " << minCellEnergy;
79 LOG(
debug) <<
"inserting in cell ID " <<
id <<
": energy = " << cellEnergy;
80 mCurrentHist(cellEnergy,
id);
83 if (cellEnergy > minCellEnergyTime) {
84 double cellTime = cell.getTimeStamp();
85 LOG(
debug) <<
"inserting in cell ID " <<
id <<
": time = " << cellTime;
86 mCurrentHistTime(cellTime,
id);
89 mVecNEntriesInHisto[thread] += nEntries;
92 std::vector<gsl::span<const o2::emcal::Cell>> ranges(mNThreads);
93 auto size_per_thread =
static_cast<unsigned int>(std::ceil((
static_cast<float>(
data.size()) / mNThreads)));
94 unsigned int currentfirst = 0;
95 for (
int ithread = 0; ithread < mNThreads; ithread++) {
96 unsigned int nelements = std::min(size_per_thread,
static_cast<unsigned int>(
data.size() - 1 - currentfirst));
97 ranges[ithread] =
data.subspan(currentfirst, nelements);
98 currentfirst += nelements;
104#if (defined(WITH_OPENMP) && !defined(__CLING__))
105 LOG(
debug) <<
"Number of threads that will be used = " << mNThreads;
106#pragma omp parallel for num_threads(mNThreads)
108 LOG(
debug) <<
"OPEN MP will not be used for the bad channel calibration";
110 for (
int ithread = 0; ithread < mNThreads; ithread++) {
111 fillfunction(ithread, ranges[ithread], minCellEnergy, minCellEnergyTime);
116 for (
auto& nEntr : mVecNEntriesInHisto) {
117 mNEntriesInHisto += nEntr;