CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EGammaPacker.cc
Go to the documentation of this file.
2 
4 
5 #include "CaloTokens.h"
6 
8 
9 namespace l1t {
10  namespace stage2 {
11  class EGammaPacker : public Packer {
12  public:
13  virtual Blocks pack(const edm::Event&, const PackerTokens*) override;
14  };
15  }
16 }
17 
18 // Implementation
19 
20 namespace l1t {
21 namespace stage2 {
22  Blocks
24  {
26  event.getByToken(static_cast<const CaloTokens*>(toks)->getEGammaToken(), egs);
27 
28  std::vector<uint32_t> load1, load2;
29 
30  for (int i = egs->getFirstBX(); i <= egs->getLastBX(); ++i) {
31 
32  for (auto j = egs->begin(i); j != egs->end(i); ++j) {
33 
34  uint32_t packed_eta = abs(j->hwEta()) & 0x7F;
35  if (j->hwEta() < 0){
36  packed_eta = (128 - packed_eta) | 1<<7;
37  }
38 
39  uint32_t word = \
40  std::min(j->hwPt(), 0x1FF) |
41  packed_eta << 9 |
42  (j->hwPhi() & 0xFF) << 17 |
43  (j->hwIso() & 0x3) << 25 |
44  (j->hwQual() & 0x7) << 27;
45 
46  if (load1.size() < l1t::stage2::layer2::demux::nEGPerLink) load1.push_back(word);
47  else load2.push_back(word);
48 
49  }
50  }
51 
52  // push zeroes if jets are missing
53  while (load1.size()<l1t::stage2::layer2::demux::nOutputFramePerBX) load1.push_back(0);
54 
55  while (load2.size()<l1t::stage2::layer2::demux::nOutputFramePerBX) load2.push_back(0);
56 
57  return {Block(9, load1), Block(11, load2)};
58 
59  }
60 
61 }
62 }
63 
int i
Definition: DBlmapReader.cc:9
std::vector< Block > Blocks
Definition: Block.h:68
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
T min(T a, T b)
Definition: MathUtil.h:58
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: EGammaPacker.cc:23
#define DEFINE_L1T_PACKER(type)
Definition: Packer.h:36