CMS 3D CMS Logo

ZDCPacker.cc
Go to the documentation of this file.
3 
4 #include "CaloTokens.h"
5 
7 #include "ZDCPacker.h"
8 #include "GTSetup.h"
9 
10 namespace l1t {
11  namespace stage2 {
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);
delete x;
Definition: CaloConfig.h:22
const unsigned int nOutputFramePerBX
Definition: GTSetup.cc:16
uint64_t word
std::vector< Block > Blocks
Definition: Block.h:99
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:23
def load(fileName)
Definition: svgfig.py:547
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: ZDCPacker.cc:12
Definition: event.py:1