Skip to content

Commit 2225baf

Browse files
authored
MCH: adapt calls to avoid deprecated O2 MCH functions (#1064)
1 parent 2abf15a commit 2225baf

2 files changed

Lines changed: 18 additions & 22 deletions

File tree

Modules/MUON/MCH/include/MCH/PedestalsTask.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "MCHRawElecMap/Mapper.h"
2222
#include "MCH/GlobalHistogram.h"
2323
#include "Framework/DataRef.h"
24-
#include "MCHCalibration/MCHChannelCalibrator.h"
24+
#include "MCHCalibration/PedestalData.h"
2525

2626
class TH1F;
2727
class TH2F;
@@ -56,7 +56,7 @@ class PedestalsTask final : public TaskInterface
5656
o2::mch::raw::Elec2DetMapper mElec2DetMapper;
5757

5858
/// helper class that performs the actual computation of the pedestals from the input digits
59-
o2::mch::calibration::PedestalProcessor mPedestalProcessor;
59+
o2::mch::calibration::PedestalData mPedestalData;
6060

6161
TH2F* mHistogramPedestals;
6262
TH2F* mHistogramNoise;

Modules/MUON/MCH/src/PedestalsTask.cxx

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "MCHMappingInterface/Segmentation.h"
3131
#include "MCHMappingInterface/CathodeSegmentation.h"
3232
#include "MCHRawElecMap/Mapper.h"
33+
#include "MCHCalibration/PedestalChannel.h"
3334
#ifdef MCH_HAS_MAPPING_FACTORY
3435
#include "MCHMappingFactory/CreateSegmentation.h"
3536
#endif
@@ -303,13 +304,12 @@ void PedestalsTask::PlotPedestalDE(uint16_t solarID, uint8_t dsID, uint8_t chann
303304
void PedestalsTask::monitorDataPedestals(o2::framework::ProcessingContext& ctx)
304305
{
305306
ILOG(Info, Support) << "Plotting pedestals" << AliceO2::InfoLogger::InfoLogger::endm;
306-
using ChannelPedestal = o2::mch::calibration::MCHChannelCalibrator::ChannelPedestal;
307307

308-
auto pedestals = ctx.inputs().get<gsl::span<ChannelPedestal>>("pedestals");
308+
auto pedestals = ctx.inputs().get<gsl::span<o2::mch::calibration::PedestalChannel>>("pedestals");
309309
for (auto& p : pedestals) {
310-
auto dsChID = p.mDsChId;
311-
double mean = p.mPedMean;
312-
double rms = p.mPedRms;
310+
auto dsChID = p.dsChannelId;
311+
double mean = p.mPedestal;
312+
double rms = p.getRms();
313313

314314
auto solarID = dsChID.getSolarId();
315315
auto dsID = dsChID.getDsId();
@@ -322,23 +322,19 @@ void PedestalsTask::monitorDataPedestals(o2::framework::ProcessingContext& ctx)
322322
void PedestalsTask::monitorDataDigits(o2::framework::ProcessingContext& ctx)
323323
{
324324
auto digits = ctx.inputs().get<gsl::span<o2::mch::calibration::PedestalDigit>>("digits");
325-
mPedestalProcessor.process(digits);
325+
mPedestalData.fill(digits);
326326

327-
auto pedestals = mPedestalProcessor.getPedestals();
328-
for (auto& p : pedestals) {
329-
auto& pMat = p.second;
330-
for (size_t dsId = 0; dsId < pMat.size(); dsId++) {
331-
auto& pRow = pMat[dsId];
332-
for (size_t ch = 0; ch < pRow.size(); ch++) {
333-
auto& pRecord = pRow[ch];
334-
335-
if (pRecord.mEntries == 0) {
336-
continue;
337-
}
327+
for (auto& p : mPedestalData) {
338328

339-
PlotPedestal(p.first, dsId, ch, pRecord.mPedestal, pRecord.getRms());
340-
}
329+
if (p.mEntries == 0) {
330+
continue;
341331
}
332+
333+
PlotPedestal(p.dsChannelId.getSolarId(),
334+
p.dsChannelId.getDsId(),
335+
p.dsChannelId.getChannel(),
336+
p.mPedestal,
337+
p.getRms());
342338
}
343339
}
344340

@@ -375,7 +371,7 @@ void PedestalsTask::reset()
375371
// clean all the monitor objects here
376372

377373
ILOG(Info, Support) << "Reseting the histogram" << AliceO2::InfoLogger::InfoLogger::endm;
378-
mPedestalProcessor.reset();
374+
mPedestalData.reset();
379375
}
380376

381377
} // namespace muonchambers

0 commit comments

Comments
 (0)