Project
Loading...
Searching...
No Matches
CrateMasks.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_CRATEMASKS_H
17#define O2_MID_CRATEMASKS_H
18
19#include <cstdint>
20#include <array>
21#include "CrateParameters.h"
22
23namespace o2
24{
25namespace mid
26{
28{
29 public:
30 CrateMasks();
31 CrateMasks(const char* filename);
32 ~CrateMasks() = default;
33
34 // Tests if the board in the feeId is active
35 bool isActive(int iboard, uint8_t feeId) const { return mActiveBoards[feeId] & (1 << iboard); };
36
38 void setActiveBoards(uint16_t feeId, uint8_t mask) { mActiveBoards[feeId] = mask; }
39
41 uint8_t getMask(uint16_t feeId) const { return mActiveBoards[feeId]; }
42
43 void write(const char* filename) const;
44
45 private:
46 bool load(const char* filename);
47 std::array<uint16_t, crateparams::sNGBTs> mActiveBoards;
48};
49
50} // namespace mid
51} // namespace o2
52
53#endif /* O2_MID_CRATEMASKS_H */
MID RO crate parameters.
bool isActive(int iboard, uint8_t feeId) const
Definition CrateMasks.h:35
void write(const char *filename) const
uint8_t getMask(uint16_t feeId) const
Gets the mask for the feeId.
Definition CrateMasks.h:41
void setActiveBoards(uint16_t feeId, uint8_t mask)
Sets the active boards in the feeId.
Definition CrateMasks.h:38
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string filename()