Project
Loading...
Searching...
No Matches
ChannelMasksHandler.h
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#ifndef O2_MID_CHANNELMASKSHANDLER_H
17#define O2_MID_CHANNELMASKSHANDLER_H
18
19#include <cstdint>
20#include <vector>
21#include <unordered_map>
23
24namespace o2
25{
26namespace mid
27{
28
30{
31 public:
38 void switchOffChannel(uint8_t deId, uint8_t columnId, int lineId, int strip, int cathode);
39
42 void switchOffChannels(const ColumnData& badChannels);
43
46 void switchOffChannels(const std::vector<ColumnData>& badChannelsList);
47
51
54 void setFromChannelMasks(const std::vector<ColumnData>& masks);
55
59 bool applyMask(ColumnData& data) const;
60
63 void merge(const std::vector<ColumnData>& masks);
64
66 std::vector<ColumnData> getMasks() const;
67
69 const std::unordered_map<uint16_t, ColumnData>& getMasksMap() const { return mMasks; }
70
72 bool operator==(const ChannelMasksHandler& right) const { return mMasks == right.mMasks; }
73
75 void clear() { mMasks.clear(); }
76
77 private:
82 ColumnData& getMask(uint8_t deId, uint8_t columnId);
83
84 std::unordered_map<uint16_t, ColumnData> mMasks{};
85};
86
87} // namespace mid
88} // namespace o2
89
90#endif /* O2_MID_CHANNELMASKSHANDLER_H */
Strip pattern (aka digits)
std::vector< ColumnData > getMasks() const
Gets the masks.
void switchOffChannel(uint8_t deId, uint8_t columnId, int lineId, int strip, int cathode)
void switchOffChannels(const ColumnData &badChannels)
void setFromChannelMask(const ColumnData &mask)
void setFromChannelMasks(const std::vector< ColumnData > &masks)
const std::unordered_map< uint16_t, ColumnData > & getMasksMap() const
Returns the masks map.
bool operator==(const ChannelMasksHandler &right) const
Comparison operator.
bool applyMask(ColumnData &data) const
void merge(const std::vector< ColumnData > &masks)
GLdouble GLdouble right
Definition glcorearb.h:4077
GLboolean * data
Definition glcorearb.h:298
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Column data structure for MID.
Definition ColumnData.h:29