CMS 3D CMS Logo

L1RPCHsbConfig.cc
Go to the documentation of this file.
3 
5 
7 
8 void L1RPCHsbConfig::setHsbMask(int hsb, const std::vector<int>& mask) {
9  if (getMaskSize() != int(mask.size())) {
10  throw cms::Exception("L1RPCHsbConfig::setHsbMask")
11  << "Wrong size of hsb mask " << mask.size() << " " << getMaskSize() << "\n";
12  }
13 
14  if (hsb != 0 && hsb != 1) {
15  throw cms::Exception("L1RPCHsbConfig::getHsbMask") << "Wrong hsb index: " << hsb << "\n";
16  }
17  if (hsb == 0) {
18  for (int i = 0; i < getMaskSize(); ++i) {
19  m_hsb0[i] = mask[i];
20  }
21  }
22 
23  if (hsb == 1) {
24  for (int i = 0; i < getMaskSize(); ++i) {
25  m_hsb1[i] = mask[i];
26  }
27  }
28 }
29 
30 int L1RPCHsbConfig::getHsbMask(int hsb, int input) const {
31  if (input < 0 || input >= int(sizeof(m_hsb0) / (sizeof(m_hsb0[0])))) {
32  throw cms::Exception("L1RPCHsbConfig::getHsbMask") << "Wrong hsb input index: " << input << "\n";
33  }
34  if (hsb == 0) {
35  return m_hsb0[input];
36  } else if (hsb == 1) {
37  return m_hsb1[input];
38  } else {
39  throw cms::Exception("L1RPCHsbConfig::getHsbMask") << "Wrong hsb index: " << hsb << "\n";
40  }
41 
42  return -1;
43 }
void setHsbMask(int hsb, const std::vector< int > &mask)
constexpr uint32_t mask
Definition: gpuClustering.h:26
static std::string const input
Definition: EdmProvDump.cc:50
int getHsbMask(int hsb, int input) const
int getMaskSize() const
virtual ~L1RPCHsbConfig()