EventFilter
L1TRawToDigi
plugins
implementations_stage1
MissHtPacker.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/Event.h
"
2
#include "
EventFilter/L1TRawToDigi/plugins/PackerFactory.h
"
3
4
#include "
CaloTokens.h
"
5
#include "
MissHtPacker.h
"
6
7
// Implementation
8
9
namespace
l1t
{
10
namespace
stage1 {
11
Blocks
MissHtPacker::pack
(
const
edm::Event
&
event
,
const
PackerTokens
* toks) {
12
edm::Handle<EtSumBxCollection>
etSums;
13
event
.getByToken(static_cast<const CaloTokens*>(toks)->getEtSumToken(), etSums);
14
15
std::vector<uint32_t>
load
;
16
17
for
(
int
i
= etSums->getFirstBX();
i
<= etSums->getLastBX(); ++
i
) {
18
int
n
= 0;
19
20
int
htmissphi = 0;
21
int
htmiss = 0;
22
23
int
flaghtmiss = 0;
24
25
for
(
auto
j
= etSums->begin(
i
);
j
!= etSums->end(
i
) &&
n
< 4; ++
j
, ++
n
) {
26
if
(
j
->getType() ==
l1t::EtSum::kMissingHt
) {
27
flaghtmiss =
j
->hwQual() & 0x1;
28
htmiss =
std::min
(
j
->hwPt(), 0x7F);
29
htmissphi =
std::min
(
j
->hwPhi(), 0x1F);
30
}
31
}
32
33
uint16_t
object
[2] = {0, 0};
34
35
object
[0] = htmissphi | ((htmiss & 0x7F) << 5) | (flaghtmiss << 12) | (0
x1
<< 14);
36
object
[1] = 0x1 | (0x1 << 2) | (0
x1
<< 4) | (0x1 << 6) | (0
x1
<< 8) | (0x1 << 10) | (0
x1
<< 12) | (0x1 << 14);
37
38
uint32_t word0 = (
object
[0] & 0xFFFF);
39
uint32_t word1 = (
object
[1] & 0xFFFF);
40
41
word0 |= (1 << 15);
42
word1 |= ((
i
== 0) << 15);
43
44
load
.push_back(word0);
45
load
.push_back(word1);
46
}
47
48
return
{
Block
(99,
load
)};
49
}
50
}
// namespace stage1
51
}
// namespace l1t
52
53
DEFINE_L1T_PACKER
(
l1t::stage1::MissHtPacker
);
l1t::stage1::MissHtPacker::pack
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition:
MissHtPacker.cc:11
l1t::stage1::MissHtPacker
Definition:
MissHtPacker.h:8
l1t::Blocks
std::vector< Block > Blocks
Definition:
Block.h:83
CaloTokens.h
mps_fire.i
i
Definition:
mps_fire.py:355
PackerFactory.h
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
min
T min(T a, T b)
Definition:
MathUtil.h:58
edm::Handle
Definition:
AssociativeIterator.h:50
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition:
testProducerWithPsetDescEmpty_cfi.py:33
svgfig.load
def load(fileName)
Definition:
svgfig.py:547
DEFINE_L1T_PACKER
#define DEFINE_L1T_PACKER(type)
Definition:
PackerFactory.h:23
Event.h
l1t
delete x;
Definition:
CaloConfig.h:22
MissHtPacker.h
l1t::PackerTokens
Definition:
PackerTokens.h:10
l1t::EtSum::kMissingHt
Definition:
EtSum.h:26
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
l1t::Block
Definition:
Block.h:54
Generated for CMSSW Reference Manual by
1.8.16