Project
Loading...
Searching...
No Matches
BadChannelMap.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#ifndef O2_CPV_CPVBADCHANNELSMAP_H_
12#define O2_CPV_CPVBADCHANNELSMAP_H_
13
14#include <iosfwd>
15#include <bitset>
16#include <Rtypes.h>
17#include <CCDB/TObjectWrapper.h> // Needed to trigger dictionary build
18
19class TH2;
20
21namespace o2
22{
23
24namespace cpv
25{
26
57{
58 public:
60 BadChannelMap() = default;
61
63 BadChannelMap(short test);
64
66 ~BadChannelMap() = default;
67
75 {
76 mBadCells |= rhs.mBadCells;
77 return *this;
78 }
79
84 bool operator==(const BadChannelMap& other) const { return mBadCells == other.mBadCells; }
85
97 void addBadChannel(unsigned short channelID)
98 {
99 if (channelID < NCHANNELS) {
100 mBadCells.set(channelID);
101 }
102 } //set bit to true
103
108 void setChannelGood(unsigned short channelID)
109 {
110 if (channelID < NCHANNELS) {
111 mBadCells.set(channelID, false);
112 }
113 }
114
120 bool isChannelGood(unsigned short channelID) const { return !mBadCells.test(channelID); }
121
131 void getHistogramRepresentation(short mod, TH2* h) const;
132
142 void PrintStream(std::ostream& stream) const;
143
144 private:
145 static constexpr unsigned short NCHANNELS = 23040;
146 std::bitset<NCHANNELS> mBadCells;
147
148 ClassDefNV(BadChannelMap, 1);
149};
150
158std::ostream& operator<<(std::ostream& in, const BadChannelMap& bcm);
159
160} // namespace cpv
161
162} // namespace o2
163
164#endif /* O2_CPV_CPVBADCHANNELSMAP_H_ */
uint8_t channelID
Definition RawEventData.h:8
Class for time synchronization of RawReader instances.
CCDB container for bad (masked) channels in CPV.
void getHistogramRepresentation(short mod, TH2 *h) const
Convert map into 2D histogram representation.
BadChannelMap & operator+=(const BadChannelMap &rhs)
Add bad channel map to this bad channel map.
void PrintStream(std::ostream &stream) const
Print bad channels on a given stream.
bool operator==(const BadChannelMap &other) const
Comparison of two bad channel maps.
bool isChannelGood(unsigned short channelID) const
Get the status of a certain cell.
void setChannelGood(unsigned short channelID)
Mark channel as good.
void addBadChannel(unsigned short channelID)
Add bad cell to the container.
~BadChannelMap()=default
Destructor.
BadChannelMap()=default
Constructor.
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &in, const BadChannelMap &bcm)
Printing bad channel map on the stream.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.
VectorOfTObjectPtrs other