28void BadChannelCalibrator::initOutput()
30 mPedestalsVector.clear();
31 mBadChannelsVector.clear();
34bool BadChannelCalibrator::readyToSend(std::string& reason)
const
41 LOGP(error,
"nslots={} while it is expected to be 1", nslots);
48 reason =
"enough statistics";
54void BadChannelCalibrator::finalize()
59 LOGP(fatal,
"nslots={} while it is expected to be 1", nslots);
66bool BadChannelCalibrator::hasEnoughData(
const Slot& slot)
const
70 auto nofChannels = pedData->
size();
73 auto nofCalibrated = std::count_if(pedData->
cbegin(), pedData->
cend(),
76 bool hasEnough = nofCalibrated > requiredChannels;
79 "nofChannelWithEnoughStat(>{})={} nofChannels={} requiredChannels={} hasEnough={}",
80 minNofEntries, nofCalibrated, nofChannels, requiredChannels, hasEnough);
85void BadChannelCalibrator::finalizeSlot(
Slot& slot)
91 mPedestalsVector.clear();
92 mBadChannelsVector.clear();
102 for (
const auto& ped : *pedestalData) {
103 if (ped.mEntries == 0) {
106 mPedestalsVector.emplace_back(ped);
108 if (ped.mPedestal < pedestalThreshold) {
109 if (ped.getRms() < noiseThreshold) {
115 mBadChannelsVector.emplace_back(ped.dsChannelId);
121 BadChannelCalibrator::emplaceNewSlot(
bool front, TFType tstart, TFType tend)
124 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
125 slot.setContainer(std::make_unique<PedestalData>());
MCH calibrator to produce a bad channel map, using pedestal data.
Utils and constants for calibration and related workflows.
const Slot & getFirstSlot() const
const Container * getContainer() const
TFType getTFStart() const
static const BadChannelCalibratorParam & Instance()
void finalizeSlot(Slot &slot) final
bool hasEnoughData(const Slot &slot) const final
Compute and store the mean and RMS of the pedestal digit amplitudes.
const_iterator cend() const
const_iterator cbegin() const
Pedestal mean and sigma for one channel.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"