src
EventFilter
L1TRawToDigi
plugins
implementations_stage2
ZDCPacker.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
6
#include "
L1TStage2Layer2Constants.h
"
7
#include "
ZDCPacker.h
"
8
#include "
GTSetup.h
"
9
10
namespace
l1t
{
11
namespace
stage2
{
12
Blocks
ZDCPacker::pack
(
const
edm::Event
&
event
,
const
PackerTokens
* toks) {
13
edm::Handle<EtSumBxCollection>
ZDCSums;
14
event
.getByToken(static_cast<const CommonTokens*>(toks)->getEtSumZDCToken(), ZDCSums);
15
16
std::vector<uint32_t>
load
;
17
int
nBx = 0;
18
19
for
(
int
i
= ZDCSums->getFirstBX();
i
<= ZDCSums->getLastBX(); ++
i
) {
20
int
zdc_mask = 0x3FF;
21
uint32_t empty_word = 0;
22
uint32_t zdcm_word = 0;
23
uint32_t zdcp_word = 0;
24
25
for
(
auto
j
= ZDCSums->begin(
i
);
j
!= ZDCSums->end(
i
); ++
j
) {
26
uint32_t
word
=
std::min
(
j
->hwPt(), zdc_mask);
27
28
if
(
j
->getType() ==
l1t::EtSum::kZDCM
)
29
zdcm_word |=
word
;
30
if
(
j
->getType() ==
l1t::EtSum::kZDCP
)
31
zdcp_word |=
word
;
32
}
33
load
.push_back(empty_word);
34
load
.push_back(zdcm_word);
35
load
.push_back(zdcp_word);
36
37
//pad with zeros to fill out block; must do this for each BX
38
while
(
load
.size() - nBx *
zdc::nOutputFramePerBX
<
zdc::nOutputFramePerBX
)
39
load
.push_back(0);
40
nBx++;
41
}
42
43
return
{
Block
(
b1_
,
load
)};
44
}
45
}
// namespace stage2
46
}
// namespace l1t
47
48
// DEFINE_L1T_PACKER(l1t::stage2::CaloEtSumZDCPacker);
49
DEFINE_L1T_PACKER
(
l1t::stage2::GTEtSumZDCPacker
);
mps_fire.i
i
Definition:
mps_fire.py:429
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
Event.h
edm::Handle
Definition:
AssociativeIterator.h:50
l1t
delete x;
Definition:
CaloConfig.h:22
l1t::stage2::zdc::nOutputFramePerBX
const unsigned int nOutputFramePerBX
Definition:
GTSetup.cc:16
l1t::EtSum::kZDCM
Definition:
EtSum.h:56
word
uint64_t word
Definition:
CTPPSTotemDataFormatter.cc:29
CaloTokens.h
l1t::stage2::ZDCPacker::b1_
int b1_
Definition:
ZDCPacker.h:12
L1TStage2Layer2Constants.h
l1t::Blocks
std::vector< Block > Blocks
Definition:
Block.h:99
SiStripPI::min
Definition:
SiStripPayloadInspectorHelper.h:178
ZDCPacker.h
DEFINE_L1T_PACKER
#define DEFINE_L1T_PACKER(type)
Definition:
PackerFactory.h:23
svgfig.load
def load(fileName)
Definition:
svgfig.py:547
l1t::stage2::ZDCPacker::pack
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition:
ZDCPacker.cc:12
SiStripSourceConfigTier0_cff.stage2
stage2
Definition:
SiStripSourceConfigTier0_cff.py:74
l1t::PackerTokens
Definition:
PackerTokens.h:10
l1t::EtSum::kZDCP
Definition:
EtSum.h:55
edm::Event
Definition:
Event.h:73
l1t::Block
Definition:
Block.h:70
PackerFactory.h
l1t::stage2::GTEtSumZDCPacker
Definition:
ZDCPacker.h:14
event
Definition:
event.py:1
GTSetup.h
Generated for CMSSW Reference Manual by
1.8.14