CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloTowerPacker.cc
Go to the documentation of this file.
3 
5 
6 #include "CaloTokens.h"
7 #include "CaloTowerPacker.h"
8 
9 namespace l1t {
10 namespace stage2 {
11  Blocks
13  {
14 
16  event.getByToken(static_cast<const CaloTokens*>(toks)->getCaloTowerToken(), towers);
17 
18  Blocks res;
19 
20  for (int i = towers->getFirstBX(); i <= towers->getLastBX(); ++i) {
21 
22  for (int phi = 1; phi <=72; phi=phi+2) { // Two phi values per link
23 
24  unsigned int id = 2*phi - 2; // Block IDs start at zero and span even numbers up to 142
25  std::vector<uint32_t> load;
26 
27  for (int eta = 1; eta <=41; eta++) { // This is abs(eta) since +/- eta are interleaved in time
28 
29  if (eta==CaloTools::kHFBegin) continue;
30 
31  // Get four towers +/- eta and phi and phi+1 to all be packed in this loop
35  l1t::CaloTower t4 = towers->at(i,l1t::CaloTools::caloTowerHash(-1*eta,phi+1));
36 
37  // Merge phi and phi+1 into one block (phi is LSW, phi+1 is MSW)
38  uint32_t word1 = \
39  std::min(t1.hwPt(), 0x1FF) |
40  (t1.hwEtRatio() & 0x7) << 9 |
41  (t1.hwQual() & 0xF) << 12;
42 
43  word1 = word1 |
44  std::min(t2.hwPt(), 0x1FF) << 16 |
45  (t2.hwEtRatio() & 0x7) << 25 |
46  (t2.hwQual() & 0xF) << 28;
47 
48  load.push_back(word1);
49 
50  // Do it all again for -eta
51 
52  uint32_t word2 = \
53  std::min(t3.hwPt(), 0x1FF) |
54  (t3.hwEtRatio() & 0x7) << 9 |
55  (t3.hwQual() & 0xF) << 12;
56 
57  word2 = word2 |
58  std::min(t4.hwPt(), 0x1FF) << 16 |
59  (t4.hwEtRatio() & 0x7) << 25 |
60  (t4.hwQual() & 0xF) << 28;
61 
62  load.push_back(word2);
63 
64  }
65 
66  res.push_back(Block(id, load));
67 
68  }
69  }
70  return res;
71  }
72 }
73 }
74 
int i
Definition: DBlmapReader.cc:9
int hwEtRatio() const
Definition: CaloTower.cc:74
static size_t caloTowerHash(int iEta, int iPhi)
Definition: CaloTools.cc:66
static const int kHFBegin
Definition: CaloTools.h:40
virtual Blocks pack(const edm::Event &, const PackerTokens *) override
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
def load
Definition: svgfig.py:546
std::vector< Block > Blocks
Definition: Block.h:68
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
int hwQual() const
Definition: L1Candidate.h:51
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:22
int hwPt() const
Definition: L1Candidate.h:48
Geom::Phi< T > phi() const