CondFormats
L1TObjects
src
L1RPCHsbConfig.cc
Go to the documentation of this file.
1
#include "
CondFormats/L1TObjects/interface/L1RPCHsbConfig.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
4
L1RPCHsbConfig::L1RPCHsbConfig
() {}
5
6
L1RPCHsbConfig::~L1RPCHsbConfig
() {}
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
}
L1RPCHsbConfig::m_hsb1
int m_hsb1[8]
Definition:
L1RPCHsbConfig.h:37
mps_fire.i
i
Definition:
mps_fire.py:355
input
static const std::string input
Definition:
EdmProvDump.cc:48
L1RPCHsbConfig::getMaskSize
int getMaskSize() const
Definition:
L1RPCHsbConfig.h:33
L1RPCHsbConfig::setHsbMask
void setHsbMask(int hsb, const std::vector< int > &mask)
Definition:
L1RPCHsbConfig.cc:8
Exception
Definition:
hltDiff.cc:246
Exception.h
L1RPCHsbConfig::~L1RPCHsbConfig
virtual ~L1RPCHsbConfig()
Definition:
L1RPCHsbConfig.cc:6
L1RPCHsbConfig::L1RPCHsbConfig
L1RPCHsbConfig()
Definition:
L1RPCHsbConfig.cc:4
L1RPCHsbConfig::getHsbMask
int getHsbMask(int hsb, int input) const
Definition:
L1RPCHsbConfig.cc:30
L1RPCHsbConfig::m_hsb0
int m_hsb0[8]
Definition:
L1RPCHsbConfig.h:33
L1RPCHsbConfig.h
Generated for CMSSW Reference Manual by
1.8.16