Project
Loading...
Searching...
No Matches
ChannelCalibrator.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
18
19#include <iostream>
20#include <sstream>
23
24namespace o2
25{
26namespace mid
27{
28
30
31void CalibData::fill(const gsl::span<const ColumnData> data)
32{
33 for (auto& col : data) {
34 mChannelScalers.count(col);
35 }
36}
37
38void CalibData::merge(const CalibData* prev)
39{
40 mChannelScalers.merge(prev->mChannelScalers);
41}
42
44{
45 std::cout << mChannelScalers;
46}
47
49{
50 mBadChannels.clear();
51 mTimeOrTriggers = 0;
52}
53
55{
56 // MID calibration occurs on a dedicated run.
57 // We therefore collect the full statistics and compute the masks only at the end of run.
58 // So we return true here
59 return true;
60}
61
62Slot& ChannelCalibrator::emplaceNewSlot(bool front, TFType tstart, TFType tend)
63{
64 auto& cont = getSlots();
65 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
66 slot.setContainer(std::make_unique<CalibData>());
67 return slot;
68}
69
71{
72 o2::mid::CalibData* calibData = slot.getContainer();
73 LOG(info) << "Finalize slot " << slot.getTFStart() << " <= TF <= " << slot.getTFEnd();
74
75 // Keep track of last TimeFrame, since the masks will be valid from now on
76 mBadChannels = makeBadChannels(calibData->getScalers(), mTimeOrTriggers, mThreshold);
77}
78
79} // namespace mid
80} // namespace o2
MID noise and dead channels calibrator.
Utils and constants for calibration and related workflows.
Function to produce the MID masks.
uint32_t col
Definition RawData.h:4
TFType getTFEnd() const
Definition TimeSlot.h:47
const Container * getContainer() const
Definition TimeSlot.h:53
TFType getTFStart() const
Definition TimeSlot.h:46
const ChannelScalers & getScalers()
Gets the channel scalers.
void fill(const gsl::span< const ColumnData > data)
void merge(const CalibData *prev)
void print()
Prints scalers.
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) final
void initOutput() final
Initialize the output.
void finalizeSlot(Slot &slot) final
bool hasEnoughData(const Slot &slot) const final
void merge(const ChannelScalers &other)
Merges two counters.
void count(const ColumnData &patterns)
GLboolean * data
Definition glcorearb.h:298
std::vector< ColumnData > makeBadChannels(const ChannelScalers &scalers, double timeOrTriggers, double threshold)
Definition MaskMaker.cxx:30
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"