DataFormats
RPCDigi
src
RPCDigiL1Link.cc
Go to the documentation of this file.
1
#include "
DataFormats/RPCDigi/interface/RPCDigiL1Link.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
4
RPCDigiL1Link::RPCDigiL1Link
() {
5
for
(
unsigned
int
i
= 0;
i
< 7;
i
++) {
6
std::pair<unsigned int, int>
c
(0, 0);
7
_link
.push_back(
c
);
8
}
9
}
10
11
RPCDigiL1Link::~RPCDigiL1Link
() {}
12
13
bool
RPCDigiL1Link::empty
()
const
{
14
bool
e
=
true
;
15
for
(
unsigned
int
l
= 1;
l
<= 6;
l
++) {
16
if
(!this->
empty
(
l
))
17
e =
false
;
18
}
19
return
e
;
20
}
21
22
bool
RPCDigiL1Link::empty
(
unsigned
int
layer)
const
{
23
this->
checklayer
(layer);
24
return
this->
rawdetId
(layer) == 0;
25
}
26
27
unsigned
int
RPCDigiL1Link::rawdetId
(
unsigned
int
layer)
const
{
28
this->
checklayer
(layer);
29
return
_link
[layer - 1].first;
30
}
31
32
int
RPCDigiL1Link::strip
(
unsigned
int
layer)
const
{
33
this->
checklayer
(layer);
34
return
abs
(
_link
[layer - 1].
second
) % 1000;
35
}
36
37
int
RPCDigiL1Link::bx
(
unsigned
int
layer)
const
{
38
this->
checklayer
(layer);
39
return
_link
[layer - 1].second / 1000;
40
}
41
42
unsigned
int
RPCDigiL1Link::nlayer
()
const
{
return
_link
.size() - 1; }
43
44
void
RPCDigiL1Link::setLink
(
unsigned
int
layer,
unsigned
int
rpcdetId,
int
strip
,
int
bx
) {
45
this->
checklayer
(layer);
46
int
pdigi
=
abs
(
bx
) * 1000 +
strip
;
47
if
(
bx
< 0)
48
pdigi
*= -1;
49
std::pair<unsigned int, int> digi(rpcdetId,
pdigi
);
50
_link
[layer - 1] = digi;
51
}
52
53
void
RPCDigiL1Link::checklayer
(
unsigned
int
layer)
const
{
54
if
(layer == 0 || layer > 6)
55
throw
cms::Exception
(
"RPCException"
) <<
"RPCDigiL1Link: layer must be in the range from 1 to 6"
<< std::endl;
56
}
mps_fire.i
i
Definition:
mps_fire.py:355
RPCDigiL1Link::setLink
void setLink(unsigned int layer, unsigned int rpcdetId, int strip, int bx)
Definition:
RPCDigiL1Link.cc:44
RPCDigiL1Link::nlayer
unsigned int nlayer() const
Definition:
RPCDigiL1Link.cc:42
RPCDigiL1Link::rawdetId
unsigned int rawdetId(unsigned int layer) const
Definition:
RPCDigiL1Link.cc:27
digitizers_cfi.strip
strip
Definition:
digitizers_cfi.py:19
RPCDigiL1Link.h
l1GtPatternGenerator_cfi.bx
bx
Definition:
l1GtPatternGenerator_cfi.py:18
edm::second
U second(std::pair< T, U > const &p)
Definition:
ParameterSet.cc:215
RPCDigiL1Link::bx
int bx(unsigned int layer) const
Definition:
RPCDigiL1Link.cc:37
RPCDigiL1Link::checklayer
void checklayer(unsigned int layer) const
Definition:
RPCDigiL1Link.cc:53
RPCDigiL1Link::~RPCDigiL1Link
~RPCDigiL1Link()
Definition:
RPCDigiL1Link.cc:11
RPCDigiL1Link::empty
bool empty() const
Definition:
RPCDigiL1Link.cc:13
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
cmsLHEtoEOSManager.l
l
Definition:
cmsLHEtoEOSManager.py:193
Digi_cff.pdigi
pdigi
Definition:
Digi_cff.py:44
RPCDigiL1Link::_link
std::vector< std::pair< unsigned int, int > > _link
Definition:
RPCDigiL1Link.h:29
RPCDigiL1Link::RPCDigiL1Link
RPCDigiL1Link()
Definition:
RPCDigiL1Link.cc:4
Exception
Definition:
hltDiff.cc:246
RPCDigiL1Link::strip
int strip(unsigned int layer) const
Definition:
RPCDigiL1Link.cc:32
Exception.h
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16