Project
Loading...
Searching...
No Matches
BadChannelsMap.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_PHOS_PHOSBADCHANNELSMAP_H_
12#define O2_PHOS_PHOSBADCHANNELSMAP_H_
13
14#include <iosfwd>
15#include <bitset>
16#include <Rtypes.h>
17
18class TH2;
19
20namespace o2
21{
22
23namespace phos
24{
25
56{
57 public:
59 BadChannelsMap() = default;
60
62 BadChannelsMap(const BadChannelsMap& another) = default;
63
66
68 ~BadChannelsMap() = default;
69
77 {
78 mBadCells |= rhs.mBadCells;
79 return *this;
80 }
81
86 bool operator==(const BadChannelsMap& other) const { return mBadCells == other.mBadCells; }
87
91 void addBadChannel(short channelID) { mBadCells.set(channelID - OFFSET); } //set bit to true
92
96 void setChannelGood(short channelID) { mBadCells.set(channelID - OFFSET, false); }
97
103 bool isChannelGood(short channelID) const { return !mBadCells.test(channelID - OFFSET); }
104
114 void getHistogramRepresentation(char mod, TH2* h) const;
115
125 void PrintStream(std::ostream& stream) const;
126
127 private:
128 static constexpr short NCHANNELS = 14337;
129 static constexpr short OFFSET = 1793;
130 std::bitset<NCHANNELS> mBadCells;
131
132 ClassDefNV(BadChannelsMap, 1);
133};
134
142std::ostream& operator<<(std::ostream& in, const BadChannelsMap& bcm);
143
144} // namespace phos
145
146} // namespace o2
147
148#endif /* O2_PHOS_PHOSBADCHANNELSMAP_H_ */
uint8_t channelID
Definition RawEventData.h:8
Class for time synchronization of RawReader instances.
CCDB container for bad (masked) channels in PHOS.
void setChannelGood(short channelID)
Mark channel as good.
void addBadChannel(short channelID)
Add bad cell to the container.
void getHistogramRepresentation(char mod, TH2 *h) const
Convert map into 2D histogram representation.
bool isChannelGood(short channelID) const
Get the status of a certain cell.
BadChannelsMap(const BadChannelsMap &another)=default
Constructor.
void PrintStream(std::ostream &stream) const
Print bad channels on a given stream.
~BadChannelsMap()=default
Destructor.
BadChannelsMap & operator+=(const BadChannelsMap &rhs)
Add bad channel map to this bad channel map.
bool operator==(const BadChannelsMap &other) const
Comparison of two bad channel maps.
BadChannelsMap()=default
Constructor.
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &in, const BadChannelsMap &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